This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MIPS build slave
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, Brendan Kirby <brendan dot kirby at imgtec dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>, gdb-patches at sourceware dot org
- Date: Thu, 23 Jul 2015 12:20:40 +0100
- Subject: Re: MIPS build slave
- Authentication-results: sourceware.org; auth=none
- References: <CAFXXi0n=5hwk0JE82gz_QEytsU0P36=4AbNdj_1wt1zmph28bw at mail dot gmail dot com> <55A9E3F5 dot 3090902 at imgtec dot com> <87fv4kswuh dot fsf at redhat dot com> <55AD543B dot 5010301 at imgtec dot com> <87fv4iczgm dot fsf at redhat dot com> <55AD8A7F dot 3080009 at imgtec dot com> <877fpu9xjh dot fsf at redhat dot com> <55ADA56A dot 5090301 at imgtec dot com> <87380i9li6 dot fsf at redhat dot com> <55AE5DD9 dot 90504 at ericsson dot com> <55AE7581 dot 9070507 at imgtec dot com> <55AE7674 dot 20406 at ericsson dot com> <55AE7F96 dot 4000107 at imgtec dot com> <55AE84AB dot 6080807 at ericsson dot com>
On 07/21/2015 06:43 PM, Simon Marchi wrote:
> On 15-07-21 01:21 PM, Brendan Kirby wrote:
>> I overrode the SHELL variable in the Buildbot systemd service I wrote to
>> start it.
>>
>> Brendan
>
> Ok thanks, I added a little warning in the wiki:
>
>
> /!\ It has been reported that the tests won't run properly if the SHELL variable is not
> set to a valid shell (e.g. /sbin/nologin instead of /bin/bash). Make sure that the
> user running the buildslave has a valid shell or override the SHELL environment
> variable somehow.
You always need a valid SHELL set. Not just for the testsuite, but
for gdb itself: gdb starts programs with the shell for
argument globbing, variable expansion ("run *", "run $foo", etc), and
redirection ("run 1>foo.txt", etc.), unless you disable all that
with "set startup-with-shell off".
$ SHELL=/foo gdb /usr/bin/sleep
...
(gdb) r
Starting program: /usr/bin/sleep
Cannot exec /usr/bin/sleep -c exec /usr/bin/sleep .
Error: No such file or directory
During startup program exited with code 127.
(gdb)
As you found, that's a bogus error message. It should have been:
(gdb) r
Starting program: /usr/bin/sleep
Cannot exec /foo -c exec /usr/bin/sleep .
Error: No such file or directory
During startup program exited with code 127.
(gdb)
This patchlet fixes that:
>From 767ecf74811b010c47a0721306beae1979141c61 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Thu, 23 Jul 2015 12:10:18 +0100
Subject: [PATCH] fix exec error message
---
gdb/fork-child.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 66c07fb..4ba62b0 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -365,7 +365,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
/* If we get here, it's an error. */
save_errno = errno;
- fprintf_unfiltered (gdb_stderr, "Cannot exec %s", exec_file);
+ fprintf_unfiltered (gdb_stderr, "Cannot exec %s", argv[0]);
for (i = 1; argv[i] != NULL; i++)
fprintf_unfiltered (gdb_stderr, " %s", argv[i]);
fprintf_unfiltered (gdb_stderr, ".\n");
--
1.9.3