public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "McAllister, Colin" <Colin.McAllister@garmin.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: SIGINT causes gdb to abort with Python API
Date: Wed, 27 Oct 2021 20:00:37 +0000	[thread overview]
Message-ID: <500ace0e9f4dc2ba8aaf5b5d9c875befb3785a98.camel@garmin.com> (raw)

Hello,
I've been dealing with an issue recently where gdb 9.1 aborts while using the Python API.

If I call gdb.execute("run"), the program I'm debugging with gdb will behave as expected. However, when I generate a keyboard interrupt to stop the program and insert a breakpoint, gdb aborts.

Based on the docs, this seems to be somewhat expected as the docs for execute say "If a GDB exception happens while command runs, it is translated as described in Exception Handling."

The tricky thing is I wrapped gdb.execute("run") in a try block to handle a KeyboardIntteruppt exception and have not been able to trigger the exception. Instead gdb aborts and my python code no longer runs.

On a side note, I've noticed I get the desired behavior if I run gdb.execute("start") and then enter "continue" in my prompt. Generating a KeyBoard interrupt stops the program and I'm able to insert breakpoints.
Curious if anyone can provide any insight into this issue that may be able to allow me to call "run" with execute.

Thanks, Colin


                 reply	other threads:[~2021-10-27 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=500ace0e9f4dc2ba8aaf5b5d9c875befb3785a98.camel@garmin.com \
    --to=colin.mcallister@garmin.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).