public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Hafiz Abid Qadeer <abid_qadeer@mentor.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: <gdb@sourceware.org>
Subject: Re: MI and SIGINT
Date: Fri, 17 Jul 2020 16:28:59 +0100	[thread overview]
Message-ID: <7c3603c8-11ca-19bb-44ea-99f2bdd77de2@mentor.com> (raw)
In-Reply-To: <20200714185850.GI3463@embecosm.com>

On 14/07/2020 19:58, Andrew Burgess wrote:
> * Hafiz Abid Qadeer <abid_qadeer@mentor.com> [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

      reply	other threads:[~2020-07-17 15:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 11:03 Hafiz Abid Qadeer
2020-07-14 18:58 ` Andrew Burgess
2020-07-17 15:28   ` Hafiz Abid Qadeer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c3603c8-11ca-19bb-44ea-99f2bdd77de2@mentor.com \
    --to=abid_qadeer@mentor.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).