mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
* target.h: Add enum target_waitkind, enum target_signal, and
struct target_waitstatus. Change status argument to target_wait to be struct target_waitstatus * instead of int *. * target.h, infrun.c, all targets: Change type of signal arguments to resume(), proceed(), and target_resume() from int to enum target_signal. * All targets (*_wait, *_resume): Change accordingly. * infcmd.c (program_info, signal_command), throughout infrun.c, * fork-child.c, solib.c, hppa-tdep.c, osfsolib.c: Use this stuff. * convex-xdep.c, convex-tdep.c: Add FIXME's (getting the Convex signal code stuff right with the new signals would be non-trivial). * inferior.h (stop_signal): Make it enum target_signal not int. * target.c, target.h (target_signal_to_string, target_signal_to_name, target_signal_from_name): New functions. * inftarg.c, target.h (target_signal_to_host, target_signal_from_host, store_waitstatus): New functions. * procfs.c (procfs_notice_signals): Use them. * i960-tdep.c (i960_fault_to_signal): New function, to replace print_fault. * config/i960/tm-i960.h: Don't define PRINT_RANDOM_SIGNAL.
This commit is contained in:
@@ -276,12 +276,13 @@ gdbsim_detach (args,from_tty)
|
||||
|
||||
static void
|
||||
gdbsim_resume (pid, step, siggnal)
|
||||
int pid, step, siggnal;
|
||||
int pid, step;
|
||||
enum target_signal siggnal;
|
||||
{
|
||||
if (sr_get_debug ())
|
||||
printf_filtered ("gdbsim_resume: step %d, signal %d\n", step, siggnal);
|
||||
|
||||
sim_resume (step, siggnal);
|
||||
sim_resume (step, target_signal_to_host (siggnal));
|
||||
}
|
||||
|
||||
/* Wait for inferior process to do something. Return pid of child,
|
||||
@@ -291,20 +292,35 @@ gdbsim_resume (pid, step, siggnal)
|
||||
static int
|
||||
gdbsim_wait (pid, status)
|
||||
int pid;
|
||||
WAITTYPE *status;
|
||||
struct target_waitstatus *status;
|
||||
{
|
||||
int sigrc;
|
||||
enum sim_stop reason;
|
||||
|
||||
if (sr_get_debug ())
|
||||
printf_filtered ("gdbsim_wait: ");
|
||||
printf_filtered ("gdbsim_wait\n");
|
||||
|
||||
sim_stop_reason (&reason, &sigrc);
|
||||
if (reason == sim_exited)
|
||||
WSETEXIT (*status, sigrc);
|
||||
else
|
||||
WSETSTOP (*status, sigrc);
|
||||
if (sr_get_debug ())
|
||||
printf_filtered ("status %d\n", *status);
|
||||
switch (reason)
|
||||
{
|
||||
case sim_exited:
|
||||
status->kind = TARGET_WAITKIND_EXITED;
|
||||
status->value.integer = sigrc;
|
||||
break;
|
||||
case sim_stopped:
|
||||
status->kind = TARGET_WAITKIND_STOPPED;
|
||||
/* The signal in sigrc is a host signal. That probably
|
||||
should be fixed. */
|
||||
status->value.sig = target_signal_from_host (sigrc);
|
||||
break;
|
||||
case sim_signalled:
|
||||
status->kind = TARGET_WAITKIND_SIGNALLED;
|
||||
/* The signal in sigrc is a host signal. That probably
|
||||
should be fixed. */
|
||||
status->value.sig = target_signal_from_host (sigrc);
|
||||
break;
|
||||
}
|
||||
|
||||
return inferior_pid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user