diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-01-22 21:18:15 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-01-22 21:18:15 +0000 |
commit | 5706ca98d16b4ed5f455c71c01655fc12f6b9eb9 (patch) | |
tree | f2aa862dc3affbf6d1119286d40114cd326330bf /coregrind | |
parent | 141383ee299d7aaea083d9bc2a97c15b1661163d (diff) |
Minor tidyings:
search_all_symtabs: look for data symbols also in .sbss and .rodata
sections.
VG_(seginfo_sect_kind): identify addresses in .sbss sections.
VG_(pp_SectKind): handle missing case Vg_SectGOTPLT
search_all_loctabs, VG_(get_objname), VG_(find_seginfo): augment tests
"di->text_present" with "&& di->text_size > 0" (probably not
necessary, but is clearer, and more consistent in that most places
that look at DebugInfo.text_{size,avma} first perform both of those
tests).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9029 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'coregrind')
-rw-r--r-- | coregrind/m_debuginfo/debuginfo.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 03269dfb..4cc21820 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1036,7 +1036,17 @@ static void search_all_symtabs ( Addr ptr, /*OUT*/DebugInfo** pdi, (di->bss_present && di->bss_size > 0 && di->bss_avma <= ptr - && ptr < di->bss_avma + di->bss_size); + && ptr < di->bss_avma + di->bss_size) + || + (di->sbss_present + && di->sbss_size > 0 + && di->sbss_avma <= ptr + && ptr < di->sbss_avma + di->sbss_size) + || + (di->rodata_present + && di->rodata_size > 0 + && di->rodata_avma <= ptr + && ptr < di->rodata_avma + di->rodata_size); } if (!inRange) continue; @@ -1064,6 +1074,7 @@ static void search_all_loctabs ( Addr ptr, /*OUT*/DebugInfo** pdi, DebugInfo* di; for (di = debugInfo_list; di != NULL; di = di->next) { if (di->text_present + && di->text_size > 0 && di->text_avma <= ptr && ptr < di->text_avma + di->text_size) { lno = ML_(search_one_loctab) ( di, ptr ); @@ -1250,6 +1261,7 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf ) expect this to produce a result. */ for (di = debugInfo_list; di != NULL; di = di->next) { if (di->text_present + && di->text_size > 0 && di->text_avma <= a && a < di->text_avma + di->text_size) { VG_(strncpy_safely)(buf, di->filename, nbuf); @@ -1288,6 +1300,7 @@ DebugInfo* VG_(find_seginfo) ( Addr a ) DebugInfo* di; for (di = debugInfo_list; di != NULL; di = di->next) { if (di->text_present + && di->text_size > 0 && di->text_avma <= a && a < di->text_avma + di->text_size) { return di; @@ -2939,6 +2952,7 @@ const HChar* VG_(pp_SectKind)( VgSectKind kind ) case Vg_SectGOT: return "GOT"; case Vg_SectPLT: return "PLT"; case Vg_SectOPD: return "OPD"; + case Vg_SectGOTPLT: return "GOTPLT"; default: vg_assert(0); } } @@ -2989,6 +3003,12 @@ VgSectKind VG_(seginfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, res = Vg_SectBSS; break; } + if (di->sbss_present + && di->sbss_size > 0 + && a >= di->sbss_avma && a < di->sbss_avma + di->sbss_size) { + res = Vg_SectBSS; + break; + } if (di->plt_present && di->plt_size > 0 && a >= di->plt_avma && a < di->plt_avma + di->plt_size) { |