GDB (xrefs)

Classes | Functions | Variables
py-lazy-string.c File Reference
`#include "defs.h"`
`#include "python-internal.h"`
`#include "charset.h"`
`#include "value.h"`
`#include "valprint.h"`
`#include "language.h"`

Go to the source code of this file.

## Classes
struct | lazy_string_object

## Functions
PyTypeObject lazy_string_object_type | CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("lazy_string_object")
static PyObject * | stpy_get_address (PyObject *self, void *closure)
static PyObject * | stpy_get_encoding (PyObject *self, void *closure)
static PyObject * | stpy_get_length (PyObject *self, void *closure)
static PyObject * | stpy_get_type (PyObject *self, void *closure)
static PyObject * | stpy_convert_to_value (PyObject *self, PyObject *args)
static void | stpy_dealloc (PyObject *self)
PyObject * | gdbpy_create_lazy_string_object (CORE_ADDR address, long length, const char *encoding, struct type *type)
int | gdbpy_initialize_lazy_string (void)
int | gdbpy_is_lazy_string (PyObject *result)
static struct type * | stpy_lazy_string_elt_type (lazy_string_object *lazy)
void | gdbpy_extract_lazy_string (PyObject *string, CORE_ADDR *addr, struct type **str_elt_type, long *length, gdb::unique_xmalloc_ptr< char > *encoding)

## Variables
static PyMethodDef | lazy_string_object_methods []
static gdb_PyGetSetDef | lazy_string_object_getset []
PyTypeObject | lazy_string_object_type

## Function Documentation

## ◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject lazy_string_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "lazy_string_object" |  | ) |

## ◆ gdbpy_create_lazy_string_object()

PyObject* gdbpy_create_lazy_string_object | ( | CORE_ADDR | address,
|  | long | length,
|  | const char * | encoding,
|  | struct type * | type
| ) |  |

Definition at line 169 of file py-lazy-string.c.

References _, lazy_string_object::address, check_typedef(), lazy_string_object::encoding, gdbpy_gdb_memory_error, get_array_bounds(), lazy_string_object_type, lazy_string_object::length, type::length, lazy_string_object::type, TYPE_CODE, TYPE_CODE_ARRAY, and type_to_type_object().

Referenced by valpy_lazy_string().

## ◆ gdbpy_extract_lazy_string()

void gdbpy_extract_lazy_string | ( | PyObject * | string,
|  | CORE_ADDR * | addr,
|  | struct type ** | str_elt_type,
|  | long * | length,
|  | gdb::unique_xmalloc_ptr< char > * | encoding
| ) |  |

Definition at line 277 of file py-lazy-string.c.

References lazy_string_object::address, lazy_string_object::encoding, gdb_assert, gdbpy_is_lazy_string(), lazy_string_object::length, type::length, and stpy_lazy_string_elt_type().

Referenced by print_children(), print_string_repr(), and varobj_value_get_print_value().

## ◆ gdbpy_initialize_lazy_string()

int gdbpy_initialize_lazy_string | ( | void |  | ) |

Definition at line 233 of file py-lazy-string.c.

References lazy_string_object_type.

Referenced by do_start_initialization().

## ◆ gdbpy_is_lazy_string()

int gdbpy_is_lazy_string | ( | PyObject * | result | ) |

Definition at line 245 of file py-lazy-string.c.

References lazy_string_object_type.

Referenced by convert_value_from_python(), gdbpy_extract_lazy_string(), pretty_print_one_value(), print_children(), print_string_repr(), and varobj_value_get_print_value().

## ◆ stpy_convert_to_value()

static PyObject* stpy_convert_to_value | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 104 of file py-lazy-string.c.

References _, lazy_string_object::address, CATCH, check_typedef(), END_CATCH, gdb_assert, GDB_PY_HANDLE_EXCEPTION, gdbpy_gdb_memory_error, lazy_string_object::length, lookup_array_range_type(), RETURN_MASK_ALL, TRY, lazy_string_object::type, TYPE_CODE, TYPE_CODE_PTR, type_object_to_type(), TYPE_TARGET_TYPE, value_at_lazy(), value_from_pointer(), and value_to_value_object().

## ◆ stpy_dealloc()

static void stpy_dealloc | ( | PyObject * | self | ) |
| static

Definition at line 155 of file py-lazy-string.c.

References lazy_string_object::encoding, and xfree().

## ◆ stpy_get_address()

static PyObject* stpy_get_address | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 60 of file py-lazy-string.c.

References lazy_string_object::address, and gdb_py_long_from_ulongest.

## ◆ stpy_get_encoding()

static PyObject* stpy_get_encoding | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 68 of file py-lazy-string.c.

References lazy_string_object::encoding.

## ◆ stpy_get_length()

static PyObject* stpy_get_length | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 87 of file py-lazy-string.c.

References lazy_string_object::length.

## ◆ stpy_get_type()

static PyObject* stpy_get_type | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 95 of file py-lazy-string.c.

References lazy_string_object::type.

## ◆ stpy_lazy_string_elt_type()

static struct type* stpy_lazy_string_elt_type | ( | lazy_string_object * | lazy | ) |
| static

Definition at line 253 of file py-lazy-string.c.

References check_typedef(), gdb_assert, lazy_string_object::type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, type_object_to_type(), and TYPE_TARGET_TYPE.

Referenced by gdbpy_extract_lazy_string().

## Variable Documentation

## ◆ lazy_string_object_getset

gdb_PyGetSetDef lazy_string_object_getset[]
| static

Initial value:
= {
{ "address", stpy_get_address, NULL, "Address of the string.", NULL },
{ "encoding", stpy_get_encoding, NULL, "Encoding of the string.", NULL },
{ "length", stpy_get_length, NULL, "Length of the string.", NULL },
{ "type", stpy_get_type, NULL, "Type associated with the string.", NULL },
{ NULL }
}
stpy_get_encoding
static PyObject * stpy_get_encoding(PyObject *self, void *closure)
Definition: py-lazy-string.c:68
stpy_get_address
static PyObject * stpy_get_address(PyObject *self, void *closure)
Definition: py-lazy-string.c:60
stpy_get_length
static PyObject * stpy_get_length(PyObject *self, void *closure)
Definition: py-lazy-string.c:87
stpy_get_type
static PyObject * stpy_get_type(PyObject *self, void *closure)
Definition: py-lazy-string.c:95

Definition at line 303 of file py-lazy-string.c.

## ◆ lazy_string_object_methods

PyMethodDef lazy_string_object_methods[]
| static

Initial value:
= {
{ "value", stpy_convert_to_value, METH_NOARGS,
"Create a (lazy) value that contains a pointer to the string." },
{NULL}
}
stpy_convert_to_value
static PyObject * stpy_convert_to_value(PyObject *self, PyObject *args)
Definition: py-lazy-string.c:104

Definition at line 296 of file py-lazy-string.c.

## ◆ lazy_string_object_type

PyTypeObject lazy_string_object_type

Definition at line 311 of file py-lazy-string.c.

Referenced by gdbpy_create_lazy_string_object(), gdbpy_initialize_lazy_string(), and gdbpy_is_lazy_string().