diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-11-08 11:19:33 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-11-08 11:19:33 +0000 |
commit | dbca1bef47fb51531dddee7271fd651a7bc6c986 (patch) | |
tree | 03f4eb95d9b611ffbe2d1fd1cd7fc677f42789e6 | |
parent | 31ada87f91b4c5306d81c8a896df9764c32941f3 (diff) | |
download | gdb-dbca1bef47fb51531dddee7271fd651a7bc6c986.zip gdb-dbca1bef47fb51531dddee7271fd651a7bc6c986.tar.gz gdb-dbca1bef47fb51531dddee7271fd651a7bc6c986.tar.bz2 |
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.
-rw-r--r-- | gdb/testsuite/gdb.base/basic-edit-cmd.exp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/basic-edit-cmd.exp b/gdb/testsuite/gdb.base/basic-edit-cmd.exp index 116daf9..aa0efb5 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" \ |