diff options
author | Greg Clayton <gclayton@apple.com> | 2012-05-30 20:20:34 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-05-30 20:20:34 +0000 |
commit | 177b855ed71a9cd029f6b36eadf32befa4ace9e7 (patch) | |
tree | f7c18dfe8c543ef473666ae13bda53dceb7a9f76 /lldb/source/Plugins/ObjectFile | |
parent | 04ed2e46a18ad8e52c1a96de1f477d26e26feace (diff) | |
download | bcm5719-llvm-177b855ed71a9cd029f6b36eadf32befa4ace9e7.tar.gz bcm5719-llvm-177b855ed71a9cd029f6b36eadf32befa4ace9e7.zip |
<rdar://problem/11537498>
Fixed an issue with the symbol table parsing of files that have STAB entries in them where there are two N_SO entries where the first has a directory, and the second contains a full path:
[ 0] 00000002 64 (N_SO ) 00 0000 0000000000000000 '/Volumes/data/src/'
[ 1] 0000001e 64 (N_SO ) 00 0000 0000000000000000 '/Volumes/data/src/Source/main.m'
[ 2] 00000047 66 (N_OSO ) 09 0001 000000004fc642d2 '/tmp/main.o'
[ 3] 00000001 2e (N_BNSYM ) 01 0000 0000000000003864
[ 4] 000000bd 24 (N_FUN ) 01 0000 0000000000003864 '_main'
[ 5] 00000001 24 (N_FUN ) 00 0000 00000000000000ae
[ 6] 00000001 4e (N_ENSYM ) 01 0000 00000000000000ae
[ 7] 00000001 64 (N_SO ) 01 0000 0000000000000000
We now correctly combine entries 0 and 1 into a single entry.
llvm-svn: 157712
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 7b0c2e78180..9b9cbb68aa3 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1665,10 +1665,28 @@ ObjectFileMachO::ParseSymtab (bool minimize) { // We use the current number of symbols in the symbol table in lieu of // using nlist_idx in case we ever start trimming entries out - if (symbol_name[0] == '/') - N_SO_index = sym_idx; + const bool N_SO_has_full_path = symbol_name[0] == '/'; + if (N_SO_has_full_path) + { + if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms)) + { + // We have two consecutive N_SO entries where the first contains a directory + // and the second contains a full path. + sym[sym_idx - 1].GetMangled().SetValue(symbol_name, false); + m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1; + add_nlist = false; + } + else + { + // This is the first entry in a N_SO that contains a directory or + // a full path to the source file + N_SO_index = sym_idx; + } + } else if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms)) { + // This is usually the second N_SO entry that contains just the filename, + // so here we combine it with the first one if we are minimizing the symbol table const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString(); if (so_path && so_path[0]) { |