2021-01-01 16:03:39 +08:00
|
|
|
# Copyright (C) 2010-2021 Free Software Foundation, Inc.
|
2011-02-05 13:27:23 +08:00
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2011-07-18 12:14:21 +08:00
|
|
|
if { ![support_displaced_stepping] } {
|
|
|
|
unsupported "displaced stepping"
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
2011-02-05 13:27:23 +08:00
|
|
|
load_lib gdb-python.exp
|
|
|
|
|
* gdb.python/lib-types.exp: Use standard_testfile,
prepare_for_testing.
* gdb.python/py-block.exp: Use standard_testfile.
* gdb.python/py-breakpoint.exp: Use standard_testfile.
* gdb.python/py-events.exp: Use standard_testfile,
standard_output_file.
* gdb.python/py-evsignal.exp: Use standard_testfile.
* gdb.python/py-evethreads.exp: Use standard_testfile.
* gdb.python/py-explore-cc.exp: Use standard_testfile.
* gdb.python/py-explore.exp: Use standard_testfile.
* gdb.python/py-finish-breakpoint.exp: Use standard_testfile,
standard_output_file.
* gdb.python/py-finish-breakpoint2.exp: Use standard_testfile,
prepare_for_testing.
* gdb.python/py-frame-inline.exp: Use standard_testfile.
* gdb.python/py-frame.exp: Use standard_testfile.
* gdb.python/py-inferior.exp: Use standard_testfile.
* gdb.python/py-infthread.exp: Use standard_testfile.
* gdb.python/py-mi.exp: Use standard_testfile.
* gdb.python/py-objfile-script.exp: Use standard_testfile,
build_executable.
* gdb.python/py-objfile.exp: Use standard_testfile.
* gdb.python/py-pp-maint.exp: Use standard_testfile,
prepare_for_testing.
* gdb.python/py-prettyprint.exp: Use standard_testfile.
* gdb.python/py-progspace.exp: Use standard_testfile,
build_executable.
* gdb.python/py-prompt.exp: Use standard_testfile,
build_executable.
* gdb.python/py-section-script.exp: Use standard_testfile,
build_executable.
* gdb.python/py-shared.exp: Use standard_testfile,
standard_output_file, clean_restart.
* gdb.python/py-symbol.exp: Use standard_output_file,
prepare_for_testing.
* gdb.python/py-symtab.exp: Use standard_output_file,
prepare_for_testing
* gdb.python/py-template.exp: Use standard_testfile.
* gdb.python/py-type.exp: Use standard_testfile.
* gdb.python/py-value-cc.exp: Use standard_testfile.
* gdb.python/py-value.exp: Use standard_testfile.
* gdb.python/python.exp: Use standard_testfile, build_executable.
2012-06-23 01:59:33 +08:00
|
|
|
standard_testfile
|
2011-02-05 13:27:23 +08:00
|
|
|
|
2011-09-14 05:39:59 +08:00
|
|
|
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
|
|
|
return -1
|
|
|
|
}
|
2017-10-13 20:15:04 +08:00
|
|
|
|
|
|
|
save_vars { GDBFLAGS } {
|
|
|
|
append GDBFLAGS " -ex \"set non-stop on\""
|
|
|
|
clean_restart $testfile
|
|
|
|
}
|
2011-02-05 13:27:23 +08:00
|
|
|
|
|
|
|
if { [skip_python_tests] } { continue }
|
|
|
|
|
2019-08-14 00:09:30 +08:00
|
|
|
set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py]
|
2017-01-27 05:12:12 +08:00
|
|
|
gdb_test_no_output "source ${pyfile}" "load python file"
|
2011-02-05 13:27:23 +08:00
|
|
|
|
2013-09-05 07:49:21 +08:00
|
|
|
gdb_test "test-events" "Event testers registered."
|
2011-02-05 13:27:23 +08:00
|
|
|
|
|
|
|
gdb_breakpoint "main"
|
|
|
|
gdb_breakpoint "thread2"
|
|
|
|
gdb_breakpoint "thread3"
|
|
|
|
|
2011-09-14 05:39:59 +08:00
|
|
|
gdb_run_cmd
|
2016-12-02 04:40:05 +08:00
|
|
|
set test "run to breakpoint 1"
|
2011-09-14 05:39:59 +08:00
|
|
|
gdb_test_multiple "" $test {
|
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that:
1 - make the CLI print stop info from a normal_stop observer, like MI
does.
2 - happen to change the order in which the Python and CLI/TUI
normal_stop observers are installed.
With those in place, py-events.exp regresses like shown below [1],
because the Python stop events are output before CLI prints stop info,
instead of after, and the test doesn't expect that.
With the same Python hooks, the order in which MI and Python events is
emited today is already undefined, because MI also uses the
normal_stop observer for output. I see no reason that we should in
general define the order observers, interpreters and scripting
languages get their turn at being notified of these events. So this
patch makes the test cope with Python->CLI output order too.
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-07-24 Pedro Alves <palves@redhat.com>
* gdb.python/py-events.exp: Accept output between the stop event
and the prompt.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
[1] - The regressions in question look like:
Before said patches:
(gdb) continue
Continuing.
event type: continue
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
(gdb) PASS: gdb.python/py-events.exp: continue
After said patches:
(gdb) continue
Continuing.
event type: continue
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
(gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-25 02:34:17 +08:00
|
|
|
-re "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 1\r\nbreakpoint number: 1\r\nthread num: 1\r\n.*$gdb_prompt $" {
|
2011-09-14 05:39:59 +08:00
|
|
|
pass $test
|
2011-02-05 13:27:23 +08:00
|
|
|
}
|
2011-09-14 05:39:59 +08:00
|
|
|
-re "The target does not support running in non-stop mode" {
|
|
|
|
unsupported "non-stop mode is unsupported"
|
|
|
|
return
|
2011-02-05 13:27:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that:
1 - make the CLI print stop info from a normal_stop observer, like MI
does.
2 - happen to change the order in which the Python and CLI/TUI
normal_stop observers are installed.
With those in place, py-events.exp regresses like shown below [1],
because the Python stop events are output before CLI prints stop info,
instead of after, and the test doesn't expect that.
With the same Python hooks, the order in which MI and Python events is
emited today is already undefined, because MI also uses the
normal_stop observer for output. I see no reason that we should in
general define the order observers, interpreters and scripting
languages get their turn at being notified of these events. So this
patch makes the test cope with Python->CLI output order too.
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-07-24 Pedro Alves <palves@redhat.com>
* gdb.python/py-events.exp: Accept output between the stop event
and the prompt.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
[1] - The regressions in question look like:
Before said patches:
(gdb) continue
Continuing.
event type: continue
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
(gdb) PASS: gdb.python/py-events.exp: continue
After said patches:
(gdb) continue
Continuing.
event type: continue
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
(gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-25 02:34:17 +08:00
|
|
|
gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 2\r\nbreakpoint number: 2\r\nthread num: 2.*" "reached breakpoint 2"
|
2011-02-05 13:27:23 +08:00
|
|
|
|
2011-09-14 05:39:59 +08:00
|
|
|
gdb_test "thread 2" {\[Switching to thread 2 .*}
|
|
|
|
|
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that:
1 - make the CLI print stop info from a normal_stop observer, like MI
does.
2 - happen to change the order in which the Python and CLI/TUI
normal_stop observers are installed.
With those in place, py-events.exp regresses like shown below [1],
because the Python stop events are output before CLI prints stop info,
instead of after, and the test doesn't expect that.
With the same Python hooks, the order in which MI and Python events is
emited today is already undefined, because MI also uses the
normal_stop observer for output. I see no reason that we should in
general define the order observers, interpreters and scripting
languages get their turn at being notified of these events. So this
patch makes the test cope with Python->CLI output order too.
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-07-24 Pedro Alves <palves@redhat.com>
* gdb.python/py-events.exp: Accept output between the stop event
and the prompt.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
[1] - The regressions in question look like:
Before said patches:
(gdb) continue
Continuing.
event type: continue
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
(gdb) PASS: gdb.python/py-events.exp: continue
After said patches:
(gdb) continue
Continuing.
event type: continue
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
(gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-25 02:34:17 +08:00
|
|
|
gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 3\r\nbreakpoint number: 3\r\nthread num: 3.*" "reached breakpoint 3"
|
2011-09-14 05:39:59 +08:00
|
|
|
|
|
|
|
gdb_test "thread 3" {\[Switching to thread 3 .*}
|
2011-02-05 13:27:23 +08:00
|
|
|
|
2011-09-14 05:39:59 +08:00
|
|
|
set test "continue thread 1"
|
|
|
|
gdb_test_multiple "continue&" $test {
|
|
|
|
-re "event type: continue\r\nthread num: 3\r\n$gdb_prompt " {
|
|
|
|
# This expect string must not expect the end-of-buffer '$'.
|
|
|
|
pass $test
|
2011-02-05 13:27:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-14 05:39:59 +08:00
|
|
|
set test "thread 3 was signaled"
|
|
|
|
gdb_test_multiple "" $test {
|
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that:
1 - make the CLI print stop info from a normal_stop observer, like MI
does.
2 - happen to change the order in which the Python and CLI/TUI
normal_stop observers are installed.
With those in place, py-events.exp regresses like shown below [1],
because the Python stop events are output before CLI prints stop info,
instead of after, and the test doesn't expect that.
With the same Python hooks, the order in which MI and Python events is
emited today is already undefined, because MI also uses the
normal_stop observer for output. I see no reason that we should in
general define the order observers, interpreters and scripting
languages get their turn at being notified of these events. So this
patch makes the test cope with Python->CLI output order too.
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-07-24 Pedro Alves <palves@redhat.com>
* gdb.python/py-events.exp: Accept output between the stop event
and the prompt.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
[1] - The regressions in question look like:
Before said patches:
(gdb) continue
Continuing.
event type: continue
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
(gdb) PASS: gdb.python/py-events.exp: continue
After said patches:
(gdb) continue
Continuing.
event type: continue
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
(gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-25 02:34:17 +08:00
|
|
|
-re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n" {
|
2011-09-14 05:39:59 +08:00
|
|
|
pass $test
|
2011-02-05 13:27:23 +08:00
|
|
|
}
|
|
|
|
}
|