* gdb.base/display.c (do_loops): Add float variable `f'.
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 746a0646cc0624aa61087288085b8f435a9470a5..8ae6293700afdbfb3ca2730f4a1a3d6f25ae870f 100644 (file)
@@ -112,7 +112,7 @@ struct display
     /* Innermost block required by this expression when evaluated */
     struct block *block;
     /* Status of this display (enabled or disabled) */
-    enum enable status;
+    int enabled_p;
   };
 
 /* Chain of expressions whose values should be displayed
@@ -390,6 +390,12 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
   else if (format != 'f')
     val_long = unpack_long (type, valaddr);
 
+  /* If the value is a pointer, and pointers and addresses are not the
+     same, then at this point, the value's length is TARGET_ADDR_BIT, not
+     TYPE_LENGTH (type).  */
+  if (TYPE_CODE (type) == TYPE_CODE_PTR)
+    len = TARGET_ADDR_BIT;
+
   /* If we are printing it as unsigned, truncate it in case it is actually
      a negative signed value (e.g. "print/u (short)-1" should print 65535
      (if shorts are 16 bits) instead of 4294967295).  */
@@ -450,9 +456,9 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
 
     case 'f':
       if (len == sizeof (float))
-         type = builtin_type_float;
+        type = builtin_type_float;
       else if (len == sizeof (double))
-         type = builtin_type_double;
+        type = builtin_type_double;
       print_floating (valaddr, type, stream);
       break;
 
@@ -1390,8 +1396,7 @@ display_command (char *exp, int from_tty)
 
 #if defined(TUI)
   if (tui_version && *exp == '$')
-    display_it = ((TuiStatus) tuiDo (
-                 (TuiOpaqueFuncPtr) tui_vSetLayoutTo, exp) == TUI_FAILURE);
+    display_it = (tui_set_layout (exp) == TUI_FAILURE);
 #endif
 
   if (display_it)
@@ -1428,7 +1433,7 @@ display_command (char *exp, int from_tty)
       new->next = display_chain;
       new->number = ++display_number;
       new->format = fmt;
-      new->status = enabled;
+      new->enabled_p = 1;
       display_chain = new;
 
       if (from_tty && target_has_execution)
@@ -1539,7 +1544,7 @@ do_one_display (struct display *d)
 {
   int within_current_scope;
 
-  if (d->status == disabled)
+  if (d->enabled_p == 0)
     return;
 
   if (d->block)
@@ -1639,7 +1644,7 @@ disable_display (int num)
   for (d = display_chain; d; d = d->next)
     if (d->number == num)
       {
-       d->status = disabled;
+       d->enabled_p = 0;
        return;
       }
   printf_unfiltered ("No display number %d.\n", num);
@@ -1670,7 +1675,7 @@ Num Enb Expression\n");
 
   for (d = display_chain; d; d = d->next)
     {
-      printf_filtered ("%d:   %c  ", d->number, "ny"[(int) d->status]);
+      printf_filtered ("%d:   %c  ", d->number, "ny"[(int) d->enabled_p]);
       if (d->format.size)
        printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
                         d->format.format);
@@ -1695,7 +1700,7 @@ enable_display (char *args, int from_tty)
   if (p == 0)
     {
       for (d = display_chain; d; d = d->next)
-       d->status = enabled;
+       d->enabled_p = 1;
     }
   else
     while (*p)
@@ -1711,7 +1716,7 @@ enable_display (char *args, int from_tty)
        for (d = display_chain; d; d = d->next)
          if (d->number == num)
            {
-             d->status = enabled;
+             d->enabled_p = 1;
              goto win;
            }
        printf_unfiltered ("No display number %d.\n", num);
@@ -1733,7 +1738,7 @@ disable_display_command (char *args, int from_tty)
   if (p == 0)
     {
       for (d = display_chain; d; d = d->next)
-       d->status = disabled;
+       d->enabled_p = 0;
     }
   else
     while (*p)
@@ -1940,9 +1945,6 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
 
       if (val)
        {
-         if (GDB_TARGET_IS_D10V
-             && SYMBOL_CLASS (sym) == LOC_REGPARM && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
-           TYPE_LENGTH (VALUE_TYPE (val)) = 2;
 #ifdef UI_OUT
          val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
                     VALUE_ADDRESS (val),
@@ -2332,9 +2334,7 @@ disassemble_command (char *arg, int from_tty)
        error ("No function contains program counter for selected frame.\n");
 #if defined(TUI)
       else if (tui_version)
-       low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
-                                (Opaque) low,
-                                (Opaque) pc);
+       low = tuiGetLowDisassemblyAddress (low, pc);
 #endif
       low += FUNCTION_START_OFFSET;
     }
@@ -2346,9 +2346,7 @@ disassemble_command (char *arg, int from_tty)
        error ("No function contains specified address.\n");
 #if defined(TUI)
       else if (tui_version)
-       low = (CORE_ADDR) tuiDo ((TuiOpaqueFuncPtr) tui_vGetLowDisassemblyAddress,
-                                (Opaque) low,
-                                (Opaque) pc);
+       low = tuiGetLowDisassemblyAddress (low, pc);
 #endif
 #if 0
       if (overlay_debugging)
@@ -2375,8 +2373,7 @@ disassemble_command (char *arg, int from_tty)
     }
 
 #if defined(TUI)
-  if (!tui_version ||
-      m_winPtrIsNull (disassemWin) || !disassemWin->generic.isVisible)
+  if (!tui_is_window_visible (DISASSEM_WIN))
 #endif
     {
       printf_filtered ("Dump of assembler code ");
@@ -2424,8 +2421,7 @@ disassemble_command (char *arg, int from_tty)
 #if defined(TUI)
   else
     {
-      tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, DISASSEM_WIN);
-      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithAddr, low);
+      tui_show_assembly (low);
     }
 #endif
 }
@@ -2445,6 +2441,8 @@ print_insn (CORE_ADDR memaddr, struct ui_file *stream)
     TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
   /* else: should set .mach=0 but some disassemblers don't grok this */
 
+  TARGET_PRINT_INSN_INFO->stream = stream;
+
   return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
 }
 \f
This page took 0.026697 seconds and 4 git commands to generate.