2008-12-16 Tristan Gingold <gingold@adacore.com>
* inflow.c: Remove old_sigio, handle_sigio, old_fcntl_flags, set_sigio_trap, clear_sigio_trap definitions. * inferior.h: Remove set_sigio_trap and clear_sigio_trap declarations. * inf-ptrace.c (inf_ptrace_wait): Remove call to set_sigio_trap and clear_sigio_trap. * inf-ttrace.c (inf_ttrace_wait): Ditto. * linux-nat.c (linux_nat_wait): Ditto. * spu-linux-nat.c (spu_child_wait): Ditto. * rs6000-nat.c (rs6000_wait): Ditto. * target.c: Remove target_activity_function and target_activity_fd. * target.h: Remove target_activity_function and target_activity_fd declarations.
This commit is contained in:
parent
077e0a5242
commit
d26b535418
10 changed files with 16 additions and 92 deletions
|
@ -1,3 +1,18 @@
|
|||
2008-12-16 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* inflow.c: Remove old_sigio, handle_sigio, old_fcntl_flags,
|
||||
set_sigio_trap, clear_sigio_trap definitions.
|
||||
* inferior.h: Remove set_sigio_trap and clear_sigio_trap declarations.
|
||||
* inf-ptrace.c (inf_ptrace_wait): Remove call to set_sigio_trap
|
||||
and clear_sigio_trap.
|
||||
* inf-ttrace.c (inf_ttrace_wait): Ditto.
|
||||
* linux-nat.c (linux_nat_wait): Ditto.
|
||||
* spu-linux-nat.c (spu_child_wait): Ditto.
|
||||
* rs6000-nat.c (rs6000_wait): Ditto.
|
||||
* target.c: Remove target_activity_function and target_activity_fd.
|
||||
* target.h: Remove target_activity_function and target_activity_fd
|
||||
declarations.
|
||||
|
||||
2008-12-15 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
|
||||
* dbxread.c (read_ofile_symtab): Sign-extend 32-bit N_LSYM and
|
||||
|
|
|
@ -389,7 +389,6 @@ inf_ptrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
do
|
||||
{
|
||||
set_sigint_trap ();
|
||||
set_sigio_trap ();
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -398,7 +397,6 @@ inf_ptrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
}
|
||||
while (pid == -1 && errno == EINTR);
|
||||
|
||||
clear_sigio_trap ();
|
||||
clear_sigint_trap ();
|
||||
|
||||
if (pid == -1)
|
||||
|
|
|
@ -930,7 +930,6 @@ inf_ttrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
do
|
||||
{
|
||||
set_sigint_trap ();
|
||||
set_sigio_trap ();
|
||||
|
||||
if (ttrace_wait (pid, lwpid, TTRACE_WAITOK, &tts, sizeof tts) == -1)
|
||||
perror_with_name (("ttrace_wait"));
|
||||
|
@ -949,7 +948,6 @@ inf_ttrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
tts.tts_event = TTEVT_NONE;
|
||||
}
|
||||
|
||||
clear_sigio_trap ();
|
||||
clear_sigint_trap ();
|
||||
}
|
||||
while (tts.tts_event == TTEVT_NONE);
|
||||
|
|
|
@ -97,10 +97,6 @@ extern void set_sigint_trap (void);
|
|||
|
||||
extern void clear_sigint_trap (void);
|
||||
|
||||
extern void set_sigio_trap (void);
|
||||
|
||||
extern void clear_sigio_trap (void);
|
||||
|
||||
/* Set/get file name for default use for standard in/out in the inferior. */
|
||||
|
||||
extern void set_inferior_io_terminal (const char *terminal_name);
|
||||
|
|
62
gdb/inflow.c
62
gdb/inflow.c
|
@ -651,68 +651,6 @@ clear_sigint_trap (void)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN)
|
||||
static void (*old_sigio) ();
|
||||
|
||||
static void
|
||||
handle_sigio (int signo)
|
||||
{
|
||||
int numfds;
|
||||
fd_set readfds;
|
||||
|
||||
signal (SIGIO, handle_sigio);
|
||||
|
||||
FD_ZERO (&readfds);
|
||||
FD_SET (target_activity_fd, &readfds);
|
||||
numfds = gdb_select (target_activity_fd + 1, &readfds, NULL, NULL, NULL);
|
||||
if (numfds >= 0 && FD_ISSET (target_activity_fd, &readfds))
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if ((*target_activity_function) ())
|
||||
kill (PIDGET (inferior_ptid), SIGINT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static int old_fcntl_flags;
|
||||
|
||||
void
|
||||
set_sigio_trap (void)
|
||||
{
|
||||
if (target_activity_function)
|
||||
{
|
||||
old_sigio = (void (*)()) signal (SIGIO, handle_sigio);
|
||||
fcntl (target_activity_fd, F_SETOWN, getpid ());
|
||||
old_fcntl_flags = fcntl (target_activity_fd, F_GETFL, 0);
|
||||
fcntl (target_activity_fd, F_SETFL, old_fcntl_flags | FASYNC);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
clear_sigio_trap (void)
|
||||
{
|
||||
if (target_activity_function)
|
||||
{
|
||||
signal (SIGIO, old_sigio);
|
||||
fcntl (target_activity_fd, F_SETFL, old_fcntl_flags);
|
||||
}
|
||||
}
|
||||
#else /* No SIGIO. */
|
||||
void
|
||||
set_sigio_trap (void)
|
||||
{
|
||||
if (target_activity_function)
|
||||
internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
|
||||
}
|
||||
|
||||
void
|
||||
clear_sigio_trap (void)
|
||||
{
|
||||
if (target_activity_function)
|
||||
internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
|
||||
}
|
||||
#endif /* No SIGIO. */
|
||||
|
||||
|
||||
/* Create a new session if the inferior will run in a different tty.
|
||||
A session is UNIX's way of grouping processes that share a controlling
|
||||
|
|
|
@ -2868,7 +2868,6 @@ retry:
|
|||
{
|
||||
/* Causes SIGINT to be passed on to the attached process. */
|
||||
set_sigint_trap ();
|
||||
set_sigio_trap ();
|
||||
}
|
||||
|
||||
while (status == 0)
|
||||
|
@ -2937,10 +2936,7 @@ retry:
|
|||
}
|
||||
|
||||
if (!target_can_async_p ())
|
||||
{
|
||||
clear_sigio_trap ();
|
||||
clear_sigint_trap ();
|
||||
}
|
||||
clear_sigint_trap ();
|
||||
|
||||
gdb_assert (lp);
|
||||
|
||||
|
|
|
@ -525,7 +525,6 @@ rs6000_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
do
|
||||
{
|
||||
set_sigint_trap ();
|
||||
set_sigio_trap ();
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -534,7 +533,6 @@ rs6000_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
}
|
||||
while (pid == -1 && errno == EINTR);
|
||||
|
||||
clear_sigio_trap ();
|
||||
clear_sigint_trap ();
|
||||
|
||||
if (pid == -1)
|
||||
|
|
|
@ -414,7 +414,6 @@ spu_child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
{
|
||||
set_sigint_trap (); /* Causes SIGINT to be passed on to the
|
||||
attached process. */
|
||||
set_sigio_trap ();
|
||||
|
||||
pid = waitpid (PIDGET (ptid), &status, 0);
|
||||
if (pid == -1 && errno == ECHILD)
|
||||
|
@ -431,7 +430,6 @@ spu_child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
|
|||
save_errno = EINTR;
|
||||
}
|
||||
|
||||
clear_sigio_trap ();
|
||||
clear_sigint_trap ();
|
||||
}
|
||||
while (pid == -1 && save_errno == EINTR);
|
||||
|
|
|
@ -2475,10 +2475,6 @@ store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
|
|||
}
|
||||
}
|
||||
|
||||
/* Returns zero to leave the inferior alone, one to interrupt it. */
|
||||
int (*target_activity_function) (void);
|
||||
int target_activity_fd;
|
||||
|
||||
/* Convert a normal process ID to a string. Returns the string in a
|
||||
static buffer. */
|
||||
|
||||
|
|
|
@ -299,15 +299,6 @@ extern void get_target_memory (struct target_ops *ops, CORE_ADDR addr,
|
|||
extern ULONGEST get_target_memory_unsigned (struct target_ops *ops,
|
||||
CORE_ADDR addr, int len);
|
||||
|
||||
|
||||
/* If certain kinds of activity happen, target_wait should perform
|
||||
callbacks. */
|
||||
/* Right now we just call (*TARGET_ACTIVITY_FUNCTION) if I/O is possible
|
||||
on TARGET_ACTIVITY_FD. */
|
||||
extern int target_activity_fd;
|
||||
/* Returns zero to leave the inferior alone, one to interrupt it. */
|
||||
extern int (*target_activity_function) (void);
|
||||
|
||||
struct thread_info; /* fwd decl for parameter list below: */
|
||||
|
||||
struct target_ops
|
||||
|
|
Loading…
Reference in a new issue