diff options
author | Tom Tromey <tromey@redhat.com> | 2013-02-28 19:01:54 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-02-28 19:01:54 +0000 |
commit | 86a3263fffd5fcd0c7896647dea4dca2b5902da5 (patch) | |
tree | a1d601c5d0518c95dd0c7ab64c38c0bbca65107c | |
parent | 81b52a3ae561ad292cf958fc9148b86b9400e0c5 (diff) | |
download | gdb-86a3263fffd5fcd0c7896647dea4dca2b5902da5.zip gdb-86a3263fffd5fcd0c7896647dea4dca2b5902da5.tar.gz gdb-86a3263fffd5fcd0c7896647dea4dca2b5902da5.tar.bz2 |
* py-block.c (gdbpy_block_for_pc): Call block_for_pc inside
TRY_CATCH.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/py-block.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2211d62..77bae9b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-02-28 Tom Tromey <tromey@redhat.com> + * py-block.c (gdbpy_block_for_pc): Call block_for_pc inside + TRY_CATCH. + +2013-02-28 Tom Tromey <tromey@redhat.com> + * objfiles.h (ALL_PSPACE_OBJFILES): Remove trailing backlash. 2013-02-27 Corinna Vinschen <vinschen@redhat.com> diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index 708b6a8..f0b8322 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -370,7 +370,7 @@ PyObject * gdbpy_block_for_pc (PyObject *self, PyObject *args) { gdb_py_ulongest pc; - struct block *block; + struct block *block = NULL; struct obj_section *section = NULL; struct symtab *symtab = NULL; volatile struct gdb_exception except; @@ -382,6 +382,9 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args) { section = find_pc_mapped_section (pc); symtab = find_pc_sect_symtab (pc, section); + + if (symtab != NULL && symtab->objfile != NULL) + block = block_for_pc (pc); } GDB_PY_HANDLE_EXCEPTION (except); @@ -392,7 +395,6 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args) return NULL; } - block = block_for_pc (pc); if (block) return block_to_block_object (block, symtab->objfile); |