summaryrefslogtreecommitdiff
path: root/gdb/python/py-symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-symbol.c')
-rw-r--r--gdb/python/py-symbol.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 729bc647a2a..4306f61113d 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -192,16 +192,19 @@ static PyObject *
sympy_needs_frame (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- volatile struct gdb_exception except;
int result = 0;
SYMPY_REQUIRE_VALID (self, symbol);
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
result = symbol_read_needs_frame (symbol);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ END_CATCH
if (result)
Py_RETURN_TRUE;
@@ -246,7 +249,6 @@ sympy_value (PyObject *self, PyObject *args)
struct frame_info *frame_info = NULL;
PyObject *frame_obj = NULL;
struct value *value = NULL;
- volatile struct gdb_exception except;
if (!PyArg_ParseTuple (args, "|O", &frame_obj))
return NULL;
@@ -264,7 +266,7 @@ sympy_value (PyObject *self, PyObject *args)
return NULL;
}
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
if (frame_obj != NULL)
{
@@ -278,7 +280,11 @@ sympy_value (PyObject *self, PyObject *args)
value = read_var_value (symbol, frame_info);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ END_CATCH
return value_to_value_object (value);
}
@@ -365,7 +371,6 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
struct symbol *symbol = NULL;
PyObject *block_obj = NULL, *ret_tuple, *sym_obj, *bool_obj;
const struct block *block = NULL;
- volatile struct gdb_exception except;
if (! PyArg_ParseTupleAndKeywords (args, kw, "s|O!i", keywords, &name,
&block_object_type, &block_obj, &domain))
@@ -376,21 +381,28 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
else
{
struct frame_info *selected_frame;
- volatile struct gdb_exception except;
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
selected_frame = get_selected_frame (_("No frame selected."));
block = get_frame_block (selected_frame, NULL);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ END_CATCH
}
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
symbol = lookup_symbol (name, block, domain, &is_a_field_of_this);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ END_CATCH
ret_tuple = PyTuple_New (2);
if (!ret_tuple)
@@ -430,17 +442,20 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
static char *keywords[] = { "name", "domain", NULL };
struct symbol *symbol = NULL;
PyObject *sym_obj;
- volatile struct gdb_exception except;
if (! PyArg_ParseTupleAndKeywords (args, kw, "s|i", keywords, &name,
&domain))
return NULL;
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
symbol = lookup_global_symbol (name, NULL, domain);
}
- GDB_PY_HANDLE_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDB_PY_HANDLE_EXCEPTION (except);
+ }
+ END_CATCH
if (symbol)
{