GDB (xrefs)

Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/varobj.h File Reference
`#include "symtab.h"`
`#include "gdbtypes.h"`
`#include "vec.h"`

Go to the source code of this file.

## Classes
struct | varobj_update_result
struct | varobj
struct | lang_varobj_ops

## Macros
#define | CPLUS_FAKE_CHILD(x) ((x) != NULL && (x)->type == NULL && (x)->value == NULL)
#define | default_varobj_ops c_varobj_ops

## Enumerations
enum | varobj_display_formats { FORMAT_NATURAL, FORMAT_BINARY, FORMAT_DECIMAL, FORMAT_HEXADECIMAL, FORMAT_OCTAL, FORMAT_ZHEXADECIMAL }
enum | varobj_type { USE_SPECIFIED_FRAME, USE_CURRENT_FRAME, USE_SELECTED_FRAME }
enum | varobj_scope_status { VAROBJ_IN_SCOPE = 0, VAROBJ_NOT_IN_SCOPE = 1, VAROBJ_INVALID = 2 }

## Functions
struct varobj * | varobj_create (const char *objname, const char *expression, CORE_ADDR frame, enum varobj_type type)
std::string | varobj_gen_name (void)
struct varobj * | varobj_get_handle (const char *name)
const char * | varobj_get_objname (const struct varobj *var)
std::string | varobj_get_expression (const struct varobj *var)
int | varobj_delete (struct varobj *var, bool only_children)
enum varobj_display_formats | varobj_set_display_format (struct varobj *var, enum varobj_display_formats format)
enum varobj_display_formats | varobj_get_display_format (const struct varobj *var)
int | varobj_get_thread_id (const struct varobj *var)
void | varobj_set_frozen (struct varobj *var, bool frozen)
bool | varobj_get_frozen (const struct varobj *var)
void | varobj_get_child_range (const struct varobj *var, int *from, int *to)
void | varobj_set_child_range (struct varobj *var, int from, int to)
gdb::unique_xmalloc_ptr< char > | varobj_get_display_hint (const struct varobj *var)
int | varobj_get_num_children (struct varobj *var)
const std::vector< varobj * > & | varobj_list_children (struct varobj *var, int *from, int *to)
std::string | varobj_get_type (struct varobj *var)
struct type * | varobj_get_gdb_type (const struct varobj *var)
const char * | varobj_get_path_expr (const struct varobj *var)
const struct language_defn * | varobj_get_language (const struct varobj *var)
int | varobj_get_attributes (const struct varobj *var)
std::string | varobj_get_formatted_value (struct varobj *var, enum varobj_display_formats format)
std::string | varobj_get_value (struct varobj *var)
bool | varobj_set_value (struct varobj *var, const char *expression)
void | all_root_varobjs (void(*func)(struct varobj *var, void *data), void *data)
std::vector< varobj_update_result > | varobj_update (struct varobj **varp, bool is_explicit)
void | varobj_invalidate (void)
bool | varobj_editable_p (const struct varobj *var)
bool | varobj_floating_p (const struct varobj *var)
void | varobj_set_visualizer (struct varobj *var, const char *visualizer)
void | varobj_enable_pretty_printing (void)
bool | varobj_has_more (const struct varobj *var, int to)
bool | varobj_is_dynamic_p (const struct varobj *var)
bool | varobj_default_value_is_changeable_p (const struct varobj *var)
bool | varobj_value_is_changeable_p (const struct varobj *var)
struct type * | varobj_get_value_type (const struct varobj *var)
bool | varobj_is_anonymous_child (const struct varobj *child)
const struct varobj * | varobj_get_path_expr_parent (const struct varobj *var)
std::string | varobj_value_get_print_value (struct value *value, enum varobj_display_formats format, const struct varobj *var)
void | varobj_formatted_print_options (struct value_print_options *opts, enum varobj_display_formats format)
void | varobj_restrict_range (const std::vector< varobj *> &children, int *from, int *to)
bool | varobj_default_is_path_expr_parent (const struct varobj *var)

