diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2011-11-28 15:49:43 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2011-11-28 15:49:43 +0000 |
commit | 5d9c59954f8b3d17402ac68681556a8f858833e2 (patch) | |
tree | d30f59cc34feaca48bc61e9541daeb668e3f8cfe /gdb/python/py-block.c | |
parent | 641c924047c553179c24b790133286ae41960fae (diff) | |
download | gdb-5d9c59954f8b3d17402ac68681556a8f858833e2.zip gdb-5d9c59954f8b3d17402ac68681556a8f858833e2.tar.gz gdb-5d9c59954f8b3d17402ac68681556a8f858833e2.tar.bz2 |
2011-11-28 Phil Muldoon <pmuldoon@redhat.com>
PR python/13369
PR python/13374
* python/python.c (gdbpy_decode_line): Do not acquire GIL.
* python/py-inferior.c (inferior_to_inferior_object): Ditto.
* python/py-value.c (valpy_nonzero): Use TRY_CATCH to catch GDB
exceptions.
* python/py-type.c (typy_strip_typedefs): Ditto.
(typy_legacy_template_argument): Ditto.
* python/py-inferior.c (inferior_to_inferior_object): Ditto.
* python/py-breakpoint.c (bppy_set_ignore_count): Ditto.
Diffstat (limited to 'gdb/python/py-block.c')
-rw-r--r-- | gdb/python/py-block.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index 3f4467a..6c6df2e 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -371,14 +371,20 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args) { gdb_py_ulongest pc; struct block *block; - struct obj_section *section; - struct symtab *symtab; + struct obj_section *section = NULL; + struct symtab *symtab = NULL; + volatile struct gdb_exception except; if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc)) return NULL; - section = find_pc_mapped_section (pc); - symtab = find_pc_sect_symtab (pc, section); + TRY_CATCH (except, RETURN_MASK_ALL) + { + section = find_pc_mapped_section (pc); + symtab = find_pc_sect_symtab (pc, section); + } + GDB_PY_HANDLE_EXCEPTION (except); + if (!symtab || symtab->objfile == NULL) { PyErr_SetString (PyExc_RuntimeError, |