Add support for AVX512VL. Add AVX512VL versions of AVX512F instructions.
[deliverable/binutils-gdb.git] / gdb / cli-out.c
index 9a8515d98549e44840c485af00c91eae3df85495..eedbd2c24ffa68f6c49f986b8077e028df584bad 100644 (file)
@@ -1,7 +1,6 @@
 /* Output generating routines for GDB CLI.
 
-   Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
@@ -24,7 +23,7 @@
 #include "defs.h"
 #include "ui-out.h"
 #include "cli-out.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "vec.h"
 
@@ -41,6 +40,17 @@ static void out_field_fmt (struct ui_out *uiout, int fldno,
                           const char *fldname,
                           const char *format,...) ATTRIBUTE_PRINTF (4, 5);
 
+/* The destructor.  */
+
+static void
+cli_uiout_dtor (struct ui_out *ui_out)
+{
+  cli_out_data *data = ui_out_data (ui_out);
+
+  VEC_free (ui_filep, data->streams);
+  xfree (data);
+}
+
 /* These are the CLI output functions */
 
 /* Mark beginning of a table */
@@ -139,7 +149,7 @@ cli_field_int (struct ui_out *uiout, int fldno, int width,
 
   if (data->suppress_output)
     return;
-  sprintf (buffer, "%d", value);
+  xsnprintf (buffer, sizeof (buffer), "%d", value);
 
   /* Always go through the function pointer (virtual function call).
      We may have been extended.  */
@@ -342,7 +352,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
 static void
 field_separator (void)
 {
-  cli_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (current_uiout);
   struct ui_file *stream = VEC_last (ui_filep, data->streams);
 
   fputc_filtered (' ', stream);
@@ -350,10 +360,7 @@ field_separator (void)
 
 /* This is the CLI ui-out implementation functions vector */
 
-/* FIXME: This can be initialized dynamically after default is set to
-   handle initial output in main.c */
-
-struct ui_out_impl cli_ui_out_impl =
+const struct ui_out_impl cli_ui_out_impl =
 {
   cli_table_begin,
   cli_table_body,
@@ -371,6 +378,7 @@ struct ui_out_impl cli_ui_out_impl =
   cli_wrap_hint,
   cli_flush,
   cli_redirect,
+  cli_uiout_dtor,
   0, /* Does not need MI hacks (i.e. needs CLI hacks).  */
 };
 
@@ -393,7 +401,7 @@ struct ui_out *
 cli_out_new (struct ui_file *stream)
 {
   int flags = ui_source_list;
-  cli_out_data *data = XMALLOC (cli_out_data);
+  cli_out_data *data = XNEW (cli_out_data);
 
   cli_out_data_ctor (data, stream);
   return ui_out_new (&cli_ui_out_impl, data, flags);
This page took 0.024878 seconds and 4 git commands to generate.