From 9f8219f130009ff0d3a3a9ab9e400cab07ce4f0e Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Thu, 16 Jun 1994 23:04:55 +0000 Subject: [PATCH] * fork-child.c (startup_inferior) [STARTUP_INFERIOR]: If defined, call it instead of doing normal loop. * infcmd.c (attach_command): Don't call wait_for_inferior if running Mach 3. * infrun.c (proceed) [PREPARE_TO_PROCEED]: If defined, call hook that can decide whether to step over the next breakpoint. * utils.c (wrap_here): Abort if wrap_buffer not allocated. (request_quit) [REQUEST_QUIT]: If defined, call it instead of doing normal quit. * Makefile.in (stop-gdb): New target. * stop-gdb.c: New file, utility to get attention of waiting GDBs in Mach 3. --- gdb/ChangeLog | 14 ++++++- gdb/fork-child.c | 4 ++ gdb/gdb-stop.c | 110 ------------------------------------------------------- gdb/stop-gdb.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 112 deletions(-) create mode 100644 gdb/stop-gdb.c diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 05c18d2..cf33152 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,10 +1,20 @@ Thu Jun 16 14:41:37 1994 Stan Shebs (shebs@andros.cygnus.com) + * fork-child.c (startup_inferior) [STARTUP_INFERIOR]: If defined, + call it instead of doing normal loop. + * infcmd.c (attach_command): Don't call wait_for_inferior if + running Mach 3. + * infrun.c (proceed) [PREPARE_TO_PROCEED]: If defined, call + hook that can decide whether to step over the next breakpoint. + * utils.c (wrap_here): Abort if wrap_buffer not allocated. + (request_quit) [REQUEST_QUIT]: If defined, call it instead of + doing normal quit. + * configure.in: Improve sorting/formatting of hosts and targets. (i[34]86-*-mach3*, i[34]86-*-osf1mk*, mips-*-mach3*, m88*-*-mach3*, ns32k-*-mach3*): Recognize. - * Makefile.in (gdb-stop): New target. - * gdb-stop.c: New file, utility to gets attention of waiting GDBs + * Makefile.in (stop-gdb): New target. + * stop-gdb.c: New file, utility to get attention of waiting GDBs in Mach 3. Wed Jun 15 00:41:03 1994 Tom Lord (lord@rtl.cygnus.com) diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 4954de2..26b74cf 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -259,6 +259,9 @@ startup_inferior (ntraps) terminal_initted = 0; +#ifdef STARTUP_INFERIOR + STARTUP_INFERIOR (pending_execs); +#else while (1) { stop_soon_quietly = 1; /* Make wait_for_inferior be quiet */ @@ -292,5 +295,6 @@ startup_inferior (ntraps) resume (0, TARGET_SIGNAL_0); /* Just make it go on */ } } +#endif /* STARTUP_INFERIOR */ stop_soon_quietly = 0; } diff --git a/gdb/gdb-stop.c b/gdb/gdb-stop.c index abb3d69..e69de29 100644 --- a/gdb/gdb-stop.c +++ b/gdb/gdb-stop.c @@ -1,110 +0,0 @@ -/* A client to make GDB return to command level in Mach 3. - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Authors: Jukka Virtanen and Peter Stout . - - A simple client to make GDB (versions 4.4 and later) on Mach 3 return - to the command level when it is waiting for the inferior to stop. - - Actions: Lookup the send right to the GDB message port from the - NetMsgServer. - - Send an asynchronous message with msgh_id - GDB_MESSAGE_ID_STOP to that port. - */ - -#include - -#include "defs.h" - -#include -#include -#include -#include -#include - -void -main (argc, argv) - int argc; - char **argv; -{ - kern_return_t kr; - mach_msg_header_t msg; - mach_port_t gdb_port; - char *host; - char *name; - - if (argc == 1) - argv[argc++] = GDB_DEF_NAME; - - if (argc != 2) - { - fprintf (stderr, "Usage : %s \n", argv[0]); - exit (1); - } - - /* Allow the user to specify a remote host. */ - host = strchr (argv[1], '@'); - if (host) - *(host++) = '\0'; - else - host = (char *) ""; - - name = malloc (strlen (argv[1]) + sizeof(GDB_NAME_PREFIX)); - if (name == NULL) - { - fprintf (stderr, "Unable to allocate memory for name."); - exit (1); - } - - strcpy (name, GDB_NAME_PREFIX); - strcat (name, argv[1]); - - /* Look up the GDB service port. For convenience, add the - GDB_NAME_PREFIX the argument before looking up the name. - For backwards compatibility, do it without. */ - - kr = netname_look_up (name_server_port, host, name, &gdb_port); - if (kr == NETNAME_NOT_CHECKED_IN) - kr = netname_look_up (name_server_port, host, argv[1], &gdb_port); - if (kr != KERN_SUCCESS) - { - fprintf (stderr, "Unable to lookup the GDB service port: %s.\n", - mach_error_string(kr)); - exit(1); - } - - /* Code generated by mig stub generator, with minor cleanups :-) - - simpleroutine stop_inferior(gdb_port : mach_port_t); */ - - msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0); - msg.msgh_remote_port = gdb_port; - msg.msgh_local_port = MACH_PORT_NULL; - msg.msgh_size = sizeof(msg); - msg.msgh_seqno = 0; - msg.msgh_id = GDB_MESSAGE_ID_STOP; - - kr = mach_msg_send (&msg); - if (kr != KERN_SUCCESS) - fprintf (stderr, "Message not sent, return code %d : %s\n", kr, - mach_error_string (kr)); - - exit (kr != KERN_SUCCESS); -} diff --git a/gdb/stop-gdb.c b/gdb/stop-gdb.c new file mode 100644 index 0000000..abb3d69 --- /dev/null +++ b/gdb/stop-gdb.c @@ -0,0 +1,110 @@ +/* A client to make GDB return to command level in Mach 3. + Copyright (C) 1992, 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Authors: Jukka Virtanen and Peter Stout . + + A simple client to make GDB (versions 4.4 and later) on Mach 3 return + to the command level when it is waiting for the inferior to stop. + + Actions: Lookup the send right to the GDB message port from the + NetMsgServer. + + Send an asynchronous message with msgh_id + GDB_MESSAGE_ID_STOP to that port. + */ + +#include + +#include "defs.h" + +#include +#include +#include +#include +#include + +void +main (argc, argv) + int argc; + char **argv; +{ + kern_return_t kr; + mach_msg_header_t msg; + mach_port_t gdb_port; + char *host; + char *name; + + if (argc == 1) + argv[argc++] = GDB_DEF_NAME; + + if (argc != 2) + { + fprintf (stderr, "Usage : %s \n", argv[0]); + exit (1); + } + + /* Allow the user to specify a remote host. */ + host = strchr (argv[1], '@'); + if (host) + *(host++) = '\0'; + else + host = (char *) ""; + + name = malloc (strlen (argv[1]) + sizeof(GDB_NAME_PREFIX)); + if (name == NULL) + { + fprintf (stderr, "Unable to allocate memory for name."); + exit (1); + } + + strcpy (name, GDB_NAME_PREFIX); + strcat (name, argv[1]); + + /* Look up the GDB service port. For convenience, add the + GDB_NAME_PREFIX the argument before looking up the name. + For backwards compatibility, do it without. */ + + kr = netname_look_up (name_server_port, host, name, &gdb_port); + if (kr == NETNAME_NOT_CHECKED_IN) + kr = netname_look_up (name_server_port, host, argv[1], &gdb_port); + if (kr != KERN_SUCCESS) + { + fprintf (stderr, "Unable to lookup the GDB service port: %s.\n", + mach_error_string(kr)); + exit(1); + } + + /* Code generated by mig stub generator, with minor cleanups :-) + + simpleroutine stop_inferior(gdb_port : mach_port_t); */ + + msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0); + msg.msgh_remote_port = gdb_port; + msg.msgh_local_port = MACH_PORT_NULL; + msg.msgh_size = sizeof(msg); + msg.msgh_seqno = 0; + msg.msgh_id = GDB_MESSAGE_ID_STOP; + + kr = mach_msg_send (&msg); + if (kr != KERN_SUCCESS) + fprintf (stderr, "Message not sent, return code %d : %s\n", kr, + mach_error_string (kr)); + + exit (kr != KERN_SUCCESS); +} -- 2.7.4