1
diff -urN gdb-orig/gdb/findvar.c gdb-6.6/gdb/findvar.c
2
--- gdb-orig/gdb/findvar.c 2006-11-24 20:59:57.000000000 +0100
3
+++ gdb-6.6/gdb/findvar.c 2006-12-13 19:40:48.191514192 +0100
5
VALUE_LVAL (v) = lval_register;
6
VALUE_FRAME_ID (v) = get_frame_id (frame);
7
VALUE_REGNUM (v) = regnum;
8
+ VALUE_REGTYPE (v) = type;
12
diff -urN gdb-orig/gdb/valarith.c gdb-6.6/gdb/valarith.c
13
--- gdb-orig/gdb/valarith.c 2006-01-24 22:21:12.000000000 +0100
14
+++ gdb-6.6/gdb/valarith.c 2006-12-13 19:40:48.197513280 +0100
16
VALUE_LVAL (v) = VALUE_LVAL (array);
17
VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
18
VALUE_REGNUM (v) = VALUE_REGNUM (array);
19
+ VALUE_REGTYPE (v) = VALUE_REGTYPE (array);
20
VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
21
set_value_offset (v, value_offset (array) + elt_offs);
23
diff -urN gdb-orig/gdb/valops.c gdb-6.6/gdb/valops.c
24
--- gdb-orig/gdb/valops.c 2006-10-09 21:28:14.000000000 +0200
25
+++ gdb-6.6/gdb/valops.c 2006-12-13 19:40:48.245505984 +0100
27
error (_("Value being assigned to is no longer active."));
29
if (VALUE_LVAL (toval) == lval_register
30
- && CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
31
+ && VALUE_REGTYPE (toval) != NULL
32
+ && CONVERT_REGISTER_P (value_reg, VALUE_REGTYPE (toval)))
34
- /* If TOVAL is a special machine register requiring
35
+ /* TOVAL is a special machine register requiring
36
conversion of program values to a special raw format. */
37
- VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval),
38
- type, value_contents (fromval));
40
+ /* Determine type of full register contents. Note that TOVAL
41
+ may refer to a subfield of the full register. */
42
+ struct type *regtype = VALUE_REGTYPE (toval);
43
+ gdb_byte *buffer = alloca (TYPE_LENGTH (regtype));
45
+ /* Copy in old register contents. */
46
+ REGISTER_TO_VALUE (frame, value_reg, regtype, buffer);
48
+ /* Modify what needs to be modified. */
49
+ if (value_bitsize (toval))
50
+ modify_field (buffer + value_offset (toval),
51
+ value_as_long (fromval),
52
+ value_bitpos (toval), value_bitsize (toval));
54
+ memcpy (buffer + value_offset (toval),
55
+ value_contents (fromval), TYPE_LENGTH (type));
57
+ /* Write back the new register contents. */
58
+ VALUE_TO_REGISTER (frame, value_reg, regtype, buffer);
62
diff -urN gdb-orig/gdb/value.c gdb-6.6/gdb/value.c
63
--- gdb-orig/gdb/value.c 2006-03-31 12:36:18.000000000 +0200
64
+++ gdb-6.6/gdb/value.c 2006-12-13 19:40:48.291498992 +0100
69
+ /* Full type of register contents if the value is from a register. */
70
+ struct type *regtype;
72
/* Register number if the value is from a register. */
76
return &value->regnum;
80
+deprecated_value_regtype_hack (struct value *value)
82
+ return &value->regtype;
86
deprecated_value_modifiable (struct value *value)
89
val->bitsize = arg->bitsize;
90
VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg);
91
VALUE_REGNUM (val) = VALUE_REGNUM (arg);
92
+ VALUE_REGTYPE (val) = VALUE_REGTYPE (arg);
93
val->lazy = arg->lazy;
94
val->optimized_out = arg->optimized_out;
95
val->embedded_offset = value_embedded_offset (arg);
97
VALUE_LVAL (v) = lval_internalvar_component;
98
VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
99
VALUE_REGNUM (v) = VALUE_REGNUM (arg1);
100
+ VALUE_REGTYPE (v) = VALUE_REGTYPE (arg1);
101
VALUE_FRAME_ID (v) = VALUE_FRAME_ID (arg1);
102
/* VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
103
+ TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
104
diff -urN gdb-orig/gdb/value.h gdb-6.6/gdb/value.h
105
--- gdb-orig/gdb/value.h 2006-11-24 20:59:57.000000000 +0100
106
+++ gdb-6.6/gdb/value.h 2006-12-13 19:40:48.333492608 +0100
108
extern short *deprecated_value_regnum_hack (struct value *);
109
#define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val))
111
+/* Full type of register contents if the value is from a register. */
112
+extern struct type **deprecated_value_regtype_hack (struct value *);
113
+#define VALUE_REGTYPE(val) (*deprecated_value_regtype_hack (val))
115
/* Convert a REF to the object referenced. */
117
extern struct value *coerce_ref (struct value *value);