aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-finish-breakpoint.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-12-27 21:29:41 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-12-27 21:29:41 +0000
commit3bc96cfbb226922c2eedc9df93a6d18bf532db7f (patch)
treeaf451a829aadbd2f41daa6dd46bb7234b7032c85 /gdb/testsuite/gdb.python/py-finish-breakpoint.c
parentc04316705c262c7a857ae87a5607d4b71ccc34e9 (diff)
downloadgdb-3bc96cfbb226922c2eedc9df93a6d18bf532db7f.zip
gdb-3bc96cfbb226922c2eedc9df93a6d18bf532db7f.tar.gz
gdb-3bc96cfbb226922c2eedc9df93a6d18bf532db7f.tar.bz2
gdb/testsuite/
* gdb.python/py-finish-breakpoint.c (test_exec_exit): Change the parameter to self_exec, adjust the function. (main): Check for argv[1] "exit". Use argv[0] for test_exec_exit. * gdb.python/py-finish-breakpoint.exp (set var self_exec = 0): New test. (set var do_exit = 0): Remove test. (newline at end of file): Add one.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-finish-breakpoint.c')
-rw-r--r--gdb/testsuite/gdb.python/py-finish-breakpoint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.c b/gdb/testsuite/gdb.python/py-finish-breakpoint.c
index cf2e06c..d8a5c1c 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.c
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.c
@@ -59,12 +59,12 @@ call_longjmp (jmp_buf *buf)
}
void
-test_exec_exit (int do_exit)
+test_exec_exit (const char *self_exec)
{
- if (do_exit)
+ if (self_exec == NULL)
exit (0);
else
- execl ("/bin/echo", "echo", "-1", (char *)0);
+ execl (self_exec, self_exec, "exit", (char *)0);
}
int main (int argc, char *argv[])
@@ -74,6 +74,9 @@ int main (int argc, char *argv[])
int bar = 42;
int i, j;
+ if (argc == 2 && strcmp (argv[1], "exit") == 0)
+ return 0;
+
do_nothing ();
i = 0;
@@ -94,7 +97,7 @@ int main (int argc, char *argv[])
else
j += 1; /* after longjmp. */
- test_exec_exit (1);
+ test_exec_exit (argv[0]);
return j; /* Break at end. */
}