0
votes

I've been trying to put together a kind of 'remote gdb agent', but I don't seem to find the right signal numbers for stop packets. Where/how can I find the signal numbers gdb actually uses? At least the gdb-multiarch from Debian Jessie repo acts weird.

Signal 31 is shown as SIG37 - real-time event 37 (I expected SIGUSR2) and if I send signal 10, dgb shows "Can't send signals to this remote system. SIGURG not sent." and sends a 'c'-packet (I expected SIGBUS).

With remote and serial debugs on, I can see that the signals 31 and 10 are actually received by gdb.

[edit] By trying I found out the first 30 signals. Here are the first ones: (the asterisk meand that can't continue with debugging) 2 SIGINT 4 SIGILL 5 SIGTRAP 6 SIGABRT * 7 SIGEMT 8 SIGFPE 9 SIGKILL 10 SIGURG * 11 SIGSTOP 12 SIGTSTP 13 SIGCONT * 14 SIGCHLD * 15 SIGTTIN * 16 SIGTTOU 17 SIGIO * 18 SIGXCPU *

[edit2]

[r $][T][1][0][#][b][5]Packet received: T10
  ...
  Can't send signals to this remote system.  SIGURG not sent.
  Sending packet: $c#63...[\x00][\x00][\x00][\x00][\x00][
  r +]Ack
1

1 Answers

2
votes

The gdb remote protocol uses its own numbers for signals. These have to be translated to the correct system values by your remote agent. See the documentation (first paragraph) for details; I think the signal numbers are only available in a gdb header file.