forked from Imagelibrary/binutils-gdb
sim: delete duplicate SIGINT handling
Many of the simulators change the SIGINT handler. E.g., moxie/interp.c: sigsave = signal (SIGINT, interrupt); However, this is unnecessary. remote-sim.h already provides an API for asynchronously stopping a sim; and both gdb and the drivers (run.c and nrun.c at least, I didn't check the others) install a SIGINT handler which calls this method. URL: https://sourceware.org/bugzilla/show_bug.cgi?id=16450 Reported-by: Tom Tromey <tromey@redhat.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
@@ -472,12 +472,6 @@ set_initial_gprs ()
|
||||
cpu.gr[PARM4] = cpu.gr[0];
|
||||
}
|
||||
|
||||
static void
|
||||
interrupt ()
|
||||
{
|
||||
cpu.asregs.exception = SIGINT;
|
||||
}
|
||||
|
||||
/* Functions so that trapped open/close don't interfere with the
|
||||
parent's functions. We say that we can't close the descriptors
|
||||
that we didn't open. exit() and cleanup() get in trouble here,
|
||||
@@ -762,7 +756,6 @@ sim_resume (sd, step, siggnal)
|
||||
word ibuf;
|
||||
word pc;
|
||||
unsigned short inst;
|
||||
void (* sigsave)();
|
||||
int memops;
|
||||
int bonus_cycles;
|
||||
int insts;
|
||||
@@ -770,7 +763,6 @@ sim_resume (sd, step, siggnal)
|
||||
int cycs;
|
||||
word WLhash;
|
||||
|
||||
sigsave = signal (SIGINT, interrupt);
|
||||
cpu.asregs.exception = step ? SIGTRAP: 0;
|
||||
pc = cpu.asregs.pc;
|
||||
|
||||
@@ -1709,8 +1701,6 @@ sim_resume (sd, step, siggnal)
|
||||
cpu.asregs.cycles += insts; /* and each takes a cycle */
|
||||
cpu.asregs.cycles += bonus_cycles; /* and extra cycles for branches */
|
||||
cpu.asregs.cycles += memops * memcycles; /* and memop cycle delays */
|
||||
|
||||
signal (SIGINT, sigsave);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user