diff options
Diffstat (limited to 'gdb/testsuite/gdb.multi')
-rw-r--r-- | gdb/testsuite/gdb.multi/bkpt-multi-exec.c | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.multi/bkpt-multi-exec.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.multi/multi-arch-exec.c | 17 | ||||
-rw-r--r-- | gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 |
4 files changed, 28 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.c b/gdb/testsuite/gdb.multi/bkpt-multi-exec.c index 94c9668..eb002fb 100644 --- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.c +++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.c @@ -2,12 +2,22 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <limits.h> -int main (void) +int main (int argc, char ** argv) { + char prog[PATH_MAX]; + int len; + + strcpy (prog, argv[0]); + len = strlen (prog); + /* Replace "bkpt-multi-exec" with "crashme". */ + memcpy (prog + len - 15, "crashme", 7); + prog[len - 8] = 0; + printf ("foll-exec is about to execl(crashme)...\n"); - execl (BASEDIR "/crashme", - BASEDIR "/crashme", + execl (prog, + prog, (char *)0); } diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp index b7662df..e522413 100644 --- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp +++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp @@ -34,8 +34,6 @@ set srcfile2 ${exec2}.c set binfile2 [standard_output_file ${exec2}] set compile_options {debug} -set dirname [relative_filename [pwd] [file dirname $binfile1]] -lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\"" if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" $compile_options] == -1 } { return -1 diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.c b/gdb/testsuite/gdb.multi/multi-arch-exec.c index 864e264..168b484 100644 --- a/gdb/testsuite/gdb.multi/multi-arch-exec.c +++ b/gdb/testsuite/gdb.multi/multi-arch-exec.c @@ -18,12 +18,23 @@ #include <stdlib.h> #include <stdio.h> #include <unistd.h> +#include <limits.h> +#include <string.h> int -main () +main (int argc, char ** argv) { - execl (BASEDIR "/multi-arch-exec-hello", - BASEDIR "/multi-arch-exec-hello", + char prog[PATH_MAX]; + int len; + + strcpy (prog, argv[0]); + len = strlen (prog); + /* Replace "multi-arch-exec" with "multi-arch-exec-hello". */ + memcpy (prog + len - 15, "multi-arch-exec-hello", 21); + prog[len + 6] = 0; + + execl (prog, + prog, (char *) NULL); perror ("execl failed"); exit (1); diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp index 5e9b59a..88e5a62 100644 --- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp +++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp @@ -52,11 +52,9 @@ if [istarget "s390*-*-*"] { set march2 "-m32" } -set dirname [relative_filename [pwd] [file dirname $binfile2]] if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \ [list debug \ - additional_flags=${march1} \ - additional_flags=-DBASEDIR=\"$dirname\"]] } { + additional_flags=${march1}]] } { return -1 } |