python: Provide textual representation for Inferior and Objfile
[deliverable/binutils-gdb.git] / gdb / python / py-objfile.c
CommitLineData
89c73ade
TT
1/* Python interface to objfiles.
2
e2882c85 3 Copyright (C) 2008-2018 Free Software Foundation, Inc.
89c73ade
TT
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 "python-internal.h"
22#include "charset.h"
23#include "objfiles.h"
d452c4bc 24#include "language.h"
7c50a931 25#include "build-id.h"
6dddd6a5 26#include "symtab.h"
88b6faea 27#include "py-ref.h"
89c73ade
TT
28
29typedef struct
30{
31 PyObject_HEAD
32
33 /* The corresponding objfile. */
34 struct objfile *objfile;
35
02be9a71
DE
36 /* Dictionary holding user-added attributes.
37 This is the __dict__ attribute of the object. */
38 PyObject *dict;
39
89c73ade
TT
40 /* The pretty-printer list of functions. */
41 PyObject *printers;
18a9fc12 42
1e611234
PM
43 /* The frame filter list of functions. */
44 PyObject *frame_filters;
d11916aa
SS
45
46 /* The list of frame unwinders. */
47 PyObject *frame_unwinders;
48
18a9fc12
TT
49 /* The type-printer list. */
50 PyObject *type_printers;
883964a7
SC
51
52 /* The debug method matcher list. */
53 PyObject *xmethods;
89c73ade
TT
54} objfile_object;
55
e36122e9 56extern PyTypeObject objfile_object_type
62eec1a5 57 CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("objfile_object");
89c73ade
TT
58
59static const struct objfile_data *objfpy_objfile_data_key;
60
7c50a931
DE
61/* Require that OBJF be a valid objfile. */
62#define OBJFPY_REQUIRE_VALID(obj) \
63 do { \
64 if (!(obj)->objfile) \
65 { \
66 PyErr_SetString (PyExc_RuntimeError, \
67 _("Objfile no longer exists.")); \
68 return NULL; \
69 } \
70 } while (0)
71
89c73ade
TT
72\f
73
74/* An Objfile method which returns the objfile's file name, or None. */
7c50a931 75
89c73ade
TT
76static PyObject *
77objfpy_get_filename (PyObject *self, void *closure)
78{
79 objfile_object *obj = (objfile_object *) self;
d59b6f6c 80
d31d2fc3 81 if (obj->objfile)
4ae6cc19 82 return host_string_to_python_string (objfile_name (obj->objfile));
89c73ade
TT
83 Py_RETURN_NONE;
84}
85
3a8b707a
DE
86/* An Objfile method which returns the objfile's file name, as specified
87 by the user, or None. */
88
89static PyObject *
90objfpy_get_username (PyObject *self, void *closure)
91{
92 objfile_object *obj = (objfile_object *) self;
93
94 if (obj->objfile)
95 {
96 const char *username = obj->objfile->original_name;
97
4ae6cc19 98 return host_string_to_python_string (username);
3a8b707a
DE
99 }
100
101 Py_RETURN_NONE;
102}
103
a0be3e44
DE
104/* If SELF is a separate debug-info file, return the "backlink" field.
105 Otherwise return None. */
106
107static PyObject *
108objfpy_get_owner (PyObject *self, void *closure)
109{
110 objfile_object *obj = (objfile_object *) self;
111 struct objfile *objfile = obj->objfile;
112 struct objfile *owner;
113
114 OBJFPY_REQUIRE_VALID (obj);
115
116 owner = objfile->separate_debug_objfile_backlink;
a0be3e44 117 if (owner != NULL)
d4d1e336
DE
118 {
119 PyObject *result = objfile_to_objfile_object (owner);
120
121 Py_XINCREF (result);
122 return result;
123 }
a0be3e44
DE
124 Py_RETURN_NONE;
125}
126
7c50a931
DE
127/* An Objfile method which returns the objfile's build id, or None. */
128
129static PyObject *
130objfpy_get_build_id (PyObject *self, void *closure)
131{
132 objfile_object *obj = (objfile_object *) self;
133 struct objfile *objfile = obj->objfile;
c74f7d1c 134 const struct bfd_build_id *build_id = NULL;
7c50a931
DE
135
136 OBJFPY_REQUIRE_VALID (obj);
137
492d29ea 138 TRY
7c50a931
DE
139 {
140 build_id = build_id_bfd_get (objfile->obfd);
141 }
492d29ea
PA
142 CATCH (except, RETURN_MASK_ALL)
143 {
144 GDB_PY_HANDLE_EXCEPTION (except);
145 }
146 END_CATCH
7c50a931
DE
147
148 if (build_id != NULL)
149 {
150 char *hex_form = make_hex_string (build_id->data, build_id->size);
151 PyObject *result;
152
4ae6cc19 153 result = host_string_to_python_string (hex_form);
7c50a931
DE
154 xfree (hex_form);
155 return result;
156 }
157
158 Py_RETURN_NONE;
159}
160
d096d8c1
DE
161/* An Objfile method which returns the objfile's progspace, or None. */
162
163static PyObject *
164objfpy_get_progspace (PyObject *self, void *closure)
165{
166 objfile_object *obj = (objfile_object *) self;
167
168 if (obj->objfile)
169 {
170 PyObject *pspace = pspace_to_pspace_object (obj->objfile->pspace);
171
172 Py_XINCREF (pspace);
173 return pspace;
174 }
175
176 Py_RETURN_NONE;
177}
178
89c73ade
TT
179static void
180objfpy_dealloc (PyObject *o)
181{
182 objfile_object *self = (objfile_object *) o;
d59b6f6c 183
02be9a71 184 Py_XDECREF (self->dict);
89c73ade 185 Py_XDECREF (self->printers);
1e611234 186 Py_XDECREF (self->frame_filters);
d11916aa 187 Py_XDECREF (self->frame_unwinders);
18a9fc12 188 Py_XDECREF (self->type_printers);
883964a7 189 Py_XDECREF (self->xmethods);
9a27f2c6 190 Py_TYPE (self)->tp_free (self);
89c73ade
TT
191}
192
4e1bbde0
DE
193/* Initialize an objfile_object.
194 The result is a boolean indicating success. */
195
196static int
197objfpy_initialize (objfile_object *self)
198{
199 self->objfile = NULL;
0f6ed0e0
TT
200
201 self->dict = PyDict_New ();
202 if (self->dict == NULL)
203 return 0;
4e1bbde0
DE
204
205 self->printers = PyList_New (0);
206 if (self->printers == NULL)
207 return 0;
208
209 self->frame_filters = PyDict_New ();
210 if (self->frame_filters == NULL)
211 return 0;
212
d11916aa
SS
213 self->frame_unwinders = PyList_New (0);
214 if (self->frame_unwinders == NULL)
215 return 0;
216
4e1bbde0
DE
217 self->type_printers = PyList_New (0);
218 if (self->type_printers == NULL)
219 return 0;
220
221 self->xmethods = PyList_New (0);
222 if (self->xmethods == NULL)
223 return 0;
224
225 return 1;
226}
227
89c73ade
TT
228static PyObject *
229objfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
230{
88b6faea 231 gdbpy_ref<objfile_object> self ((objfile_object *) type->tp_alloc (type, 0));
d59b6f6c 232
88b6faea 233 if (self != NULL)
89c73ade 234 {
88b6faea
TT
235 if (!objfpy_initialize (self.get ()))
236 return NULL;
89c73ade 237 }
4e1bbde0 238
88b6faea 239 return (PyObject *) self.release ();
89c73ade
TT
240}
241
242PyObject *
243objfpy_get_printers (PyObject *o, void *ignore)
244{
245 objfile_object *self = (objfile_object *) o;
d59b6f6c 246
89c73ade
TT
247 Py_INCREF (self->printers);
248 return self->printers;
249}
250
251static int
252objfpy_set_printers (PyObject *o, PyObject *value, void *ignore)
253{
254 PyObject *tmp;
255 objfile_object *self = (objfile_object *) o;
d59b6f6c 256
89c73ade
TT
257 if (! value)
258 {
259 PyErr_SetString (PyExc_TypeError,
044c0f87 260 _("Cannot delete the pretty_printers attribute."));
89c73ade
TT
261 return -1;
262 }
263
264 if (! PyList_Check (value))
265 {
266 PyErr_SetString (PyExc_TypeError,
044c0f87 267 _("The pretty_printers attribute must be a list."));
89c73ade
TT
268 return -1;
269 }
270
271 /* Take care in case the LHS and RHS are related somehow. */
272 tmp = self->printers;
273 Py_INCREF (value);
274 self->printers = value;
275 Py_XDECREF (tmp);
276
277 return 0;
278}
279
1e611234
PM
280/* Return the Python dictionary attribute containing frame filters for
281 this object file. */
282PyObject *
283objfpy_get_frame_filters (PyObject *o, void *ignore)
284{
285 objfile_object *self = (objfile_object *) o;
286
287 Py_INCREF (self->frame_filters);
288 return self->frame_filters;
289}
290
291/* Set this object file's frame filters dictionary to FILTERS. */
292static int
293objfpy_set_frame_filters (PyObject *o, PyObject *filters, void *ignore)
294{
295 PyObject *tmp;
296 objfile_object *self = (objfile_object *) o;
297
298 if (! filters)
299 {
300 PyErr_SetString (PyExc_TypeError,
301 _("Cannot delete the frame filters attribute."));
302 return -1;
303 }
304
305 if (! PyDict_Check (filters))
306 {
307 PyErr_SetString (PyExc_TypeError,
308 _("The frame_filters attribute must be a dictionary."));
309 return -1;
310 }
311
312 /* Take care in case the LHS and RHS are related somehow. */
313 tmp = self->frame_filters;
314 Py_INCREF (filters);
315 self->frame_filters = filters;
316 Py_XDECREF (tmp);
317
318 return 0;
319}
320
d11916aa
SS
321/* Return the frame unwinders attribute for this object file. */
322
323PyObject *
324objfpy_get_frame_unwinders (PyObject *o, void *ignore)
325{
326 objfile_object *self = (objfile_object *) o;
327
328 Py_INCREF (self->frame_unwinders);
329 return self->frame_unwinders;
330}
331
332/* Set this object file's frame unwinders list to UNWINDERS. */
333
334static int
335objfpy_set_frame_unwinders (PyObject *o, PyObject *unwinders, void *ignore)
336{
337 PyObject *tmp;
338 objfile_object *self = (objfile_object *) o;
339
340 if (!unwinders)
341 {
342 PyErr_SetString (PyExc_TypeError,
343 _("Cannot delete the frame unwinders attribute."));
344 return -1;
345 }
346
347 if (!PyList_Check (unwinders))
348 {
349 PyErr_SetString (PyExc_TypeError,
350 _("The frame_unwinders attribute must be a list."));
351 return -1;
352 }
353
354 /* Take care in case the LHS and RHS are related somehow. */
355 tmp = self->frame_unwinders;
356 Py_INCREF (unwinders);
357 self->frame_unwinders = unwinders;
358 Py_XDECREF (tmp);
359
360 return 0;
361}
362
18a9fc12
TT
363/* Get the 'type_printers' attribute. */
364
365static PyObject *
366objfpy_get_type_printers (PyObject *o, void *ignore)
367{
368 objfile_object *self = (objfile_object *) o;
369
370 Py_INCREF (self->type_printers);
371 return self->type_printers;
372}
373
883964a7
SC
374/* Get the 'xmethods' attribute. */
375
376PyObject *
377objfpy_get_xmethods (PyObject *o, void *ignore)
378{
379 objfile_object *self = (objfile_object *) o;
380
381 Py_INCREF (self->xmethods);
382 return self->xmethods;
383}
384
18a9fc12
TT
385/* Set the 'type_printers' attribute. */
386
387static int
388objfpy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
389{
390 PyObject *tmp;
391 objfile_object *self = (objfile_object *) o;
392
393 if (! value)
394 {
395 PyErr_SetString (PyExc_TypeError,
396 _("Cannot delete the type_printers attribute."));
397 return -1;
398 }
399
400 if (! PyList_Check (value))
401 {
402 PyErr_SetString (PyExc_TypeError,
403 _("The type_printers attribute must be a list."));
404 return -1;
405 }
406
407 /* Take care in case the LHS and RHS are related somehow. */
408 tmp = self->type_printers;
409 Py_INCREF (value);
410 self->type_printers = value;
411 Py_XDECREF (tmp);
412
413 return 0;
414}
415
29703da4
PM
416/* Implementation of gdb.Objfile.is_valid (self) -> Boolean.
417 Returns True if this object file still exists in GDB. */
418
419static PyObject *
420objfpy_is_valid (PyObject *self, PyObject *args)
421{
422 objfile_object *obj = (objfile_object *) self;
423
424 if (! obj->objfile)
425 Py_RETURN_FALSE;
426
427 Py_RETURN_TRUE;
428}
429
86e4ed39
DE
430/* Implementation of gdb.Objfile.add_separate_debug_file (self) -> Boolean. */
431
432static PyObject *
433objfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
434{
2adadf51 435 static const char *keywords[] = { "file_name", NULL };
86e4ed39
DE
436 objfile_object *obj = (objfile_object *) self;
437 const char *file_name;
86e4ed39
DE
438
439 OBJFPY_REQUIRE_VALID (obj);
440
2adadf51 441 if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s", keywords, &file_name))
86e4ed39
DE
442 return NULL;
443
492d29ea 444 TRY
86e4ed39 445 {
192b62ce 446 gdb_bfd_ref_ptr abfd (symfile_bfd_open (file_name));
86e4ed39 447
192b62ce 448 symbol_file_add_separate (abfd.get (), file_name, 0, obj->objfile);
86e4ed39 449 }
492d29ea
PA
450 CATCH (except, RETURN_MASK_ALL)
451 {
452 GDB_PY_HANDLE_EXCEPTION (except);
453 }
454 END_CATCH
86e4ed39
DE
455
456 Py_RETURN_NONE;
457}
458
1256af7d
SM
459/* Implement repr() for gdb.Objfile. */
460
461static PyObject *
462objfpy_repr (PyObject *self_)
463{
464 objfile_object *self = (objfile_object *) self_;
465 objfile *obj = self->objfile;
466
467 if (obj == nullptr)
468 return PyString_FromString ("<gdb.Objfile (invalid)>");
469
470 return PyString_FromFormat ("<gdb.Objfile filename=%s>",
471 objfile_filename (obj));
472}
473
6dddd6a5
DE
474/* Subroutine of gdbpy_lookup_objfile_by_build_id to simplify it.
475 Return non-zero if STRING is a potentially valid build id. */
476
477static int
478objfpy_build_id_ok (const char *string)
479{
480 size_t i, n = strlen (string);
481
482 if (n % 2 != 0)
483 return 0;
484 for (i = 0; i < n; ++i)
485 {
486 if (!isxdigit (string[i]))
487 return 0;
488 }
489 return 1;
490}
491
492/* Subroutine of gdbpy_lookup_objfile_by_build_id to simplify it.
493 Returns non-zero if BUILD_ID matches STRING.
494 It is assumed that objfpy_build_id_ok (string) returns TRUE. */
495
496static int
c74f7d1c 497objfpy_build_id_matches (const struct bfd_build_id *build_id,
6dddd6a5
DE
498 const char *string)
499{
500 size_t i;
501
502 if (strlen (string) != 2 * build_id->size)
503 return 0;
504
505 for (i = 0; i < build_id->size; ++i)
506 {
507 char c1 = string[i * 2], c2 = string[i * 2 + 1];
508 int byte = (host_hex_value (c1) << 4) | host_hex_value (c2);
509
510 if (byte != build_id->data[i])
511 return 0;
512 }
513
514 return 1;
515}
516
517/* Subroutine of gdbpy_lookup_objfile to simplify it.
518 Look up an objfile by its file name. */
519
520static struct objfile *
521objfpy_lookup_objfile_by_name (const char *name)
522{
523 struct objfile *objfile;
524
525 ALL_OBJFILES (objfile)
526 {
e02c96a7
DE
527 const char *filename;
528
6dddd6a5
DE
529 if ((objfile->flags & OBJF_NOT_FILENAME) != 0)
530 continue;
531 /* Don't return separate debug files. */
532 if (objfile->separate_debug_objfile_backlink != NULL)
533 continue;
e02c96a7
DE
534
535 filename = objfile_filename (objfile);
536 if (filename != NULL && compare_filenames_for_search (filename, name))
537 return objfile;
538 if (compare_filenames_for_search (objfile->original_name, name))
6dddd6a5
DE
539 return objfile;
540 }
541
542 return NULL;
543}
544
545/* Subroutine of gdbpy_lookup_objfile to simplify it.
546 Look up an objfile by its build id. */
547
548static struct objfile *
549objfpy_lookup_objfile_by_build_id (const char *build_id)
550{
551 struct objfile *objfile;
552
553 ALL_OBJFILES (objfile)
554 {
c74f7d1c 555 const struct bfd_build_id *obfd_build_id;
6dddd6a5
DE
556
557 if (objfile->obfd == NULL)
558 continue;
559 /* Don't return separate debug files. */
560 if (objfile->separate_debug_objfile_backlink != NULL)
561 continue;
562 obfd_build_id = build_id_bfd_get (objfile->obfd);
563 if (obfd_build_id == NULL)
564 continue;
565 if (objfpy_build_id_matches (obfd_build_id, build_id))
566 return objfile;
567 }
568
569 return NULL;
570}
571
572/* Implementation of gdb.lookup_objfile. */
573
574PyObject *
575gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
576{
2adadf51 577 static const char *keywords[] = { "name", "by_build_id", NULL };
6dddd6a5
DE
578 const char *name;
579 PyObject *by_build_id_obj = NULL;
580 int by_build_id;
581 struct objfile *objfile;
582
2adadf51
PA
583 if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!", keywords,
584 &name, &PyBool_Type, &by_build_id_obj))
6dddd6a5
DE
585 return NULL;
586
587 by_build_id = 0;
588 if (by_build_id_obj != NULL)
589 {
590 int cmp = PyObject_IsTrue (by_build_id_obj);
591
592 if (cmp < 0)
593 return NULL;
594 by_build_id = cmp;
595 }
596
597 if (by_build_id)
598 {
599 if (!objfpy_build_id_ok (name))
600 {
601 PyErr_SetString (PyExc_TypeError, _("Not a valid build id."));
602 return NULL;
603 }
604 objfile = objfpy_lookup_objfile_by_build_id (name);
605 }
606 else
607 objfile = objfpy_lookup_objfile_by_name (name);
608
609 if (objfile != NULL)
610 {
611 PyObject *result = objfile_to_objfile_object (objfile);
612
613 Py_XINCREF (result);
614 return result;
615 }
616
617 PyErr_SetString (PyExc_ValueError, _("Objfile not found."));
618 return NULL;
619}
620
89c73ade
TT
621\f
622
623/* Clear the OBJFILE pointer in an Objfile object and remove the
624 reference. */
625static void
c1bd65d0 626py_free_objfile (struct objfile *objfile, void *datum)
89c73ade 627{
2d38bced 628 gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
88b6faea 629 gdbpy_ref<objfile_object> object ((objfile_object *) datum);
89c73ade 630 object->objfile = NULL;
89c73ade
TT
631}
632
633/* Return a borrowed reference to the Python object of type Objfile
634 representing OBJFILE. If the object has already been created,
635 return it. Otherwise, create it. Return NULL and set the Python
636 error on failure. */
4e1bbde0 637
89c73ade
TT
638PyObject *
639objfile_to_objfile_object (struct objfile *objfile)
640{
88b6faea
TT
641 gdbpy_ref<objfile_object> object
642 ((objfile_object *) objfile_data (objfile, objfpy_objfile_data_key));
643 if (object == NULL)
89c73ade 644 {
88b6faea
TT
645 object.reset (PyObject_New (objfile_object, &objfile_object_type));
646 if (object != NULL)
89c73ade 647 {
88b6faea
TT
648 if (!objfpy_initialize (object.get ()))
649 return NULL;
883964a7 650
4e1bbde0 651 object->objfile = objfile;
88b6faea 652 set_objfile_data (objfile, objfpy_objfile_data_key, object.get ());
89c73ade
TT
653 }
654 }
655
88b6faea 656 return (PyObject *) object.release ();
89c73ade
TT
657}
658
999633ed 659int
89c73ade
TT
660gdbpy_initialize_objfile (void)
661{
662 objfpy_objfile_data_key
c1bd65d0 663 = register_objfile_data_with_cleanup (NULL, py_free_objfile);
89c73ade
TT
664
665 if (PyType_Ready (&objfile_object_type) < 0)
999633ed 666 return -1;
89c73ade 667
aa36459a
TT
668 return gdb_pymodule_addobject (gdb_module, "Objfile",
669 (PyObject *) &objfile_object_type);
89c73ade
TT
670}
671
672\f
673
29703da4
PM
674static PyMethodDef objfile_object_methods[] =
675{
676 { "is_valid", objfpy_is_valid, METH_NOARGS,
677 "is_valid () -> Boolean.\n\
678Return true if this object file is valid, false if not." },
679
86e4ed39
DE
680 { "add_separate_debug_file", (PyCFunction) objfpy_add_separate_debug_file,
681 METH_VARARGS | METH_KEYWORDS,
682 "add_separate_debug_file (file_name).\n\
683Add FILE_NAME to the list of files containing debug info for the objfile." },
684
29703da4
PM
685 { NULL }
686};
687
0d1f4ceb 688static gdb_PyGetSetDef objfile_getset[] =
89c73ade 689{
02be9a71
DE
690 { "__dict__", gdb_py_generic_dict, NULL,
691 "The __dict__ for this objfile.", &objfile_object_type },
89c73ade
TT
692 { "filename", objfpy_get_filename, NULL,
693 "The objfile's filename, or None.", NULL },
3a8b707a
DE
694 { "username", objfpy_get_username, NULL,
695 "The name of the objfile as provided by the user, or None.", NULL },
a0be3e44
DE
696 { "owner", objfpy_get_owner, NULL,
697 "The objfile owner of separate debug info objfiles, or None.",
698 NULL },
7c50a931
DE
699 { "build_id", objfpy_get_build_id, NULL,
700 "The objfile's build id, or None.", NULL },
d096d8c1
DE
701 { "progspace", objfpy_get_progspace, NULL,
702 "The objfile's progspace, or None.", NULL },
89c73ade
TT
703 { "pretty_printers", objfpy_get_printers, objfpy_set_printers,
704 "Pretty printers.", NULL },
1e611234
PM
705 { "frame_filters", objfpy_get_frame_filters,
706 objfpy_set_frame_filters, "Frame Filters.", NULL },
d11916aa
SS
707 { "frame_unwinders", objfpy_get_frame_unwinders,
708 objfpy_set_frame_unwinders, "Frame Unwinders", NULL },
18a9fc12
TT
709 { "type_printers", objfpy_get_type_printers, objfpy_set_type_printers,
710 "Type printers.", NULL },
883964a7
SC
711 { "xmethods", objfpy_get_xmethods, NULL,
712 "Debug methods.", NULL },
89c73ade
TT
713 { NULL }
714};
715
e36122e9 716PyTypeObject objfile_object_type =
89c73ade 717{
9a27f2c6 718 PyVarObject_HEAD_INIT (NULL, 0)
89c73ade
TT
719 "gdb.Objfile", /*tp_name*/
720 sizeof (objfile_object), /*tp_basicsize*/
721 0, /*tp_itemsize*/
722 objfpy_dealloc, /*tp_dealloc*/
723 0, /*tp_print*/
724 0, /*tp_getattr*/
725 0, /*tp_setattr*/
726 0, /*tp_compare*/
1256af7d 727 objfpy_repr, /*tp_repr*/
89c73ade
TT
728 0, /*tp_as_number*/
729 0, /*tp_as_sequence*/
730 0, /*tp_as_mapping*/
731 0, /*tp_hash */
732 0, /*tp_call*/
733 0, /*tp_str*/
734 0, /*tp_getattro*/
735 0, /*tp_setattro*/
736 0, /*tp_as_buffer*/
737 Py_TPFLAGS_DEFAULT, /*tp_flags*/
738 "GDB objfile object", /* tp_doc */
739 0, /* tp_traverse */
740 0, /* tp_clear */
741 0, /* tp_richcompare */
742 0, /* tp_weaklistoffset */
743 0, /* tp_iter */
744 0, /* tp_iternext */
29703da4 745 objfile_object_methods, /* tp_methods */
89c73ade
TT
746 0, /* tp_members */
747 objfile_getset, /* tp_getset */
748 0, /* tp_base */
749 0, /* tp_dict */
750 0, /* tp_descr_get */
751 0, /* tp_descr_set */
02be9a71 752 offsetof (objfile_object, dict), /* tp_dictoffset */
89c73ade
TT
753 0, /* tp_init */
754 0, /* tp_alloc */
755 objfpy_new, /* tp_new */
756};
This page took 1.295691 seconds and 4 git commands to generate.