aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-03-18 18:41:36 +0000
committerPedro Alves <palves@redhat.com>2011-03-18 18:41:36 +0000
commit0fdb4f184b39af02d76e21cd25af561b464f15a6 (patch)
tree17616315af45c3550e9fbc428c82d55b620070bd /gdb/stack.c
parente69aa73e27e67368cf501cc154db03809eb5445a (diff)
downloadgdb-0fdb4f184b39af02d76e21cd25af561b464f15a6.zip
gdb-0fdb4f184b39af02d76e21cd25af561b464f15a6.tar.gz
gdb-0fdb4f184b39af02d76e21cd25af561b464f15a6.tar.bz2
gdb/
* findvar.c (value_of_register): Mark the value as unavailable, if the register is unavailable. * frame.h (frame_register_unwind): New `unavailablep' parameter. (frame_register): New `unavailablep' parameter. (frame_register_read): Update comment. * frame.c (frame_register_unwind): New `unavailablep' parameter. Set it if the register is unavailable. If the register is unavailable, clear the output buffer. (frame_register): New `unavailablep' parameter. Pass it down. (frame_unwind_register): Adjust. (put_frame_register): Adjust. (frame_register_read): Adjust. Also return false if the register is not available. (frame_register_unwind_location): Adjust. * sentinel-frame.c (sentinel_frame_prev_register): If the register is unavailable, mark the value accordingly. * stack.c (frame_info): Handle unavailable registers. gdb/testsuite/ * gdb.trace/unavailable.exp (fpreg, spreg, pcreg): Define. (test_register, test_register_unavailable): New procedures. (gdb_unavailable_registers_test): New procedure. (gdb_trace_collection_test): Call it.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 6e59cd0..79c3a43 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1186,6 +1186,7 @@ frame_info (char *addr_exp, int from_tty)
{
enum lval_type lval;
int optimized;
+ int unavailable;
CORE_ADDR addr;
int realnum;
int count;
@@ -1202,9 +1203,9 @@ frame_info (char *addr_exp, int from_tty)
/* 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,
+ &optimized, &unavailable, &lval, &addr,
&realnum, NULL);
- if (!optimized && lval == not_lval)
+ if (!optimized && !unavailable && lval == not_lval)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int sp_size = register_size (gdbarch, gdbarch_sp_regnum (gdbarch));
@@ -1212,7 +1213,7 @@ frame_info (char *addr_exp, int from_tty)
CORE_ADDR sp;
frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
- &optimized, &lval, &addr,
+ &optimized, &unavailable, &lval, &addr,
&realnum, value);
/* NOTE: cagney/2003-05-22: This is assuming that the
stack pointer was packed as an unsigned integer. That
@@ -1223,14 +1224,14 @@ frame_info (char *addr_exp, int from_tty)
printf_filtered ("\n");
need_nl = 0;
}
- else if (!optimized && lval == lval_memory)
+ else if (!optimized && !unavailable && lval == lval_memory)
{
printf_filtered (" Previous frame's sp at ");
fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
printf_filtered ("\n");
need_nl = 0;
}
- else if (!optimized && lval == lval_register)
+ else if (!optimized && !unavailable && lval == lval_register)
{
printf_filtered (" Previous frame's sp in %s\n",
gdbarch_register_name (gdbarch, realnum));
@@ -1248,11 +1249,11 @@ frame_info (char *addr_exp, int from_tty)
{
/* Find out the location of the saved register without
fetching the corresponding value. */
- frame_register_unwind (fi, i, &optimized, &lval, &addr, &realnum,
- NULL);
+ frame_register_unwind (fi, i, &optimized, &unavailable,
+ &lval, &addr, &realnum, NULL);
/* For moment, only display registers that were saved on the
stack. */
- if (!optimized && lval == lval_memory)
+ if (!optimized && !unavailable && lval == lval_memory)
{
if (count == 0)
puts_filtered (" Saved registers:\n ");