From: Gulshan Singh via Gdb <gdb@sourceware.org>
To: gdb@sourceware.org
Subject: `sys.exit` from Python no longer exits the GDB process
Date: Thu, 20 Jun 2024 12:25:21 -0700 [thread overview]
Message-ID: <CANEZYrcsr4cANwOHSyV3k1n9cPn6XBvYh-heDqy++=gEpVGnLQ@mail.gmail.com> (raw)
I'm using GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1)
15.0.50.20240403-git on Ubuntu 24.04, and I'm observing different
behavior with `sys.exit` in Python then when I was using GNU gdb
(Ubuntu 12.1-0ubuntu1~22.04.2) 12.1 on Ubuntu 22.04.
In GDB 12.1, `sys.exit(1)` in Python would exit the GDB process with
an exit code of 1. In GDB 15.0, I'm seeing that there's an exception
message instead, and GDB does not exit:
```
Python Exception <class 'SystemExit'>: 1
Error occurred in Python: 1
```
Is this a bug or intentional behavior? I work on an open source Python
GDB plugin that has some unit tests that get run inside GDB. When an
exception occurs, it's caught and we exit with `sys.exit` so we can
check the return code from our test running scripts. But with the
latest GDB this no longer happens, eventually we run the `quit`
command, and the exit code is zero. If this is intended behavior, is
there any alternative we can use to quit GDB with a non-zero exit code
from Python?
next reply other threads:[~2024-06-20 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 19:25 Gulshan Singh via Gdb [this message]
2024-06-20 19:37 ` Paul Koning via Gdb
2024-06-23 22:07 ` Tom Tromey
2024-07-02 19:09 ` Gulshan Singh via Gdb
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='CANEZYrcsr4cANwOHSyV3k1n9cPn6XBvYh-heDqy++=gEpVGnLQ@mail.gmail.com' \
--to=gdb@sourceware.org \
--cc=gsingh2011@gmail.com \
/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