GDB (xrefs)
|
#include "defs.h"
#include "exceptions.h"
#include "gdbcore.h"
#include "gdbthread.h"
#include "inferior.h"
#include "objfiles.h"
#include "observer.h"
#include "python-internal.h"
#include "arch-utils.h"
#include "language.h"
#include "gdb_signals.h"
#include "py-event.h"
#include "py-stopevent.h"
Go to the source code of this file.
#define CHARBUFFERPROC_NAME charbufferproc |
Definition at line 894 of file py-inferior.c.
#define INFPY_REQUIRE_VALID | ( | Inferior | ) |
do { \ if (!Inferior->inferior) \ { \ PyErr_SetString (PyExc_RuntimeError, \ _("Inferior no longer exists.")); \ return NULL; \ } \ } while (0)
Definition at line 72 of file py-inferior.c.
Referenced by infpy_get_num(), infpy_get_pid(), infpy_get_was_attached(), and infpy_threads().
static void add_thread_object | ( | struct thread_info * | tp | ) | [static] |
Definition at line 239 of file py-inferior.c.
References create_thread_object(), do_cleanups(), ensure_python_env(), gdb_python_initialized, gdbpy_print_stack(), thread_object::inf_obj, threadlist_entry::next, inferior_object::nthreads, python_gdbarch, python_language, threadlist_entry::thread_obj, inferior_object::threads, and xmalloc().
Referenced by gdbpy_initialize_inferior().
static int build_inferior_list | ( | struct inferior * | inf, |
void * | arg | ||
) | [static] |
Definition at line 378 of file py-inferior.c.
References inferior_to_inferior_object(), and Py_DECREF.
Referenced by gdbpy_inferiors().
static PyTypeObject inferior_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "inferior_object" | ) | [static] |
static PyTypeObject membuf_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "membuf_object" | ) | [static] |
static void delete_thread_object | ( | struct thread_info * | tp, |
int | ignore | ||
) | [static] |
Definition at line 272 of file py-inferior.c.
References do_cleanups(), ensure_python_env(), find_inferior_object(), gdb_python_initialized, threadlist_entry::next, inferior_object::nthreads, thread_info::ptid, ptid_get_pid(), Py_DECREF, python_gdbarch, python_language, thread_object::thread, threadlist_entry::thread_obj, inferior_object::threads, and xfree().
Referenced by gdbpy_initialize_inferior().
PyObject* find_inferior_object | ( | int | pid | ) |
Definition at line 195 of file py-inferior.c.
References find_inferior_pid(), and inferior_to_inferior_object().
Referenced by create_thread_object(), delete_thread_object(), and find_thread_object().
thread_object* find_thread_object | ( | ptid_t | ptid | ) |
Definition at line 206 of file py-inferior.c.
References find_inferior_object(), threadlist_entry::next, inferior::pid, thread_info::ptid, ptid_equal(), ptid_get_pid(), Py_DECREF, thread_object::thread, and threadlist_entry::thread_obj.
Referenced by gdbpy_selected_thread(), and get_event_thread().
PyObject* gdbpy_inferiors | ( | PyObject * | unused, |
PyObject * | unused2 | ||
) |
Definition at line 399 of file py-inferior.c.
References build_inferior_list(), iterate_over_inferiors(), and Py_DECREF.
int gdbpy_initialize_inferior | ( | void | ) |
Definition at line 781 of file py-inferior.c.
References add_thread_object(), delete_thread_object(), gdb_module, gdb_pymodule_addobject(), inferior_object_type, infpy_inf_data_key, membuf_object_type, observer_attach_inferior_exit(), observer_attach_new_objfile(), observer_attach_new_thread(), observer_attach_normal_stop(), observer_attach_target_resumed(), observer_attach_thread_exit(), py_free_inferior(), python_inferior_exit(), python_new_objfile(), python_on_normal_stop(), and python_on_resume().
Referenced by _initialize_python().
PyObject* gdbpy_selected_inferior | ( | PyObject * | self, |
PyObject * | args | ||
) |
Definition at line 775 of file py-inferior.c.
References current_inferior(), and inferior_to_inferior_object().
static Py_ssize_t get_char_buffer | ( | PyObject * | self, |
Py_ssize_t | segment, | ||
char ** | ptrptr | ||
) | [static] |
Definition at line 606 of file py-inferior.c.
References get_read_buffer().
static Py_ssize_t get_read_buffer | ( | PyObject * | self, |
Py_ssize_t | segment, | ||
void ** | ptrptr | ||
) | [static] |
Definition at line 574 of file py-inferior.c.
References _, membuf_object::buffer, and membuf_object::length.
Referenced by get_char_buffer(), and get_write_buffer().
static Py_ssize_t get_seg_count | ( | PyObject * | self, |
Py_ssize_t * | lenp | ||
) | [static] |
Definition at line 597 of file py-inferior.c.
static Py_ssize_t get_write_buffer | ( | PyObject * | self, |
Py_ssize_t | segment, | ||
void ** | ptrptr | ||
) | [static] |
Definition at line 591 of file py-inferior.c.
References get_read_buffer().
PyObject* inferior_to_inferior_object | ( | struct inferior * | inferior | ) |
Definition at line 167 of file py-inferior.c.
References inferior_object::inferior, inferior_object_type, infpy_inf_data_key, inferior_object::nthreads, and inferior_object::threads.
Referenced by build_inferior_list(), create_exited_event_object(), find_inferior_object(), and gdbpy_selected_inferior().
static void infpy_dealloc | ( | PyObject * | obj | ) | [static] |
Definition at line 727 of file py-inferior.c.
References inferior_object::inferior, and infpy_inf_data_key.
static PyObject* infpy_get_num | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 347 of file py-inferior.c.
References inferior_object::inferior, INFPY_REQUIRE_VALID, and inferior::num.
static PyObject* infpy_get_pid | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 357 of file py-inferior.c.
References inferior_object::inferior, INFPY_REQUIRE_VALID, and inferior::pid.
static PyObject* infpy_get_was_attached | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 367 of file py-inferior.c.
References inferior::attach_flag, inferior_object::inferior, and INFPY_REQUIRE_VALID.
static PyObject* infpy_is_valid | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 716 of file py-inferior.c.
References inferior_object::inferior.
static PyObject* infpy_read_memory | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 426 of file py-inferior.c.
References membuf_object::addr, membuf_object::buffer, GDB_PY_HANDLE_EXCEPTION, get_addr_from_python(), membuf_object::length, membuf_object_type, Py_DECREF, read_memory(), gdb_exception::reason, RETURN_MASK_ALL, TRY_CATCH, xfree(), and xmalloc().
static PyObject* infpy_search_memory | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 628 of file py-inferior.c.
References _, CORE_ADDR_MAX, GDB_PY_HANDLE_EXCEPTION, get_addr_from_python(), RETURN_MASK_ALL, target_search_memory(), and TRY_CATCH.
static PyObject* infpy_threads | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 318 of file py-inferior.c.
References GDB_PY_HANDLE_EXCEPTION, INFPY_REQUIRE_VALID, threadlist_entry::next, inferior_object::nthreads, RETURN_MASK_ALL, threadlist_entry::thread_obj, inferior_object::threads, TRY_CATCH, and update_thread_list().
static PyObject* infpy_write_memory | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 484 of file py-inferior.c.
References GDB_PY_HANDLE_EXCEPTION, get_addr_from_python(), RETURN_MASK_ALL, TRY_CATCH, and write_memory_with_notification().
static void mbpy_dealloc | ( | PyObject * | self | ) | [static] |
Definition at line 537 of file py-inferior.c.
References xfree().
Definition at line 545 of file py-inferior.c.
References _, membuf_object::addr, membuf_object::length, paddress(), pulongest(), and python_gdbarch.
static void py_free_inferior | ( | struct inferior * | inf, |
void * | datum | ||
) | [static] |
Definition at line 741 of file py-inferior.c.
References do_cleanups(), ensure_python_env(), gdb_python_initialized, inferior_object::inferior, threadlist_entry::next, inferior_object::nthreads, Py_DECREF, python_gdbarch, python_language, threadlist_entry::thread_obj, inferior_object::threads, and xfree().
Referenced by gdbpy_initialize_inferior().
static void python_inferior_exit | ( | struct inferior * | inf | ) | [static] |
Definition at line 121 of file py-inferior.c.
References current_language, do_cleanups(), emit_exited_event(), ensure_python_env(), inferior::exit_code, gdb_python_initialized, gdbpy_print_stack(), inferior::has_exit_code, LONGEST, and target_gdbarch().
Referenced by gdbpy_initialize_inferior().
static void python_new_objfile | ( | struct objfile * | objfile | ) | [static] |
Definition at line 144 of file py-inferior.c.
References current_language, do_cleanups(), emit_new_objfile_event(), ensure_python_env(), gdb_python_initialized, gdbpy_print_stack(), and get_objfile_arch().
Referenced by gdbpy_initialize_inferior().
static void python_on_normal_stop | ( | struct bpstats * | bs, |
int | print_frame | ||
) | [static] |
Definition at line 83 of file py-inferior.c.
References current_language, do_cleanups(), emit_stop_event(), ensure_python_env(), find_thread_ptid(), gdb_python_initialized, gdbpy_print_stack(), get_current_arch(), inferior_ptid, inferior_thread(), thread_suspend_state::stop_signal, and thread_info::suspend.
Referenced by gdbpy_initialize_inferior().
static void python_on_resume | ( | ptid_t | ptid | ) | [static] |
Definition at line 105 of file py-inferior.c.
References current_language, do_cleanups(), emit_continue_event(), ensure_python_env(), gdb_python_initialized, gdbpy_print_stack(), and target_gdbarch().
Referenced by gdbpy_initialize_inferior().
PyBufferProcs buffer_procs [static] |
Definition at line 897 of file py-inferior.c.
PyGetSetDef inferior_object_getset[] [static] |
{ { "num", infpy_get_num, NULL, "ID of inferior, as assigned by GDB.", NULL }, { "pid", infpy_get_pid, NULL, "PID of inferior, as assigned by the OS.", NULL }, { "was_attached", infpy_get_was_attached, NULL, "True if the inferior was created using 'attach'.", NULL }, { NULL } }
Definition at line 808 of file py-inferior.c.
PyMethodDef inferior_object_methods[] [static] |
{ { "is_valid", infpy_is_valid, METH_NOARGS, "is_valid () -> Boolean.\n\ Return true if this inferior is valid, false if not." }, { "threads", infpy_threads, METH_NOARGS, "Return all the threads of this inferior." }, { "read_memory", (PyCFunction) infpy_read_memory, METH_VARARGS | METH_KEYWORDS, "read_memory (address, length) -> buffer\n\ Return a buffer object for reading from the inferior's memory." }, { "write_memory", (PyCFunction) infpy_write_memory, METH_VARARGS | METH_KEYWORDS, "write_memory (address, buffer [, length])\n\ Write the given buffer object to the inferior's memory." }, { "search_memory", (PyCFunction) infpy_search_memory, METH_VARARGS | METH_KEYWORDS, "search_memory (address, length, pattern) -> long\n\ Return a long with the address of a match, or None." }, { NULL } }
Definition at line 818 of file py-inferior.c.
PyTypeObject inferior_object_type [static] |
Definition at line 840 of file py-inferior.c.
Referenced by gdbpy_initialize_inferior(), and inferior_to_inferior_object().
struct inferior_data* infpy_inf_data_key [static] |
Definition at line 57 of file py-inferior.c.
Referenced by gdbpy_initialize_inferior(), inferior_to_inferior_object(), and infpy_dealloc().
PyTypeObject membuf_object_type [static] |
Definition at line 907 of file py-inferior.c.
Referenced by gdbpy_initialize_inferior(), and infpy_read_memory().