aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-29 12:03:50 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-06-29 12:03:50 -0400
commita05a883fbaba69d0f80806e46a9457727fcbe74c (patch)
treebf42b4af7d2b766c0424514e269a41e8ffc162f6 /gdb/value.c
parentdd4f75f2b6f0be9cb45204aacb3e22462d3c7cd5 (diff)
downloadgdb-a05a883fbaba69d0f80806e46a9457727fcbe74c.zip
gdb-a05a883fbaba69d0f80806e46a9457727fcbe74c.tar.gz
gdb-a05a883fbaba69d0f80806e46a9457727fcbe74c.tar.bz2
gdb: introduce frame_debug_printf
Introduce frame_debug_printf, to convert the "frame" debug messages to the new system. Replace fprint_frame with a frame_info::to_string method that returns a string, like what was done with frame_id::to_string. This makes it easier to use with frame_debug_printf. gdb/ChangeLog: * frame.h (frame_debug_printf): New. * frame.c: Use frame_debug_printf throughout when printing frame debug messages. * amd64-windows-tdep.c: Likewise. * value.c: Likewise. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-reg-undefined.exp: Update regexp. Change-Id: I3c230b0814ea81c23af3e1aca1aac8d4ba91d726
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 9df035a..6a07495 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3956,17 +3956,17 @@ value_fetch_lazy_register (struct value *val)
regnum = VALUE_REGNUM (val);
gdbarch = get_frame_arch (frame);
- fprintf_unfiltered (gdb_stdlog,
- "{ value_fetch_lazy "
- "(frame=%d,regnum=%d(%s),...) ",
+ string_file debug_file;
+ fprintf_unfiltered (&debug_file,
+ "(frame=%d, regnum=%d(%s), ...) ",
frame_relative_level (frame), regnum,
user_reg_map_regnum_to_name (gdbarch, regnum));
- fprintf_unfiltered (gdb_stdlog, "->");
+ fprintf_unfiltered (&debug_file, "->");
if (value_optimized_out (new_val))
{
- fprintf_unfiltered (gdb_stdlog, " ");
- val_print_optimized_out (new_val, gdb_stdlog);
+ fprintf_unfiltered (&debug_file, " ");
+ val_print_optimized_out (new_val, &debug_file);
}
else
{
@@ -3974,23 +3974,23 @@ value_fetch_lazy_register (struct value *val)
const gdb_byte *buf = value_contents (new_val);
if (VALUE_LVAL (new_val) == lval_register)
- fprintf_unfiltered (gdb_stdlog, " register=%d",
+ fprintf_unfiltered (&debug_file, " register=%d",
VALUE_REGNUM (new_val));
else if (VALUE_LVAL (new_val) == lval_memory)
- fprintf_unfiltered (gdb_stdlog, " address=%s",
+ fprintf_unfiltered (&debug_file, " address=%s",
paddress (gdbarch,
value_address (new_val)));
else
- fprintf_unfiltered (gdb_stdlog, " computed");
+ fprintf_unfiltered (&debug_file, " computed");
- fprintf_unfiltered (gdb_stdlog, " bytes=");
- fprintf_unfiltered (gdb_stdlog, "[");
+ fprintf_unfiltered (&debug_file, " bytes=");
+ fprintf_unfiltered (&debug_file, "[");
for (i = 0; i < register_size (gdbarch, regnum); i++)
- fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
- fprintf_unfiltered (gdb_stdlog, "]");
+ fprintf_unfiltered (&debug_file, "%02x", buf[i]);
+ fprintf_unfiltered (&debug_file, "]");
}
- fprintf_unfiltered (gdb_stdlog, " }\n");
+ frame_debug_printf ("%s", debug_file.c_str ());
}
/* Dispose of the intermediate values. This prevents