From: Andrew Burgess Date: Fri, 8 Nov 2024 11:19:33 +0000 (+0000) Subject: gdb/testsuite: fix gdb.base/basic-edit-cmd.exp test X-Git-Tag: gdb-16-branchpoint~512 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbca1bef47fb51531dddee7271fd651a7bc6c986;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: fix gdb.base/basic-edit-cmd.exp test In the recent commit: commit 31ada87f91b4c5306d81c8a896df9764c32941f3 Date: Wed Nov 6 22:18:55 2024 +0000 gdb: fixes and tests for the 'edit' command the new gdb.base/basic-edit-cmd.exp was added. The Linaro CI highlighted an issue with the test which I failed to address before pushing the above commit. Part of the test loads a file into GDB and then uses the 'edit' command with no arguments to edit the default location. This default location is expected to be the 'main' function. On my local machine the line reported is the opening '{' of main, and that is what the test checks for. The Linaro CI though appears to see the first code line of main. I think either result is fine as far as this test is concerned, so I've expanded the test regexp to check for either line number. This should make the CI testing happy again. --- diff --git a/gdb/testsuite/gdb.base/basic-edit-cmd.exp b/gdb/testsuite/gdb.base/basic-edit-cmd.exp index 116daf9e3b7..aa0efb54597 100644 --- a/gdb/testsuite/gdb.base/basic-edit-cmd.exp +++ b/gdb/testsuite/gdb.base/basic-edit-cmd.exp @@ -76,8 +76,11 @@ save_vars { env(EDITOR) } { # even for non-dwarf debug formats, but this currently fails # with the stabs board. if { $non_dwarf } { setup_xfail *-*-* } + # Additionally, some targets will report the default location + # as the opening brace of main, while others report the first + # line of code inside main. For this test either will do. gdb_test "edit" \ - "\r\n\\+$line_0 $srcfile_re" \ + "\r\n\\+(?:$line_0|$line_1) $srcfile_re" \ "check edit of default location" gdb_test "list $line_4" \