This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] fix crash in Symbol
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Tue, 07 Apr 2009 14:32:23 -0600
- Subject: [python] fix crash in Symbol
- Reply-to: Tom Tromey <tromey at redhat dot com>
This fixes a crash in Symbol.
You can see it with "python print gdb.Symbol()".
The fix is to not allow user construction of Symbol objects.
Tom
2009-04-07 Tom Tromey <tromey@redhat.com>
* python/python-symbol.c (gdbpy_initialize_symbols): Don't set
tp_new.
diff --git a/gdb/python/python-symbol.c b/gdb/python/python-symbol.c
index c7fda5c..03d43c1 100644
--- a/gdb/python/python-symbol.c
+++ b/gdb/python/python-symbol.c
@@ -1,6 +1,6 @@
/* Python interface to symbols.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This file is part of GDB.
@@ -235,7 +235,6 @@ PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
void
gdbpy_initialize_symbols (void)
{
- symbol_object_type.tp_new = PyType_GenericNew;
if (PyType_Ready (&symbol_object_type) < 0)
return;