This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/3] Fixed abortion using Python API for label symbol object.
- From: Maxim Bublis <satori at yandex-team dot ru>
- To: gdb-patches at sourceware dot org
- Cc: Maxim Bublis <satori at yandex-team dot ru>
- Date: Tue, 4 Mar 2014 14:35:57 +0400
- Subject: [PATCH 0/3] Fixed abortion using Python API for label symbol object.
- Authentication-results: sourceware.org; auth=none
Hi,
There is a problem with calling .value() method for label symbol object,
i.e. symbol object with it's .addr_class == gdb.SYMBOL_LOC_LABEL.
If you debugging code similar to that:
int main() {
abort();
some_label:
return 0;
}
and if you are running something like that (frame with `main' function should be selected in this case):
gdb> python "print list(gdb.selected_frame().block())[0].value(gdb.selected_frame())"
gdb will fail with SIGABRT.
Following patchset adds testcase, fixes problem and documents this behavior.
Maxim Bublis (3):
gdb/testsuite/gdb.python: Added testcase for .value() method
gdb/python: raise TypeError instead of abort() on calling .value()
method for label symbol object
gdb/doc/python.texi: documented gdb.SYMBOL_LOC_LABEL. Added notion on
possible exception thrown from symbol object .value() method
gdb/ChangeLog | 6 ++++++
gdb/doc/ChangeLog | 6 ++++++
gdb/doc/python.texi | 9 ++++++++-
gdb/python/py-symbol.c | 6 ++++++
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.python/py-symbol.c | 3 +++
gdb/testsuite/gdb.python/py-symbol.exp | 6 ++++++
7 files changed, 41 insertions(+), 1 deletion(-)
--
1.7.9.5