GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
py-connection.c File Reference
#include "defs.h"
#include "python-internal.h"
#include "process-stratum-target.h"
#include "inferior.h"
#include "observable.h"
#include "target-connection.h"
#include "py-events.h"
#include "py-event.h"
#include "arch-utils.h"
#include "remote.h"
#include "charset.h"
#include <map>

Go to the source code of this file.

Classes

struct  connection_object
 
struct  py_send_packet_callbacks
 

Macros

#define CONNPY_REQUIRE_VALID(connection)
 

Functions

PyTypeObject connection_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("connection_object")
 
PyTypeObject remote_connection_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("remote_connection_object")
 
gdbpy_ref target_to_connection_object (process_stratum_target *target)
 
PyObjectgdbpy_connections (PyObject *self, PyObject *args)
 
static int emit_connection_event (process_stratum_target *target, eventregistry_object *registry)
 
static void connpy_connection_removed (process_stratum_target *target)
 
static void connpy_connection_dealloc (PyObject *obj)
 
static PyObjectconnpy_repr (PyObject *obj)
 
static PyObjectconnpy_is_valid (PyObject *self, PyObject *args)
 
static PyObjectconnpy_get_connection_num (PyObject *self, void *closure)
 
static PyObjectconnpy_get_connection_type (PyObject *self, void *closure)
 
static PyObjectconnpy_get_description (PyObject *self, void *closure)
 
static PyObjectconnpy_get_connection_details (PyObject *self, void *closure)
 
int gdbpy_initialize_connection (void)
 
static PyObjectconnpy_send_packet (PyObject *self, PyObject *args, PyObject *kw)
 
void _initialize_py_connection ()
 

Variables

static std::map< process_stratum_target *, gdbpy_ref< connection_object > > all_connection_objects
 
static PyMethodDef connection_object_methods []
 
static PyMethodDef remote_connection_object_methods []
 
static gdb_PyGetSetDef connection_object_getset []
 
PyTypeObject connection_object_type
 
PyTypeObject remote_connection_object_type
 

Macro Definition Documentation

◆ CONNPY_REQUIRE_VALID

#define CONNPY_REQUIRE_VALID (   connection)
Value:
do { \
if (connection->target == nullptr) \
{ \
PyErr_SetString (PyExc_RuntimeError, \
_("Connection no longer exists.")); \
return nullptr; \
} \
} while (0)

Definition at line 56 of file py-connection.c.

Function Documentation

◆ _initialize_py_connection()

void _initialize_py_connection ( )

Definition at line 444 of file py-connection.c.

Referenced by initialize_all_files().

◆ connpy_connection_dealloc()

static void connpy_connection_dealloc ( PyObject obj)
static

Definition at line 182 of file py-connection.c.

References connection_object::target.

◆ connpy_connection_removed()

static void connpy_connection_removed ( process_stratum_target target)
static

◆ connpy_get_connection_details()

static PyObject * connpy_get_connection_details ( PyObject self,
void *  closure 
)
static

◆ connpy_get_connection_num()

static PyObject * connpy_get_connection_num ( PyObject self,
void *  closure 
)
static

◆ connpy_get_connection_type()

static PyObject * connpy_get_connection_type ( PyObject self,
void *  closure 
)
static

◆ connpy_get_description()

static PyObject * connpy_get_description ( PyObject self,
void *  closure 
)
static

◆ connpy_is_valid()

static PyObject * connpy_is_valid ( PyObject self,
PyObject args 
)
static

Definition at line 220 of file py-connection.c.

References connection_object::target.

◆ connpy_repr()

static PyObject * connpy_repr ( PyObject obj)
static

◆ connpy_send_packet()

static PyObject * connpy_send_packet ( PyObject self,
PyObject args,
PyObject kw 
)
static

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF() [1/2]

PyTypeObject connection_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "connection_object"  )

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF() [2/2]

PyTypeObject remote_connection_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "remote_connection_object"  )

◆ emit_connection_event()

static int emit_connection_event ( process_stratum_target target,
eventregistry_object registry 
)
static

◆ gdbpy_connections()

PyObject * gdbpy_connections ( PyObject self,
PyObject args 
)

◆ gdbpy_initialize_connection()

int gdbpy_initialize_connection ( void  )

◆ target_to_connection_object()

gdbpy_ref target_to_connection_object ( process_stratum_target target)

Variable Documentation

◆ all_connection_objects

std::map<process_stratum_target *, gdbpy_ref<connection_object> > all_connection_objects
static

Definition at line 70 of file py-connection.c.

Referenced by connpy_connection_removed(), and target_to_connection_object().

◆ connection_object_getset

gdb_PyGetSetDef connection_object_getset[]
static
Initial value:
=
{
{ "num", connpy_get_connection_num, NULL,
"ID number of this connection, as assigned by GDB.", NULL },
{ "type", connpy_get_connection_type, NULL,
"A short string that is the name for this connection type.", NULL },
{ "description", connpy_get_description, NULL,
"A longer string describing this connection type.", NULL },
{ "details", connpy_get_connection_details, NULL,
"A string containing additional connection details.", NULL },
{ NULL }
}
static PyObject * connpy_get_connection_num(PyObject *self, void *closure)
static PyObject * connpy_get_description(PyObject *self, void *closure)
static PyObject * connpy_get_connection_type(PyObject *self, void *closure)
static PyObject * connpy_get_connection_details(PyObject *self, void *closure)

Definition at line 473 of file py-connection.c.

◆ connection_object_methods

PyMethodDef connection_object_methods[]
static
Initial value:
=
{
{ "is_valid", connpy_is_valid, METH_NOARGS,
"is_valid () -> Boolean.\n\
Return true if this TargetConnection is valid, false if not." },
{ NULL }
}
static PyObject * connpy_is_valid(PyObject *self, PyObject *args)

Definition at line 452 of file py-connection.c.

◆ connection_object_type

PyTypeObject connection_object_type

Definition at line 488 of file py-connection.c.

Referenced by gdbpy_initialize_connection(), and target_to_connection_object().

◆ remote_connection_object_methods

PyMethodDef remote_connection_object_methods[]
static
Initial value:
=
{
{ "send_packet", (PyCFunction) connpy_send_packet,
METH_VARARGS | METH_KEYWORDS,
"send_packet (PACKET) -> Bytes\n\
Send PACKET to a remote target, return the reply as a bytes array." },
{ NULL }
}
static PyObject * connpy_send_packet(PyObject *self, PyObject *args, PyObject *kw)

Definition at line 462 of file py-connection.c.

◆ remote_connection_object_type

PyTypeObject remote_connection_object_type

Definition at line 531 of file py-connection.c.

Referenced by gdbpy_initialize_connection(), and target_to_connection_object().