diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2022-01-12 16:06:10 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2022-01-12 16:19:19 +0100 |
commit | 51eebae32ab1b7bb454c90252edb877211f6fcb4 (patch) | |
tree | 3512b26b033b37713a3dcb3cdcb230c850239f7b /gdb | |
parent | ae9adb365189f0f8c04aa5d7348c8e8a73a65f61 (diff) | |
download | gdb-51eebae32ab1b7bb454c90252edb877211f6fcb4.zip gdb-51eebae32ab1b7bb454c90252edb877211f6fcb4.tar.gz gdb-51eebae32ab1b7bb454c90252edb877211f6fcb4.tar.bz2 |
gdb/testsuite: fix gdb.python/py-events.exp for finding process id
When executed with --target_board=native-extended-gdbserver, the
gdb.python/py-events.exp test errors out with
ERROR: tcl error sourcing /path/to/gdb/testsuite/gdb.python/py-events.exp.
ERROR: can't read "process_id": no such variable
while executing
"lappend expected "ptid: \\($process_id, $process_id, 0\\)" "address: $addr""
(file "/path/to/gdb/testsuite/gdb.python/py-events.exp" line 103)
invoked from within
"source /path/to/gdb/testsuite/gdb.python/py-events.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source /path/to/gdb/testsuite/gdb.python/py-events.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
There are multiple problems around this:
1. The process_id variable is not initialized to a default value.
2. The test attempts to find the PID of the current thread, but the
regexp that it uses is not tailored for the output printed by the
remote target.
3. The test uses "info threads" to find the current thread PID.
Using the "thread" command instead is simpler.
Fix these problems.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.python/py-events.exp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp index 4df012b..2fdd216 100644 --- a/gdb/testsuite/gdb.python/py-events.exp +++ b/gdb/testsuite/gdb.python/py-events.exp @@ -81,12 +81,17 @@ delete_breakpoints # Test inferior call events -gdb_test_multiple "info threads" "get current thread" { - -re -wrap "process ($decimal)\[^\n\r\]*do_nothing.*" { +set process_id "invalid" +gdb_test_multiple "thread" "get current thread" { + -re -wrap "process ($decimal).*" { set process_id $expect_out(1,string) pass $gdb_test_name } - -re -wrap "Thread $hex \\(LWP ($decimal)\\)\[^\n\r\]*do_nothing.*" { + -re -wrap "Thread $hex \\(LWP ($decimal)\\).*" { + set process_id $expect_out(1,string) + pass $gdb_test_name + } + -re -wrap "Thread $decimal\.($decimal).*" { set process_id $expect_out(1,string) pass $gdb_test_name } |