diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-10-21 20:41:50 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-10-21 20:41:50 +0000 |
commit | 100f92e2dea21ccb7de8fb0cb3a9b70d43d55bad (patch) | |
tree | 29f70f683bed980e1fec4d7cf5c1325bf63fed81 /gdb/inftarg.c | |
parent | efa0c22e67c2858aec856d734b2a89da68cde606 (diff) | |
download | gdb-100f92e2dea21ccb7de8fb0cb3a9b70d43d55bad.zip gdb-100f92e2dea21ccb7de8fb0cb3a9b70d43d55bad.tar.gz gdb-100f92e2dea21ccb7de8fb0cb3a9b70d43d55bad.tar.bz2 |
* Makefile.in (c-exp.tab.o): Remove notice about shift/reduce conflicts
which no longer occur.
gcc -Wall lint:
* findvar.c (symbol_read_needs_frame), corelow.c (ignore),
inflow.c (gdb_has_a_terminal): Make sure to return a value.
* regex.h: Declare re_set_syntax.
* printcmd.c: Include valprint.h.
* infcmd.c, exec.c, maint.c, core.c: Include language.h.
* maint.c: Include expression.h.
* infrun.c, fork-child.c, corelow.c, inflow.c: Include thread.h.
* inftarg.c: Include command.h.
* coredep.c: Include value.h.
* c-exp.y, m2-exp.y, ch-exp.y: Include bfd.h, symfile.h and objfiles.h.
* ch-typeprint.c: Include typeprint.h.
* ch-valprint.c: Include c-lang.h.
* nlmread.c: Include buildsym.h.
* environ.c: Include gdbcore.h. Only include defs.h once.
(set_in_environ): Cast const char * to char * when passing to
set_gnutarget.
Remove unused variables:
* printcmd.c (printf_command): args_to_vprintf.
* coffread.c (coff_symfile_init): strsection.
Move variables to within the #ifdefs where they are used:
* symtab.c (gdb_mangle_name): opname.
* inftarg.c (child_attach): pid and exec_file.
* inftarg.c (child_detach): siggnal.
* objfiles.c (allocate_objfile): mapto, md, and fd.
* objfiles.c (free_objfile): mmfd.
* infrun.c (wait_for_inferior): Include BPSTAT_WHAT_LAST in switch.
* infrun.c (wait_for_inferior): Remove unused same_pid label.
* inferior.h: Declare set_sigint_trap and clear_sigint_trap.
* parser-defs.h: Declare write_exp_elt_block.
* stabsread.h: Declare elfstab_offset_sections and
coffstab_build_psymtabs.
Diffstat (limited to 'gdb/inftarg.c')
-rw-r--r-- | gdb/inftarg.c | 81 |
1 files changed, 43 insertions, 38 deletions
diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 3270fa6..2c110ab 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -24,7 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "target.h" #include "wait.h" #include "gdbcore.h" - +#include "command.h" #include <signal.h> static void @@ -32,7 +32,7 @@ child_prepare_to_store PARAMS ((void)); #ifndef CHILD_WAIT static int -child_wait PARAMS ((int *)); +child_wait PARAMS ((int, int *)); #endif /* CHILD_WAIT */ static void @@ -110,35 +110,38 @@ child_attach (args, from_tty) char *args; int from_tty; { - char *exec_file; - int pid; - if (!args) error_no_arg ("process-id to attach"); #ifndef ATTACH_DETACH error ("Can't attach to a process on this machine."); #else - pid = atoi (args); + { + char *exec_file; + int pid; + + pid = atoi (args); - if (pid == getpid()) /* Trying to masturbate? */ - error ("I refuse to debug myself!"); + if (pid == getpid()) /* Trying to masturbate? */ + error ("I refuse to debug myself!"); - if (from_tty) - { - exec_file = (char *) get_exec_file (0); + if (from_tty) + { + exec_file = (char *) get_exec_file (0); - if (exec_file) - printf ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid)); - else - printf ("Attaching to %s\n", target_pid_to_str (pid)); + if (exec_file) + printf ("Attaching to program `%s', %s\n", exec_file, + target_pid_to_str (pid)); + else + printf ("Attaching to %s\n", target_pid_to_str (pid)); - fflush (stdout); - } + fflush (stdout); + } - attach (pid); - inferior_pid = pid; - push_target (&child_ops); + attach (pid); + inferior_pid = pid; + push_target (&child_ops); + } #endif /* ATTACH_DETACH */ } @@ -156,26 +159,28 @@ child_detach (args, from_tty) char *args; int from_tty; { - int siggnal = 0; - #ifdef ATTACH_DETACH - if (from_tty) - { - char *exec_file = get_exec_file (0); - if (exec_file == 0) - exec_file = ""; - printf ("Detaching from program: %s %s\n", exec_file, - target_pid_to_str (inferior_pid)); - fflush (stdout); - } - if (args) - siggnal = atoi (args); - - detach (siggnal); - inferior_pid = 0; - unpush_target (&child_ops); /* Pop out of handling an inferior */ + { + int siggnal = 0; + + if (from_tty) + { + char *exec_file = get_exec_file (0); + if (exec_file == 0) + exec_file = ""; + printf ("Detaching from program: %s %s\n", exec_file, + target_pid_to_str (inferior_pid)); + fflush (stdout); + } + if (args) + siggnal = atoi (args); + + detach (siggnal); + inferior_pid = 0; + unpush_target (&child_ops); + } #else - error ("This version of Unix does not support detaching a process."); + error ("This version of Unix does not support detaching a process."); #endif } |