aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 14:38:30 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:22:16 -0700
commitefaf1ae025cbef5438d2fe943dd010b773d757ac (patch)
treed51e1d379430439462d5cb1358c642e679647f12 /gdb/printcmd.c
parentcdf3de175d41acec85d6c3cc8b599f79658edb06 (diff)
downloadgdb-efaf1ae025cbef5438d2fe943dd010b773d757ac.zip
gdb-efaf1ae025cbef5438d2fe943dd010b773d757ac.tar.gz
gdb-efaf1ae025cbef5438d2fe943dd010b773d757ac.tar.bz2
Turn remaining value_contents functions into methods
This turns the remaining value_contents functions -- value_contents, value_contents_all, value_contents_for_printing, and value_contents_for_printing_const -- into methods of value. It also converts the static functions require_not_optimized_out and require_available to be private methods. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index ba7d2978..8619e38 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2457,7 +2457,7 @@ printf_c_string (struct ui_file *stream, const char *format,
null terminated) to be printed without problems. */
gdb_byte *tem_str = (gdb_byte *) alloca (len + 1);
- memcpy (tem_str, value_contents (value).data (), len);
+ memcpy (tem_str, value->contents ().data (), len);
tem_str [len] = 0;
str = tem_str;
}
@@ -2521,7 +2521,7 @@ printf_wide_c_string (struct ui_file *stream, const char *format,
if (VALUE_LVAL (value) == lval_internalvar
&& c_is_string_type_p (value->type ()))
{
- str = value_contents (value).data ();
+ str = value->contents ().data ();
len = value->type ()->length ();
}
else
@@ -2631,14 +2631,14 @@ printf_floating (struct ui_file *stream, const char *format,
param_type = float_type_from_length (param_type);
if (param_type != value->type ())
value = value_from_contents (param_type,
- value_contents (value).data ());
+ value->contents ().data ());
}
value = value_cast (fmt_type, value);
/* Convert the value to a string and print it. */
std::string str
- = target_float_to_string (value_contents (value).data (), fmt_type, format);
+ = target_float_to_string (value->contents ().data (), fmt_type, format);
gdb_puts (str.c_str (), stream);
}
@@ -2799,7 +2799,7 @@ ui_printf (const char *arg, struct ui_file *stream)
|| valtype->code () != TYPE_CODE_INT)
error (_("expected wchar_t argument for %%lc"));
- bytes = value_contents (val_args[i]).data ();
+ bytes = val_args[i]->contents ().data ();
auto_obstack output;