aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-10-06 08:56:54 -0600
committerTom Tromey <tromey@adacore.com>2020-10-09 11:18:52 -0600
commit7c184d334adac03eb200b0f8b01edaf051bfc01b (patch)
tree38ff6a0265cb9dbbd3683aa7d726bb92bc47e324 /gdb/testsuite
parent5c4258f4c051a31d7209712ecd28830c55a92034 (diff)
downloadgdb-7c184d334adac03eb200b0f8b01edaf051bfc01b.zip
gdb-7c184d334adac03eb200b0f8b01edaf051bfc01b.tar.gz
gdb-7c184d334adac03eb200b0f8b01edaf051bfc01b.tar.bz2
Fix bit offset regression
The type-safe attribute patch introduced a regression that can occur when the DW_AT_bit_offset value is negative. This can happen with some Ada programs. This patch fixes the problem. It also fixes a minor oddity in the existing scalar storage test -- this test was intended to assign a smaller number of bits to the field. 2020-10-09 Tom Tromey <tromey@adacore.com> * dwarf2/read.c (dwarf2_add_field): Handle signed offsets. gdb/testsuite/ChangeLog 2020-10-09 Tom Tromey <tromey@adacore.com> * gdb.ada/scalar_storage/storage.adb (Another_Range): New type. (Rec): Add field. Fix range. * gdb.ada/scalar_storage.exp: Update.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.ada/scalar_storage.exp4
-rw-r--r--gdb/testsuite/gdb.ada/scalar_storage/storage.adb9
3 files changed, 14 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e1b623b..d7e8095 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-09 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/scalar_storage/storage.adb (Another_Range): New type.
+ (Rec): Add field. Fix range.
+ * gdb.ada/scalar_storage.exp: Update.
+
2020-10-09 Hannes Domani <ssbssa@yahoo.de>
PR exp/26714
diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp
index b5e634c..952d7fd 100644
--- a/gdb/testsuite/gdb.ada/scalar_storage.exp
+++ b/gdb/testsuite/gdb.ada/scalar_storage.exp
@@ -34,5 +34,5 @@ if ![runto "storage.adb:$bp_location" ] then {
return
}
-gdb_test "print V_LE" "= \\(value => 126\\)"
-gdb_test "print V_BE" "= \\(value => 126\\)"
+gdb_test "print V_LE" "= \\(value => 126, another_value => 12\\)"
+gdb_test "print V_BE" "= \\(value => 126, another_value => 12\\)"
diff --git a/gdb/testsuite/gdb.ada/scalar_storage/storage.adb b/gdb/testsuite/gdb.ada/scalar_storage/storage.adb
index 608425d..741718e 100644
--- a/gdb/testsuite/gdb.ada/scalar_storage/storage.adb
+++ b/gdb/testsuite/gdb.ada/scalar_storage/storage.adb
@@ -18,13 +18,16 @@ with System.Storage_Elements; use System.Storage_Elements;
procedure Storage is
subtype Some_Range is Natural range 0..127;
+ subtype Another_Range is Natural range 0..15;
type Rec is record
Value : Some_Range;
+ Another_Value : Another_Range;
end record;
for Rec use record
- Value at 0 range 0..127;
+ Value at 0 range 0..6;
+ Another_Value at 0 range 7..10;
end record;
type Rec_LE is new Rec;
@@ -39,8 +42,8 @@ procedure Storage is
V_BE : Rec_BE;
begin
- V_LE.Value := 126;
- V_BE.Value := 126;
+ V_LE := (126, 12);
+ V_BE := (126, 12);
Do_Nothing (V_LE'Address); -- START
Do_Nothing (V_BE'Address);