summaryrefslogtreecommitdiff
path: root/gdb/blockframe.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-15 17:23:32 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-15 17:23:32 +0000
commit0714963c79d71c6a88e14cfb855043566ec149bf (patch)
treed21badd0230cc611c556932f76029b963cfc47ca /gdb/blockframe.c
parent98a23b3f746e24a90d40ade25b6d31642ab4feb8 (diff)
2003-07-15 Andrew Cagney <cagney@redhat.com>
* frame.c (get_prev_frame): Move disabled inside_entry_func to before code inhibiting repeated unwind attempts. Add to commentary on that test's problems. * blockframe.c (inside_main_func): Look for "main" in the minimal symbol table. * d10v-tdep.c (d10v_frame_this_id): Delete check that frames are identical. Index: testsuite/ChangeLog 2003-07-15 Andrew Cagney <cagney@redhat.com> * gdb.asm/asm-source.exp: Do not allow "start" in the backtrace.
Diffstat (limited to 'gdb/blockframe.c')
-rw-r--r--gdb/blockframe.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 23ee66c360..9a11c90057 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -106,6 +106,47 @@ inside_main_func (CORE_ADDR pc)
BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
}
}
+
+ /* Not in the normal symbol tables, see if "main" is in the partial
+ symbol table. If it's not, then give up. */
+ {
+ struct minimal_symbol *msymbol
+ = lookup_minimal_symbol (main_name (), NULL, symfile_objfile);
+ if (msymbol != NULL && MSYMBOL_TYPE (msymbol) == mst_text)
+ {
+ struct obj_section *osect
+ = find_pc_sect_section (SYMBOL_VALUE_ADDRESS (msymbol),
+ msymbol->ginfo.bfd_section);
+ if (osect != NULL)
+ {
+ int i;
+ /* Step over other symbols at this same address, and
+ symbols in other sections, to find the next symbol in
+ this section with a different address. */
+ for (i = 1; SYMBOL_LINKAGE_NAME (msymbol + i) != NULL; i++)
+ {
+ if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol)
+ && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
+ break;
+ }
+
+ symfile_objfile->ei.main_func_lowpc = SYMBOL_VALUE_ADDRESS (msymbol);
+
+ /* Use the lesser of the next minimal symbol in the same
+ section, or the end of the section, as the end of the
+ function. */
+ if (SYMBOL_LINKAGE_NAME (msymbol + i) != NULL
+ && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr)
+ symfile_objfile->ei.main_func_highpc = SYMBOL_VALUE_ADDRESS (msymbol + i);
+ else
+ /* We got the start address from the last msymbol in the
+ objfile. So the end address is the end of the
+ section. */
+ symfile_objfile->ei.main_func_highpc = osect->endaddr;
+ }
+ }
+ }
+
return (symfile_objfile->ei.main_func_lowpc <= pc &&
symfile_objfile->ei.main_func_highpc > pc);
}