<rdar://problem/12237556>
Fixed an issue where we didn't parse N_SO stab pairs where the first N_SO was a relative path.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163259 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 2027535..898f581 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1481,36 +1481,36 @@
FileSpec dsc_filespec(dsc_path, false);
// We need definitions of two structures in the on-disk DSC, copy them here manually
-struct lldb_copy_dyld_cache_header
-{
- char magic[16];
- uint32_t mappingOffset;
- uint32_t mappingCount;
- uint32_t imagesOffset;
- uint32_t imagesCount;
- uint64_t dyldBaseAddress;
- uint64_t codeSignatureOffset;
- uint64_t codeSignatureSize;
- uint64_t slideInfoOffset;
- uint64_t slideInfoSize;
- uint64_t localSymbolsOffset;
- uint64_t localSymbolsSize;
-};
-struct lldb_copy_dyld_cache_local_symbols_info
-{
- uint32_t nlistOffset;
- uint32_t nlistCount;
- uint32_t stringsOffset;
- uint32_t stringsSize;
- uint32_t entriesOffset;
- uint32_t entriesCount;
-};
-struct lldb_copy_dyld_cache_local_symbols_entry
-{
- uint32_t dylibOffset;
- uint32_t nlistStartIndex;
- uint32_t nlistCount;
-};
+ struct lldb_copy_dyld_cache_header
+ {
+ char magic[16];
+ uint32_t mappingOffset;
+ uint32_t mappingCount;
+ uint32_t imagesOffset;
+ uint32_t imagesCount;
+ uint64_t dyldBaseAddress;
+ uint64_t codeSignatureOffset;
+ uint64_t codeSignatureSize;
+ uint64_t slideInfoOffset;
+ uint64_t slideInfoSize;
+ uint64_t localSymbolsOffset;
+ uint64_t localSymbolsSize;
+ };
+ struct lldb_copy_dyld_cache_local_symbols_info
+ {
+ uint32_t nlistOffset;
+ uint32_t nlistCount;
+ uint32_t stringsOffset;
+ uint32_t stringsSize;
+ uint32_t entriesOffset;
+ uint32_t entriesCount;
+ };
+ struct lldb_copy_dyld_cache_local_symbols_entry
+ {
+ uint32_t dylibOffset;
+ uint32_t nlistStartIndex;
+ uint32_t nlistCount;
+ };
/* The dyld_cache_header has a pointer to the dyld_cache_local_symbols_info structure (localSymbolsOffset).
The dyld_cache_local_symbols_info structure gives us three things:
@@ -1830,8 +1830,12 @@
m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
}
}
+ else
+ {
+ // This could be a relative path to a N_SO
+ N_SO_index = sym_idx;
+ }
}
-
break;
case StabObjectFileName:
@@ -2549,6 +2553,11 @@
m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
}
}
+ else
+ {
+ // This could be a relative path to a N_SO
+ N_SO_index = sym_idx;
+ }
}
break;