- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Two patches that seem to get gdb working on hppa2.0w-hp-hpux11.00
- From: Eric Anderson <anderse at hpl dot hp dot com>
- Date: Wed, 22 Nov 2000 18:13:17 -0800 (PST)
1. The HP-UX cc compiler does not seem to like seeing a default: case in
a switch without something after it; I inserted a break and the
compiler likes it.
2. Starting sub-processes in fork-child.c:fork_inferior is done
without the -f flag, which lets the shell run the startup scripts and
fork things. The comments above the execlp seem to indicate that the
-f should be present, however, it's not there. I would imagine that
the problem has been somehow fixed elsewhere, but became un-fixed for
hppa2.0w-hp-hpux11.00.
I don't know what the "correct" fix here is; if there is only a
problem on this particular architecture, you probably only want the
change on that architecture.
Without the -f, the code starts the sub-shell, goes into
startup_inferior, sees a fork, and decrements the count, then sees a
SIGCHLD, tells the child to resume, but the whole thing wedges there.
-Eric
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 top.c
*** top.c 2000/11/16 14:51:50 1.21
--- top.c 2000/11/23 02:04:42
*************** define_command (char *comname, int from_
*** 3104,3109 ****
--- 3104,3110 ----
break;
default:
/* Should never come here as hookc would be 0. */
+ break;
}
}
}
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 fork-child.c
*** fork-child.c 2000/09/01 23:39:11 1.6
--- fork-child.c 2000/11/23 02:04:42
*************** fork_inferior (char *exec_file, char *al
*** 305,311 ****
*/
if (shell)
{
! execlp (shell_file, shell_file, "-c", shell_command, (char *) 0);
/* If we get here, it's an error */
fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,
--- 305,311 ----
*/
if (shell)
{
! execlp (shell_file, shell_file, "-f", "-c", shell_command, (char *) 0)
;
/* If we get here, it's an error */
fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,