PR python/14634:
authorTom Tromey <tromey@redhat.com>
Mon, 15 Oct 2012 15:20:27 +0000 (15:20 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 15 Oct 2012 15:20:27 +0000 (15:20 +0000)
* python/py-symbol.c (sympy_dealloc): Check for NULL symbol.
testsuite
* gdb.python/py-symbol.exp: Test symbol destructor.

gdb/ChangeLog
gdb/python/py-symbol.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-symbol.exp

index e6867c62eec345ca2bad91bc1ff5830e5a714f8d..53087700b116d87fb85c71b5ae9c49154856b7e8 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-15  Tom Tromey  <tromey@redhat.com>
+
+       PR python/14634:
+       * python/py-symbol.c (sympy_dealloc): Check for NULL symbol.
+
 2012-10-11  Andrew Burgess  <aburgess@broadcom.com>
 
        * remote-sim.c (gdbsim_create_inferior): Call init_thread_list to
index 00a84777a491ac2f6a2bf221e945360db8798116..83d272e65defefa3338654a1323dcee5cbdf2d3b 100644 (file)
@@ -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);
index f20dd50746d1a964358c8a6fef50e76666794227..71c2d85e3a12cc7af5497c6399c169081a78435c 100644 (file)
@@ -1,3 +1,7 @@
+2012-10-15  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.python/py-symbol.exp: Test symbol destructor.
+
 2012-10-14  Yao Qi  <yao@codesourcery.com>
 
        * gdb.mi/mi2-cli.exp: Move to mi-cli.exp.
index bc20ee471dbf8e25c13acc8fcc1c8bceb2419656..4442e79c0501b1f1701cbdf9d11247ee24471135 100644 (file)
@@ -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"