diff options
author | Tom Tromey <tromey@redhat.com> | 2013-02-28 19:23:55 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-02-28 19:23:55 +0000 |
commit | 8156b292f0bda6d2f335d2f4bda6c5bb37709260 (patch) | |
tree | f8f08d7211baa07b5d7a48d1fc409d86b7650852 /gdb/python/python.c | |
parent | 789f5888389f3e0aa1e948824c4b391a655b3cb0 (diff) | |
download | gdb-8156b292f0bda6d2f335d2f4bda6c5bb37709260.tar.gz |
* python/python.c (gdbpy_find_pc_line): Call find_pc_line
inside TRY_CATCH.
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r-- | gdb/python/python.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index 8dd65a102c2..e2c19b3d3a0 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -738,16 +738,25 @@ gdbpy_parse_and_eval (PyObject *self, PyObject *args) static PyObject * gdbpy_find_pc_line (PyObject *self, PyObject *args) { - struct symtab_and_line sal; - CORE_ADDR pc; gdb_py_ulongest pc_llu; + volatile struct gdb_exception except; + PyObject *result; if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc_llu)) return NULL; - pc = (CORE_ADDR) pc_llu; - sal = find_pc_line (pc, 0); - return symtab_and_line_to_sal_object (sal); + TRY_CATCH (except, RETURN_MASK_ALL) + { + struct symtab_and_line sal; + CORE_ADDR pc; + + pc = (CORE_ADDR) pc_llu; + sal = find_pc_line (pc, 0); + result = symtab_and_line_to_sal_object (sal); + } + GDB_PY_HANDLE_EXCEPTION (except); + + return result; } /* Read a file as Python code. |