## Variables
const char * | varobj_format_string []
const struct lang_varobj_ops | c_varobj_ops
const struct lang_varobj_ops | cplus_varobj_ops
const struct lang_varobj_ops | ada_varobj_ops

## Macro Definition Documentation

## ◆ CPLUS_FAKE_CHILD

#define CPLUS_FAKE_CHILD | ( |  | x | ) | ((x) != NULL && (x)->type == NULL && (x)->value == NULL)

Definition at line 170 of file varobj.h.

Referenced by c_is_path_expr_parent(), construct_visualizer(), cplus_describe_child(), cplus_number_of_children(), cplus_value_of_variable(), install_default_visualizer(), install_new_value(), varobj_default_value_is_changeable_p(), and varobj_get_type().

## ◆ default_varobj_ops

#define default_varobj_ops c_varobj_ops

Definition at line 236 of file varobj.h.

## Enumeration Type Documentation

## ◆ varobj_display_formats

enum varobj_display_formats

Enumerator
FORMAT_NATURAL |
FORMAT_BINARY |
FORMAT_DECIMAL |
FORMAT_HEXADECIMAL |
FORMAT_OCTAL |
FORMAT_ZHEXADECIMAL |

Definition at line 25 of file varobj.h.

## ◆ varobj_scope_status

enum varobj_scope_status

Enumerator
VAROBJ_IN_SCOPE |
VAROBJ_NOT_IN_SCOPE |
VAROBJ_INVALID |

Definition at line 43 of file varobj.h.

## ◆ varobj_type

enum varobj_type

Enumerator
USE_SPECIFIED_FRAME |
USE_CURRENT_FRAME |
USE_SELECTED_FRAME |

Definition at line 35 of file varobj.h.

## Function Documentation

## ◆ all_root_varobjs()

void all_root_varobjs | ( | void(*)(struct varobj *var, void *data) | func,
|  | void * | data
| ) |  |

Definition at line 2469 of file varobj.c.

References varobj_root::next, rootlist, and varobj_root::rootvar.

Referenced by mi_cmd_var_update(), and varobj_invalidate().

## ◆ varobj_create()

struct varobj* varobj_create | ( | const char * | objname,
|  | const char * | expression,
|  | CORE_ADDR | frame,
|  | enum varobj_type | type
| ) |  |

Definition at line 264 of file varobj.c.

References _, CATCH, END_CATCH, error(), evaluate_expression(), evaluate_type(), find_frame_addr_in_frame_chain(), fprintf_unfiltered(), frame_find_by_id(), frame_id_p(), gdb_stderr, get_frame_block(), get_frame_id(), get_frame_pc(), get_selected_frame(), has_stack_frames(), inferior_ptid, innermost_block, install_new_value(), install_variable(), null_frame_id, parse_exp_1(), ptid_to_global_thread_id(), RETURN_MASK_ERROR, select_frame(), TRY, value::type, USE_CURRENT_FRAME, USE_SELECTED_FRAME, value_actual_type(), value_cast(), value_type(), and variable_default_display().

Referenced by mi_cmd_var_create(), value_of_root(), and varobj_invalidate_iter().

## ◆ varobj_default_is_path_expr_parent()

bool varobj_default_is_path_expr_parent | ( | const struct varobj * | var | ) |

Definition at line 934 of file varobj.c.

## ◆ varobj_default_value_is_changeable_p()

bool varobj_default_value_is_changeable_p | ( | const struct varobj * | var | ) |

Definition at line 2440 of file varobj.c.

References CPLUS_FAKE_CHILD, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRUCT, TYPE_CODE_UNION, and varobj_get_value_type().

Referenced by ada_value_is_changeable_p().

## ◆ varobj_delete()

int varobj_delete | ( | struct varobj * | var,
|  | bool | only_children
| ) |  |

Definition at line 475 of file varobj.c.

References delete_variable(), and vlist::var.

