From: Tom Tromey Date: Mon, 15 Oct 2012 15:20:27 +0000 (+0000) Subject: PR python/14634: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74f910c87c017f1f232e7a8f67daafc8072c1089;p=binutils-gdb.git PR python/14634: * python/py-symbol.c (sympy_dealloc): Check for NULL symbol. testsuite * gdb.python/py-symbol.exp: Test symbol destructor. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e6867c62eec..53087700b11 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-10-15 Tom Tromey + + PR python/14634: + * python/py-symbol.c (sympy_dealloc): Check for NULL symbol. + 2012-10-11 Andrew Burgess * remote-sim.c (gdbsim_create_inferior): Call init_thread_list to diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index 00a84777a49..83d272e65de 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -335,7 +335,7 @@ sympy_dealloc (PyObject *obj) if (sym_obj->prev) sym_obj->prev->next = sym_obj->next; - else if (SYMBOL_SYMTAB (sym_obj->symbol)) + else if (sym_obj->symbol && SYMBOL_SYMTAB (sym_obj->symbol)) { set_objfile_data (SYMBOL_SYMTAB (sym_obj->symbol)->objfile, sympy_objfile_data_key, sym_obj->next); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f20dd50746d..71c2d85e3a1 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-10-15 Tom Tromey + + * gdb.python/py-symbol.exp: Test symbol destructor. + 2012-10-14 Yao Qi * gdb.mi/mi2-cli.exp: Move to mi-cli.exp. diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp index bc20ee471db..4442e79c050 100644 --- a/gdb/testsuite/gdb.python/py-symbol.exp +++ b/gdb/testsuite/gdb.python/py-symbol.exp @@ -160,3 +160,4 @@ gdb_test "python print a\[0\].is_valid()" "True" "Test symbol validity" delete_breakpoints gdb_unload gdb_test "python print a\[0\].is_valid()" "False" "Test symbol validity" +gdb_test_no_output "python a = None" "Test symbol destructor"