]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/python/py-symbol.c
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / python / py-symbol.c
CommitLineData
f3e9a817
PM
1/* Python interface to symbols.
2
618f726f 3 Copyright (C) 2008-2016 Free Software Foundation, Inc.
f3e9a817
PM
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "block.h"
f3e9a817
PM
22#include "frame.h"
23#include "symtab.h"
24#include "python-internal.h"
25#include "objfiles.h"
26
27typedef struct sympy_symbol_object {
28 PyObject_HEAD
29 /* The GDB symbol structure this object is wrapping. */
30 struct symbol *symbol;
31 /* A symbol object is associated with an objfile, so keep track with
32 doubly-linked list, rooted in the objfile. This lets us
33 invalidate the underlying struct symbol when the objfile is
34 deleted. */
35 struct sympy_symbol_object *prev;
36 struct sympy_symbol_object *next;
37} symbol_object;
38
39/* Require a valid symbol. All access to symbol_object->symbol should be
40 gated by this call. */
41#define SYMPY_REQUIRE_VALID(symbol_obj, symbol) \
42 do { \
43 symbol = symbol_object_to_symbol (symbol_obj); \
44 if (symbol == NULL) \
45 { \
46 PyErr_SetString (PyExc_RuntimeError, \
47 _("Symbol is invalid.")); \
48 return NULL; \
49 } \
50 } while (0)
51
52static const struct objfile_data *sympy_objfile_data_key;
53
54static PyObject *
55sympy_str (PyObject *self)
56{
57 PyObject *result;
58 struct symbol *symbol = NULL;
59
60 SYMPY_REQUIRE_VALID (self, symbol);
61
62 result = PyString_FromString (SYMBOL_PRINT_NAME (symbol));
63
64 return result;
65}
66
457e09f0
DE
67static PyObject *
68sympy_get_type (PyObject *self, void *closure)
69{
70 struct symbol *symbol = NULL;
71
72 SYMPY_REQUIRE_VALID (self, symbol);
73
74 if (SYMBOL_TYPE (symbol) == NULL)
75 {
76 Py_INCREF (Py_None);
77 return Py_None;
78 }
79
80 return type_to_type_object (SYMBOL_TYPE (symbol));
81}
82
f3e9a817
PM
83static PyObject *
84sympy_get_symtab (PyObject *self, void *closure)
85{
86 struct symbol *symbol = NULL;
87
88 SYMPY_REQUIRE_VALID (self, symbol);
89
1994afbf
DE
90 if (!SYMBOL_OBJFILE_OWNED (symbol))
91 Py_RETURN_NONE;
92
08be3fe3 93 return symtab_to_symtab_object (symbol_symtab (symbol));
f3e9a817
PM
94}
95
96static PyObject *
97sympy_get_name (PyObject *self, void *closure)
98{
99 struct symbol *symbol = NULL;
100
101 SYMPY_REQUIRE_VALID (self, symbol);
102
103 return PyString_FromString (SYMBOL_NATURAL_NAME (symbol));
104}
105
106static PyObject *
107sympy_get_linkage_name (PyObject *self, void *closure)
108{
109 struct symbol *symbol = NULL;
110
111 SYMPY_REQUIRE_VALID (self, symbol);
112
113 return PyString_FromString (SYMBOL_LINKAGE_NAME (symbol));
114}
115
116static PyObject *
117sympy_get_print_name (PyObject *self, void *closure)
118{
119 struct symbol *symbol = NULL;
120
121 SYMPY_REQUIRE_VALID (self, symbol);
122
123 return sympy_str (self);
124}
125
126static PyObject *
127sympy_get_addr_class (PyObject *self, void *closure)
128{
129 struct symbol *symbol = NULL;
130
131 SYMPY_REQUIRE_VALID (self, symbol);
132
133 return PyInt_FromLong (SYMBOL_CLASS (symbol));
134}
135
136static PyObject *
137sympy_is_argument (PyObject *self, void *closure)
138{
139 struct symbol *symbol = NULL;
140
141 SYMPY_REQUIRE_VALID (self, symbol);
142
143 return PyBool_FromLong (SYMBOL_IS_ARGUMENT (symbol));
144}
145
146static PyObject *
147sympy_is_constant (PyObject *self, void *closure)
148{
149 struct symbol *symbol = NULL;
fe978cb0 150 enum address_class theclass;
f3e9a817
PM
151
152 SYMPY_REQUIRE_VALID (self, symbol);
153
fe978cb0 154 theclass = SYMBOL_CLASS (symbol);
f3e9a817 155
fe978cb0 156 return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
f3e9a817
PM
157}
158
159static PyObject *
160sympy_is_function (PyObject *self, void *closure)
161{
162 struct symbol *symbol = NULL;
fe978cb0 163 enum address_class theclass;
f3e9a817
PM
164
165 SYMPY_REQUIRE_VALID (self, symbol);
166
fe978cb0 167 theclass = SYMBOL_CLASS (symbol);
f3e9a817 168
fe978cb0 169 return PyBool_FromLong (theclass == LOC_BLOCK);
f3e9a817
PM
170}
171
172static PyObject *
173sympy_is_variable (PyObject *self, void *closure)
174{
175 struct symbol *symbol = NULL;
fe978cb0 176 enum address_class theclass;
f3e9a817
PM
177
178 SYMPY_REQUIRE_VALID (self, symbol);
179
fe978cb0 180 theclass = SYMBOL_CLASS (symbol);
f3e9a817
PM
181
182 return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
fe978cb0
PA
183 && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
184 || theclass == LOC_STATIC || theclass == LOC_COMPUTED
185 || theclass == LOC_OPTIMIZED_OUT));
f3e9a817
PM
186}
187
f0823d2c
TT
188/* Implementation of gdb.Symbol.needs_frame -> Boolean.
189 Returns true iff the symbol needs a frame for evaluation. */
190
191static PyObject *
192sympy_needs_frame (PyObject *self, void *closure)
193{
194 struct symbol *symbol = NULL;
f0823d2c
TT
195 int result = 0;
196
197 SYMPY_REQUIRE_VALID (self, symbol);
198
492d29ea 199 TRY
f0823d2c
TT
200 {
201 result = symbol_read_needs_frame (symbol);
202 }
492d29ea
PA
203 CATCH (except, RETURN_MASK_ALL)
204 {
205 GDB_PY_HANDLE_EXCEPTION (except);
206 }
207 END_CATCH
f0823d2c
TT
208
209 if (result)
210 Py_RETURN_TRUE;
211 Py_RETURN_FALSE;
212}
213
64e7d9dd
TT
214/* Implementation of gdb.Symbol.line -> int.
215 Returns the line number at which the symbol was defined. */
216
217static PyObject *
218sympy_line (PyObject *self, void *closure)
219{
220 struct symbol *symbol = NULL;
221
222 SYMPY_REQUIRE_VALID (self, symbol);
223
224 return PyInt_FromLong (SYMBOL_LINE (symbol));
225}
226
29703da4
PM
227/* Implementation of gdb.Symbol.is_valid (self) -> Boolean.
228 Returns True if this Symbol still exists in GDB. */
229
230static PyObject *
231sympy_is_valid (PyObject *self, PyObject *args)
232{
233 struct symbol *symbol = NULL;
234
235 symbol = symbol_object_to_symbol (self);
236 if (symbol == NULL)
237 Py_RETURN_FALSE;
238
239 Py_RETURN_TRUE;
240}
241
f0823d2c
TT
242/* Implementation of gdb.Symbol.value (self[, frame]) -> gdb.Value. Returns
243 the value of the symbol, or an error in various circumstances. */
244
245static PyObject *
246sympy_value (PyObject *self, PyObject *args)
247{
248 struct symbol *symbol = NULL;
249 struct frame_info *frame_info = NULL;
250 PyObject *frame_obj = NULL;
251 struct value *value = NULL;
f0823d2c
TT
252
253 if (!PyArg_ParseTuple (args, "|O", &frame_obj))
254 return NULL;
255
256 if (frame_obj != NULL && !PyObject_TypeCheck (frame_obj, &frame_object_type))
257 {
258 PyErr_SetString (PyExc_TypeError, "argument is not a frame");
259 return NULL;
260 }
261
262 SYMPY_REQUIRE_VALID (self, symbol);
263 if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
264 {
265 PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
266 return NULL;
267 }
268
492d29ea 269 TRY
f0823d2c
TT
270 {
271 if (frame_obj != NULL)
272 {
273 frame_info = frame_object_to_frame_info (frame_obj);
274 if (frame_info == NULL)
c6910659 275 error (_("invalid frame"));
f0823d2c 276 }
256458bc 277
f0823d2c 278 if (symbol_read_needs_frame (symbol) && frame_info == NULL)
c6910659 279 error (_("symbol requires a frame to compute its value"));
f0823d2c 280
63e43d3a
PMR
281 /* TODO: currently, we have no way to recover the block in which SYMBOL
282 was found, so we have no block to pass to read_var_value. This will
283 yield an incorrect value when symbol is not local to FRAME_INFO (this
284 can happen with nested functions). */
285 value = read_var_value (symbol, NULL, frame_info);
f0823d2c 286 }
492d29ea
PA
287 CATCH (except, RETURN_MASK_ALL)
288 {
289 GDB_PY_HANDLE_EXCEPTION (except);
290 }
291 END_CATCH
f0823d2c
TT
292
293 return value_to_value_object (value);
294}
295
f3e9a817
PM
296/* Given a symbol, and a symbol_object that has previously been
297 allocated and initialized, populate the symbol_object with the
298 struct symbol data. Also, register the symbol_object life-cycle
b021a221 299 with the life-cycle of the object file associated with this
f3e9a817
PM
300 symbol, if needed. */
301static void
302set_symbol (symbol_object *obj, struct symbol *symbol)
303{
304 obj->symbol = symbol;
305 obj->prev = NULL;
1994afbf
DE
306 if (SYMBOL_OBJFILE_OWNED (symbol)
307 && symbol_symtab (symbol) != NULL)
f3e9a817 308 {
08be3fe3 309 struct objfile *objfile = symbol_objfile (symbol);
f3e9a817 310
19ba03f4
SM
311 obj->next = ((struct sympy_symbol_object *)
312 objfile_data (objfile, sympy_objfile_data_key));
f3e9a817
PM
313 if (obj->next)
314 obj->next->prev = obj;
08be3fe3 315 set_objfile_data (objfile, sympy_objfile_data_key, obj);
f3e9a817
PM
316 }
317 else
318 obj->next = NULL;
319}
320
321/* Create a new symbol object (gdb.Symbol) that encapsulates the struct
322 symbol object from GDB. */
323PyObject *
324symbol_to_symbol_object (struct symbol *sym)
325{
326 symbol_object *sym_obj;
327
328 sym_obj = PyObject_New (symbol_object, &symbol_object_type);
329 if (sym_obj)
330 set_symbol (sym_obj, sym);
331
332 return (PyObject *) sym_obj;
333}
334
335/* Return the symbol that is wrapped by this symbol object. */
336struct symbol *
337symbol_object_to_symbol (PyObject *obj)
338{
339 if (! PyObject_TypeCheck (obj, &symbol_object_type))
340 return NULL;
341 return ((symbol_object *) obj)->symbol;
342}
343
344static void
345sympy_dealloc (PyObject *obj)
346{
347 symbol_object *sym_obj = (symbol_object *) obj;
348
349 if (sym_obj->prev)
350 sym_obj->prev->next = sym_obj->next;
08be3fe3 351 else if (sym_obj->symbol != NULL
1994afbf 352 && SYMBOL_OBJFILE_OWNED (sym_obj->symbol)
08be3fe3 353 && symbol_symtab (sym_obj->symbol) != NULL)
f3e9a817 354 {
08be3fe3 355 set_objfile_data (symbol_objfile (sym_obj->symbol),
f3e9a817
PM
356 sympy_objfile_data_key, sym_obj->next);
357 }
358 if (sym_obj->next)
359 sym_obj->next->prev = sym_obj->prev;
360 sym_obj->symbol = NULL;
361}
362
363/* Implementation of
364 gdb.lookup_symbol (name [, block] [, domain]) -> (symbol, is_field_of_this)
365 A tuple with 2 elements is always returned. The first is the symbol
366 object or None, the second is a boolean with the value of
367 is_a_field_of_this (see comment in lookup_symbol_in_language). */
6e6fbe60 368
f3e9a817
PM
369PyObject *
370gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
371{
1993b719
TT
372 int domain = VAR_DOMAIN;
373 struct field_of_this_result is_a_field_of_this;
f3e9a817
PM
374 const char *name;
375 static char *keywords[] = { "name", "block", "domain", NULL };
76dce0be 376 struct symbol *symbol = NULL;
f3e9a817 377 PyObject *block_obj = NULL, *ret_tuple, *sym_obj, *bool_obj;
9df2fbc4 378 const struct block *block = NULL;
f3e9a817
PM
379
380 if (! PyArg_ParseTupleAndKeywords (args, kw, "s|O!i", keywords, &name,
381 &block_object_type, &block_obj, &domain))
382 return NULL;
383
384 if (block_obj)
385 block = block_object_to_block (block_obj);
386 else
387 {
388 struct frame_info *selected_frame;
f3e9a817 389
492d29ea 390 TRY
f3e9a817 391 {
626e7282
JK
392 selected_frame = get_selected_frame (_("No frame selected."));
393 block = get_frame_block (selected_frame, NULL);
f3e9a817 394 }
492d29ea
PA
395 CATCH (except, RETURN_MASK_ALL)
396 {
397 GDB_PY_HANDLE_EXCEPTION (except);
398 }
399 END_CATCH
f3e9a817
PM
400 }
401
492d29ea 402 TRY
76dce0be 403 {
aead7601
SM
404 symbol = lookup_symbol (name, block, (domain_enum) domain,
405 &is_a_field_of_this).symbol;
76dce0be 406 }
492d29ea
PA
407 CATCH (except, RETURN_MASK_ALL)
408 {
409 GDB_PY_HANDLE_EXCEPTION (except);
410 }
411 END_CATCH
f3e9a817
PM
412
413 ret_tuple = PyTuple_New (2);
414 if (!ret_tuple)
415 return NULL;
416
417 if (symbol)
418 {
419 sym_obj = symbol_to_symbol_object (symbol);
420 if (!sym_obj)
421 {
422 Py_DECREF (ret_tuple);
423 return NULL;
424 }
425 }
426 else
427 {
428 sym_obj = Py_None;
429 Py_INCREF (Py_None);
430 }
431 PyTuple_SET_ITEM (ret_tuple, 0, sym_obj);
432
1993b719 433 bool_obj = (is_a_field_of_this.type != NULL) ? Py_True : Py_False;
f3e9a817
PM
434 Py_INCREF (bool_obj);
435 PyTuple_SET_ITEM (ret_tuple, 1, bool_obj);
436
437 return ret_tuple;
438}
439
6e6fbe60
DE
440/* Implementation of
441 gdb.lookup_global_symbol (name [, domain]) -> symbol or None. */
442
443PyObject *
444gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
445{
446 int domain = VAR_DOMAIN;
447 const char *name;
448 static char *keywords[] = { "name", "domain", NULL };
76dce0be 449 struct symbol *symbol = NULL;
6e6fbe60
DE
450 PyObject *sym_obj;
451
452 if (! PyArg_ParseTupleAndKeywords (args, kw, "s|i", keywords, &name,
453 &domain))
454 return NULL;
455
492d29ea 456 TRY
76dce0be 457 {
aead7601 458 symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
76dce0be 459 }
492d29ea
PA
460 CATCH (except, RETURN_MASK_ALL)
461 {
462 GDB_PY_HANDLE_EXCEPTION (except);
463 }
464 END_CATCH
6e6fbe60
DE
465
466 if (symbol)
467 {
468 sym_obj = symbol_to_symbol_object (symbol);
469 if (!sym_obj)
470 return NULL;
471 }
472 else
473 {
474 sym_obj = Py_None;
475 Py_INCREF (Py_None);
476 }
477
478 return sym_obj;
479}
480
f3e9a817
PM
481/* This function is called when an objfile is about to be freed.
482 Invalidate the symbol as further actions on the symbol would result
483 in bad data. All access to obj->symbol should be gated by
484 SYMPY_REQUIRE_VALID which will raise an exception on invalid
485 symbols. */
486static void
487del_objfile_symbols (struct objfile *objfile, void *datum)
488{
19ba03f4 489 symbol_object *obj = (symbol_object *) datum;
f3e9a817
PM
490 while (obj)
491 {
492 symbol_object *next = obj->next;
493
494 obj->symbol = NULL;
495 obj->next = NULL;
496 obj->prev = NULL;
497
498 obj = next;
499 }
500}
501
999633ed 502int
f3e9a817
PM
503gdbpy_initialize_symbols (void)
504{
505 if (PyType_Ready (&symbol_object_type) < 0)
999633ed 506 return -1;
f3e9a817
PM
507
508 /* Register an objfile "free" callback so we can properly
509 invalidate symbol when an object file that is about to be
510 deleted. */
511 sympy_objfile_data_key
512 = register_objfile_data_with_cleanup (NULL, del_objfile_symbols);
513
999633ed
TT
514 if (PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNDEF", LOC_UNDEF) < 0
515 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST",
516 LOC_CONST) < 0
517 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_STATIC",
518 LOC_STATIC) < 0
519 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGISTER",
520 LOC_REGISTER) < 0
521 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_ARG",
522 LOC_ARG) < 0
523 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REF_ARG",
524 LOC_REF_ARG) < 0
525 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LOCAL",
526 LOC_LOCAL) < 0
527 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_TYPEDEF",
528 LOC_TYPEDEF) < 0
529 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LABEL",
530 LOC_LABEL) < 0
531 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_BLOCK",
532 LOC_BLOCK) < 0
533 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST_BYTES",
534 LOC_CONST_BYTES) < 0
535 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNRESOLVED",
536 LOC_UNRESOLVED) < 0
537 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_OPTIMIZED_OUT",
538 LOC_OPTIMIZED_OUT) < 0
539 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_COMPUTED",
540 LOC_COMPUTED) < 0
541 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGPARM_ADDR",
542 LOC_REGPARM_ADDR) < 0
543 || PyModule_AddIntConstant (gdb_module, "SYMBOL_UNDEF_DOMAIN",
544 UNDEF_DOMAIN) < 0
545 || PyModule_AddIntConstant (gdb_module, "SYMBOL_VAR_DOMAIN",
546 VAR_DOMAIN) < 0
547 || PyModule_AddIntConstant (gdb_module, "SYMBOL_STRUCT_DOMAIN",
548 STRUCT_DOMAIN) < 0
549 || PyModule_AddIntConstant (gdb_module, "SYMBOL_LABEL_DOMAIN",
550 LABEL_DOMAIN) < 0
551 || PyModule_AddIntConstant (gdb_module, "SYMBOL_VARIABLES_DOMAIN",
552 VARIABLES_DOMAIN) < 0
553 || PyModule_AddIntConstant (gdb_module, "SYMBOL_FUNCTIONS_DOMAIN",
554 FUNCTIONS_DOMAIN) < 0
555 || PyModule_AddIntConstant (gdb_module, "SYMBOL_TYPES_DOMAIN",
556 TYPES_DOMAIN) < 0)
557 return -1;
f3e9a817 558
aa36459a
TT
559 return gdb_pymodule_addobject (gdb_module, "Symbol",
560 (PyObject *) &symbol_object_type);
f3e9a817
PM
561}
562
563\f
564
565static PyGetSetDef symbol_object_getset[] = {
457e09f0
DE
566 { "type", sympy_get_type, NULL,
567 "Type of the symbol.", NULL },
f3e9a817
PM
568 { "symtab", sympy_get_symtab, NULL,
569 "Symbol table in which the symbol appears.", NULL },
570 { "name", sympy_get_name, NULL,
571 "Name of the symbol, as it appears in the source code.", NULL },
572 { "linkage_name", sympy_get_linkage_name, NULL,
9a2b4c1b
MS
573 "Name of the symbol, as used by the linker (i.e., may be mangled).",
574 NULL },
f3e9a817
PM
575 { "print_name", sympy_get_print_name, NULL,
576 "Name of the symbol in a form suitable for output.\n\
577This is either name or linkage_name, depending on whether the user asked GDB\n\
578to display demangled or mangled names.", NULL },
579 { "addr_class", sympy_get_addr_class, NULL, "Address class of the symbol." },
580 { "is_argument", sympy_is_argument, NULL,
581 "True if the symbol is an argument of a function." },
582 { "is_constant", sympy_is_constant, NULL,
583 "True if the symbol is a constant." },
584 { "is_function", sympy_is_function, NULL,
585 "True if the symbol is a function or method." },
586 { "is_variable", sympy_is_variable, NULL,
587 "True if the symbol is a variable." },
f0823d2c
TT
588 { "needs_frame", sympy_needs_frame, NULL,
589 "True if the symbol requires a frame for evaluation." },
64e7d9dd
TT
590 { "line", sympy_line, NULL,
591 "The source line number at which the symbol was defined." },
f3e9a817
PM
592 { NULL } /* Sentinel */
593};
594
29703da4
PM
595static PyMethodDef symbol_object_methods[] = {
596 { "is_valid", sympy_is_valid, METH_NOARGS,
597 "is_valid () -> Boolean.\n\
598Return true if this symbol is valid, false if not." },
f0823d2c
TT
599 { "value", sympy_value, METH_VARARGS,
600 "value ([frame]) -> gdb.Value\n\
601Return the value of the symbol." },
29703da4
PM
602 {NULL} /* Sentinel */
603};
604
f3e9a817 605PyTypeObject symbol_object_type = {
9a27f2c6 606 PyVarObject_HEAD_INIT (NULL, 0)
f3e9a817
PM
607 "gdb.Symbol", /*tp_name*/
608 sizeof (symbol_object), /*tp_basicsize*/
609 0, /*tp_itemsize*/
610 sympy_dealloc, /*tp_dealloc*/
611 0, /*tp_print*/
612 0, /*tp_getattr*/
613 0, /*tp_setattr*/
614 0, /*tp_compare*/
615 0, /*tp_repr*/
616 0, /*tp_as_number*/
617 0, /*tp_as_sequence*/
618 0, /*tp_as_mapping*/
619 0, /*tp_hash */
620 0, /*tp_call*/
621 sympy_str, /*tp_str*/
622 0, /*tp_getattro*/
623 0, /*tp_setattro*/
624 0, /*tp_as_buffer*/
625 Py_TPFLAGS_DEFAULT, /*tp_flags*/
626 "GDB symbol object", /*tp_doc */
627 0, /*tp_traverse */
628 0, /*tp_clear */
629 0, /*tp_richcompare */
630 0, /*tp_weaklistoffset */
631 0, /*tp_iter */
632 0, /*tp_iternext */
29703da4 633 symbol_object_methods, /*tp_methods */
f3e9a817
PM
634 0, /*tp_members */
635 symbol_object_getset /*tp_getset */
636};