aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2012-09-21 17:17:23 +0000
committerAndrew Burgess <aburgess@broadcom.com>2012-09-21 17:17:23 +0000
commit2603f7eeca78caeef1f362eccebe7cd4b589ba41 (patch)
tree4bd3f1743320af702d138e695e4b6adb424e8d4d /gdb/findvar.c
parentd09bbf000469737045fd17ef5b12fdd25db0b989 (diff)
downloadgdb-2603f7eeca78caeef1f362eccebe7cd4b589ba41.zip
gdb-2603f7eeca78caeef1f362eccebe7cd4b589ba41.tar.gz
gdb-2603f7eeca78caeef1f362eccebe7cd4b589ba41.tar.bz2
http://sourceware.org/ml/gdb-patches/2012-08/msg00715.html
gdb/ChangeLog * findvar.c (read_frame_register_value): Mark the result value as optimized out if any of the input registers have been optimized out. gdb/testsuite/ChangeLog * gdb.dwarf2/dw2-op-out-param.S: New file. * gdb.dwarf2/dw2-op-out-param.exp: New file.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 66bcebe..ec9dde7 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -677,7 +677,10 @@ default_value_from_register (struct type *type, int regnum,
/* VALUE must be an lval_register value. If regnum is the value's
associated register number, and len the length of the values type,
read one or more registers in FRAME, starting with register REGNUM,
- until we've read LEN bytes. */
+ until we've read LEN bytes.
+
+ If any of the registers we try to read are optimized out, then mark the
+ complete resulting value as optimized out. */
void
read_frame_register_value (struct value *value, struct frame_info *frame)
@@ -703,6 +706,12 @@ read_frame_register_value (struct value *value, struct frame_info *frame)
struct value *regval = get_frame_register_value (frame, regnum);
int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset;
+ if (value_optimized_out (regval))
+ {
+ set_value_optimized_out (value, 1);
+ break;
+ }
+
/* If the register length is larger than the number of bytes
remaining to copy, then only copy the appropriate bytes. */
if (reg_len > len)