summaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-01-09 22:14:35 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-01-09 22:14:35 +0000
commit2ba64b60093e61142c7e74b2a6bc746e5685489e (patch)
treea0fe6d635d3853bd91412b960f1a33cb49b72b56 /gdb/minsyms.c
parent06b427236737f87b391d4ec68193d427c4468d02 (diff)
downloadgdb-2ba64b60093e61142c7e74b2a6bc746e5685489e.tar.gz
2007-01-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* minsyms.c (lookup_minimal_symbol_by_pc_section): Handle nested symbols. * gdb.arch/i386-size-overlap.c, gdb.arch/i386-size-overlap.exp: New.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 55f2d4a5695..e4b0356b868 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -510,6 +510,22 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section)
continue;
}
+ /* If we are past the end of the current symbol, try
+ the previous symbol if it has a larger overlapping
+ size. This happens on i686-pc-linux-gnu with glibc;
+ the nocancel variants of system calls are inside
+ the cancellable variants, but both have sizes. */
+ if (hi > 0
+ && MSYMBOL_SIZE (&msymbol[hi]) != 0
+ && pc >= (SYMBOL_VALUE_ADDRESS (&msymbol[hi])
+ + MSYMBOL_SIZE (&msymbol[hi]))
+ && pc < (SYMBOL_VALUE_ADDRESS (&msymbol[hi - 1])
+ + MSYMBOL_SIZE (&msymbol[hi - 1])))
+ {
+ hi--;
+ continue;
+ }
+
/* Otherwise, this symbol must be as good as we're going
to get. */
break;