96 PyErr_SetString (PyExc_RuntimeError,
97 _(
"Unexpected value. Expecting a " 98 "gdb.Symbol or a Python string."));
140 if (vresult == Py_None)
244 int should_print = 0;
312 if (result == Py_None)
318 return PyObject_GetIter (result.
get ());
346 const char *sym_name,
351 int print_args_field,
359 if (fa->
val == NULL && fa->
error == NULL)
379 if (print_args_field || args_type !=
NO_VALUES)
380 maybe_tuple.
emplace (out,
nullptr);
393 DMGL_PARAMS | DMGL_ANSI);
400 DMGL_PARAMS | DMGL_ANSI);
416 if (print_args_field)
447 _(
"<error reading variable: %s>"),
481 int print_args_field,
512 if (item == NULL && PyErr_Occurred ())
520 struct block *sym_block;
524 success =
extract_sym (item.get (), &sym_name, &sym, &sym_block,
547 PyErr_SetString (PyExc_RuntimeError,
548 _(
"No symbol or value provided."));
601 args_type, print_args_field, NULL)
619 args_type, print_args_field,
628 item.reset (PyIter_Next (iter));
642 else if (PyErr_Occurred ())
677 int print_args_field,
692 struct block *sym_block;
693 int local_indent = 8 + (8 * indent);
733 if (print_args_field || args_type !=
NO_VALUES)
741 out->
spaces (local_indent);
766 int val_indent = (indent + 1) * 4;
794 if (!PyErr_Occurred ())
810 if (args_iter == NULL)
814 if (locals_iter == NULL)
819 if (args_iter != Py_None
824 if (locals_iter != Py_None
844 if (locals_iter == NULL)
849 if (locals_iter != Py_None
869 if (args_iter == NULL)
887 if (args_iter != Py_None
925 struct ui_out *out,
int indent, htab_t levels_printed)
948 if (py_inf_frame == NULL)
1009 if (paddr != Py_None)
1026 slot = (
struct frame_info **) htab_find_slot (levels_printed,
1081 const char *
function = NULL;
1083 if (py_func == NULL)
1090 if (function_to_free == NULL)
1093 function = function_to_free.get ();
1095 else if (PyLong_Check (py_func.
get ()))
1104 if (msymbol.
minsym != NULL)
1107 else if (py_func != Py_None)
1109 PyErr_SetString (PyExc_RuntimeError,
1110 _(
"FrameDecorator.function: expecting a " \
1111 "String, integer or None."));
1118 if (
function == NULL)
1162 if (py_fn != Py_None)
1167 if (filename == NULL)
1192 if (py_line == NULL)
1195 if (py_line != Py_None)
1197 line = PyLong_AsLong (py_line.
get ());
1198 if (PyErr_Occurred ())
1247 if (elided != Py_None)
1256 while ((item = PyIter_Next (elided.
get ())))
1268 if (item == NULL && PyErr_Occurred ())
1281 int frame_low,
int frame_high)
1284 if (frame_obj == NULL)
1287 gdbpy_ref<> module (PyImport_ImportModule (
"gdb.frames"));
1292 "execute_frame_filters"));
1293 if (sort_func == NULL)
1296 gdbpy_ref<> py_frame_low (PyInt_FromLong (frame_low));
1297 if (py_frame_low == NULL)
1300 gdbpy_ref<> py_frame_high (PyInt_FromLong (frame_high));
1301 if (py_frame_high == NULL)
1304 gdbpy_ref<> iterable (PyObject_CallFunctionObjArgs (sort_func.
get (),
1306 py_frame_low.
get (),
1307 py_frame_high.
get (),
1309 if (iterable == NULL)
1312 if (iterable != Py_None)
1313 return PyObject_GetIter (iterable.
get ());
1337 struct ui_out *out,
int frame_low,
int frame_high)
1361 if (iterable == NULL)
1383 if (iterable == Py_None)
1386 htab_up levels_printed (htab_create (20,
1397 if (PyErr_Occurred ())
1406 levels_printed.get ());
void annotate_frame_function_name(void)
#define PyObject_GetAttrString(obj, attr)
void fprintf_symbol_filtered(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
void annotate_frame_source_file_end(void)
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
#define SYMBOL_PRINT_NAME(symbol)
void field_string(const char *fldname, const char *string)
int gdbpy_is_string(PyObject *obj)
void void wrap_hint(const char *identstring)
enum ext_lang_bt_status gdbpy_apply_frame_filter(const struct extension_language_defn *extlang, struct frame_info *frame, int flags, enum ext_lang_frame_args args_type, struct ui_out *out, int frame_low, int frame_high)
void annotate_arg_begin(void)
void field_skip(const char *fldname)
void common_val_print(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
#define SYMBOL_CLASS(symbol)
const struct language_defn * language_def(enum language lang)
PyObject * frame_info_to_frame_object(struct frame_info *frame)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
static enum ext_lang_bt_status py_mi_print_variables(PyObject *filter, struct ui_out *out, struct value_print_options *opts, enum ext_lang_frame_args args_type, struct frame_info *frame)
struct symbol * symbol_object_to_symbol(PyObject *obj)
void annotate_arg_value(struct type *type)
void text(const char *string)
static enum ext_lang_bt_status py_print_locals(PyObject *filter, struct ui_out *out, enum ext_lang_frame_args args_type, int indent, struct frame_info *frame)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
#define MSYMBOL_PRINT_NAME(symbol)
static enum ext_lang_bt_status py_print_single_arg(struct ui_out *out, const char *sym_name, struct frame_arg *fa, struct value *fv, const struct value_print_options *opts, enum ext_lang_frame_args args_type, int print_args_field, const struct language_defn *language)
void annotate_frame_address(void)
const char print_entry_values_no[]
void annotate_frame_args(void)
void annotate_frame_source_file(void)
struct type * check_typedef(struct type *type)
#define CATCH(EXCEPTION, MASK)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
struct value * read_var_value(struct symbol *var, const struct block *var_block, struct frame_info *frame)
static enum ext_lang_bt_status py_print_args(PyObject *filter, struct ui_out *out, enum ext_lang_frame_args args_type, struct frame_info *frame)
std::unique_ptr< htab, htab_deleter > htab_up
const char print_entry_values_compact[]
static PyObject * bootstrap_python_frame_filters(struct frame_info *frame, int frame_low, int frame_high)
void field_stream(const char *fldname, string_file &stream)
int gdb_python_initialized
gdb::unique_xmalloc_ptr< char > python_string_to_host_string(PyObject *obj)
virtual void puts(const char *str)
void void spaces(int numspaces)
void annotate_frame_begin(int level, struct gdbarch *gdbarch, CORE_ADDR pc)
void read_frame_arg(struct symbol *sym, struct frame_info *frame, struct frame_arg *argp, struct frame_arg *entryargp)
static void print_args(struct field *args, int nargs, int spaces)
T & emplace(Args &&... args)
const struct language_defn * current_language
const char print_entry_values_only[]
void annotate_arg_end(void)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
static enum ext_lang_bt_status py_print_frame(PyObject *filter, int flags, enum ext_lang_frame_args args_type, struct ui_out *out, int indent, htab_t levels_printed)
void annotate_frame_end(void)
void gdbpy_convert_exception(struct gdb_exception exception)
int frame_relative_level(struct frame_info *fi)
#define TYPE_CODE(thistype)
void annotate_frame_source_begin(void)
void field_int(const char *fldname, int value)
void annotate_frame_address_end(void)
struct minimal_symbol * minsym
void gdbpy_print_stack(void)
void get_user_print_options(struct value_print_options *opts)
struct value * convert_value_from_python(PyObject *obj)
#define SYMBOL_LANGUAGE(symbol)
void annotate_frame_source_line(void)
static enum ext_lang_bt_status py_print_type(struct ui_out *out, struct value *val)
static int mi_should_print(struct symbol *sym, enum mi_print_types type)
static enum ext_lang_bt_status extract_sym(PyObject *obj, gdb::unique_xmalloc_ptr< char > *name, struct symbol **sym, struct block **sym_block, const struct language_defn **language)
int get_addr_from_python(PyObject *obj, CORE_ADDR *addr)
struct type * value_type(const struct value *value)
void annotate_arg_name_end(void)
void field_fmt_int(int width, ui_align align, const char *fldname, int value)
const struct language_defn * python_language
#define PyObject_CallMethod
static enum ext_lang_bt_status extract_value(PyObject *obj, struct value **value)
struct frame_info * frame_object_to_frame_info(PyObject *obj)
void print_frame_info(struct frame_info *, int print_level, enum print_what print_what, int args, int set_current_sal)
static enum ext_lang_bt_status py_print_value(struct ui_out *out, struct value *val, const struct value_print_options *opts, int indent, enum ext_lang_frame_args args_type, const struct language_defn *language)
static enum ext_lang_bt_status enumerate_locals(PyObject *iter, struct ui_out *out, int indent, enum ext_lang_frame_args args_type, int print_args_field, struct frame_info *frame)
static PyObject * get_py_iter_from_func(PyObject *filter, const char *func)
static enum ext_lang_bt_status enumerate_args(PyObject *iter, struct ui_out *out, enum ext_lang_frame_args args_type, int print_args_field, struct frame_info *frame)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
#define PyObject_HasAttrString(obj, attr)
#define SYMBOL_IS_ARGUMENT(symbol)
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3