Referenced by mi_cmd_var_delete(), update_dynamic_varobj_children(), update_type_if_necessary(), value_of_root(), varobj_invalidate_iter(), varobj_set_visualizer(), and varobj_update().

## ◆ varobj_editable_p()

bool varobj_editable_p | ( | const struct varobj * | var | ) |

Definition at line 2394 of file varobj.c.

References varobj_root::is_valid, varobj::root, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_FUNC, TYPE_CODE_METHOD, TYPE_CODE_STRUCT, TYPE_CODE_UNION, varobj::value, VALUE_LVAL, and varobj_get_value_type().

Referenced by mi_cmd_var_assign(), varobj_get_attributes(), and varobj_set_value().

## ◆ varobj_enable_pretty_printing()

void varobj_enable_pretty_printing | ( | void |  | ) |

Definition at line 60 of file varobj.c.

References pretty_printing.

Referenced by mi_cmd_enable_pretty_printing().

## ◆ varobj_floating_p()

bool varobj_floating_p | ( | const struct varobj * | var | ) |

Definition at line 2431 of file varobj.c.

References varobj_root::floating, and varobj::root.

Referenced by mi_cmd_var_update_iter().

## ◆ varobj_formatted_print_options()

void varobj_formatted_print_options | ( | struct value_print_options * | opts,
|  | enum varobj_display_formats | format
| ) |  |

Definition at line 2270 of file varobj.c.

References value_print_options::deref_ref, format_code, get_formatted_print_options(), and value_print_options::raw.

Referenced by ada_value_of_variable(), and varobj_value_get_print_value().

## ◆ varobj_gen_name()

std::string varobj_gen_name | ( | void |  | ) |

Definition at line 420 of file varobj.c.

References string_printf().

Referenced by mi_cmd_var_create().

## ◆ varobj_get_attributes()

int varobj_get_attributes | ( | const struct varobj * | var | ) |

Definition at line 979 of file varobj.c.

References varobj_editable_p().

Referenced by mi_cmd_var_show_attributes().

## ◆ varobj_get_child_range()

void varobj_get_child_range | ( | const struct varobj * | var,
|  | int * | from,
|  | int * | to
| ) |  |

Definition at line 1428 of file varobj.c.

References varobj::from, and varobj::to.

Referenced by varobj_update_one().

## ◆ varobj_get_display_format()

enum varobj_display_formats varobj_get_display_format | ( | const struct varobj * | var | ) |

Definition at line 533 of file varobj.c.

References varobj::format, and vlist::var.

Referenced by mi_cmd_var_show_format().

## ◆ varobj_get_display_hint()

gdb::unique_xmalloc_ptr<char> varobj_get_display_hint | ( | const struct varobj * | var | ) |

Definition at line 539 of file varobj.c.

References varobj::dynamic, gdb_python_initialized, gdbpy_get_display_hint(), varobj_dynamic::pretty_printer, and vlist::var.

Referenced by mi_cmd_var_list_children(), print_varobj(), and varobj_update_one().

## ◆ varobj_get_expression()

std::string varobj_get_expression | ( | const struct varobj * | var | ) |

Definition at line 467 of file varobj.c.

References name_of_variable(), and vlist::var.

Referenced by mi_cmd_var_info_expression(), and print_varobj().

## ◆ varobj_get_formatted_value()

std::string varobj_get_formatted_value | ( | struct varobj * | var,
|  | enum varobj_display_formats | format
| ) |  |

Definition at line 999 of file varobj.c.

References my_value_of_variable().

Referenced by mi_cmd_var_evaluate_expression().

## ◆ varobj_get_frozen()

bool varobj_get_frozen | ( | const struct varobj * | var | ) |

Definition at line 595 of file varobj.c.

References varobj::frozen, and vlist::var.

Referenced by print_varobj().

## ◆ varobj_get_gdb_type()

struct type* varobj_get_gdb_type | ( | const struct varobj * | var | ) |

Definition at line 914 of file varobj.c.

References varobj::type.

Referenced by c_is_path_expr_parent(), and mi_print_value_p().

## ◆ varobj_get_handle()

struct varobj* varobj_get_handle | ( | const char * | name | ) |

Definition at line 433 of file varobj.c.

References _, error(), vlist::next, varobj::obj_name, vlist::var, varobj_table, and VAROBJ_TABLE_SIZE.

Referenced by mi_cmd_var_assign(), mi_cmd_var_delete(), mi_cmd_var_evaluate_expression(), mi_cmd_var_info_expression(), mi_cmd_var_info_num_children(), mi_cmd_var_info_path_expression(), mi_cmd_var_info_type(), mi_cmd_var_list_children(), mi_cmd_var_set_format(), mi_cmd_var_set_frozen(), mi_cmd_var_set_update_range(), mi_cmd_var_set_visualizer(), mi_cmd_var_show_attributes(), mi_cmd_var_show_format(), and mi_cmd_var_update().

## ◆ varobj_get_language()

const struct language_defn* varobj_get_language | ( | const struct varobj * | var | ) |

Definition at line 973 of file varobj.c.

References varobj_root::exp, and varobj::root.

Referenced by mi_cmd_var_info_expression().

## ◆ varobj_get_num_children()

int varobj_get_num_children | ( | struct varobj * | var | ) |

Definition at line 816 of file varobj.c.

References dummy, varobj::num_children, number_of_children(), update_dynamic_varobj_children(), varobj_iter::var, and varobj_is_dynamic_p().

Referenced by mi_cmd_var_info_num_children(), print_varobj(), and varobj_update_one().

## ◆ varobj_get_objname()

const char* varobj_get_objname | ( | const struct varobj * | var | ) |

Definition at line 458 of file varobj.c.

References varobj::obj_name, and vlist::var.

Referenced by print_varobj(), and varobj_update_one().

## ◆ varobj_get_path_expr()

const char* varobj_get_path_expr | ( | const struct varobj * | var | ) |

Definition at line 956 of file varobj.c.

References gdb_assert, is_root_p(), varobj_root::lang_ops, varobj::path_expr, lang_varobj_ops::path_expr_of_child, and varobj::root.

Referenced by ada_path_expr_of_child(), c_describe_child(), cplus_describe_child(), and mi_cmd_var_info_path_expression().

## ◆ varobj_get_path_expr_parent()

const struct varobj* varobj_get_path_expr_parent | ( | const struct varobj * | var | ) |

Definition at line 942 of file varobj.c.

References is_path_expr_parent(), is_root_p(), and varobj::parent.

Referenced by c_describe_child(), and cplus_describe_child().

## ◆ varobj_get_thread_id()

int varobj_get_thread_id | ( | const struct varobj * | var | ) |

Definition at line 573 of file varobj.c.

References varobj::root, varobj_root::thread_id, varobj_root::valid_block, and vlist::var.

Referenced by mi_cmd_var_update_iter(), and print_varobj().

## ◆ varobj_get_type()

std::string varobj_get_type | ( | struct varobj * | var | ) |

Definition at line 900 of file varobj.c.

References CPLUS_FAKE_CHILD, varobj_root::is_valid, varobj::root, string, varobj::type, and type_to_string().

Referenced by mi_cmd_var_info_type(), print_varobj(), update_type_if_necessary(), value_of_root(), and varobj_update_one().

## ◆ varobj_get_value()

std::string varobj_get_value | ( | struct varobj * | var | ) |

Definition at line 1006 of file varobj.c.

References varobj::format, and my_value_of_variable().

Referenced by mi_cmd_var_assign(), mi_cmd_var_evaluate_expression(), mi_cmd_var_set_format(), print_varobj(), and varobj_update_one().

## ◆ varobj_get_value_type()

struct type* varobj_get_value_type | ( | const struct varobj * | var | ) |

Definition at line 2011 of file varobj.c.

References check_typedef(), get_target_type(), type, varobj::type, TYPE_IS_REFERENCE, varobj::value, and value_type().

Referenced by c_describe_child(), c_is_path_expr_parent(), c_number_of_children(), cplus_describe_child(), cplus_number_of_children(), varobj_default_value_is_changeable_p(), and varobj_editable_p().

## ◆ varobj_has_more()

bool varobj_has_more | ( | const struct varobj * | var,
|  | int | to
| ) |  |

Definition at line 559 of file varobj.c.

References varobj::children, varobj::dynamic, varobj_dynamic::saved_item, and vlist::var.

Referenced by mi_cmd_var_create(), mi_cmd_var_list_children(), varobj_update(), and varobj_update_one().

## ◆ varobj_invalidate()

void varobj_invalidate | ( | void |  | ) |

Definition at line 2520 of file varobj.c.

References all_root_varobjs(), and varobj_invalidate_iter().

Referenced by clear_symtab_users().

## ◆ varobj_is_anonymous_child()

bool varobj_is_anonymous_child | ( | const struct varobj * | child | ) |

Definition at line 38 of file c-varobj.c.

References ANONYMOUS_STRUCT_NAME, ANONYMOUS_UNION_NAME, and varobj::name.

Referenced by create_child_with_value().

## ◆ varobj_is_dynamic_p()

bool varobj_is_dynamic_p | ( | const struct varobj * | var | ) |

Definition at line 993 of file varobj.c.

References varobj::dynamic, and varobj_dynamic::pretty_printer.

Referenced by mi_print_value_p(), print_varobj(), varobj_get_num_children(), varobj_list_children(), varobj_update(), and varobj_update_one().

## ◆ varobj_list_children()

const std::vector<varobj *>& varobj_list_children | ( | struct varobj * | var,
|  | int * | from,
|  | int * | to
| ) |  |

Definition at line 840 of file varobj.c.

References varobj::children, varobj_dynamic::children_requested, create_child(), varobj::dynamic, name, name_of_child(), varobj::num_children, number_of_children(), string, update_dynamic_varobj_children(), varobj_iter::var, varobj_is_dynamic_p(), and varobj_restrict_range().

Referenced by mi_cmd_var_list_children().

## ◆ varobj_restrict_range()

void varobj_restrict_range | ( | const std::vector< varobj *> & | children,
|  | int * | from,
|  | int * | to
| ) |  |

Definition at line 606 of file varobj.c.

Referenced by ada_value_has_mutated(), and varobj_list_children().

## ◆ varobj_set_child_range()

void varobj_set_child_range | ( | struct varobj * | var,
|  | int | from,
|  | int | to
| ) |  |

Definition at line 1438 of file varobj.c.

References varobj::from, and varobj::to.

Referenced by mi_cmd_var_set_update_range().

## ◆ varobj_set_display_format()

enum varobj_display_formats varobj_set_display_format | ( | struct varobj * | var,
|  | enum varobj_display_formats | format
| ) |  |

Definition at line 504 of file varobj.c.

References varobj::format, FORMAT_BINARY, FORMAT_DECIMAL, FORMAT_HEXADECIMAL, FORMAT_NATURAL, FORMAT_OCTAL, FORMAT_ZHEXADECIMAL, varobj::print_value, varobj::value, value_lazy(), vlist::var, variable_default_display(), varobj_value_get_print_value(), and varobj_value_is_changeable_p().

Referenced by mi_cmd_var_set_format().

## ◆ varobj_set_frozen()

void varobj_set_frozen | ( | struct varobj * | var,
|  | bool | frozen
| ) |  |

Definition at line 582 of file varobj.c.

References varobj::frozen, and vlist::var.

Referenced by mi_cmd_var_set_frozen().

## ◆ varobj_set_value()

bool varobj_set_value | ( | struct varobj * | var,
|  | const char * | expression
| ) |  |

Definition at line 1016 of file varobj.c.

