This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/3] Fixed abortion using Python API for label symbol object.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]