aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-07-18 10:02:14 -0600
committerTom Tromey <tromey@adacore.com>2023-07-31 10:48:00 -0600
commitfe34aba06029a86df15742b983cd398580ca3b94 (patch)
treef283ff018702a3e6feb6ac99bd3772be15bba5f2 /gdb/dwarf2
parent3d05c80b5dc47de626bed24d2a238e7a3309545e (diff)
downloadgdb-fe34aba06029a86df15742b983cd398580ca3b94.zip
gdb-fe34aba06029a86df15742b983cd398580ca3b94.tar.gz
gdb-fe34aba06029a86df15742b983cd398580ca3b94.tar.bz2
Fix bug in fixed-point handling
Alexandre Oliva found a bug in gdb's handling of fixed-point -- a certain Ada fixed-point type would be misintepreted. The bug was that the DW_AT_small looked like: <1><13cd>: Abbrev Number: 16 (DW_TAG_constant) <13ce> DW_AT_GNU_numerator: 1 <13cf> DW_AT_GNU_denominator: 0x8000000000000000 ... but gdb interpreted the denominator as a negative value.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index b1f1c1d..61730f6 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -14867,6 +14867,8 @@ get_mpz (struct dwarf2_cu *cu, gdb_mpz *value, struct attribute *attr)
? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE,
true);
}
+ else if (attr->form_is_unsigned ())
+ *value = gdb_mpz (attr->as_unsigned ());
else
*value = gdb_mpz (attr->constant_value (1));
}