This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

TUI, always pass a value to val_print & co (Re: s/print_scalar_formatted/val_print_scalar_formatted/, mostly)


On Tuesday, 25 de January de 2011 18:01:42, Pedro Alves wrote:

> Only a handful of print_scalar_formatted calls are left in the
> tree after this.  mips-tdep.c has 3 that could/should be converted
> to val_print_scalar_formatted, but I didn't bother yet as I'd need to
> make them construct a value too.  TUI has a use that needs fixing (and
> needs similarly to be fixed for always-a-value-passed-to-val_print&co),
> that I plan on fixing (I'm a TUI user!).  MI has one use that
> is unrelated to printing "struct values", so can stay as is.

Ah, I forgot.  In the TUI case, it turns out it's dead code
and it was born that way:
 <http://sourceware.org/ml/gdb-patches/2004-03/msg00115.html>
...

Neither "info reg", neither MI register printing seem to 
do anything fancy with vectors, so I just removed it.

Applied.

-- 
Pedro Alves

2011-01-25  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* tui/tui-regs.c (tui_register_format): Remove dead code.

---
 gdb/tui/tui-regs.c |   18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

Index: src/gdb/tui/tui-regs.c
===================================================================
--- src.orig/gdb/tui/tui-regs.c	2010-10-18 20:29:09.000000000 +0100
+++ src/gdb/tui/tui-regs.c	2010-10-18 20:29:41.000000000 +0100
@@ -697,23 +697,7 @@ tui_register_format (struct frame_info *
   stream = tui_sfileopen (256);
   gdb_stdout = stream;
   cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout);
-  if (TYPE_VECTOR (type) != 0 && 0)
-    {
-      gdb_byte buf[MAX_REGISTER_SIZE];
-      int len;
-      struct value_print_options opts;
-
-      len = register_size (gdbarch, regnum);
-      fprintf_filtered (stream, "%-14s ", name);
-      get_frame_register (frame, regnum, buf);
-      get_formatted_print_options (&opts, 'f');
-      print_scalar_formatted (buf, type, &opts, len, stream);
-    }
-  else
-    {
-      gdbarch_print_registers_info (gdbarch, stream,
-                                    frame, regnum, 1);
-    }
+  gdbarch_print_registers_info (gdbarch, stream, frame, regnum, 1);
 
   /* Save formatted output in the buffer.  */
   p = tui_file_get_strbuf (stream);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]