From f05f3e723568756ac523ffddfe90fe6ed12dbb95 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Fri, 19 Nov 2021 22:48:59 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp When running the testsuite, I have: Running .../gdb/testsuite/gdb.base/realname-expand.exp ... DUPLICATE: gdb.base/realname-expand.exp: set basenames-may-differ on This is due to the fact that the test restarts GDB twice and each time sets the basenames-may-differ setting. This patch proposes to fix this by not restarting GDB so the setting is maintained. It just clears the breakpoints between the two tests and updates the breakpoints number as required. This patch also perform some minor refactorings to improve visibility. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/realname-expand.exp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/realname-expand.exp b/gdb/testsuite/gdb.base/realname-expand.exp index 63299cd5b5c..b476ef876ef 100644 --- a/gdb/testsuite/gdb.base/realname-expand.exp +++ b/gdb/testsuite/gdb.base/realname-expand.exp @@ -40,10 +40,12 @@ clean_restart ${testfile} gdb_test_no_output "set basenames-may-differ on" -gdb_test "rbreak realname-expand-real.c:func" "^rbreak realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\.\r\nvoid func\\(void\\);" +gdb_test "rbreak realname-expand-real.c:func" \ + [multi_line "" \ + "Breakpoint 1 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\." \ + "void func\\(void\\);"] -clean_restart ${testfile} - -gdb_test_no_output "set basenames-may-differ on" +delete_breakpoints -gdb_test "break realname-expand-real.c:func" "^break realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\." +gdb_test "break realname-expand-real.c:func" \ + "\r\nBreakpoint 2 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\." -- 2.30.2