From ba3c61fc5854059a71baee9cb2b951275bf3cb7b Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 25 Mar 2021 14:31:35 +0000 Subject: [PATCH] gdb/testsuite: use -wrap with gdb_test_multiple in lib/ada.exp I ran into a new failure in gdb.base/gdb-caching-proc.exp: FAIL: gdb.base/gdb-caching-proc.exp: supports_memtag: initial: memory-tag check This is a failure from the `supports_memtag` proc added recently (this new proc is in lib/gdb.exp). The problem here is that `supports_memtag` is hitting one of the default error cases in gdb_test_multiple, specifically it is finding a $gdb_prompt left unmatched from an earlier call to gdb_test_multiple. Looking back through the test output I found that the problem is the proc `gnat_runtime_has_debug_info` in lib/ada.exp. This proc is not matching the trailing $gdb_prompt. This leaves the prompt in the expect buffer, then when we run `supports_memtag` it sees the prompt and thinks that the test completed with no output. Fixed by making use of `-wrap` in `gnat_runtime_has_debug_info` to ensure the trailing prompt gets matched. gdb/testsuite/ChangeLog: * lib/ada.exp (gnat_runtime_has_debug_info): Use -wrap with gdb_test_multiple. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/ada.exp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5bd09ce4fce..1bcdaeb69d5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-03-25 Andrew Burgess + + * lib/ada.exp (gnat_runtime_has_debug_info): Use -wrap with + gdb_test_multiple. + 2021-03-24 Luis Machado * gdb.arch/aarch64-mte.c: New file. diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index bdd0a09476e..857b079b9e5 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -188,8 +188,8 @@ gdb_caching_proc gnat_runtime_has_debug_info { set has_debug_info 0 gdb_test_multiple "whatis __gnat_debug_raise_exception" "" { - -re "type = " { } - -re "type = void" { + -re -wrap "type = " { } + -re -wrap "type = void" { set has_debug_info 1 } default { -- 2.30.2