This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix swallowed "Quit" when inserting breakpoints
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 16 Nov 2017 17:00:32 -0500
- Subject: [binutils-gdb] Fix swallowed "Quit" when inserting breakpoints
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 688fca4fe6c83a6802731faa8455d177998d614d ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 688fca4fe6c83a6802731faa8455d177998d614d
Fix swallowed "Quit" when inserting breakpoints
If GDB is inserting a breakpoint and you type Ctrl-C at the exact
"right" time, you'll hit a QUIT call in target_read, and the
breakpoint insertion is cancelled. However, the related TRY/CATCH
code in insert_bp_location does:
CATCH (e, RETURN_MASK_ALL)
{
bp_err = e.error;
bp_err_message = e.message;
}
The problem with that is that a RETURN_QUIT exception has e.error ==
0, which means that further below, in the places that check for error
with:
if (bp_err != GDB_NO_ERROR)
because GDB_NO_ERROR == 0, GDB continues as if the breakpoint was
inserted succesfully, and resumes the inferior. Since the breakpoint
wasn't inserted the inferior runs free, out of our control...
Fix this by having insert_bp_location store a copy of the whole
exception instead of just a error/message parts, and then checking
"gdb_exception::reason" instead.
This was exposed by the new gdb.base/bp-cmds-continue-ctrl-c.exp
testcase added later in the series.
gdb/ChangeLog:
2017-11-16 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location): Replace bp_err and
bp_err_message locals by a gdb_exception local.