From 0fdb4f184b39af02d76e21cd25af561b464f15a6 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 18 Mar 2011 18:41:36 +0000 Subject: 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. --- gdb/sentinel-frame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdb/sentinel-frame.c') diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c index f68ea1c..e6000cc 100644 --- a/gdb/sentinel-frame.c +++ b/gdb/sentinel-frame.c @@ -61,7 +61,10 @@ sentinel_frame_prev_register (struct frame_info *this_frame, /* Use the regcache_cooked_read() method so that it, on the fly, constructs either a raw or pseudo register from the raw register cache. */ - regcache_cooked_read (cache->regcache, regnum, value_contents_raw (value)); + if (regcache_cooked_read (cache->regcache, + regnum, + value_contents_raw (value)) == REG_UNAVAILABLE) + mark_value_bytes_unavailable (value, 0, register_size (gdbarch, regnum)); return value; } -- cgit v1.1