110 VEC (ui_out_level_p) *levels;
150 current =
VEC_pop (ui_out_level_p, uiout->levels);
153 return uiout->
level + 1;
160 int nr_rows,
const char *tblid);
164 enum ui_align alig,
const char *col_name,
168 int level,
const char *
id);
178 const char *fldname);
238 int nr_rows,
const char *tblid);
242 enum ui_align align,
const char *col_name,
246 int level,
const char *
id);
253 enum ui_align align,
const char *fldname);
255 enum ui_align align,
const char *fldname,
256 const char *format, va_list args)
259 static void uo_text (
struct ui_out *uiout,
const char *
string);
261 const char *format, va_list args)
272 int alignment,
const char *col_name,
275 int *alignment,
char **colhdr);
290 if (uiout->table.flag)
292 _(
"tables cannot be nested; table_begin found before \
293 previous table_end."));
295 uiout->table.flag = 1;
296 uiout->table.body_flag = 0;
297 uiout->table.entry_level = uiout->
level + 1;
298 uiout->table.columns = nbrofcols;
300 uiout->table.id = xstrdup (tblid);
302 uiout->table.id = NULL;
311 if (!uiout->table.flag)
313 _(
"table_body outside a table is not valid; it must be \
314 after a table_begin and before a table_end."));
315 if (uiout->table.body_flag)
317 _(
"extra table_body call not allowed; there must be \
318 only one table_body after a table_begin and before a table_end."));
319 if (uiout->table.header_next->colno != uiout->table.columns)
321 _(
"number of headers differ from number of table \
324 uiout->table.body_flag = 1;
325 uiout->table.header_next = uiout->table.header_first;
333 if (!uiout->table.flag)
335 _(
"misplaced table_end or missing table_begin."));
337 uiout->table.entry_level = 0;
338 uiout->table.body_flag = 0;
339 uiout->table.flag = 0;
347 const char *col_name,
350 if (!uiout->table.flag || uiout->table.body_flag)
352 _(
"table header must be specified after table_begin \
353 and before table_body."));
370 int nr_rows,
const char *tblid)
383 if (uiout->table.flag && !uiout->table.body_flag)
385 _(
"table header or table_body expected; lists must be \
386 specified after table_body."));
407 if (uiout->table.body_flag
408 && uiout->table.entry_level == new_level)
409 uiout->table.header_next = uiout->table.header_first;
411 uo_begin (uiout, type, new_level,
id);
420 uo_end (uiout, type, old_level);
435 xfree (end_cleanup_data);
477 uo_field_int (uiout, fldno, width, align, fldname, value);
493 uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
558 const char *format, ...)
568 va_start (args, format);
570 uo_field_fmt (uiout, fldno, width, align, fldname, format, args);
590 const char *format,...)
594 va_start (args, format);
621 int oldflags = uiout->
flags;
623 uiout->
flags |= mask;
631 int oldflags = uiout->
flags;
633 uiout->
flags &= ~mask;
641 return (uiout->
flags & mask);
681 const char *col_name,
704 const char *fldname,
int value)
710 enum ui_align align,
const char *fldname)
795 const char *col_name,
808 xfree (uiout->table.id);
809 uiout->table.id = NULL;
821 uiout->
impl->
begin (uiout, type, level,
id);
831 uiout->
impl->
end (uiout, type, level);
841 uiout->
impl->
field_int (uiout, fldno, width, align, fldname, value);
872 uiout->
impl->
field_fmt (uiout, fldno, width, align, fldname, format, args);
899 uiout->
impl->
message (uiout, verbosity, format, args);
943 while (uiout->table.header_first != NULL)
945 uiout->table.header_next = uiout->table.header_first;
946 uiout->table.header_first = uiout->table.header_first->next;
947 xfree (uiout->table.header_next->colhdr);
948 xfree (uiout->table.header_next->col_name);
949 xfree (uiout->table.header_next);
951 gdb_assert (uiout->table.header_first == NULL);
952 uiout->table.header_last = NULL;
953 uiout->table.header_next = NULL;
960 const char *col_name,
971 temphdr->
colhdr = xstrdup (colhdr);
975 if (col_name != NULL)
976 temphdr->
col_name = xstrdup (col_name);
977 else if (colhdr != NULL)
978 temphdr->
col_name = xstrdup (colhdr);
982 temphdr->
next = NULL;
983 if (uiout->table.header_first == NULL)
986 uiout->table.header_first = temphdr;
987 uiout->table.header_last = temphdr;
991 temphdr->
colno = uiout->table.header_last->colno + 1;
992 uiout->table.header_last->next = temphdr;
993 uiout->table.header_last = temphdr;
995 uiout->table.header_next = uiout->table.header_last;
1009 if (uiout->table.header_next == NULL)
1011 *colno = uiout->table.header_next->colno;
1012 *width = uiout->table.header_next->width;
1013 *alignment = uiout->table.header_next->alignment;
1014 *colhdr = uiout->table.header_next->colhdr;
1016 uiout->table.header_next = uiout->table.header_next->next;
1031 if (uiout->table.flag)
1033 if (!uiout->table.body_flag)
1035 _(
"table_body missing; table fields must be \
1036 specified after table_body and inside a list."));
1046 if (uiout->table.body_flag
1047 && uiout->table.entry_level == uiout->
level
1052 _(
"ui-out internal error in handling headers."));
1074 int *width,
int *alignment,
char **col_name)
1078 if (!uiout->table.flag)
1081 for (hdr = uiout->table.header_first; hdr; hdr = hdr->
next)
1082 if (hdr->
colno == colno)
1084 *width = hdr->
width;
1105 uiout->table.flag = 0;
1106 uiout->table.body_flag = 0;
1108 uiout->levels = NULL;
1115 uiout->table.id = NULL;
1116 uiout->table.header_first = NULL;
1117 uiout->table.header_last = NULL;
1118 uiout->table.header_next = NULL;
1134 VEC_iterate (ui_out_level_p, uiout->levels, i, current);
1138 VEC_free (ui_out_level_p, uiout->levels);
static void do_cleanup_end(void *data)
static void default_text(struct ui_out *uiout, const char *string)
static void uo_table_header(struct ui_out *uiout, int width, enum ui_align align, const char *col_name, const char *colhdr)
static void uo_text(struct ui_out *uiout, const char *string)
struct ui_out_hdr * header_last
void ui_out_wrap_hint(struct ui_out *uiout, char *identstring)
int ui_out_get_verblvl(struct ui_out *uiout)
void ui_out_field_stream(struct ui_out *uiout, const char *fldname, struct ui_file *stream)
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
void ui_out_end(struct ui_out *uiout, enum ui_out_type type)
void ui_out_spaces(struct ui_out *uiout, int numspaces)
static struct cleanup * make_cleanup_ui_out_end(struct ui_out *uiout, enum ui_out_type type)
static void ui_out_table_end(struct ui_out *uiout)
redirect_ftype * redirect
static void static void default_wrap_hint(struct ui_out *uiout, char *identstring)
struct ui_out_hdr * header_first
static void uo_table_end(struct ui_out *uiout)
char * ui_file_xstrdup(struct ui_file *file, long *length)
struct cleanup * make_cleanup_ui_out_table_begin_end(struct ui_out *ui_out, int nr_cols, int nr_rows, const char *tblid)
static void uo_begin(struct ui_out *uiout, enum ui_out_type type, int level, const char *id)
void internal_error(const char *file, int line, const char *fmt,...)
static void append_header_to_list(struct ui_out *uiout, int width, int alignment, const char *col_name, const char *colhdr)
int ui_out_is_mi_like_p(struct ui_out *uiout)
static void uo_field_skip(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname)
static void default_table_body(struct ui_out *uiout)
int ui_out_test_flags(struct ui_out *uiout, int mask)
int ui_out_set_flags(struct ui_out *uiout, int mask)
#define VEC_safe_push(T, V, O)
table_end_ftype * table_end
static void static void uo_wrap_hint(struct ui_out *uiout, char *identstring)
void _initialize_ui_out(void)
static void do_cleanup_table_end(void *data)
struct ui_out_level * ui_out_level_p
void ui_out_field_fmt(struct ui_out *uiout, const char *fldname, const char *format,...)
static int pop_level(struct ui_out *uiout, enum ui_out_type type)
static void default_table_header(struct ui_out *uiout, int width, enum ui_align alig, const char *col_name, const char *colhdr)
void ui_out_text(struct ui_out *uiout, const char *string)
table_begin_ftype * table_begin
field_fmt_ftype * field_fmt
static int push_level(struct ui_out *uiout, enum ui_out_type type, const char *id)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
static int get_next_header(struct ui_out *uiout, int *colno, int *width, int *alignment, char **colhdr)
void ui_out_flush(struct ui_out *uiout)
#define VEC_iterate(T, V, I, P)
static void default_field_int(struct ui_out *uiout, int fldno, int width, enum ui_align alig, const char *fldname, int value)
void ui_out_destroy(struct ui_out *uiout)
void ui_out_field_skip(struct ui_out *uiout, const char *fldname)
static void uo_data_destroy(struct ui_out *uiout)
struct cleanup * make_cleanup_ui_out_list_begin_end(struct ui_out *uiout, const char *id)
struct cleanup * make_cleanup_ui_out_tuple_begin_end(struct ui_out *uiout, const char *id)
static void static void default_spaces(struct ui_out *uiout, int numspaces)
data_destroy_ftype * data_destroy
static void ui_out_table_begin(struct ui_out *uiout, int nbrofcols, int nr_rows, const char *tblid)
struct ui_out_hdr * header_next
static void uo_table_body(struct ui_out *uiout)
static void default_table_end(struct ui_out *uiout)
void ui_out_message(struct ui_out *uiout, int verbosity, const char *format,...)
DEF_VEC_P(ui_out_level_p)
field_skip_ftype * field_skip
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static void default_field_string(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *string)
struct ui_out * ui_out_new(const struct ui_out_impl *impl, void *data, int flags)
static void default_end(struct ui_out *uiout, enum ui_out_type type, int level)
#define VEC_index(T, V, I)
wrap_hint_ftype * wrap_hint
static void default_table_begin(struct ui_out *uiout, int nbrofcols, int nr_rows, const char *tblid)
void ui_out_begin(struct ui_out *uiout, enum ui_out_type type, const char *id)
static void clear_table(struct ui_out *uiout)
static void default_flush(struct ui_out *uiout)
int ui_out_query_field(struct ui_out *uiout, int colno, int *width, int *alignment, char **col_name)
field_string_ftype * field_string
static void uo_field_int(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, int value)
static void uo_flush(struct ui_out *uiout)
table_body_ftype * table_body
static void static void uo_spaces(struct ui_out *uiout, int numspaces)
ui_out_begin_ftype * begin
static void uo_end(struct ui_out *uiout, enum ui_out_type type, int level)
static void verify_field(struct ui_out *uiout, int *fldno, int *width, int *align)
static int uo_redirect(struct ui_out *uiout, struct ui_file *outstream)
void ui_out_table_header(struct ui_out *uiout, int width, enum ui_align alignment, const char *col_name, const char *colhdr)
void ui_file_rewind(struct ui_file *file)
const struct ui_out_impl * impl
const char * print_core_address(struct gdbarch *gdbarch, CORE_ADDR address)
int ui_out_redirect(struct ui_out *uiout, struct ui_file *outstream)
void ui_out_field_core_addr(struct ui_out *uiout, const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
void * ui_out_data(struct ui_out *uiout)
static void ATTRIBUTE_PRINTF(6, 0)
void uo_field_string(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *string)
void ui_out_field_fmt_int(struct ui_out *uiout, int input_width, enum ui_align input_align, const char *fldname, int value)
static void default_field_skip(struct ui_out *uiout, int fldno, int width, enum ui_align alig, const char *fldname)
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
int ui_out_clear_flags(struct ui_out *uiout, int mask)
static void default_data_destroy(struct ui_out *uiout)
void ui_out_table_body(struct ui_out *uiout)
static void default_message(struct ui_out *uiout, int verbosity, const char *format, va_list args) ATTRIBUTE_PRINTF(3
table_header_ftype * table_header
static void clear_header_list(struct ui_out *uiout)
static void uo_message(struct ui_out *uiout, int verbosity, const char *format, va_list args) ATTRIBUTE_PRINTF(3
const struct ui_out_impl default_ui_out_impl
static void default_begin(struct ui_out *uiout, enum ui_out_type type, int level, const char *id)
field_int_ftype * field_int
static void uo_field_fmt(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *format, va_list args) ATTRIBUTE_PRINTF(6
static void default_field_fmt(struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *format, va_list args) ATTRIBUTE_PRINTF(6
void do_cleanups(struct cleanup *old_chain)
static struct ui_out_level * current_level(struct ui_out *uiout)
static void uo_table_begin(struct ui_out *uiout, int nbrofcols, int nr_rows, const char *tblid)