+2003-09-12 Andrew Cagney <cagney@redhat.com>
+
+ * objfiles.h (struct entry_info): Deprecate "entry_file_lowpc" and
+ "entry_file_highpc". Update comments.
+ * defs.h (deprecated_inside_entry_file): Rename
+ "inside_entry_file".
+ * blockframe.c (deprecated_inside_entry_file): Rename
+ "inside_entry_file".
+ * frame.c (get_prev_frame): Update. Use if 0 instead of #if 0.
+ * vax-tdep.c (vax_frame_chain): Update.
+ * sh64-tdep.c (sh64_frame_chain): Update.
+ * sh-tdep.c (sh_frame_chain): Update.
+ * rs6000-tdep.c (rs6000_frame_chain): Update.
+ * ns32k-tdep.c (ns32k_frame_chain): Update.
+ * mips-tdep.c (mips_frame_chain): Update.
+ * m68hc11-tdep.c (m68hc11_frame_this_id): Update.
+ * m32r-tdep.c (m32r_frame_this_id): Update.
+ * i386-interix-tdep.c (i386_interix_frame_chain_valid): Update.
+ * frv-tdep.c (frv_frame_this_id): Update.
+ * d10v-tdep.c (d10v_frame_this_id): Update.
+ * cris-tdep.c (cris_frame_chain): Update.
+ * blockframe.c (legacy_frame_chain_valid): Update.
+ * avr-tdep.c (avr_frame_this_id): Update.
+ * arm-tdep.c (arm_prologue_this_id): Update.
+ * alpha-tdep.c (alpha_heuristic_frame_this_id): Update.
+ * objfiles.c (objfile_relocate): Update.
+ * mipsread.c (mipscoff_symfile_read): Update.
+ (mipscoff_symfile_read): Update.
+ * mdebugread.c (parse_partial_symbols): Update.
+ * dwarfread.c (read_file_scope): Update.
+ * dwarf2read.c (read_file_scope): Update.
+ * dbxread.c (read_dbx_symtab): Update.
+ (read_dbx_symtab): Update.
+ * coffread.c (complete_symtab): Update.
+
2003-09-12 Jeff Johnston <jjohnstn@redhat.com>
* top.c (quit_target): New static helper function.
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (info->start_pc))
+ if (deprecated_inside_entry_file (info->start_pc))
return;
*this_id = frame_id_build (info->vfp, info->start_pc);
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (func <= LOWEST_PC || inside_entry_file (func))
+ if (func <= LOWEST_PC || deprecated_inside_entry_file (func))
return;
/* If we've hit a wall, stop. */
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
A PC of zero is always considered to be the bottom of the stack. */
int
-inside_entry_file (CORE_ADDR addr)
+deprecated_inside_entry_file (CORE_ADDR addr)
{
if (addr == 0)
return 1;
if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0))
return 0;
}
- return (addr >= symfile_objfile->ei.entry_file_lowpc &&
- addr < symfile_objfile->ei.entry_file_highpc);
+ return (addr >= symfile_objfile->ei.deprecated_entry_file_lowpc &&
+ addr < symfile_objfile->ei.deprecated_entry_file_highpc);
}
/* Test a specified PC value to see if it is in the range of addresses
/* NOTE/drow 2002-12-25: should there be a way to disable this check? It
assumes a single small entry file, and the way some debug readers (e.g.
dbxread) figure out which object is the entry file is somewhat hokey. */
- if (inside_entry_file (frame_pc_unwind (fi)))
+ if (deprecated_inside_entry_file (frame_pc_unwind (fi)))
return 0;
return 1;
if (current_objfile->ei.entry_point >= current_source_start_addr &&
current_objfile->ei.entry_point < current_source_end_addr)
{
- current_objfile->ei.entry_file_lowpc = current_source_start_addr;
- current_objfile->ei.entry_file_highpc = current_source_end_addr;
+ current_objfile->ei.deprecated_entry_file_lowpc = current_source_start_addr;
+ current_objfile->ei.deprecated_entry_file_highpc = current_source_end_addr;
}
}
{
return get_frame_base (fi);
}
- else if (!inside_entry_file (get_frame_pc (fi)))
+ else if (!deprecated_inside_entry_file (get_frame_pc (fi)))
{
return read_memory_unsigned_integer (get_frame_base (fi), 4);
}
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (func <= IMEM_START || inside_entry_file (func))
+ if (func <= IMEM_START || deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
if (objfile->ei.entry_point < nlist.n_value &&
objfile->ei.entry_point >= last_o_file_start)
{
- objfile->ei.entry_file_lowpc = last_o_file_start;
- objfile->ei.entry_file_highpc = nlist.n_value;
+ objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
+ objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
}
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols
&& objfile->ei.entry_point < nlist.n_value
&& objfile->ei.entry_point >= last_o_file_start)
{
- objfile->ei.entry_file_lowpc = last_o_file_start;
- objfile->ei.entry_file_highpc = nlist.n_value;
+ objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
+ objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
}
if (pst)
extern int inside_entry_func (CORE_ADDR);
-extern int inside_entry_file (CORE_ADDR addr);
+extern int deprecated_inside_entry_file (CORE_ADDR addr);
extern int inside_main_func (CORE_ADDR pc);
if (objfile->ei.entry_point >= lowpc &&
objfile->ei.entry_point < highpc)
{
- objfile->ei.entry_file_lowpc = lowpc;
- objfile->ei.entry_file_highpc = highpc;
+ objfile->ei.deprecated_entry_file_lowpc = lowpc;
+ objfile->ei.deprecated_entry_file_highpc = highpc;
}
attr = dwarf_attr (die, DW_AT_language);
if (objfile->ei.entry_point >= dip->at_low_pc &&
objfile->ei.entry_point < dip->at_high_pc)
{
- objfile->ei.entry_file_lowpc = dip->at_low_pc;
- objfile->ei.entry_file_highpc = dip->at_high_pc;
+ objfile->ei.deprecated_entry_file_lowpc = dip->at_low_pc;
+ objfile->ei.deprecated_entry_file_highpc = dip->at_high_pc;
}
set_cu_language (dip);
if (dip->at_producer != NULL)
checking for "main" in the minimal symbols. With that fixed
asm-source tests now stop in "main" instead of halting the
backtrace in wierd and wonderful ways somewhere inside the entry
- file. Suspect that inside_entry_file and inside_entry_func tests
- were added to work around that (now fixed) case. */
+ file. Suspect that deprecated_inside_entry_file and
+ inside_entry_func tests were added to work around that (now
+ fixed) case. */
/* NOTE: cagney/2003-07-15: danielj (if I'm reading it right)
suggested having the inside_entry_func test use the
inside_main_func msymbol trick (along with entry_point_address I
}
this_frame->prev_p = 1;
-#if 0
/* If we're inside the entry file, it isn't valid. Don't apply this
test to a dummy frame - dummy frame PC's typically land in the
entry file. Don't apply this test to the sentinel frame.
/* NOTE: cagney/2003-01-10: If there is a way of disabling this test
then it should probably be moved to before the ->prev_p test,
above. */
- /* NOTE: vinschen/2003-04-01: Disabled. It turns out that the call to
- inside_entry_file destroys a meaningful backtrace under some
- conditions. E. g. the backtrace tests in the asm-source testcase
- are broken for some targets. In this test the functions are all
- implemented as part of one file and the testcase is not necessarily
- linked with a start file (depending on the target). What happens is,
- that the first frame is printed normaly and following frames are
- treated as being inside the enttry file then. This way, only the
- #0 frame is printed in the backtrace output. */
- if (this_frame->type != DUMMY_FRAME && this_frame->level >= 0
- && inside_entry_file (get_frame_pc (this_frame)))
+ /* NOTE: vinschen/2003-04-01: Disabled. It turns out that the call
+ to deprecated_inside_entry_file destroys a meaningful backtrace
+ under some conditions. E. g. the backtrace tests in the
+ asm-source testcase are broken for some targets. In this test
+ the functions are all implemented as part of one file and the
+ testcase is not necessarily linked with a start file (depending
+ on the target). What happens is, that the first frame is printed
+ normaly and following frames are treated as being inside the
+ enttry file then. This way, only the #0 frame is printed in the
+ backtrace output. */
+ if (0
+ && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+ && deprecated_inside_entry_file (get_frame_pc (this_frame)))
{
if (frame_debug)
{
}
return NULL;
}
-#endif
/* If any of the old frame initialization methods are around, use
the legacy get_prev_frame method. */
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Check if the stack is empty. */
it'll make the correct test. */
return ((get_frame_type (thisframe) == SIGTRAMP_FRAME)
|| (chain != 0
- && !inside_entry_file (read_memory_integer
- (thisframe->frame + 4, 4))));
+ && !deprecated_inside_entry_file (read_memory_integer
+ (thisframe->frame + 4, 4))));
}
/* We want to find the previous frame, which on Interix is tricky when
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Check if the stack is empty. */
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
if (objfile->ei.entry_point >= save_pst->textlow &&
objfile->ei.entry_point < save_pst->texthigh)
{
- objfile->ei.entry_file_lowpc = save_pst->textlow;
- objfile->ei.entry_file_highpc = save_pst->texthigh;
+ objfile->ei.deprecated_entry_file_lowpc = save_pst->textlow;
+ objfile->ei.deprecated_entry_file_highpc = save_pst->texthigh;
}
/* The objfile has its functions reordered if this partial symbol
CORE_ADDR tmp;
CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame);
- if (saved_pc == 0 || inside_entry_file (saved_pc))
+ if (saved_pc == 0 || deprecated_inside_entry_file (saved_pc))
return 0;
/* Check if the PC is inside a call stub. If it is, fetch the
if (mainline
&& objfile->ei.entry_point != INVALID_ENTRY_POINT
- && objfile->ei.entry_file_lowpc == INVALID_ENTRY_LOWPC)
+ && objfile->ei.deprecated_entry_file_lowpc == INVALID_ENTRY_LOWPC)
{
struct minimal_symbol *m;
m = lookup_minimal_symbol_by_pc (objfile->ei.entry_point);
if (m && DEPRECATED_SYMBOL_NAME (m + 1))
{
- objfile->ei.entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m);
- objfile->ei.entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1);
+ objfile->ei.deprecated_entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m);
+ objfile->ei.deprecated_entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1);
}
}
FP value, and that address is saved at the previous FP value as a
4-byte word. */
- if (inside_entry_file (get_frame_pc (frame)))
+ if (deprecated_inside_entry_file (get_frame_pc (frame)))
return 0;
return (read_memory_integer (get_frame_base (frame), 4));
objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
}
- if (objfile->ei.entry_file_lowpc != INVALID_ENTRY_LOWPC)
+ if (objfile->ei.deprecated_entry_file_lowpc != INVALID_ENTRY_LOWPC)
{
- objfile->ei.entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
- objfile->ei.entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+ objfile->ei.deprecated_entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+ objfile->ei.deprecated_entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
}
if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
to the user executable's recorded entry point, as if the call had been made
directly by the kernel.
- The traditional gdb method of using this info is to use the recorded entry
- point to set the variables entry_file_lowpc and entry_file_highpc from
- the debugging information, where these values are the starting address
- (inclusive) and ending address (exclusive) of the instruction space in the
- executable which correspond to the "startup file", I.E. crt0.o in most
- cases. This file is assumed to be a startup file and frames with pc's
- inside it are treated as nonexistent. Setting these variables is necessary
- so that backtraces do not fly off the bottom of the stack.
+ The traditional gdb method of using this info is to use the
+ recorded entry point to set the variables
+ deprecated_entry_file_lowpc and deprecated_entry_file_highpc from
+ the debugging information, where these values are the starting
+ address (inclusive) and ending address (exclusive) of the
+ instruction space in the executable which correspond to the
+ "startup file", I.E. crt0.o in most cases. This file is assumed to
+ be a startup file and frames with pc's inside it are treated as
+ nonexistent. Setting these variables is necessary so that
+ backtraces do not fly off the bottom of the stack.
+
+ NOTE: cagney/2003-09-09: It turns out that this "traditional"
+ method doesn't work. Corinna writes: ``It turns out that the call
+ to deprecated_inside_entry_file destroys a meaningful backtrace
+ under some conditions. E. g. the backtrace tests in the asm-source
+ testcase are broken for some targets. In this test the functions
+ are all implemented as part of one file and the testcase is not
+ necessarily linked with a start file (depending on the target).
+ What happens is, that the first frame is printed normaly and
+ following frames are treated as being inside the enttry file then.
+ This way, only the #0 frame is printed in the backtrace output.''
+ Ref "frame.c" "NOTE: vinschen/2003-04-01".
Gdb also supports an alternate method to avoid running off the bottom
of the stack.
/* Start (inclusive) and end (exclusive) of object file containing the
entry point. */
- CORE_ADDR entry_file_lowpc;
- CORE_ADDR entry_file_highpc;
+ CORE_ADDR deprecated_entry_file_lowpc;
+ CORE_ADDR deprecated_entry_file_highpc;
/* Start (inclusive) and end (exclusive) of the user code main() function. */
frame. */
return read_memory_addr (get_frame_base (thisframe), wordsize);
- if (inside_entry_file (get_frame_pc (thisframe))
+ if (deprecated_inside_entry_file (get_frame_pc (thisframe))
|| get_frame_pc (thisframe) == entry_point_address ())
return 0;
get_frame_base (frame),
get_frame_base (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
- if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
+ if (get_frame_pc (frame)
+ && !deprecated_inside_entry_file (get_frame_pc (frame)))
return read_memory_integer (get_frame_base (frame)
+ get_frame_extra_info (frame)->f_offset, 4);
else
get_frame_base (frame),
get_frame_base (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
- if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
+ if (get_frame_pc (frame)
+ && !deprecated_inside_entry_file (get_frame_pc (frame)))
{
int media_mode = pc_is_isa32 (get_frame_pc (frame));
int size;
/* Examination of non-executable.o files. Short-circuit this stuff. */
objfile->ei.entry_point = INVALID_ENTRY_POINT;
}
- objfile->ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
- objfile->ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
+ objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC;
+ objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC;
objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
{
/* In the case of the VAX, the frame's nominal address is the FP value,
and 12 bytes later comes the saved previous FP value as a 4-byte word. */
- if (inside_entry_file (get_frame_pc (frame)))
+ if (deprecated_inside_entry_file (get_frame_pc (frame)))
return (0);
return (read_memory_integer (get_frame_base (frame) + 12, 4));