Patchwork [13/55] Two simple uses of value_print_scalar_formatted

login
register
mail settings
Submitter Tom Tromey
Date Dec. 8, 2019, 6:29 p.m.
Message ID <20191208182958.10181-14-tom@tromey.com>
Download mbox | patch
Permalink /patch/36595/
State New
Headers show

Comments

Tom Tromey - Dec. 8, 2019, 6:29 p.m.
A couple of spots could be easily converted to use
value_print_scalar_formatted.  This patch makes this change.

gdb/ChangeLog
2019-12-08  Tom Tromey  <tom@tromey.com>

	* printcmd.c (print_formatted): Use value_print_scalar_formatted.
	* mips-tdep.c (mips_print_register): Use
	value_print_scalar_formatted.

Change-Id: Icb05b23148a13cf4257b8c7c05796389566f217d
---
 gdb/ChangeLog   | 6 ++++++
 gdb/mips-tdep.c | 5 +----
 gdb/printcmd.c  | 5 +----
 3 files changed, 8 insertions(+), 8 deletions(-)

Patch

diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 0852851595f..721c030b44b 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6373,10 +6373,7 @@  mips_print_register (struct ui_file *file, struct frame_info *frame,
     fprintf_filtered (file, ": ");
 
   get_formatted_print_options (&opts, 'x');
-  val_print_scalar_formatted (value_type (val),
-			      value_embedded_offset (val),
-			      val,
-			      &opts, 0, file);
+  value_print_scalar_formatted (val, &opts, 0, file);
 }
 
 /* Print IEEE exception condition bits in FLAGS.  */
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index f7674cf1d01..9071a796c0e 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -321,10 +321,7 @@  print_formatted (struct value *val, int size,
   else
     /* User specified format, so don't look to the type to tell us
        what to do.  */
-    val_print_scalar_formatted (type,
-				value_embedded_offset (val),
-				val,
-				options, size, stream);
+    value_print_scalar_formatted (val, options, size, stream);
 }
 
 /* Return builtin floating point type of same length as TYPE.