gdb/python/py-symtab.c - gdb

Global variables defined

Data types defined

Functions defined

Macros defined

Source code

  1. /* Python interface to symbol tables.

  2.    Copyright (C) 2008-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #include "defs.h"
  15. #include "charset.h"
  16. #include "symtab.h"
  17. #include "source.h"
  18. #include "python-internal.h"
  19. #include "objfiles.h"
  20. #include "block.h"

  21. typedef struct stpy_symtab_object {
  22.   PyObject_HEAD
  23.   /* The GDB Symbol table structure.  */
  24.   struct symtab *symtab;
  25.   /* A symtab object is associated with an objfile, so keep track with
  26.      a doubly-linked list, rooted in the objfile.  This allows
  27.      invalidation of the underlying struct symtab when the objfile is
  28.      deleted.  */
  29.   struct stpy_symtab_object *prev;
  30.   struct stpy_symtab_object *next;
  31. } symtab_object;

  32. static PyTypeObject symtab_object_type
  33.     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("symtab_object");
  34. static const struct objfile_data *stpy_objfile_data_key;

  35. /* Require a valid symbol table.  All access to symtab_object->symtab
  36.    should be gated by this call.  */
  37. #define STPY_REQUIRE_VALID(symtab_obj, symtab)                 \
  38.   do {                                                         \
  39.     symtab = symtab_object_to_symtab (symtab_obj);         \
  40.     if (symtab == NULL)                                         \
  41.       {                                                         \
  42.         PyErr_SetString (PyExc_RuntimeError,                 \
  43.                          _("Symbol Table is invalid.")); \
  44.         return NULL;                                         \
  45.       }                                                         \
  46.   } while (0)

  47. typedef struct salpy_sal_object {
  48.   PyObject_HEAD
  49.   /* The GDB Symbol table structure.  */
  50.   symtab_object *symtab;
  51.   /* The GDB Symbol table and line structure.  */
  52.   struct symtab_and_line *sal;
  53.   /* A Symtab and line object is associated with an objfile, so keep
  54.      track with a doubly-linked list, rooted in the objfile.  This
  55.      allows invalidation of the underlying struct symtab_and_line
  56.      when the objfile is deleted.  */
  57.   struct salpy_sal_object *prev;
  58.   struct salpy_sal_object *next;
  59. } sal_object;

  60. static PyTypeObject sal_object_type
  61.     CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("sal_object");
  62. static const struct objfile_data *salpy_objfile_data_key;

  63. /* Require a valid symbol table and line object.  All access to
  64.    sal_object->sal should be gated by this call.  */
  65. #define SALPY_REQUIRE_VALID(sal_obj, sal)                                \
  66.   do {                                                                        \
  67.     sal = sal_object_to_symtab_and_line (sal_obj);                        \
  68.     if (sal == NULL)                                                        \
  69.       {                                                                        \
  70.           PyErr_SetString (PyExc_RuntimeError,                                \
  71.                            _("Symbol Table and Line is invalid."));        \
  72.           return NULL;                                                        \
  73.         }                                                                \
  74.   } while (0)

  75. static PyObject *
  76. stpy_str (PyObject *self)
  77. {
  78.   PyObject *result;
  79.   struct symtab *symtab = NULL;

  80.   STPY_REQUIRE_VALID (self, symtab);

  81.   result = PyString_FromString (symtab_to_filename_for_display (symtab));

  82.   return result;
  83. }

  84. static PyObject *
  85. stpy_get_filename (PyObject *self, void *closure)
  86. {
  87.   PyObject *str_obj;
  88.   struct symtab *symtab = NULL;
  89.   const char *filename;

  90.   STPY_REQUIRE_VALID (self, symtab);
  91.   filename = symtab_to_filename_for_display (symtab);

  92.   str_obj = PyString_Decode (filename, strlen (filename),
  93.                              host_charset (), NULL);
  94.   return str_obj;
  95. }

  96. static PyObject *
  97. stpy_get_objfile (PyObject *self, void *closure)
  98. {
  99.   struct symtab *symtab = NULL;
  100.   PyObject *result;

  101.   STPY_REQUIRE_VALID (self, symtab);

  102.   result = objfile_to_objfile_object (SYMTAB_OBJFILE (symtab));
  103.   Py_XINCREF (result);
  104.   return result;
  105. }

  106. /* Getter function for symtab.producer.  */

  107. static PyObject *
  108. stpy_get_producer (PyObject *self, void *closure)
  109. {
  110.   struct symtab *symtab = NULL;
  111.   struct compunit_symtab *cust;

  112.   STPY_REQUIRE_VALID (self, symtab);
  113.   cust = SYMTAB_COMPUNIT (symtab);
  114.   if (COMPUNIT_PRODUCER (cust) != NULL)
  115.     {
  116.       const char *producer = COMPUNIT_PRODUCER (cust);

  117.       return PyString_Decode (producer, strlen (producer),
  118.                               host_charset (), NULL);
  119.     }

  120.   Py_RETURN_NONE;
  121. }

  122. static PyObject *
  123. stpy_fullname (PyObject *self, PyObject *args)
  124. {
  125.   const char *fullname;
  126.   struct symtab *symtab = NULL;

  127.   STPY_REQUIRE_VALID (self, symtab);

  128.   fullname = symtab_to_fullname (symtab);

  129.   return PyString_Decode (fullname, strlen (fullname), host_charset (), NULL);
  130. }

  131. /* Implementation of gdb.Symtab.is_valid (self) -> Boolean.
  132.    Returns True if this Symbol table still exists in GDB.  */

  133. static PyObject *
  134. stpy_is_valid (PyObject *self, PyObject *args)
  135. {
  136.   struct symtab *symtab = NULL;

  137.   symtab = symtab_object_to_symtab (self);
  138.   if (symtab == NULL)
  139.     Py_RETURN_FALSE;

  140.   Py_RETURN_TRUE;
  141. }

  142. /* Return the GLOBAL_BLOCK of the underlying symtab.  */

  143. static PyObject *
  144. stpy_global_block (PyObject *self, PyObject *args)
  145. {
  146.   struct symtab *symtab = NULL;
  147.   struct block *block = NULL;
  148.   const struct blockvector *blockvector;

  149.   STPY_REQUIRE_VALID (self, symtab);

  150.   blockvector = SYMTAB_BLOCKVECTOR (symtab);
  151.   block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
  152.   return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
  153. }

  154. /* Return the STATIC_BLOCK of the underlying symtab.  */

  155. static PyObject *
  156. stpy_static_block (PyObject *self, PyObject *args)
  157. {
  158.   struct symtab *symtab = NULL;
  159.   struct block *block = NULL;
  160.   const struct blockvector *blockvector;

  161.   STPY_REQUIRE_VALID (self, symtab);

  162.   blockvector = SYMTAB_BLOCKVECTOR (symtab);
  163.   block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
  164.   return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
  165. }

  166. /* Implementation of gdb.Symtab.linetable (self) -> gdb.Linetable.
  167.    Returns a gdb.Linetable object corresponding to this symbol
  168.    table.  */

  169. static PyObject *
  170. stpy_get_linetable (PyObject *self, PyObject *args)
  171. {
  172.   struct symtab *symtab = NULL;

  173.   STPY_REQUIRE_VALID (self, symtab);

  174.   return symtab_to_linetable_object (self);
  175. }

  176. static PyObject *
  177. salpy_str (PyObject *self)
  178. {
  179.   char *s;
  180.   const char *filename;
  181.   sal_object *sal_obj;
  182.   PyObject *result;
  183.   struct symtab_and_line *sal = NULL;

  184.   SALPY_REQUIRE_VALID (self, sal);

  185.   sal_obj = (sal_object *) self;
  186.   filename = (sal_obj->symtab == (symtab_object *) Py_None)
  187.     ? "<unknown>" : symtab_to_filename_for_display (sal_obj->symtab->symtab);

  188.   s = xstrprintf ("symbol and line for %s, line %d", filename,
  189.                   sal->line);

  190.   result = PyString_FromString (s);
  191.   xfree (s);

  192.   return result;
  193. }

  194. static void
  195. stpy_dealloc (PyObject *obj)
  196. {
  197.   symtab_object *symtab = (symtab_object *) obj;

  198.   if (symtab->prev)
  199.     symtab->prev->next = symtab->next;
  200.   else if (symtab->symtab)
  201.     {
  202.       set_objfile_data (SYMTAB_OBJFILE (symtab->symtab),
  203.                         stpy_objfile_data_key, symtab->next);
  204.     }
  205.   if (symtab->next)
  206.     symtab->next->prev = symtab->prev;
  207.   symtab->symtab = NULL;
  208. }


  209. static PyObject *
  210. salpy_get_pc (PyObject *self, void *closure)
  211. {
  212.   struct symtab_and_line *sal = NULL;

  213.   SALPY_REQUIRE_VALID (self, sal);

  214.   return gdb_py_long_from_ulongest (sal->pc);
  215. }

  216. /* Implementation of the get method for the 'last' attribute of
  217.    gdb.Symtab_and_line.  */

  218. static PyObject *
  219. salpy_get_last (PyObject *self, void *closure)
  220. {
  221.   struct symtab_and_line *sal = NULL;

  222.   SALPY_REQUIRE_VALID (self, sal);

  223.   if (sal->end > 0)
  224.     return gdb_py_long_from_ulongest (sal->end - 1);
  225.   else
  226.     Py_RETURN_NONE;
  227. }

  228. static PyObject *
  229. salpy_get_line (PyObject *self, void *closure)
  230. {
  231.   struct symtab_and_line *sal = NULL;

  232.   SALPY_REQUIRE_VALID (self, sal);

  233.   return PyInt_FromLong (sal->line);
  234. }

  235. static PyObject *
  236. salpy_get_symtab (PyObject *self, void *closure)
  237. {
  238.   struct symtab_and_line *sal;
  239.   sal_object *self_sal = (sal_object *) self;

  240.   SALPY_REQUIRE_VALID (self, sal);

  241.   Py_INCREF (self_sal->symtab);

  242.   return (PyObject *) self_sal->symtab;
  243. }

  244. /* Implementation of gdb.Symtab_and_line.is_valid (self) -> Boolean.
  245.    Returns True if this Symbol table and line object still exists GDB.  */

  246. static PyObject *
  247. salpy_is_valid (PyObject *self, PyObject *args)
  248. {
  249.   struct symtab_and_line *sal;

  250.   sal = sal_object_to_symtab_and_line (self);
  251.   if (sal == NULL)
  252.     Py_RETURN_FALSE;

  253.   Py_RETURN_TRUE;
  254. }

  255. static void
  256. salpy_dealloc (PyObject *self)
  257. {
  258.   sal_object *self_sal = (sal_object *) self;

  259.   if (self_sal->prev)
  260.     self_sal->prev->next = self_sal->next;
  261.   else if (self_sal->symtab != (symtab_object * ) Py_None)
  262.     set_objfile_data (SYMTAB_OBJFILE (self_sal->symtab->symtab),
  263.                       salpy_objfile_data_key, self_sal->next);

  264.   if (self_sal->next)
  265.     self_sal->next->prev = self_sal->prev;

  266.   Py_DECREF (self_sal->symtab);
  267.   xfree (self_sal->sal);
  268.   Py_TYPE (self)->tp_free (self);
  269. }

  270. /* Given a sal, and a sal_object that has previously been allocated
  271.    and initialized, populate the sal_object with the struct sal data.
  272.    Also, register the sal_object life-cycle with the life-cycle of the
  273.    object file associated with this sal, if needed.  If a failure
  274.    occurs during the sal population, this function will return -1.  */
  275. static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
  276. set_sal (sal_object *sal_obj, struct symtab_and_line sal)
  277. {
  278.   symtab_object *symtab_obj;

  279.   if (sal.symtab)
  280.     {
  281.       symtab_obj = (symtab_object *) symtab_to_symtab_object  (sal.symtab);
  282.       /* If a symtab existed in the sal, but it cannot be duplicated,
  283.          we exit.  */
  284.       if (symtab_obj == NULL)
  285.         return -1;
  286.     }
  287.   else
  288.     {
  289.       symtab_obj = (symtab_object *) Py_None;
  290.       Py_INCREF (Py_None);
  291.     }

  292.   sal_obj->sal = xmemdup (&sal, sizeof (struct symtab_and_line),
  293.                           sizeof (struct symtab_and_line));
  294.   sal_obj->symtab = symtab_obj;
  295.   sal_obj->prev = NULL;

  296.   /* If the SAL does not have a symtab, we do not add it to the
  297.      objfile cleanup observer linked list.  */
  298.   if (sal_obj->symtab != (symtab_object *)Py_None)
  299.     {
  300.       sal_obj->next = objfile_data (SYMTAB_OBJFILE (sal_obj->symtab->symtab),
  301.                                     salpy_objfile_data_key);
  302.       if (sal_obj->next)
  303.         sal_obj->next->prev = sal_obj;

  304.       set_objfile_data (SYMTAB_OBJFILE (sal_obj->symtab->symtab),
  305.                         salpy_objfile_data_key, sal_obj);
  306.     }
  307.   else
  308.     sal_obj->next = NULL;

  309.   return 0;
  310. }

  311. /* Given a symtab, and a symtab_object that has previously been
  312.    allocated and initialized, populate the symtab_object with the
  313.    struct symtab data.  Also, register the symtab_object life-cycle
  314.    with the life-cycle of the object file associated with this
  315.    symtab, if needed.  */
  316. static void
  317. set_symtab (symtab_object *obj, struct symtab *symtab)
  318. {
  319.   obj->symtab = symtab;
  320.   obj->prev = NULL;
  321.   if (symtab)
  322.     {
  323.       obj->next = objfile_data (SYMTAB_OBJFILE (symtab),
  324.                                 stpy_objfile_data_key);
  325.       if (obj->next)
  326.         obj->next->prev = obj;
  327.       set_objfile_data (SYMTAB_OBJFILE (symtab), stpy_objfile_data_key, obj);
  328.     }
  329.   else
  330.     obj->next = NULL;
  331. }

  332. /* Create a new symbol table (gdb.Symtab) object that encapsulates the
  333.    symtab structure from GDB.  */
  334. PyObject *
  335. symtab_to_symtab_object (struct symtab *symtab)
  336. {
  337.   symtab_object *symtab_obj;

  338.   symtab_obj = PyObject_New (symtab_object, &symtab_object_type);
  339.   if (symtab_obj)
  340.     set_symtab (symtab_obj, symtab);

  341.   return (PyObject *) symtab_obj;
  342. }

  343. /* Create a new symtab and line (gdb.Symtab_and_line) object
  344.    that encapsulates the symtab_and_line structure from GDB.  */
  345. PyObject *
  346. symtab_and_line_to_sal_object (struct symtab_and_line sal)
  347. {
  348.   sal_object *sal_obj;
  349.   int success = 0;

  350.   sal_obj = PyObject_New (sal_object, &sal_object_type);
  351.   if (sal_obj)
  352.     {
  353.       if (set_sal (sal_obj, sal) < 0)
  354.         {
  355.           Py_DECREF (sal_obj);
  356.           return NULL;
  357.         }
  358.     }

  359.   return (PyObject *) sal_obj;
  360. }

  361. /* Return struct symtab_and_line reference that is wrapped by this
  362.    object.  */
  363. struct symtab_and_line *
  364. sal_object_to_symtab_and_line (PyObject *obj)
  365. {
  366.   if (! PyObject_TypeCheck (obj, &sal_object_type))
  367.     return NULL;
  368.   return ((sal_object *) obj)->sal;
  369. }

  370. /* Return struct symtab reference that is wrapped by this object.  */
  371. struct symtab *
  372. symtab_object_to_symtab (PyObject *obj)
  373. {
  374.   if (! PyObject_TypeCheck (obj, &symtab_object_type))
  375.     return NULL;
  376.   return ((symtab_object *) obj)->symtab;
  377. }

  378. /* This function is called when an objfile is about to be freed.
  379.    Invalidate the symbol table as further actions on the symbol table
  380.    would result in bad data.  All access to obj->symtab should be
  381.    gated by STPY_REQUIRE_VALID which will raise an exception on
  382.    invalid symbol tables.  */
  383. static void
  384. del_objfile_symtab (struct objfile *objfile, void *datum)
  385. {
  386.   symtab_object *obj = datum;

  387.   while (obj)
  388.     {
  389.       symtab_object *next = obj->next;

  390.       obj->symtab = NULL;
  391.       obj->next = NULL;
  392.       obj->prev = NULL;
  393.       obj = next;
  394.     }
  395. }

  396. /* This function is called when an objfile is about to be freed.
  397.    Invalidate the sal object as further actions on the sal
  398.    would result in bad data.  All access to obj->sal should be
  399.    gated by SALPY_REQUIRE_VALID which will raise an exception on
  400.    invalid symbol table and line objects.  */
  401. static void
  402. del_objfile_sal (struct objfile *objfile, void *datum)
  403. {
  404.   sal_object *obj = datum;

  405.   while (obj)
  406.     {
  407.       sal_object *next = obj->next;

  408.       Py_DECREF (obj->symtab);
  409.       obj->symtab = (symtab_object *) Py_None;
  410.       Py_INCREF (Py_None);

  411.       obj->next = NULL;
  412.       obj->prev = NULL;
  413.       xfree (obj->sal);
  414.       obj->sal = NULL;

  415.       obj = next;
  416.     }
  417. }

  418. int
  419. gdbpy_initialize_symtabs (void)
  420. {
  421.   symtab_object_type.tp_new = PyType_GenericNew;
  422.   if (PyType_Ready (&symtab_object_type) < 0)
  423.     return -1;

  424.   sal_object_type.tp_new = PyType_GenericNew;
  425.   if (PyType_Ready (&sal_object_type) < 0)
  426.     return -1;

  427.   /* Register an objfile "free" callback so we can properly
  428.      invalidate symbol tables, and symbol table and line data
  429.      structures when an object file that is about to be
  430.      deleted.  */
  431.   stpy_objfile_data_key
  432.     = register_objfile_data_with_cleanup (NULL, del_objfile_symtab);
  433.   salpy_objfile_data_key
  434.     = register_objfile_data_with_cleanup (NULL, del_objfile_sal);

  435.   if (gdb_pymodule_addobject (gdb_module, "Symtab",
  436.                               (PyObject *) &symtab_object_type) < 0)
  437.     return -1;

  438.   return gdb_pymodule_addobject (gdb_module, "Symtab_and_line",
  439.                                  (PyObject *) &sal_object_type);
  440. }



  441. static PyGetSetDef symtab_object_getset[] = {
  442.   { "filename", stpy_get_filename, NULL,
  443.     "The symbol table's source filename.", NULL },
  444.   { "objfile", stpy_get_objfile, NULL, "The symtab's objfile.",
  445.     NULL },
  446.   { "producer", stpy_get_producer, NULL,
  447.     "The name/version of the program that compiled this symtab.", NULL },
  448.   {NULL/* Sentinel */
  449. };

  450. static PyMethodDef symtab_object_methods[] = {
  451.   { "is_valid", stpy_is_valid, METH_NOARGS,
  452.     "is_valid () -> Boolean.\n\
  453. Return true if this symbol table is valid, false if not." },
  454.   { "fullname", stpy_fullname, METH_NOARGS,
  455.     "fullname () -> String.\n\
  456. Return the symtab's full source filename." },
  457.   { "global_block", stpy_global_block, METH_NOARGS,
  458.     "global_block () -> gdb.Block.\n\
  459. Return the global block of the symbol table." },
  460.   { "static_block", stpy_static_block, METH_NOARGS,
  461.     "static_block () -> gdb.Block.\n\
  462. Return the static block of the symbol table." },
  463.     { "linetable", stpy_get_linetable, METH_NOARGS,
  464.     "linetable () -> gdb.Linetable.\n\
  465. Return the Linetable associated with this symbol table" },
  466.   {NULL/* Sentinel */
  467. };

  468. static PyTypeObject symtab_object_type = {
  469.   PyVarObject_HEAD_INIT (NULL, 0)
  470.   "gdb.Symtab",                          /*tp_name*/
  471.   sizeof (symtab_object),          /*tp_basicsize*/
  472.   0,                                  /*tp_itemsize*/
  473.   stpy_dealloc,                          /*tp_dealloc*/
  474.   0,                                  /*tp_print*/
  475.   0,                                  /*tp_getattr*/
  476.   0,                                  /*tp_setattr*/
  477.   0,                                  /*tp_compare*/
  478.   0,                                  /*tp_repr*/
  479.   0,                                  /*tp_as_number*/
  480.   0,                                  /*tp_as_sequence*/
  481.   0,                                  /*tp_as_mapping*/
  482.   0,                                  /*tp_hash */
  483.   0,                                  /*tp_call*/
  484.   stpy_str,                          /*tp_str*/
  485.   0,                                  /*tp_getattro*/
  486.   0,                                  /*tp_setattro*/
  487.   0,                                  /*tp_as_buffer*/
  488.   Py_TPFLAGS_DEFAULT,                  /*tp_flags*/
  489.   "GDB symtab object",                  /*tp_doc */
  490.   0,                                  /*tp_traverse */
  491.   0,                                  /*tp_clear */
  492.   0,                                  /*tp_richcompare */
  493.   0,                                  /*tp_weaklistoffset */
  494.   0,                                  /*tp_iter */
  495.   0,                                  /*tp_iternext */
  496.   symtab_object_methods,          /*tp_methods */
  497.   0,                                  /*tp_members */
  498.   symtab_object_getset                  /*tp_getset */
  499. };

  500. static PyGetSetDef sal_object_getset[] = {
  501.   { "symtab", salpy_get_symtab, NULL, "Symtab object.", NULL },
  502.   { "pc", salpy_get_pc, NULL, "Return the symtab_and_line's pc.", NULL },
  503.   { "last", salpy_get_last, NULL,
  504.     "Return the symtab_and_line's last address.", NULL },
  505.   { "line", salpy_get_line, NULL,
  506.     "Return the symtab_and_line's line.", NULL },
  507.   {NULL/* Sentinel */
  508. };

  509. static PyMethodDef sal_object_methods[] = {
  510.   { "is_valid", salpy_is_valid, METH_NOARGS,
  511.     "is_valid () -> Boolean.\n\
  512. Return true if this symbol table and line is valid, false if not." },
  513.   {NULL/* Sentinel */
  514. };

  515. static PyTypeObject sal_object_type = {
  516.   PyVarObject_HEAD_INIT (NULL, 0)
  517.   "gdb.Symtab_and_line",          /*tp_name*/
  518.   sizeof (sal_object),                  /*tp_basicsize*/
  519.   0,                                  /*tp_itemsize*/
  520.   salpy_dealloc,                  /*tp_dealloc*/
  521.   0,                                  /*tp_print*/
  522.   0,                                  /*tp_getattr*/
  523.   0,                                  /*tp_setattr*/
  524.   0,                                  /*tp_compare*/
  525.   0,                                  /*tp_repr*/
  526.   0,                                  /*tp_as_number*/
  527.   0,                                  /*tp_as_sequence*/
  528.   0,                                  /*tp_as_mapping*/
  529.   0,                                  /*tp_hash */
  530.   0,                                  /*tp_call*/
  531.   salpy_str,                          /*tp_str*/
  532.   0,                                  /*tp_getattro*/
  533.   0,                                  /*tp_setattro*/
  534.   0,                                  /*tp_as_buffer*/
  535.   Py_TPFLAGS_DEFAULT,                  /*tp_flags*/
  536.   "GDB symtab_and_line object",          /*tp_doc */
  537.   0,                                  /*tp_traverse */
  538.   0,                                  /*tp_clear */
  539.   0,                                  /*tp_richcompare */
  540.   0,                                  /*tp_weaklistoffset */
  541.   0,                                  /*tp_iter */
  542.   0,                                  /*tp_iternext */
  543.   sal_object_methods,                  /*tp_methods */
  544.   0,                                  /*tp_members */
  545.   sal_object_getset                  /*tp_getset */
  546. };