68 result = PyString_FromString (self_string->
encoding);
83 return PyLong_FromLong (self_string->
length);
98 struct value *val = NULL;
103 _(
"Cannot create a value from NULL."));
134 if (address == 0 && length != 0)
137 _(
"Cannot create a lazy string with address 0x0, " \
138 "and a non-zero length."));
144 PyErr_SetString (PyExc_RuntimeError,
145 _(
"A lazy string's type cannot be NULL."));
155 if (encoding == NULL || !strcmp (encoding,
""))
158 str_obj->
encoding = xstrdup (encoding);
161 return (PyObject *) str_obj;
189 struct type **str_type,
199 *str_type = lazy->
type;
208 "Create a (lazy) value that contains a pointer to the string." },
217 {
"type",
stpy_get_type, NULL,
"Type associated with the string.", NULL },
242 "GDB lazy string object",
249 lazy_string_object_methods,
251 lazy_string_object_getset
static PyObject * stpy_get_encoding(PyObject *self, void *closure)
static PyObject * stpy_get_address(PyObject *self, void *closure)
static PyObject * stpy_convert_to_value(PyObject *self, PyObject *args)
int gdbpy_initialize_lazy_string(void)
#define gdb_py_long_from_ulongest
PyTypeObject lazy_string_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF("lazy_string_object")
static void stpy_dealloc(PyObject *self)
#define GDB_PY_HANDLE_EXCEPTION(Exception)
static PyMethodDef lazy_string_object_methods[]
#define CATCH(EXCEPTION, MASK)
PyObject * value_to_value_object(struct value *val)
struct value * value_at_lazy(struct type *type, CORE_ADDR addr)
static PyObject * stpy_get_length(PyObject *self, void *closure)
PyTypeObject lazy_string_object_type
int gdbpy_is_lazy_string(PyObject *result)
PyObject * gdbpy_gdb_memory_error
PyObject * gdbpy_create_lazy_string_object(CORE_ADDR address, long length, const char *encoding, struct type *type)
static PyObject * stpy_get_type(PyObject *self, void *closure)
PyObject_HEAD CORE_ADDR address
void gdbpy_extract_lazy_string(PyObject *string, CORE_ADDR *addr, struct type **str_type, long *length, char **encoding)
static PyGetSetDef lazy_string_object_getset[]
#define PyVarObject_HEAD_INIT(type, size)
PyObject * type_to_type_object(struct type *type)