should be expanded, @code{False} if they shouldn't (see @code{set print
union} in @ref{Print Settings}).
+@item address
+@code{True} if the string representation of a pointer should include the
+address, @code{False} if it shouldn't (see @code{set print address} in
+@ref{Print Settings}).
+
@item deref_refs
@code{True} if C@t{++} references should be resolved to the value they
refer to, @code{False} (the default) if they shouldn't. Note that, unlike
"array_indexes", /* See set print array-indexes on|off. */
"symbols", /* See set print symbol on|off. */
"unions", /* See set print union on|off. */
+ "address", /* See set print address on|off. */
/* C++ options. */
"deref_refs", /* No corresponding setting. */
"actual_objects", /* See set print object on|off. */
PyObject *array_indexes_obj = NULL;
PyObject *symbols_obj = NULL;
PyObject *unions_obj = NULL;
+ PyObject *address_obj = NULL;
PyObject *deref_refs_obj = NULL;
PyObject *actual_objects_obj = NULL;
PyObject *static_members_obj = NULL;
char *format = NULL;
if (!gdb_PyArg_ParseTupleAndKeywords (args,
kw,
- "|O!O!O!O!O!O!O!O!O!IIIs",
+ "|O!O!O!O!O!O!O!O!O!O!IIIs",
keywords,
&PyBool_Type, &raw_obj,
&PyBool_Type, &pretty_arrays_obj,
&PyBool_Type, &array_indexes_obj,
&PyBool_Type, &symbols_obj,
&PyBool_Type, &unions_obj,
+ &PyBool_Type, &address_obj,
&PyBool_Type, &deref_refs_obj,
&PyBool_Type, &actual_objects_obj,
&PyBool_Type, &static_members_obj,
return NULL;
if (!copy_py_bool_obj (&opts.unionprint, unions_obj))
return NULL;
+ if (!copy_py_bool_obj (&opts.addressprint, address_obj))
+ return NULL;
if (!copy_py_bool_obj (&opts.deref_ref, deref_refs_obj))
return NULL;
if (!copy_py_bool_obj (&opts.objectprint, actual_objects_obj))
}
}
+# Test the address option for gdb.Value.format_string.
+proc test_address {} {
+ global undefined
+ global current_lang
+
+ check_var_with_bool_opt "address" "a_point_t"
+ check_var_with_bool_opt "address" "a_point_t_pointer" \
+ $undefined \
+ ""
+ check_var_with_bool_opt "address" "another_point"
+ check_var_with_bool_opt "symbols" "a_struct_with_union"
+ check_var_with_bool_opt "address" "an_enum"
+ check_var_with_bool_opt "address" "a_string" \
+ $undefined \
+ "\"hello world\""
+ check_var_with_bool_opt "address" "a_binary_string" \
+ $undefined \
+ "\"hello\""
+ check_var_with_bool_opt "address" "a_binary_string_array"
+ check_var_with_bool_opt "address" "a_big_string"
+ check_var_with_bool_opt "address" "an_array"
+ check_var_with_bool_opt "address" "an_array_with_repetition"
+ check_var_with_bool_opt "address" "a_symbol_pointer" \
+ $undefined \
+ "<global_symbol>"
+
+ if { $current_lang == "c++" } {
+ check_var_with_bool_opt "address" "a_point_t_ref"
+ check_var_with_bool_opt "address" "a_base_ref" \
+ $undefined \
+ ""
+ }
+
+ with_temp_option "set print address off" "set print address on" {
+ check_var_with_no_opts "a_string" \
+ "\"hello world\""
+ check_var_with_bool_opt "address" "a_string" \
+ $undefined \
+ "\"hello world\""
+ }
+}
+
# Test the deref_refs option for gdb.Value.format_string.
proc test_deref_refs {} {
global current_lang
test_array_indexes
test_symbols
test_unions
+ test_address
test_deref_refs
test_actual_objects
test_static_members