From bea883fd928f283b41d10b02f2b92f28bfb634cf Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Wed, 23 Jan 2013 19:59:13 +0000 Subject: Add a new class gdb.Architecture which exposes GDB's internal representation of architecture via GDB Python API. * Makefile.in: Add entries corresponding to the new file python/py-arch.c. * NEWS (Python Scripting): Add entries for the new class gdb.Architecture and the new method gdb.Frame.architecture. * python/py-arch.c: Implement gdb.Architecture class. * python/py-frame.c (frapy_arch): Implement the method gdb.Frame.architecture(). (frame_object_methods): Add 'architecture' to the method table. * python/python-internal.h: Add declarations of new utility functions. * python/python.c (_initialize_python): Initialize gdb.Architecture class. * doc/gdb.texinfo (Architectures In Python): New sub-sub-section describing the gdb.Architecture class. (Frames In Python): Add description about the new method gdb.Frame.architecture(). * testsuite/gdb.python/frame.exp: Add a test for gdb.Frame.architecture() method. --- gdb/python/python-internal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/python/python-internal.h') diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 7d52c06..8dff1d7 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -250,6 +250,8 @@ PyObject *pspy_get_printers (PyObject *, void *); PyObject *objfile_to_objfile_object (struct objfile *); PyObject *objfpy_get_printers (PyObject *, void *); +PyObject *gdbarch_to_arch_object (struct gdbarch *gdbarch); + thread_object *create_thread_object (struct thread_info *tp); thread_object *find_thread_object (ptid_t ptid); PyObject *find_inferior_object (int pid); @@ -263,6 +265,7 @@ struct type *type_object_to_type (PyObject *obj); struct symtab *symtab_object_to_symtab (PyObject *obj); struct symtab_and_line *sal_object_to_symtab_and_line (PyObject *obj); struct frame_info *frame_object_to_frame_info (PyObject *frame_obj); +struct gdbarch *arch_object_to_gdbarch (PyObject *obj); void gdbpy_initialize_gdb_readline (void); void gdbpy_initialize_auto_load (void); @@ -293,6 +296,7 @@ void gdbpy_initialize_continue_event (void); void gdbpy_initialize_exited_event (void); void gdbpy_initialize_thread_event (void); void gdbpy_initialize_new_objfile_event (void); +void gdbpy_initialize_arch (void); struct cleanup *make_cleanup_py_decref (PyObject *py); -- cgit v1.1