aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.c12
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.exp8
-rw-r--r--gdb/testsuite/gdb.base/foll-vfork.c2
-rw-r--r--gdb/testsuite/gdb.base/foll-vfork.exp8
4 files changed, 19 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c
index 1b76090..78c1cda 100644
--- a/gdb/testsuite/gdb.base/foll-exec.c
+++ b/gdb/testsuite/gdb.base/foll-exec.c
@@ -17,27 +17,27 @@ main ()
printf ("foll-exec is about to execlp(execd-prog)...\n");
- execlp ("gdb.base/execd-prog",
- "gdb.base/execd-prog",
+ execlp (BASEDIR "/execd-prog",
+ BASEDIR "/execd-prog",
"execlp arg1 from foll-exec",
(char *)0);
printf ("foll-exec is about to execl(execd-prog)...\n");
- execl ("gdb.base/execd-prog",
- "gdb.base/execd-prog",
+ execl (BASEDIR "/execd-prog",
+ BASEDIR "/execd-prog",
"execl arg1 from foll-exec",
"execl arg2 from foll-exec",
(char *)0);
{
static char * argv[] = {
- (char *)"gdb.base/execd-prog",
+ (char *)BASEDIR "/execd-prog",
(char *)"execv arg1 from foll-exec",
(char *)0};
printf ("foll-exec is about to execv(execd-prog)...\n");
- execv ("gdb.base/execd-prog", argv);
+ execv (BASEDIR "/execd-prog", argv);
}
}
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 9456f42..135cad6 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -29,13 +29,17 @@ set testfile2 "execd-prog"
set srcfile2 ${testfile2}.c
set binfile2 [standard_output_file ${testfile2}]
+set compile_options debug
+set dirname [relative_filename [pwd] [file dirname $binfile]]
+lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\""
+
# build the first test case
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $compile_options] != "" } {
untested foll-exec.exp
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_options] != "" } {
untested foll-exec.exp
return -1
}
diff --git a/gdb/testsuite/gdb.base/foll-vfork.c b/gdb/testsuite/gdb.base/foll-vfork.c
index 694843f..d7d72fd 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.c
+++ b/gdb/testsuite/gdb.base/foll-vfork.c
@@ -29,7 +29,7 @@ main ()
pid = vfork ();
if (pid == 0) {
printf ("I'm the child!\n");
- execlp ("gdb.base/vforked-prog", "gdb.base/vforked-prog", (char *)0);
+ execlp (BASEDIR "/vforked-prog", BASEDIR "/vforked-prog", (char *)0);
perror ("exec failed");
_exit (1);
}
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
index 0660060..29d6da0 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.exp
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -47,7 +47,11 @@ if [istarget "hppa*-hp-hpux10.20"] then {
standard_testfile
-if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
+set compile_options debug
+set dirname [relative_filename [pwd] [file dirname $binfile]]
+lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\""
+
+if {[build_executable $testfile.exp $testfile $srcfile $compile_options] == -1} {
untested "failed to compile $testfile"
return -1
}
@@ -55,7 +59,7 @@ if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
set testfile2 "vforked-prog"
set srcfile2 ${testfile2}.c
-if {[build_executable $testfile.exp $testfile2 $srcfile2 {debug}] == -1} {
+if {[build_executable $testfile.exp $testfile2 $srcfile2 $compile_options] == -1} {
untested "failed to compile $testfile2"
return -1
}