mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:27:26 +08:00
testsuite: Fix runaway attach processes
I have started seeing occasional runaway 'attach' processes these days. I cannot be certain it is really caused by this patch, for example grep 'FAIL.*cmdline attach run' does not show anything in my logs. But as I remember this 'attach' runaway process always happened in GDB (but I do not remember it in the past months) I think it would be most safe to just solve it forever by [attached]. gdb/testsuite/ChangeLog 2014-09-12 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/attach.c: Include unistd.h. (main): Call alarm. Add label postloop. * gdb.base/attach.exp (do_attach_tests): Use gdb_get_line_number, gdb_breakpoint, gdb_continue_to_breakpoint. (test_command_line_attach_run): Kill ${testpid} in one exit path.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2014-09-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/attach.c: Include unistd.h.
|
||||||
|
(main): Call alarm. Add label postloop.
|
||||||
|
* gdb.base/attach.exp (do_attach_tests): Use gdb_get_line_number,
|
||||||
|
gdb_breakpoint, gdb_continue_to_breakpoint.
|
||||||
|
(test_command_line_attach_run): Kill ${testpid} in one exit path.
|
||||||
|
|
||||||
2014-09-11 Pedro Alves <palves@redhat.com>
|
2014-09-11 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
PR gdb/17347
|
PR gdb/17347
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
exit unless/until gdb sets the variable to non-zero.)
|
exit unless/until gdb sets the variable to non-zero.)
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int should_exit = 0;
|
int should_exit = 0;
|
||||||
|
|
||||||
@ -12,9 +13,11 @@ int main ()
|
|||||||
{
|
{
|
||||||
int local_i = 0;
|
int local_i = 0;
|
||||||
|
|
||||||
|
alarm (60);
|
||||||
|
|
||||||
while (! should_exit)
|
while (! should_exit)
|
||||||
{
|
{
|
||||||
local_i++;
|
local_i++;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0; /* postloop */
|
||||||
}
|
}
|
||||||
|
@ -256,11 +256,8 @@ proc do_attach_tests {} {
|
|||||||
|
|
||||||
# Verify that the modification really happened.
|
# Verify that the modification really happened.
|
||||||
|
|
||||||
gdb_test "tbreak 19" "Temporary breakpoint .*at.*$srcfile, line 19.*" \
|
gdb_breakpoint [gdb_get_line_number "postloop"] temporary
|
||||||
"after attach2, set tbreak postloop"
|
gdb_continue_to_breakpoint "postloop" ".* postloop .*"
|
||||||
|
|
||||||
gdb_test "continue" "main.*at.*$srcfile:19.*" \
|
|
||||||
"after attach2, reach tbreak postloop"
|
|
||||||
|
|
||||||
# Allow the test process to exit, to cleanup after ourselves.
|
# Allow the test process to exit, to cleanup after ourselves.
|
||||||
|
|
||||||
@ -418,6 +415,7 @@ proc test_command_line_attach_run {} {
|
|||||||
"-iex \"set height 0\" -iex \"set width 0\" --pid=$testpid -ex \"start\""]
|
"-iex \"set height 0\" -iex \"set width 0\" --pid=$testpid -ex \"start\""]
|
||||||
if { $res != 0} {
|
if { $res != 0} {
|
||||||
fail $test
|
fail $test
|
||||||
|
remote_exec build "kill -9 ${testpid}"
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
gdb_test_multiple "" $test {
|
gdb_test_multiple "" $test {
|
||||||
|
Reference in New Issue
Block a user