GDB (xrefs)

Classes | Typedefs | Functions | Variables
py-param.c File Reference
`#include "defs.h"`
`#include "value.h"`
`#include "python-internal.h"`
`#include "charset.h"`
`#include "gdbcmd.h"`
`#include "cli/cli-decode.h"`
`#include "completer.h"`
`#include "language.h"`
`#include "arch-utils.h"`
`#include "py-ref.h"`

Go to the source code of this file.

## Classes
struct | parm_constant
union | parmpy_variable
struct | parmpy_object

## Typedefs
typedef struct parmpy_object | parmpy_object

## Functions
PyTypeObject parmpy_object_type | CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("parmpy_object")
static PyObject * | get_attr (PyObject *obj, PyObject *attr_name)
static int | set_parameter_value (parmpy_object *self, PyObject *value)
static int | set_attr (PyObject *obj, PyObject *attr_name, PyObject *val)
static gdb::unique_xmalloc_ptr< char > | get_doc_string (PyObject *object, PyObject *attr)
static gdb::unique_xmalloc_ptr< char > | call_doc_function (PyObject *obj, PyObject *method, PyObject *arg)
static void | get_set_value (const char *args, int from_tty, struct cmd_list_element *c)
static void | get_show_value (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | add_setshow_generic (int parmclass, enum command_class cmdclass, char *cmd_name, parmpy_object *self, char *set_doc, char *show_doc, char *help_doc, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static int | compute_enum_values (parmpy_object *self, PyObject *enum_values)
static int | parmpy_init (PyObject *self, PyObject *args, PyObject *kwds)
int | gdbpy_initialize_parameters (void)

## Variables
struct parm_constant | parm_constants []
static PyObject * | set_doc_cst
static PyObject * | show_doc_cst
PyTypeObject | parmpy_object_type

## Typedef Documentation

## ◆ parmpy_object

typedef struct parmpy_object parmpy_object

Definition at line 90 of file py-param.c.

## Function Documentation

## ◆ add_setshow_generic()

static void add_setshow_generic | ( | int | parmclass,
|  | enum command_class | cmdclass,
|  | char * | cmd_name,
|  | parmpy_object * | self,
|  | char * | set_doc,
|  | char * | show_doc,
|  | char * | help_doc,
|  | struct cmd_list_element ** | set_list,
|  | struct cmd_list_element ** | show_list
| ) |  |
| static

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

References add_setshow_auto_boolean_cmd(), add_setshow_boolean_cmd(), add_setshow_enum_cmd(), add_setshow_filename_cmd(), add_setshow_integer_cmd(), add_setshow_optional_filename_cmd(), add_setshow_string_cmd(), add_setshow_string_noescape_cmd(), add_setshow_uinteger_cmd(), add_setshow_zinteger_cmd(), get_set_value(), get_show_value(), lookup_cmd(), set_cmd_context(), var_auto_boolean, var_boolean, var_enum, var_filename, var_integer, var_optional_filename, var_string, var_string_noescape, var_uinteger, and var_zinteger.

Referenced by parmpy_init().

## ◆ call_doc_function()

static gdb::unique_xmalloc_ptr<char> call_doc_function | ( | PyObject * | obj,
|  | PyObject * | method,
|  | PyObject * | arg
| ) |  |
| static

Definition at line 329 of file py-param.c.

References _, gdbpy_is_string(), gdb::ref_ptr< T, Policy >::get(), and python_string_to_host_string().

Referenced by get_set_value(), and get_show_value().

## ◆ compute_enum_values()

static int compute_enum_values | ( | parmpy_object * | self,
|  | PyObject * | enum_values
| ) |  |
| static

Definition at line 555 of file py-param.c.

References _, gdbpy_is_string(), gdb::ref_ptr< T, Policy >::get(), gdb_argv::get(), python_string_to_host_string(), gdb_argv::release(), size, and XCNEWVEC.

Referenced by parmpy_init().

## ◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject parmpy_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "parmpy_object" |  | ) |

## ◆ gdbpy_initialize_parameters()

int gdbpy_initialize_parameters | ( | void |  | ) |

Definition at line 729 of file py-param.c.

References gdb_module, gdb_pymodule_addobject(), parm_constant::name, name, parm_constants, parmpy_object_type, set_doc_cst, and show_doc_cst.

Referenced by do_start_initialization().

## ◆ get_attr()

static PyObject* get_attr | ( | PyObject * | obj,
|  | PyObject * | attr_name
| ) |  |
| static

Definition at line 103 of file py-param.c.

References gdbpy_parameter_value().

## ◆ get_doc_string()

static gdb::unique_xmalloc_ptr<char> get_doc_string | ( | PyObject * | object,
|  | PyObject * | attr
| ) |  |
| static

Definition at line 304 of file py-param.c.

References _, gdbpy_is_string(), gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), and python_string_to_host_string().

Referenced by get_set_value(), get_show_value(), and parmpy_init().

## ◆ get_set_value()

static void get_set_value | ( | const char * | args,
|  | int | from_tty,
|  | struct cmd_list_element * | c
| ) |  |
| static

Definition at line 360 of file py-param.c.

References call_doc_function(), current_language, fprintf_filtered(), gdb_stdout, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), get_cmd_context(), get_current_arch(), get_doc_string(), and set_doc_cst.

