GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
py-micmd.c File Reference
#include "defs.h"
#include "python-internal.h"
#include "arch-utils.h"
#include "charset.h"
#include "language.h"
#include "mi/mi-cmds.h"
#include "mi/mi-parse.h"
#include "cli/cli-cmds.h"
#include <string>

Go to the source code of this file.

Classes

struct  micmdpy_object
 
struct  mi_command_py
 

Macros

#define pymicmd_debug_printf(fmt, ...)    debug_prefixed_printf_cond (pymicmd_debug, "py-micmd", fmt, ##__VA_ARGS__)
 
#define PYMICMD_SCOPED_DEBUG_ENTER_EXIT    scoped_debug_enter_exit (pymicmd_debug, "py-micmd")
 

Typedefs

using mi_command_py_up = std::unique_ptr<mi_command_py>
 

Functions

static void show_pymicmd_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
PyTypeObject micmdpy_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("micmdpy_object")
 
static gdb::unique_xmalloc_ptr< char > py_object_to_mi_key (PyObject *key_obj)
 
static void serialize_mi_result_1 (PyObject *result, const char *field_name)
 
static void serialize_mi_result (PyObject *result)
 
static mi_command_pyas_mi_command_py (mi_command *cmd)
 
static int micmdpy_uninstall_command (micmdpy_object *obj)
 
static int micmdpy_install_command (micmdpy_object *obj)
 
static int micmdpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
 
static void micmdpy_dealloc (PyObject *obj)
 
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_micommands ()
 
static void gdbpy_finalize_micommands ()
 
static PyObjectmicmdpy_get_name (PyObject *self, void *closure)
 
static PyObjectmicmdpy_get_installed (PyObject *self, void *closure)
 
static int micmdpy_set_installed (PyObject *self, PyObject *newvalue, void *closure)
 
void _initialize_py_micmd ()
 
 GDBPY_INITIALIZE_FILE (gdbpy_initialize_micommands, gdbpy_finalize_micommands)
 

Variables

static bool pymicmd_debug
 
static PyObjectinvoke_cst
 
static gdb_PyGetSetDef micmdpy_object_getset []
 
PyTypeObject micmdpy_object_type
 

Macro Definition Documentation

◆ pymicmd_debug_printf

#define pymicmd_debug_printf ( fmt,
... )    debug_prefixed_printf_cond (pymicmd_debug, "py-micmd", fmt, ##__VA_ARGS__)

◆ PYMICMD_SCOPED_DEBUG_ENTER_EXIT

#define PYMICMD_SCOPED_DEBUG_ENTER_EXIT    scoped_debug_enter_exit (pymicmd_debug, "py-micmd")

Typedef Documentation

◆ mi_command_py_up

using mi_command_py_up = std::unique_ptr<mi_command_py>

Definition at line 167 of file py-micmd.c.

Function Documentation

◆ _initialize_py_micmd()

void _initialize_py_micmd ( )

Definition at line 747 of file py-micmd.c.

Referenced by initialize_all_files().

◆ as_mi_command_py()

static mi_command_py * as_mi_command_py ( mi_command * cmd)
static

Definition at line 414 of file py-micmd.c.

Referenced by gdbpy_finalize_micommands(), and micmdpy_install_command().

◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject micmdpy_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ( "micmdpy_object" )
extern

◆ gdbpy_finalize_micommands()

static void gdbpy_finalize_micommands ( )
static

Definition at line 636 of file py-micmd.c.

References as_mi_command_py(), and remove_mi_cmd_entries().

◆ GDBPY_INITIALIZE_FILE()

◆ gdbpy_initialize_micommands()

static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_micommands ( )
static

Definition at line 615 of file py-micmd.c.

References gdb_module, gdb_pymodule_addobject(), invoke_cst, and micmdpy_object_type.

◆ micmdpy_dealloc()

static void micmdpy_dealloc ( PyObject * obj)
static

◆ micmdpy_get_installed()

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

Definition at line 665 of file py-micmd.c.

References micmdpy_object::mi_command.

◆ micmdpy_get_name()

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

Definition at line 651 of file py-micmd.c.

References micmdpy_object::mi_command_name.

◆ micmdpy_init()

static int micmdpy_init ( PyObject * self,
PyObject * args,
PyObject * kwargs )
static

◆ micmdpy_install_command()

static int micmdpy_install_command ( micmdpy_object * obj)
static

◆ micmdpy_set_installed()

static int micmdpy_set_installed ( PyObject * self,
PyObject * newvalue,
void * closure )
static

◆ micmdpy_uninstall_command()

static int micmdpy_uninstall_command ( micmdpy_object * obj)
static

◆ py_object_to_mi_key()

static gdb::unique_xmalloc_ptr< char > py_object_to_mi_key ( PyObject * key_obj)
static

◆ serialize_mi_result()

static void serialize_mi_result ( PyObject * result)
static

Definition at line 331 of file py-micmd.c.

References gdbpy_error(), py_object_to_mi_key(), serialize_mi_result_1(), and value.

Referenced by mi_command_py::invoke().

◆ serialize_mi_result_1()

static void serialize_mi_result_1 ( PyObject * result,
const char * field_name )
static

◆ show_pymicmd_debug()

static void show_pymicmd_debug ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 39 of file py-micmd.c.

References gdb_printf().

Variable Documentation

◆ invoke_cst

PyObject* invoke_cst
static

Definition at line 174 of file py-micmd.c.

Referenced by gdbpy_initialize_micommands(), and mi_command_py::invoke().

◆ micmdpy_object_getset

gdb_PyGetSetDef micmdpy_object_getset[]
static
Initial value:
= {
{ "name", micmdpy_get_name, nullptr, "The command's name.", nullptr },
"Is this command installed for use.", nullptr },
{ nullptr }
}
static PyObject * micmdpy_get_installed(PyObject *self, void *closure)
Definition py-micmd.c:665
static int micmdpy_set_installed(PyObject *self, PyObject *newvalue, void *closure)
Definition py-micmd.c:681
static PyObject * micmdpy_get_name(PyObject *self, void *closure)
Definition py-micmd.c:651

Definition at line 697 of file py-micmd.c.

◆ micmdpy_object_type

PyTypeObject micmdpy_object_type

Definition at line 706 of file py-micmd.c.

Referenced by gdbpy_initialize_micommands().

◆ pymicmd_debug

bool pymicmd_debug
static

Definition at line 34 of file py-micmd.c.