Python QUIT processing updates
See the previous patches in this series for the motivation behind these changes. This commit contains updates to Python's QUIT handling. Ideally, we'd like to throw gdb_exception_forced_quit through the extension language; I made an attempt to do this for gdb_exception_quit in an earlier version of this patch, but Pedro pointed out that it is (almost certainly) not safe to do so. Still, we definitely don't want to swallow the exception representing a SIGTERM for GDB, nor do we want to force modules written in the extension language to have to explicitly handle this case. Since the idea is for GDB to cleanup and quit for this exception, we'll simply call quit_force() just as if the gdb_exception_forced_quit propagation had managed to make it back to the top level. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26761 Tested-by: Tom de Vries <tdevries@suse.de> Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
parent
b1ffd1124a
commit
b940a061c0
5 changed files with 22 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "top.h" /* For quit_force (). */
|
||||
#include "charset.h"
|
||||
#include "value.h"
|
||||
#include "language.h"
|
||||
|
@ -371,6 +372,10 @@ valpy_get_address (PyObject *self, void *closure)
|
|||
res_val = value_addr (val_obj->value);
|
||||
val_obj->address = value_to_value_object (res_val);
|
||||
}
|
||||
catch (const gdb_exception_forced_quit &except)
|
||||
{
|
||||
quit_force (NULL, 0);
|
||||
}
|
||||
catch (const gdb_exception &except)
|
||||
{
|
||||
val_obj->address = Py_None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue