GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
py-prettyprint.c File Reference
#include "defs.h"
#include "objfiles.h"
#include "symtab.h"
#include "language.h"
#include "valprint.h"
#include "extension-priv.h"
#include "python.h"
#include "python-internal.h"
#include "cli/cli-style.h"

Go to the source code of this file.

Classes

struct  printer_object
 

Enumerations

enum  gdbpy_string_repr_result { string_repr_none , string_repr_error , string_repr_ok }
 

Functions

static gdbpy_ref search_pp_list (PyObject *list, PyObject *value)
 
static PyObjectfind_pretty_printer_from_objfiles (PyObject *value)
 
static gdbpy_ref find_pretty_printer_from_progspace (PyObject *value)
 
static gdbpy_ref find_pretty_printer_from_gdb (PyObject *value)
 
static gdbpy_ref find_pretty_printer (PyObject *value)
 
static gdbpy_ref pretty_print_one_value (PyObject *printer, struct value **out_value)
 
gdb::unique_xmalloc_ptr< char > gdbpy_get_display_hint (PyObject *printer)
 
static void print_stack_unless_memory_error (struct ui_file *stream)
 
static enum gdbpy_string_repr_result print_string_repr (PyObject *printer, const char *hint, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language, struct gdbarch *gdbarch)
 
static void print_children (PyObject *printer, const char *hint, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language, int is_py_none)
 
enum ext_lang_rc gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
 
gdbpy_ref apply_varobj_pretty_printer (PyObject *printer_obj, struct value **replacement, struct ui_file *stream, const value_print_options *opts)
 
gdbpy_ref gdbpy_get_varobj_pretty_printer (struct value *value)
 
PyObjectgdbpy_default_visualizer (PyObject *self, PyObject *args)
 
static int set_boolean (PyObject *dict, const char *name, bool val)
 
static int set_unsigned (PyObject *dict, const char *name, unsigned int val)
 
PyObjectgdbpy_print_options (PyObject *unused1, PyObject *unused2)
 
void gdbpy_get_print_options (value_print_options *opts)
 
static int gdbpy_initialize_prettyprint ()
 
 GDBPY_INITIALIZE_FILE (gdbpy_initialize_prettyprint)
 

Variables

PyTypeObject printer_object_type
 
const struct value_print_optionsgdbpy_current_print_options
 

Enumeration Type Documentation

◆ gdbpy_string_repr_result

Enumerator
string_repr_none 
string_repr_error 
string_repr_ok 

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

Function Documentation

◆ apply_varobj_pretty_printer()

gdbpy_ref apply_varobj_pretty_printer ( PyObject * printer_obj,
struct value ** replacement,
struct ui_file * stream,
const value_print_options * opts )

◆ find_pretty_printer()

static gdbpy_ref find_pretty_printer ( PyObject * value)
static

◆ find_pretty_printer_from_gdb()

static gdbpy_ref find_pretty_printer_from_gdb ( PyObject * value)
static

Definition at line 150 of file py-prettyprint.c.

References gdb_python_module, and search_pp_list().

Referenced by find_pretty_printer().

◆ find_pretty_printer_from_objfiles()

static PyObject * find_pretty_printer_from_objfiles ( PyObject * value)
static

◆ find_pretty_printer_from_progspace()

static gdbpy_ref find_pretty_printer_from_progspace ( PyObject * value)
static

◆ gdbpy_apply_val_pretty_printer()

enum ext_lang_rc gdbpy_apply_val_pretty_printer ( const struct extension_language_defn * extlang,
struct value * value,
struct ui_file * stream,
int recurse,
const struct value_print_options * options,
const struct language_defn * language )

◆ gdbpy_default_visualizer()

PyObject * gdbpy_default_visualizer ( PyObject * self,
PyObject * args )

Definition at line 678 of file py-prettyprint.c.

References find_pretty_printer(), value, and value_object_to_value().

◆ gdbpy_get_display_hint()

gdb::unique_xmalloc_ptr< char > gdbpy_get_display_hint ( PyObject * printer)

◆ gdbpy_get_print_options()

void gdbpy_get_print_options ( value_print_options * opts)

◆ gdbpy_get_varobj_pretty_printer()

gdbpy_ref gdbpy_get_varobj_pretty_printer ( struct value * value)

Definition at line 664 of file py-prettyprint.c.

References find_pretty_printer(), and value_to_value_object().

◆ GDBPY_INITIALIZE_FILE()

GDBPY_INITIALIZE_FILE ( gdbpy_initialize_prettyprint )

◆ gdbpy_initialize_prettyprint()

static int gdbpy_initialize_prettyprint ( )
static

Definition at line 838 of file py-prettyprint.c.

References gdb_module, gdb_pymodule_addobject(), and printer_object_type.

◆ gdbpy_print_options()

PyObject * gdbpy_print_options ( PyObject * unused1,
PyObject * unused2 )

◆ pretty_print_one_value()

static gdbpy_ref pretty_print_one_value ( PyObject * printer,
struct value ** out_value )
static

◆ print_children()

static void print_children ( PyObject * printer,
const char * hint,
struct ui_file * stream,
int recurse,
const struct value_print_options * options,
const struct language_defn * language,
int is_py_none )
static

◆ print_stack_unless_memory_error()

static void print_stack_unless_memory_error ( struct ui_file * stream)
static

◆ print_string_repr()

static enum gdbpy_string_repr_result print_string_repr ( PyObject * printer,
const char * hint,
struct ui_file * stream,
int recurse,
const struct value_print_options * options,
const struct language_defn * language,
struct gdbarch * gdbarch )
static

◆ search_pp_list()

static gdbpy_ref search_pp_list ( PyObject * list,
PyObject * value )
static

◆ set_boolean()

static int set_boolean ( PyObject * dict,
const char * name,
bool val )
static

Definition at line 698 of file py-prettyprint.c.

References name.

Referenced by gdbpy_print_options().

◆ set_unsigned()

static int set_unsigned ( PyObject * dict,
const char * name,
unsigned int val )
static

Definition at line 708 of file py-prettyprint.c.

References gdb_py_object_from_ulongest(), and name.

Referenced by gdbpy_print_options().

Variable Documentation

◆ gdbpy_current_print_options

const struct value_print_options* gdbpy_current_print_options

◆ printer_object_type

PyTypeObject printer_object_type

Definition at line 793 of file py-prettyprint.c.

Referenced by gdbpy_initialize_prettyprint().