mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
b1468492c6
Modify gdb.base/attach.exp to test the behaviour of the option exec-file-mismatch. Note that this test can also be run using/ make check RUNTESTFLAGS="--target_board=native-extended-gdbserver" TESTS=gdb.base/attach.exp to test the behaviour of attaching to running program using a gdb server. Note: when running the test with a gdbserver, the tests in test_command_line_attach_run fail because the command "run" is not supported. I tried to extend the condition if ![isnative] then { unsupported "commandline attach run test" return 0 } but unclear to me how to best do that. The below trials all failed to work properly: if { ![isnative] || [target_is_gdbserver] } then { if { ![isnative] || [use_gdb_stub] } then { if { ![isnative] || [is_remote target] } then { => could never obtain a condition that was true with gdbserver. 2020-01-25 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/attach.exp: Test 'set exec-file-mismatch'.
25 lines
543 B
C
25 lines
543 B
C
/* This program is intended to be started outside of gdb, and then
|
|
attached to by gdb. Thus, it simply spins in a loop. The loop
|
|
is exited when & if the variable 'should_exit' is non-zero. (It
|
|
is initialized to zero in this program, so the loop will never
|
|
exit unless/until gdb sets the variable to non-zero.)
|
|
*/
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
int bidule = 0;
|
|
int should_exit = 0;
|
|
|
|
int main ()
|
|
{
|
|
int local_i = 0;
|
|
|
|
alarm (60);
|
|
|
|
while (! should_exit)
|
|
{
|
|
local_i++;
|
|
}
|
|
return 0; /* postloop */
|
|
}
|