This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 2/5] Frame unwinding using struct value
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 4 Apr 2008 10:32:24 -0700
- Subject: Re: [RFC 2/5] Frame unwinding using struct value
- References: <20080331221024.GA22334@caradoc.them.org>
> (frame_register_unwind): Remove debug messages. Use
> frame_unwind_register_value.
It looks like we'll also be able to get rid of this function
at some point soon. As far as I can tell, I can only find 2 places
where it's being used:
- mep-tdep.c: But this will disappear as soon as we convert
the function using it;
- stack.c:frame_info() I think we can adjust the code to use
frame_unwind_register_value instead. The code looks like this:
/* Find out the location of the saved stack pointer with out
actually evaluating it. */
frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
&optimized, &lval, &addr,
&realnum, NULL);
if (!optimized && lval == not_lval)
{
gdb_byte value[MAX_REGISTER_SIZE];
CORE_ADDR sp;
frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
&optimized, &lval, &addr,
&realnum, value);
/* NOTE: cagney/2003-05-22: This is assuming that the
stack pointer was packed as an unsigned integer. That
may or may not be valid. */
sp = extract_unsigned_integer (value,
register_size (gdbarch,
gdbarch_sp_regnum (gdbarch)));
printf_filtered (" Previous frame's sp is ");
fputs_filtered (paddress (sp), gdb_stdout);
printf_filtered ("\n");
need_nl = 0;
}
else if (!optimized && lval == lval_memory)
{
printf_filtered (" Previous frame's sp at ");
fputs_filtered (paddress (addr), gdb_stdout);
printf_filtered ("\n");
need_nl = 0;
}
else if (!optimized && lval == lval_register)
{
printf_filtered (" Previous frame's sp in %s\n",
gdbarch_register_name (gdbarch, realnum));
need_nl = 0;
--
Joel