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>
+2014-02-17 Mike Frysinger <vapier@gentoo.org>
+
+ PR gdb/16450
+ * compile.c (control_c_sim_desc): Delete.
+ (control_c): Likewise.
+ (sim_resume): Delete signal(SIGINT) handling.
+
2013-09-23 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
}
}
-/* Grotty global variable for use by control_c signal handler. */
-static SIM_DESC control_c_sim_desc;
-
-static void
-control_c (int sig)
-{
- sim_engine_set_run_state (control_c_sim_desc, sim_stopped, SIGINT);
-}
-
int
sim_stop (SIM_DESC sd)
{
int cycles = 0;
int insts = 0;
int tick_start = get_now ();
- void (*prev) ();
int poll_count = 0;
int res;
int tmp;
init_pointers (sd);
- control_c_sim_desc = sd;
- prev = signal (SIGINT, control_c);
-
if (step)
{
sim_engine_set_run_state (sd, sim_stopped, SIGTRAP);
h8_set_exr (sd, (trace<<7) | intMask);
h8_set_mask (sd, oldmask);
- signal (SIGINT, prev);
}
int
+2014-02-17 Mike Frysinger <vapier@gentoo.org>
+
+ PR gdb/16450
+ * interp.c (interrupt): Delete.
+ (sim_resume): Delete signal(SIGINT) handling.
+
2013-09-23 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
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,
word ibuf;
word pc;
unsigned short inst;
- void (* sigsave)();
int memops;
int bonus_cycles;
int insts;
int cycs;
word WLhash;
- sigsave = signal (SIGINT, interrupt);
cpu.asregs.exception = step ? SIGTRAP: 0;
pc = cpu.asregs.pc;
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);
}
+2014-02-17 Mike Frysinger <vapier@gentoo.org>
+
+ PR gdb/16450
+ * interp.c (interrupt): Delete.
+ (sim_resume): Delete signal(SIGINT) handling.
+
2013-09-23 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
}
-static void
-interrupt ()
-{
- CPU.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,
int needfetch;
word inst;
enum microblaze_instr op;
- void (*sigsave)();
int memops;
int bonus_cycles;
int insts;
short num_delay_slot; /* UNUSED except as reqd parameter */
enum microblaze_instr_type insn_type;
- sigsave = signal (SIGINT, interrupt);
CPU.exception = step ? SIGTRAP : 0;
memops = 0;
CPU.cycles += insts; /* and each takes a cycle */
CPU.cycles += bonus_cycles; /* and extra cycles for branches */
CPU.cycles += memops; /* and memop cycle delays */
-
- signal (SIGINT, sigsave);
}
+2014-02-17 Mike Frysinger <vapier@gentoo.org>
+
+ PR gdb/16450
+ * interp.c (interrupt): Delete.
+ (sim_resume): Delete signal(SIGINT) handling.
+
2013-09-23 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
cpu.asregs.sregs[i] = 0;
}
-static void
-interrupt ()
-{
- cpu.asregs.exception = SIGINT;
-}
-
/* Write a 1 byte value to memory. */
static void INLINE
word pc, opc;
unsigned long long insts;
unsigned short inst;
- void (* sigsave)();
sim_cpu *scpu = STATE_CPU (sd, 0); /* FIXME */
address_word cia = CIA_GET (scpu);
- sigsave = signal (SIGINT, interrupt);
cpu.asregs.exception = step ? SIGTRAP: 0;
pc = cpu.asregs.regs[PC_REGNO];
insts = cpu.asregs.insts;
/* Hide away the things we've cached while executing. */
cpu.asregs.regs[PC_REGNO] = pc;
cpu.asregs.insts += insts; /* instructions done ... */
-
- signal (SIGINT, sigsave);
}
int
+2014-02-17 Mike Frysinger <vapier@gentoo.org>
+
+ PR gdb/16450
+ * interp.c (control_c): Delete.
+ (sim_resume): Delete signal(SIGINT) handling.
+
2013-09-23 Alan Modra <amodra@gmail.com>
* configure: Regenerate.
return 0;
}
-void
-control_c (sig, code, scp, addr)
- int sig;
- int code;
- char *scp;
- char *addr;
-{
- raise_exception (SIGINT);
-}
-
static int
div1 (R, iRn2, iRn1/*, T*/)
int *R;
register int endianw = global_endianw;
int tick_start = get_now ();
- void (*prev) ();
void (*prev_fpe) ();
register unsigned short *jump_table = sh_jump_table;
register unsigned char *memory;
register unsigned int sbit = ((unsigned int) 1 << 31);
- prev = signal (SIGINT, control_c);
prev_fpe = signal (SIGFPE, SIG_IGN);
init_pointers ();
}
signal (SIGFPE, prev_fpe);
- signal (SIGINT, prev);
}
int