1 /* Output generating routines for GDB.
3 Copyright (C) 1999-2016 Free Software Foundation, Inc.
5 Contributed by Cygnus Solutions.
6 Written by Fernando Nasser for Cygnus.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #include "expression.h" /* For language.h */
28 /* table header structures */
34 enum ui_align alignment;
37 struct ui_out_hdr *next;
42 /* Count each field; the first element is for non-list fields. */
44 /* The type of this level. */
45 enum ui_out_type type;
48 /* Define uiout->level vector types and operations. */
49 typedef struct ui_out_level *ui_out_level_p;
50 DEF_VEC_P (ui_out_level_p);
52 /* Tables are special. Maintain a separate structure that tracks
53 their state. At present an output can only contain a single table
54 but that restriction might eventually be lifted. */
58 /* If on, a table is being generated. */
61 /* If on, the body of a table is being generated. If off, the table
62 header is being generated. */
65 /* The level at which each entry of the table is to be found. A row
66 (a tuple) is made up of entries. Consequently ENTRY_LEVEL is one
67 above that of the table. */
70 /* Number of table columns (as specified in the table_begin call). */
73 /* String identifying the table (as specified in the table_begin
77 /* Points to the first table header (if any). */
78 struct ui_out_hdr *header_first;
80 /* Points to the last table header (if any). */
81 struct ui_out_hdr *header_last;
83 /* Points to header of NEXT column to format. */
84 struct ui_out_hdr *header_next;
89 /* The ui_out structure */
90 /* Any change here requires a corresponding one in the initialization
91 of the default uiout, which is statically initialized. */
96 /* Specific implementation of ui-out. */
97 const struct ui_out_impl *impl;
103 /* Vector to store and track the ui-out levels. */
104 VEC (ui_out_level_p) *levels;
106 /* A table, if any. At present only a single table is supported. */
107 struct ui_out_table table;
110 /* The current (inner most) level. */
111 static struct ui_out_level *
112 current_level (struct ui_out *uiout)
114 return VEC_index (ui_out_level_p, uiout->levels, uiout->level);
117 /* Create a new level, of TYPE. Return the new level's index. */
119 push_level (struct ui_out *uiout,
120 enum ui_out_type type,
123 struct ui_out_level *current;
126 current = XNEW (struct ui_out_level);
127 current->field_count = 0;
128 current->type = type;
129 VEC_safe_push (ui_out_level_p, uiout->levels, current);
133 /* Discard the current level, return the discarded level's index.
134 TYPE is the type of the level being discarded. */
136 pop_level (struct ui_out *uiout,
137 enum ui_out_type type)
139 struct ui_out_level *current;
141 /* We had better not underflow the buffer. */
142 gdb_assert (uiout->level > 0);
143 gdb_assert (current_level (uiout)->type == type);
144 current = VEC_pop (ui_out_level_p, uiout->levels);
147 return uiout->level + 1;
151 /* These are the default implementation functions. */
153 static void default_table_begin (struct ui_out *uiout, int nbrofcols,
154 int nr_rows, const char *tblid);
155 static void default_table_body (struct ui_out *uiout);
156 static void default_table_end (struct ui_out *uiout);
157 static void default_table_header (struct ui_out *uiout, int width,
158 enum ui_align alig, const char *col_name,
160 static void default_begin (struct ui_out *uiout,
161 enum ui_out_type type,
162 int level, const char *id);
163 static void default_end (struct ui_out *uiout,
164 enum ui_out_type type,
166 static void default_field_int (struct ui_out *uiout, int fldno, int width,
170 static void default_field_skip (struct ui_out *uiout, int fldno, int width,
172 const char *fldname);
173 static void default_field_string (struct ui_out *uiout, int fldno, int width,
177 static void default_field_fmt (struct ui_out *uiout, int fldno,
178 int width, enum ui_align align,
181 va_list args) ATTRIBUTE_PRINTF (6, 0);
182 static void default_spaces (struct ui_out *uiout, int numspaces);
183 static void default_text (struct ui_out *uiout, const char *string);
184 static void default_message (struct ui_out *uiout, int verbosity,
186 va_list args) ATTRIBUTE_PRINTF (3, 0);
187 static void default_wrap_hint (struct ui_out *uiout, char *identstring);
188 static void default_flush (struct ui_out *uiout);
189 static void default_data_destroy (struct ui_out *uiout);
191 /* This is the default ui-out implementation functions vector. */
193 const struct ui_out_impl default_ui_out_impl =
198 default_table_header,
203 default_field_string,
211 default_data_destroy,
212 0, /* Does not need MI hacks. */
215 /* The default ui_out */
217 struct ui_out def_uiout =
220 &default_ui_out_impl, /* impl */
223 /* Pointer to current ui_out */
224 /* FIXME: This should not be a global, but something passed down from main.c
227 struct ui_out *current_uiout = &def_uiout;
229 /* These are the interfaces to implementation functions. */
231 static void uo_table_begin (struct ui_out *uiout, int nbrofcols,
232 int nr_rows, const char *tblid);
233 static void uo_table_body (struct ui_out *uiout);
234 static void uo_table_end (struct ui_out *uiout);
235 static void uo_table_header (struct ui_out *uiout, int width,
236 enum ui_align align, const char *col_name,
238 static void uo_begin (struct ui_out *uiout,
239 enum ui_out_type type,
240 int level, const char *id);
241 static void uo_end (struct ui_out *uiout,
242 enum ui_out_type type,
244 static void uo_field_int (struct ui_out *uiout, int fldno, int width,
245 enum ui_align align, const char *fldname, int value);
246 static void uo_field_skip (struct ui_out *uiout, int fldno, int width,
247 enum ui_align align, const char *fldname);
248 static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
249 enum ui_align align, const char *fldname,
250 const char *format, va_list args)
251 ATTRIBUTE_PRINTF (6, 0);
252 static void uo_spaces (struct ui_out *uiout, int numspaces);
253 static void uo_text (struct ui_out *uiout, const char *string);
254 static void uo_message (struct ui_out *uiout, int verbosity,
255 const char *format, va_list args)
256 ATTRIBUTE_PRINTF (3, 0);
257 static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
258 static void uo_flush (struct ui_out *uiout);
259 static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
260 static void uo_data_destroy (struct ui_out *uiout);
262 /* Prototypes for local functions */
264 extern void _initialize_ui_out (void);
265 static void append_header_to_list (struct ui_out *uiout, int width,
266 enum ui_align alignment, const char *col_name,
268 static int get_next_header (struct ui_out *uiout, int *colno, int *width,
269 enum ui_align *alignment, char **colhdr);
270 static void clear_header_list (struct ui_out *uiout);
271 static void clear_table (struct ui_out *uiout);
272 static void verify_field (struct ui_out *uiout, int *fldno, int *width,
273 enum ui_align *align);
275 /* exported functions (ui_out API) */
277 /* Mark beginning of a table. */
280 ui_out_table_begin (struct ui_out *uiout, int nbrofcols,
284 if (uiout->table.flag)
285 internal_error (__FILE__, __LINE__,
286 _("tables cannot be nested; table_begin found before \
287 previous table_end."));
289 uiout->table.flag = 1;
290 uiout->table.body_flag = 0;
291 uiout->table.entry_level = uiout->level + 1;
292 uiout->table.columns = nbrofcols;
294 uiout->table.id = xstrdup (tblid);
296 uiout->table.id = NULL;
297 clear_header_list (uiout);
299 uo_table_begin (uiout, nbrofcols, nr_rows, uiout->table.id);
303 ui_out_table_body (struct ui_out *uiout)
305 if (!uiout->table.flag)
306 internal_error (__FILE__, __LINE__,
307 _("table_body outside a table is not valid; it must be \
308 after a table_begin and before a table_end."));
309 if (uiout->table.body_flag)
310 internal_error (__FILE__, __LINE__,
311 _("extra table_body call not allowed; there must be \
312 only one table_body after a table_begin and before a table_end."));
313 if (uiout->table.header_next->colno != uiout->table.columns)
314 internal_error (__FILE__, __LINE__,
315 _("number of headers differ from number of table \
318 uiout->table.body_flag = 1;
319 uiout->table.header_next = uiout->table.header_first;
321 uo_table_body (uiout);
325 ui_out_table_end (struct ui_out *uiout)
327 if (!uiout->table.flag)
328 internal_error (__FILE__, __LINE__,
329 _("misplaced table_end or missing table_begin."));
331 uiout->table.entry_level = 0;
332 uiout->table.body_flag = 0;
333 uiout->table.flag = 0;
335 uo_table_end (uiout);
340 ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
341 const char *col_name,
344 if (!uiout->table.flag || uiout->table.body_flag)
345 internal_error (__FILE__, __LINE__,
346 _("table header must be specified after table_begin \
347 and before table_body."));
349 append_header_to_list (uiout, width, alignment, col_name, colhdr);
351 uo_table_header (uiout, width, alignment, col_name, colhdr);
355 do_cleanup_table_end (void *data)
357 struct ui_out *ui_out = (struct ui_out *) data;
359 ui_out_table_end (ui_out);
363 make_cleanup_ui_out_table_begin_end (struct ui_out *ui_out, int nr_cols,
364 int nr_rows, const char *tblid)
366 ui_out_table_begin (ui_out, nr_cols, nr_rows, tblid);
367 return make_cleanup (do_cleanup_table_end, ui_out);
371 ui_out_begin (struct ui_out *uiout,
372 enum ui_out_type type,
377 if (uiout->table.flag && !uiout->table.body_flag)
378 internal_error (__FILE__, __LINE__,
379 _("table header or table_body expected; lists must be \
380 specified after table_body."));
382 /* Be careful to verify the ``field'' before the new tuple/list is
383 pushed onto the stack. That way the containing list/table/row is
384 verified and not the newly created tuple/list. This verification
385 is needed (at least) for the case where a table row entry
386 contains either a tuple/list. For that case bookkeeping such as
387 updating the column count or advancing to the next heading still
388 needs to be performed. */
394 verify_field (uiout, &fldno, &width, &align);
397 new_level = push_level (uiout, type, id);
399 /* If the push puts us at the same level as a table row entry, we've
400 got a new table row. Put the header pointer back to the start. */
401 if (uiout->table.body_flag
402 && uiout->table.entry_level == new_level)
403 uiout->table.header_next = uiout->table.header_first;
405 uo_begin (uiout, type, new_level, id);
409 ui_out_end (struct ui_out *uiout,
410 enum ui_out_type type)
412 int old_level = pop_level (uiout, type);
414 uo_end (uiout, type, old_level);
417 struct ui_out_end_cleanup_data
419 struct ui_out *uiout;
420 enum ui_out_type type;
424 do_cleanup_end (void *data)
426 struct ui_out_end_cleanup_data *end_cleanup_data
427 = (struct ui_out_end_cleanup_data *) data;
429 ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
430 xfree (end_cleanup_data);
433 static struct cleanup *
434 make_cleanup_ui_out_end (struct ui_out *uiout,
435 enum ui_out_type type)
437 struct ui_out_end_cleanup_data *end_cleanup_data;
439 end_cleanup_data = XNEW (struct ui_out_end_cleanup_data);
440 end_cleanup_data->uiout = uiout;
441 end_cleanup_data->type = type;
442 return make_cleanup (do_cleanup_end, end_cleanup_data);
446 make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
449 ui_out_begin (uiout, ui_out_type_tuple, id);
450 return make_cleanup_ui_out_end (uiout, ui_out_type_tuple);
454 make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
457 ui_out_begin (uiout, ui_out_type_list, id);
458 return make_cleanup_ui_out_end (uiout, ui_out_type_list);
462 ui_out_field_int (struct ui_out *uiout,
470 verify_field (uiout, &fldno, &width, &align);
472 uo_field_int (uiout, fldno, width, align, fldname, value);
476 ui_out_field_fmt_int (struct ui_out *uiout,
478 enum ui_align input_align,
486 verify_field (uiout, &fldno, &width, &align);
488 uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
491 /* Documented in ui-out.h. */
494 ui_out_field_core_addr (struct ui_out *uiout,
496 struct gdbarch *gdbarch,
499 ui_out_field_string (uiout, fldname,
500 print_core_address (gdbarch, address));
504 ui_out_field_stream (struct ui_out *uiout,
506 struct ui_file *stream)
509 char *buffer = ui_file_xstrdup (stream, &length);
510 struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
513 ui_out_field_string (uiout, fldname, buffer);
515 ui_out_field_skip (uiout, fldname);
516 ui_file_rewind (stream);
517 do_cleanups (old_cleanup);
520 /* Used to omit a field. */
523 ui_out_field_skip (struct ui_out *uiout,
530 verify_field (uiout, &fldno, &width, &align);
532 uo_field_skip (uiout, fldno, width, align, fldname);
536 ui_out_field_string (struct ui_out *uiout,
544 verify_field (uiout, &fldno, &width, &align);
546 uo_field_string (uiout, fldno, width, align, fldname, string);
551 ui_out_field_fmt (struct ui_out *uiout,
553 const char *format, ...)
560 /* Will not align, but has to call anyway. */
561 verify_field (uiout, &fldno, &width, &align);
563 va_start (args, format);
565 uo_field_fmt (uiout, fldno, width, align, fldname, format, args);
571 ui_out_spaces (struct ui_out *uiout, int numspaces)
573 uo_spaces (uiout, numspaces);
577 ui_out_text (struct ui_out *uiout,
580 uo_text (uiout, string);
584 ui_out_message (struct ui_out *uiout, int verbosity,
585 const char *format,...)
589 va_start (args, format);
590 uo_message (uiout, verbosity, format, args);
595 ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
597 uo_wrap_hint (uiout, identstring);
601 ui_out_flush (struct ui_out *uiout)
607 ui_out_redirect (struct ui_out *uiout, struct ui_file *outstream)
609 return uo_redirect (uiout, outstream);
612 /* Set the flags specified by the mask given. */
614 ui_out_set_flags (struct ui_out *uiout, int mask)
616 int oldflags = uiout->flags;
618 uiout->flags |= mask;
622 /* Clear the flags specified by the mask given. */
624 ui_out_clear_flags (struct ui_out *uiout, int mask)
626 int oldflags = uiout->flags;
628 uiout->flags &= ~mask;
632 /* Test the flags against the mask given. */
634 ui_out_test_flags (struct ui_out *uiout, int mask)
636 return (uiout->flags & mask);
639 /* Obtain the current verbosity level (as stablished by the
640 'set verbositylevel' command. */
643 ui_out_get_verblvl (struct ui_out *uiout)
645 /* FIXME: not implemented yet. */
650 ui_out_is_mi_like_p (struct ui_out *uiout)
652 return uiout->impl->is_mi_like_p;
655 /* Default gdb-out hook functions. */
658 default_table_begin (struct ui_out *uiout, int nbrofcols,
665 default_table_body (struct ui_out *uiout)
670 default_table_end (struct ui_out *uiout)
675 default_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
676 const char *col_name,
682 default_begin (struct ui_out *uiout,
683 enum ui_out_type type,
690 default_end (struct ui_out *uiout,
691 enum ui_out_type type,
697 default_field_int (struct ui_out *uiout, int fldno, int width,
699 const char *fldname, int value)
704 default_field_skip (struct ui_out *uiout, int fldno, int width,
705 enum ui_align align, const char *fldname)
710 default_field_string (struct ui_out *uiout,
720 default_field_fmt (struct ui_out *uiout, int fldno, int width,
729 default_spaces (struct ui_out *uiout, int numspaces)
734 default_text (struct ui_out *uiout, const char *string)
739 default_message (struct ui_out *uiout, int verbosity,
746 default_wrap_hint (struct ui_out *uiout, char *identstring)
751 default_flush (struct ui_out *uiout)
756 default_data_destroy (struct ui_out *uiout)
760 /* Interface to the implementation functions. */
763 uo_table_begin (struct ui_out *uiout, int nbrofcols,
767 if (!uiout->impl->table_begin)
769 uiout->impl->table_begin (uiout, nbrofcols, nr_rows, tblid);
773 uo_table_body (struct ui_out *uiout)
775 if (!uiout->impl->table_body)
777 uiout->impl->table_body (uiout);
781 uo_table_end (struct ui_out *uiout)
783 if (!uiout->impl->table_end)
785 uiout->impl->table_end (uiout);
789 uo_table_header (struct ui_out *uiout, int width, enum ui_align align,
790 const char *col_name,
793 if (!uiout->impl->table_header)
795 uiout->impl->table_header (uiout, width, align, col_name, colhdr);
798 /* Clear the table associated with UIOUT. */
801 clear_table (struct ui_out *uiout)
803 xfree (uiout->table.id);
804 uiout->table.id = NULL;
805 clear_header_list (uiout);
809 uo_begin (struct ui_out *uiout,
810 enum ui_out_type type,
814 if (uiout->impl->begin == NULL)
816 uiout->impl->begin (uiout, type, level, id);
820 uo_end (struct ui_out *uiout,
821 enum ui_out_type type,
824 if (uiout->impl->end == NULL)
826 uiout->impl->end (uiout, type, level);
830 uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align,
834 if (!uiout->impl->field_int)
836 uiout->impl->field_int (uiout, fldno, width, align, fldname, value);
840 uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align,
843 if (!uiout->impl->field_skip)
845 uiout->impl->field_skip (uiout, fldno, width, align, fldname);
849 uo_field_string (struct ui_out *uiout, int fldno, int width,
854 if (!uiout->impl->field_string)
856 uiout->impl->field_string (uiout, fldno, width, align, fldname, string);
860 uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align,
865 if (!uiout->impl->field_fmt)
867 uiout->impl->field_fmt (uiout, fldno, width, align, fldname, format, args);
871 uo_spaces (struct ui_out *uiout, int numspaces)
873 if (!uiout->impl->spaces)
875 uiout->impl->spaces (uiout, numspaces);
879 uo_text (struct ui_out *uiout,
882 if (!uiout->impl->text)
884 uiout->impl->text (uiout, string);
888 uo_message (struct ui_out *uiout, int verbosity,
892 if (!uiout->impl->message)
894 uiout->impl->message (uiout, verbosity, format, args);
898 uo_wrap_hint (struct ui_out *uiout, char *identstring)
900 if (!uiout->impl->wrap_hint)
902 uiout->impl->wrap_hint (uiout, identstring);
906 uo_flush (struct ui_out *uiout)
908 if (!uiout->impl->flush)
910 uiout->impl->flush (uiout);
914 uo_redirect (struct ui_out *uiout, struct ui_file *outstream)
916 if (!uiout->impl->redirect)
918 uiout->impl->redirect (uiout, outstream);
923 uo_data_destroy (struct ui_out *uiout)
925 if (!uiout->impl->data_destroy)
928 uiout->impl->data_destroy (uiout);
931 /* local functions */
933 /* List of column headers manipulation routines. */
936 clear_header_list (struct ui_out *uiout)
938 while (uiout->table.header_first != NULL)
940 uiout->table.header_next = uiout->table.header_first;
941 uiout->table.header_first = uiout->table.header_first->next;
942 xfree (uiout->table.header_next->colhdr);
943 xfree (uiout->table.header_next->col_name);
944 xfree (uiout->table.header_next);
946 gdb_assert (uiout->table.header_first == NULL);
947 uiout->table.header_last = NULL;
948 uiout->table.header_next = NULL;
952 append_header_to_list (struct ui_out *uiout,
954 enum ui_align alignment,
955 const char *col_name,
958 struct ui_out_hdr *temphdr;
960 temphdr = XNEW (struct ui_out_hdr);
961 temphdr->width = width;
962 temphdr->alignment = alignment;
963 /* We have to copy the column title as the original may be an
966 temphdr->colhdr = xstrdup (colhdr);
968 temphdr->colhdr = NULL;
970 if (col_name != NULL)
971 temphdr->col_name = xstrdup (col_name);
972 else if (colhdr != NULL)
973 temphdr->col_name = xstrdup (colhdr);
975 temphdr->col_name = NULL;
977 temphdr->next = NULL;
978 if (uiout->table.header_first == NULL)
981 uiout->table.header_first = temphdr;
982 uiout->table.header_last = temphdr;
986 temphdr->colno = uiout->table.header_last->colno + 1;
987 uiout->table.header_last->next = temphdr;
988 uiout->table.header_last = temphdr;
990 uiout->table.header_next = uiout->table.header_last;
993 /* Extract the format information for the NEXT header and advance
994 the header pointer. Return 0 if there was no next header. */
997 get_next_header (struct ui_out *uiout,
1000 enum ui_align *alignment,
1003 /* There may be no headers at all or we may have used all columns. */
1004 if (uiout->table.header_next == NULL)
1006 *colno = uiout->table.header_next->colno;
1007 *width = uiout->table.header_next->width;
1008 *alignment = uiout->table.header_next->alignment;
1009 *colhdr = uiout->table.header_next->colhdr;
1010 /* Advance the header pointer to the next entry. */
1011 uiout->table.header_next = uiout->table.header_next->next;
1016 /* Verify that the field/tuple/list is correctly positioned. Return
1017 the field number and corresponding alignment (if
1018 available/applicable). */
1021 verify_field (struct ui_out *uiout, int *fldno, int *width,
1022 enum ui_align *align)
1024 struct ui_out_level *current = current_level (uiout);
1027 if (uiout->table.flag)
1029 if (!uiout->table.body_flag)
1030 internal_error (__FILE__, __LINE__,
1031 _("table_body missing; table fields must be \
1032 specified after table_body and inside a list."));
1033 /* NOTE: cagney/2001-12-08: There was a check here to ensure
1034 that this code was only executed when uiout->level was
1035 greater than zero. That no longer applies - this code is run
1036 before each table row tuple is started and at that point the
1040 current->field_count += 1;
1042 if (uiout->table.body_flag
1043 && uiout->table.entry_level == uiout->level
1044 && get_next_header (uiout, fldno, width, align, &text))
1046 if (*fldno != current->field_count)
1047 internal_error (__FILE__, __LINE__,
1048 _("ui-out internal error in handling headers."));
1053 *align = ui_noalign;
1054 *fldno = current->field_count;
1059 /* Access to ui-out members data. */
1062 ui_out_data (struct ui_out *uiout)
1067 /* Access table field parameters. */
1069 ui_out_query_field (struct ui_out *uiout, int colno,
1070 int *width, int *alignment, char **col_name)
1072 struct ui_out_hdr *hdr;
1074 if (!uiout->table.flag)
1077 for (hdr = uiout->table.header_first; hdr; hdr = hdr->next)
1078 if (hdr->colno == colno)
1080 *width = hdr->width;
1081 *alignment = hdr->alignment;
1082 *col_name = hdr->col_name;
1089 /* Initalize private members at startup. */
1092 ui_out_new (const struct ui_out_impl *impl, void *data,
1095 struct ui_out *uiout = XNEW (struct ui_out);
1096 struct ui_out_level *current = XNEW (struct ui_out_level);
1100 uiout->flags = flags;
1101 uiout->table.flag = 0;
1102 uiout->table.body_flag = 0;
1104 uiout->levels = NULL;
1106 /* Create uiout->level 0, the default level. */
1107 current->type = ui_out_type_tuple;
1108 current->field_count = 0;
1109 VEC_safe_push (ui_out_level_p, uiout->levels, current);
1111 uiout->table.id = NULL;
1112 uiout->table.header_first = NULL;
1113 uiout->table.header_last = NULL;
1114 uiout->table.header_next = NULL;
1118 /* Free UIOUT and the memory areas it references. */
1121 ui_out_destroy (struct ui_out *uiout)
1124 struct ui_out_level *current;
1126 /* Make sure that all levels are freed in the case where levels have
1127 been pushed, but not popped before the ui_out object is
1130 VEC_iterate (ui_out_level_p, uiout->levels, i, current);
1134 VEC_free (ui_out_level_p, uiout->levels);
1135 uo_data_destroy (uiout);
1136 clear_table (uiout);
1140 /* Standard gdb initialization hook. */
1143 _initialize_ui_out (void)
1145 /* nothing needs to be done */