Referenced by add_setshow_generic().

## ◆ get_show_value()

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

Definition at line 402 of file py-param.c.

References call_doc_function(), current_language, fprintf_filtered(), gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), get_cmd_context(), get_current_arch(), get_doc_string(), show_doc_cst, and parmpy_object::value.

Referenced by add_setshow_generic().

## ◆ parmpy_init()

static int parmpy_init | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kwds
| ) |  |
| static

Definition at line 631 of file py-param.c.

References _, add_setshow_generic(), CATCH, class_breakpoint, class_files, class_info, class_maintenance, class_obscure, class_run, class_stack, class_support, class_trace, class_vars, compute_enum_values(), cmd_list_element::doc, END_CATCH, parmpy_object::enumeration, gdbpy_doc_cst, gdbpy_parse_command_name(), get_doc_string(), memset(), name, no_class, Py_DECREF, RETURN_MASK_ALL, RETURN_QUIT, set_doc_cst, setlist, show_doc_cst, showlist, TRY, parmpy_object::type, parmpy_object::value, var_auto_boolean, var_boolean, var_enum, var_filename, var_integer, var_optional_filename, var_string, var_string_noescape, var_uinteger, var_zinteger, and xfree().

## ◆ set_attr()

static int set_attr | ( | PyObject * | obj,
|  | PyObject * | attr_name,
|  | PyObject * | val
| ) |  |
| static

Definition at line 279 of file py-param.c.

References _, and set_parameter_value().

## ◆ set_parameter_value()

static int set_parameter_value | ( | parmpy_object * | self,
|  | PyObject * | value
| ) |  |
| static

Definition at line 123 of file py-param.c.

References _, AUTO_BOOLEAN_AUTO, AUTO_BOOLEAN_FALSE, AUTO_BOOLEAN_TRUE, gdb_py_int_as_long(), gdbpy_is_string(), INT_MAX, INT_MIN, python_string_to_host_string(), string, UINT_MAX, var_auto_boolean, var_boolean, var_enum, var_filename, var_integer, var_optional_filename, var_string, var_string_noescape, var_uinteger, var_zinteger, and xfree().

Referenced by set_attr().

## Variable Documentation

## ◆ parm_constants

struct parm_constant parm_constants[]

Initial value:
=
{
{ "PARAM_BOOLEAN", var_boolean },
{ "PARAM_AUTO_BOOLEAN", var_auto_boolean },
{ "PARAM_UINTEGER", var_uinteger },
{ "PARAM_INTEGER", var_integer },
{ "PARAM_STRING", var_string },
{ "PARAM_STRING_NOESCAPE", var_string_noescape },
{ "PARAM_OPTIONAL_FILENAME", var_optional_filename },
{ "PARAM_FILENAME", var_filename },
{ "PARAM_ZINTEGER", var_zinteger },
{ "PARAM_ENUM", var_enum },
{ NULL, 0 }
}
var_uinteger
Definition: command.h:78
var_zinteger
Definition: command.h:101
var_string_noescape
Definition: command.h:92
var_optional_filename
Definition: command.h:95
var_integer
Definition: command.h:84
var_auto_boolean
Definition: command.h:74
var_enum
Definition: command.h:112
var_filename
Definition: command.h:98
var_string
Definition: command.h:89
var_boolean
Definition: command.h:67

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

Referenced by gdbpy_initialize_parameters().

## ◆ parmpy_object_type

PyTypeObject parmpy_object_type

Definition at line 758 of file py-param.c.

Referenced by gdbpy_initialize_parameters().

## ◆ set_doc_cst

PyObject* set_doc_cst
| static

Definition at line 96 of file py-param.c.

Referenced by gdbpy_initialize_parameters(), get_set_value(), and parmpy_init().

## ◆ show_doc_cst

PyObject* show_doc_cst
| static

Definition at line 97 of file py-param.c.

Referenced by gdbpy_initialize_parameters(), get_show_value(), and parmpy_init().