mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-12 18:36:10 +08:00
* 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.
This commit is contained in:
@ -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;
|
||||
|
||||
if (pid == getpid()) /* Trying to masturbate? */
|
||||
error ("I refuse to debug myself!");
|
||||
pid = atoi (args);
|
||||
|
||||
if (from_tty)
|
||||
{
|
||||
exec_file = (char *) get_exec_file (0);
|
||||
if (pid == getpid()) /* Trying to masturbate? */
|
||||
error ("I refuse to debug myself!");
|
||||
|
||||
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 (from_tty)
|
||||
{
|
||||
exec_file = (char *) get_exec_file (0);
|
||||
|
||||
fflush (stdout);
|
||||
}
|
||||
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));
|
||||
|
||||
attach (pid);
|
||||
inferior_pid = pid;
|
||||
push_target (&child_ops);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user