Skip to content

Commit e529d77

Browse files
committed
[lldb] Use enum constant instead of raw value
1 parent a89d54f commit e529d77

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,7 @@ size_t ObjectFileMachO::ParseSymtab() {
22972297

22982298
#if defined(__APPLE__) && \
22992299
(defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
2300-
if (m_header.flags & 0x80000000u &&
2300+
if (m_header.flags & MH_DYLIB_IN_CACHE &&
23012301
process->GetAddressByteSize() == sizeof(void *)) {
23022302
// This mach-o memory file is in the dyld shared cache. If this
23032303
// program is not remote and this is iOS, then this process will
@@ -2379,7 +2379,7 @@ size_t ObjectFileMachO::ParseSymtab() {
23792379
// problem. For binaries outside the shared cache, it's faster to
23802380
// read the entire strtab at once instead of piece-by-piece as we
23812381
// process the nlist records.
2382-
if ((m_header.flags & 0x80000000u) == 0) {
2382+
if ((m_header.flags & MH_DYLIB_IN_CACHE) == 0) {
23832383
DataBufferSP strtab_data_sp(
23842384
ReadMemory(process_sp, strtab_addr, strtab_data_byte_size));
23852385
if (strtab_data_sp) {
@@ -2608,7 +2608,7 @@ size_t ObjectFileMachO::ParseSymtab() {
26082608
// to parse any DSC unmapped symbol information. If we find any, we set a
26092609
// flag that tells the normal nlist parser to ignore all LOCAL symbols.
26102610

2611-
if (m_header.flags & 0x80000000u) {
2611+
if (m_header.flags & MH_DYLIB_IN_CACHE) {
26122612
// Before we can start mapping the DSC, we need to make certain the
26132613
// target process is actually using the cache we can find.
26142614

llvm/include/llvm/BinaryFormat/MachO.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ enum {
8282
MH_HAS_TLV_DESCRIPTORS = 0x00800000u,
8383
MH_NO_HEAP_EXECUTION = 0x01000000u,
8484
MH_APP_EXTENSION_SAFE = 0x02000000u,
85-
MH_NLIST_OUTOFSYNC_WITH_DYLDINFO = 0x04000000u
85+
MH_NLIST_OUTOFSYNC_WITH_DYLDINFO = 0x04000000u,
86+
MH_DYLIB_IN_CACHE = 0x80000000u,
8687
};
8788

8889
enum : uint32_t {

0 commit comments

Comments
 (0)