gdb/
[deliverable/binutils-gdb.git] / gdb / ui-out.c
index 53ad963a648d0b5b45b614e2f35c7c87428e97d3..b821719a11ce3a25b102c7d48a79c85504dfdef1 100644 (file)
@@ -222,7 +222,7 @@ struct ui_out def_uiout =
 /* FIXME: This should not be a global, but something passed down from main.c
    or top.c.  */
 
-struct ui_out *uiout = &def_uiout;
+struct ui_out *current_uiout = &def_uiout;
 
 /* These are the interfaces to implementation functions.  */
 
@@ -486,27 +486,16 @@ ui_out_field_fmt_int (struct ui_out *uiout,
   uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
 }
 
+/* Documented in ui-out.h.  */
+
 void
 ui_out_field_core_addr (struct ui_out *uiout,
                        const char *fldname,
                        struct gdbarch *gdbarch,
                        CORE_ADDR address)
 {
-  char addstr[20];
-  int addr_bit = gdbarch_addr_bit (gdbarch);
-
-  if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-    address &= ((CORE_ADDR) 1 << addr_bit) - 1;
-
-  /* FIXME: cagney/2002-05-03: Need local_address_string() function
-     that returns the language localized string formatted to a width
-     based on gdbarch_addr_bit.  */
-  if (addr_bit <= 32)
-    strcpy (addstr, hex_string_custom (address, 8));
-  else
-    strcpy (addstr, hex_string_custom (address, 16));
-
-  ui_out_field_string (uiout, fldname, addstr);
+  ui_out_field_string (uiout, fldname,
+                      print_core_address (gdbarch, address));
 }
 
 void
@@ -1061,7 +1050,7 @@ append_header_to_list (struct ui_out *uiout,
   uiout->table.header_next = uiout->table.header_last;
 }
 
-/* Extract the format information for the NEXT header and and advance
+/* Extract the format information for the NEXT header and advance
    the header pointer.  Return 0 if there was no next header.  */
 
 static int
@@ -1126,13 +1115,6 @@ specified after table_body and inside a list."));
 }
 
 
-/* Access to ui_out format private members.  */
-
-void
-ui_out_get_field_separator (struct ui_out *uiout)
-{
-}
-
 /* Access to ui-out members data.  */
 
 void *
@@ -1141,6 +1123,28 @@ ui_out_data (struct ui_out *uiout)
   return uiout->data;
 }
 
+/* Access table field parameters.  */
+int
+ui_out_query_field (struct ui_out *uiout, int colno,
+                   int *width, int *alignment, char **col_name)
+{
+  struct ui_out_hdr *hdr;
+
+  if (!uiout->table.flag)
+    return 0;
+
+  for (hdr = uiout->table.header_first; hdr; hdr = hdr->next)
+    if (hdr->colno == colno)
+      {
+       *width = hdr->width;
+       *alignment = hdr->alignment;
+       *col_name = hdr->col_name;
+       return 1;
+      }
+
+  return 0;
+}
+
 /* Initalize private members at startup.  */
 
 struct ui_out *
This page took 0.025118 seconds and 4 git commands to generate.