diff options
author | Tom Tromey <tromey@redhat.com> | 2011-01-06 17:16:58 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-01-06 17:16:58 +0000 |
commit | 57126e4a45e3000ea9aa429da6a4ee4646606a3a (patch) | |
tree | f92a042b4cba5b0811b3fb63b0cb741284ef1254 | |
parent | 12505806d06803312a664d33cd05ab45067a67f1 (diff) | |
download | gdb-57126e4a45e3000ea9aa429da6a4ee4646606a3a.zip gdb-57126e4a45e3000ea9aa429da6a4ee4646606a3a.tar.gz gdb-57126e4a45e3000ea9aa429da6a4ee4646606a3a.tar.bz2 |
* python/py-frame.c (frapy_block): Use get_frame_block.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/python/py-frame.c | 21 |
2 files changed, 18 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a653f2f..6a1ed8b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2011-01-06 Tom Tromey <tromey@redhat.com> + + * python/py-frame.c (frapy_block): Use get_frame_block. + 2011-01-06 Joel Brobecker <brobecker@adacore.com> Do not stop on SIGPRIO signals by default diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 6bff949..42ccce9 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -211,20 +211,22 @@ static PyObject * frapy_block (PyObject *self, PyObject *args) { struct frame_info *frame; - struct block *block = NULL; + struct block *block = NULL, *fn_block; volatile struct gdb_exception except; - struct symtab_and_line sal; TRY_CATCH (except, RETURN_MASK_ALL) { FRAPY_REQUIRE_VALID ((frame_object *) self, frame); - - find_frame_sal (frame, &sal); - block = block_for_pc (get_frame_address_in_block (frame)); + block = get_frame_block (frame, NULL); } GDB_PY_HANDLE_EXCEPTION (except); - if (!sal.symtab || !sal.symtab->objfile) + for (fn_block = block; + fn_block != NULL && BLOCK_FUNCTION (fn_block) == NULL; + fn_block = BLOCK_SUPERBLOCK (fn_block)) + ; + + if (block == NULL || fn_block == NULL || BLOCK_FUNCTION (fn_block) == NULL) { PyErr_SetString (PyExc_RuntimeError, _("Cannot locate object file for block.")); @@ -232,7 +234,12 @@ frapy_block (PyObject *self, PyObject *args) } if (block) - return block_to_block_object (block, sal.symtab->objfile); + { + struct symtab *symt; + + symt = SYMBOL_SYMTAB (BLOCK_FUNCTION (fn_block)); + return block_to_block_object (block, symt->objfile); + } Py_RETURN_NONE; } |