aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ada
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-02-22 12:02:10 -0700
committerTom Tromey <tromey@adacore.com>2022-04-04 12:46:08 -0600
commit45016746f1a992e7300cae74761c681a8a3f4fe7 (patch)
treea609743440e8e2a6494e03d7db223853ba16eaad /gdb/testsuite/gdb.ada
parentc3f2a3738a3603f51e3621504d8207767526add9 (diff)
downloadgdb-45016746f1a992e7300cae74761c681a8a3f4fe7.zip
gdb-45016746f1a992e7300cae74761c681a8a3f4fe7.tar.gz
gdb-45016746f1a992e7300cae74761c681a8a3f4fe7.tar.bz2
Fix bug in Ada attributes lexing
The Ada lexer allows whitespace between the apostrophe and the attribute text, but processAttribute does not handle this. This patch fixes the problem and introduces a regression test.
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r--gdb/testsuite/gdb.ada/formatted_ref.exp16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.ada/formatted_ref.exp b/gdb/testsuite/gdb.ada/formatted_ref.exp
index bb5f78c..882dbf1 100644
--- a/gdb/testsuite/gdb.ada/formatted_ref.exp
+++ b/gdb/testsuite/gdb.ada/formatted_ref.exp
@@ -70,13 +70,15 @@ proc test_p_x_addr { var addr } {
global gdb_prompt
foreach attr {access unchecked_access unrestricted_access} {
- set test "print/x $var'$attr"
- gdb_test_multiple $test $test {
- -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
- pass $test
- }
- -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
- fail "$test (prints unexpected address)"
+ foreach space {"" " "} {
+ set test "print/x $var'$space$attr"
+ gdb_test_multiple $test $test {
+ -re "\\$\[0-9\]+ = $addr.*$gdb_prompt $" {
+ pass $test
+ }
+ -re "\\$\[0-9\]+ = 0x\[a-f0-9+\]+.*$gdb_prompt $" {
+ fail "$test (prints unexpected address)"
+ }
}
}
}