aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-10-13 16:26:28 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-10-13 16:26:28 +0000
commit22c05d8adc1cde13d7f7b8311604d77f64819d8c (patch)
tree5d85b6edbec20db0103f7d035e8670bb8b04d7f7 /gdb/value.c
parent9cf03b7e412b9cdeca8b5ea3f73c081e31078a28 (diff)
downloadgdb-22c05d8adc1cde13d7f7b8311604d77f64819d8c.zip
gdb-22c05d8adc1cde13d7f7b8311604d77f64819d8c.tar.gz
gdb-22c05d8adc1cde13d7f7b8311604d77f64819d8c.tar.bz2
gdb/
Fix internal error regression. * value.c (value_primitive_field): Handle value_optimized_out. Move packed bitfields comment. gdb/testsuite/ Fix internal error regression. * gdb.dwarf2/implptr-optimized-out.S: New file. * gdb.dwarf2/implptr-optimized-out.exp: New file.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/value.c b/gdb/value.c
index e72670b..d263d0c 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2488,16 +2488,19 @@ value_primitive_field (struct value *arg1, int offset,
description correctly. */
check_typedef (type);
- /* Handle packed fields */
-
- if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
+ if (value_optimized_out (arg1))
+ v = allocate_optimized_out_value (type);
+ else if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
{
- /* Create a new value for the bitfield, with bitpos and bitsize
+ /* Handle packed fields.
+
+ Create a new value for the bitfield, with bitpos and bitsize
set. If possible, arrange offset and bitpos so that we can
do a single aligned read of the size of the containing type.
Otherwise, adjust offset to the byte containing the first
bit. Assume that the address, offset, and embedded offset
are sufficiently aligned. */
+
int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno);
int container_bitsize = TYPE_LENGTH (type) * 8;