diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-04-22 20:42:37 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-04-22 20:42:37 +0000 |
commit | 4365c36c9b87e20565b20c52809c781c50831a18 (patch) | |
tree | fd18d65814126ec28fd97ac1212534fb7df2eeb4 /gdb/printcmd.c | |
parent | 87fe2d9df2930715c261130be8d41c5a1a41f7a7 (diff) | |
download | gdb-4365c36c9b87e20565b20c52809c781c50831a18.zip gdb-4365c36c9b87e20565b20c52809c781c50831a18.tar.gz gdb-4365c36c9b87e20565b20c52809c781c50831a18.tar.bz2 |
* objfiles.h (obj_section), objfiles.c (build_objfile_section_table):
Add objfile field.
* objfiles.c (find_pc_section): Return a struct obj_section *.
* sparc-tdep.c (in_solib_trampoline): Deal with find_pc_section return.
* symfile.c (syms_from_objfile) [IBM6000_TARGET]:
Don't use obj_section hack.
* xcoffexec (vmap_symtab): Relocate obj_sections.
* printcmd.c (containing_function_bounds): Use find_pc_section.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 1b855a4..298de93 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -31,6 +31,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "breakpoint.h" #include "demangle.h" +/* These are just for containing_function_bounds. It might be better + to move containing_function_bounds to blockframe.c or thereabouts. */ +#include "bfd.h" +#include "symfile.h" +#include "objfiles.h" + extern int asm_demangle; /* Whether to demangle syms in asm printouts */ extern int addressprint; /* Whether to print hex addresses in HLL " */ @@ -1846,18 +1852,28 @@ static int containing_function_bounds (pc, low, high) CORE_ADDR pc, *low, *high; { - int scan; + CORE_ADDR scan; + CORE_ADDR limit; + struct obj_section *sec; if (!find_pc_partial_function (pc, 0, low)) return 0; + sec = find_pc_section (pc); + if (sec == NULL) + return 0; + limit = sec->endaddr; + scan = *low; - do { - scan++; - if (!find_pc_partial_function (scan, 0, high)) - return 0; - } while (*low == *high); - + while (scan < limit) + { + ++scan; + if (!find_pc_partial_function (scan, 0, high)) + return 0; + if (*low != *high) + return 1; + } + *high = limit; return 1; } |