References CATCH, coerce_array(), END_CATCH, evaluate_expression(), gdb_assert, input_radix, install_new_value(), parse_exp_1(), RETURN_MASK_ERROR, TRY, varobj::updated, varobj::value, value_assign(), value_lazy(), varobj_editable_p(), and varobj_value_is_changeable_p().

Referenced by mi_cmd_var_assign().

## ◆ varobj_set_visualizer()

void varobj_set_visualizer | ( | struct varobj * | var,
|  | const char * | visualizer
| ) |  |

Definition at line 1445 of file varobj.c.

References _, construct_visualizer(), error(), gdb_python_initialized, gdbpy_print_stack(), gdb::ref_ptr< T, Policy >::get(), varobj::num_children, and varobj_delete().

Referenced by mi_cmd_var_set_visualizer().

## ◆ varobj_update()

std::vector<varobj_update_result> varobj_update | ( | struct varobj ** | varp,
|  | bool | is_explicit
| ) |  |

Definition at line 1527 of file varobj.c.

References varobj_update_result::changed, varobj::children, varobj_update_result::children_changed, varobj_dynamic::children_requested, dummy, varobj::dynamic, varobj::from, varobj::frozen, varobj::index, install_new_value(), varobj_root::lang_ops, new_type(), varobj_update_result::newobj, varobj::num_children, varobj::parent, varobj::root, value::stack, varobj_update_result::status, varobj::to, varobj::type, varobj_update_result::type_changed, lang_varobj_ops::type_of_child, update_dynamic_varobj_children(), update_type_if_necessary(), varobj::updated, varobj_update_result::value_installed, value_of_child(), value_of_root(), value_type(), varobj_update_result::varobj, varobj_delete(), varobj_has_more(), VAROBJ_INVALID, varobj_is_dynamic_p(), VAROBJ_NOT_IN_SCOPE, and varobj_value_has_mutated().

Referenced by varobj_update_one().

## ◆ varobj_value_get_print_value()

std::string varobj_value_get_print_value | ( | struct value * | value,
|  | enum varobj_display_formats | format,
|  | const struct varobj * | var
| ) |  |

Definition at line 2279 of file varobj.c.

References apply_varobj_pretty_printer(), builtin_type::builtin_char, builtin_type(), common_val_print(), current_language, varobj::dynamic, dynamic_varobj_has_child_method(), gdb_python_initialized, gdbpy_extract_lazy_string(), gdbpy_get_display_hint(), gdbpy_is_lazy_string(), gdbpy_print_stack(), gdbpy_to_string_cst, gdb::ref_ptr< T, Policy >::get(), get_type_arch(), LA_PRINT_STRING, varobj_dynamic::pretty_printer, python_string_to_target_string(), string, type, val_print_string(), value_type(), and varobj_formatted_print_options().

Referenced by c_value_of_variable(), install_new_value(), my_value_of_variable(), and varobj_set_display_format().

## ◆ varobj_value_is_changeable_p()

bool varobj_value_is_changeable_p | ( | const struct varobj * | var | ) |

Definition at line 2422 of file varobj.c.

References varobj_root::lang_ops, varobj::root, and lang_varobj_ops::value_is_changeable_p.

Referenced by c_value_of_variable(), install_new_value(), varobj_set_display_format(), and varobj_set_value().

## Variable Documentation

## ◆ ada_varobj_ops

const struct lang_varobj_ops ada_varobj_ops

Definition at line 995 of file ada-varobj.c.

## ◆ c_varobj_ops

const struct lang_varobj_ops c_varobj_ops

Definition at line 539 of file c-varobj.c.

Referenced by ada_name_of_variable().

## ◆ cplus_varobj_ops

const struct lang_varobj_ops cplus_varobj_ops

Definition at line 953 of file c-varobj.c.

## ◆ varobj_format_string

const char* varobj_format_string[]

Definition at line 53 of file varobj.c.

Referenced by mi_cmd_var_set_format(), and mi_cmd_var_show_format().