Re: MI and SIGINT
Hafiz Abid Qadeer <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On 14/07/2020 19:58, Andrew Burgess wrote: > * Hafiz Abid Qadeer <[email protected]> [2020-07-14 12:03:11 +0100]: > >> Hi All, >> We have observed that a SIGINT send by an IDE can cause GDB to not print >> MI stopped messages. Although this is very difficult to reproduce by >> hand but the sequence look something like this. >> >> 1. You do continue and GDB hits a breakpoint and starts calling the >> observers. >> 2. One of the observer will call into python sniffers. >> 3. If during that time, a SIGINT has arrived, it will cause python to >> throw exception which will cause GDB to abandon printing the stopped >> message. > > I don't have time to test this right now, but if your diagnosis is > correct then this should be easy to test. Write a sniffer that sends > itself a SIGINT and check you see the problem. > > This should make it possible to create a reliable test case. I looked at bit more at it and it seems the behavior is intentional and was added in 9ccabccd15603dbf9fe988c86708fe644d1398a7. If the ctrl-c arrives while python unwinders are running then its translated to a quit exception when back inside gdb. In MI case, this quit exception can cause MI stop message not being printed. I wonder if this should be classified as a defect or intentional behavior considering the following in the documentation. "An interrupt (often Ctrl-c) does not exit from GDB, but rather terminates the action of any GDB command that is in progress and returns to GDB command level. It is safe to type the interrupt character at any time because GDB does not allow it to take effect until a time when it is safe." https://www.sourceware.org/gdb/onlinedocs/gdb.html#Quitting-GDB Thanks, -- Hafiz Abid Qadeer Mentor Embedded/CodeSourcery