public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Problem sending program a signal on hitting breakpoint - an anomaly?
@ 2023-07-28  8:47 K
  0 siblings, 0 replies; 3+ messages in thread
From: K @ 2023-07-28  8:47 UTC (permalink / raw)
  To: gdb

I've being trying to run commands that will deliver a signal to the inferior
upon a breakpoint hit:

b <func>
> Breakpoint 1, <func>
commands 1
signal SIGSYS
end

unfortunately rather than deliver the signal this triggers the breakpoint again
and so loops.
is this to be expected or an unfortunate 'feature'?
my understanding is that 'signal' is a resumption-invoking command like
cont, step et al, and that the breakpoint will be executed and stepped over.
which if true means gdb is reacting to this signal rather than just
delivering it
as advertised.
is there a workaround for this?

thanks for reading.

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Problem sending program a signal on hitting breakpoint - an anomaly?
@ 2023-07-28 10:11 K
  2023-07-28 14:50 ` K
  0 siblings, 1 reply; 3+ messages in thread
From: K @ 2023-07-28 10:11 UTC (permalink / raw)
  To: gdb

ah! the signal is delivered and the program handles it. on its return
gdb announces the breakpoint being hit.
which suggests the breakpointed instruction was not stepped over.

(gdb v13.2, x86-64)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-28 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  8:47 Problem sending program a signal on hitting breakpoint - an anomaly? K
2023-07-28 10:11 K
2023-07-28 14:50 ` K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).