diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-01-04 09:32:46 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-01-04 09:32:46 +0000 |
commit | 2aaaf250e80afb4a5c66fb0b7801e24cc5c4e680 (patch) | |
tree | 662d674e201a43a4b38dec6ac5772fac40610814 /gdb/dwarf2loc.c | |
parent | c27e4edb52011c9f4bbdb141fb360c708a879f87 (diff) | |
download | gdb-2aaaf250e80afb4a5c66fb0b7801e24cc5c4e680.zip gdb-2aaaf250e80afb4a5c66fb0b7801e24cc5c4e680.tar.gz gdb-2aaaf250e80afb4a5c66fb0b7801e24cc5c4e680.tar.bz2 |
Fix an internal error on writing pieced value
In ee40d8d (Move computed value's frame id to piece_closure), I only
updated read_pieced_value to use frame_id from piece_closure, but
forgot to update write_pieced_value, so it causes the following
internal error on arm-linux,
set variable l = 4^M
gdb/git/gdb/value.c:1579: internal-error: frame_id* deprecated_value_next_frame_id_hack(value*): Assertion `value->lval == lval_register' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.base/store.exp: var longest l; setting l to 4 (GDB internal error)
This patch fixes the internal error.
gdb:
2017-01-04 Yao Qi <yao.qi@linaro.org>
* dwarf2loc.c (write_pieced_value): Don't use VALUE_FRAME_ID (to),
use c->frame_id when the piece location is DWARF_VALUE_REGISTER.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index bab1799..35de0ed 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1908,24 +1908,12 @@ write_pieced_value (struct value *to, struct value *from) const gdb_byte *contents; struct piece_closure *c = (struct piece_closure *) value_computed_closure (to); - struct frame_info *frame; size_t type_len; size_t buffer_size = 0; std::vector<gdb_byte> buffer; int bits_big_endian = gdbarch_bits_big_endian (get_type_arch (value_type (to))); - /* VALUE_FRAME_ID is used instead of VALUE_NEXT_FRAME_ID here - because FRAME is passed to get_frame_register_bytes() and - put_frame_register_bytes(), both of which do their own "->next" - operations. */ - frame = frame_find_by_id (VALUE_FRAME_ID (to)); - if (frame == NULL) - { - mark_value_bytes_optimized_out (to, 0, TYPE_LENGTH (value_type (to))); - return; - } - contents = value_contents (from); bits_to_skip = 8 * value_offset (to); if (value_bitsize (to)) @@ -1988,6 +1976,7 @@ write_pieced_value (struct value *to, struct value *from) { case DWARF_VALUE_REGISTER: { + struct frame_info *frame = frame_find_by_id (c->frame_id); struct gdbarch *arch = get_frame_arch (frame); int gdb_regnum = dwarf_reg_to_regnum_or_error (arch, p->v.regno); int reg_offset = dest_offset; |