-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> * breakpoint.c (insert_bp_location): Replace bp_err and bp_err_message locals by a gdb_exception local.
- Loading branch information
Showing
2 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2017-11-16 Pedro Alves <[email protected]> | ||
|
||
* breakpoint.c (insert_bp_location): Replace bp_err and | ||
bp_err_message locals by a gdb_exception local. | ||
|
||
2017-11-16 Pedro Alves <[email protected]> | ||
|
||
* inflow.c (scoped_ignore_sigttou): New class. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters