aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r--gdb/ui-out.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index ebb312a..4d3bf0c 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -124,6 +124,7 @@ push_level (struct ui_out *uiout,
const char *id)
{
struct ui_out_level *current;
+
/* We had better not overflow the buffer. */
uiout->level++;
gdb_assert (uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS);
@@ -371,6 +372,7 @@ ui_out_begin (struct ui_out *uiout,
const char *id)
{
int new_level;
+
if (uiout->table.flag && !uiout->table.body_flag)
internal_error (__FILE__, __LINE__,
_("table header or table_body expected; lists must be \
@@ -387,6 +389,7 @@ specified after table_body."));
int fldno;
int width;
int align;
+
verify_field (uiout, &fldno, &width, &align);
}
@@ -406,6 +409,7 @@ ui_out_end (struct ui_out *uiout,
enum ui_out_type type)
{
int old_level = pop_level (uiout, type);
+
uo_end (uiout, type, old_level);
}
@@ -419,6 +423,7 @@ static void
do_cleanup_end (void *data)
{
struct ui_out_end_cleanup_data *end_cleanup_data = data;
+
ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
xfree (end_cleanup_data);
}
@@ -428,6 +433,7 @@ make_cleanup_ui_out_end (struct ui_out *uiout,
enum ui_out_type type)
{
struct ui_out_end_cleanup_data *end_cleanup_data;
+
end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
end_cleanup_data->uiout = uiout;
end_cleanup_data->type = type;
@@ -511,6 +517,7 @@ ui_out_field_stream (struct ui_out *uiout,
long length;
char *buffer = ui_file_xstrdup (buf->stream, &length);
struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
+
if (length > 0)
ui_out_field_string (uiout, fldname, buffer);
else
@@ -589,9 +596,7 @@ ui_out_message (struct ui_out *uiout, int verbosity,
va_list args;
va_start (args, format);
-
uo_message (uiout, verbosity, format, args);
-
va_end (args);
}
@@ -651,7 +656,6 @@ ui_out_set_flags (struct ui_out *uiout, int mask)
int oldflags = uiout->flags;
uiout->flags |= mask;
-
return oldflags;
}
@@ -662,7 +666,6 @@ ui_out_clear_flags (struct ui_out *uiout, int mask)
int oldflags = uiout->flags;
uiout->flags &= ~mask;
-
return oldflags;
}
@@ -1145,6 +1148,7 @@ ui_out_new (struct ui_out_impl *impl, void *data,
int flags)
{
struct ui_out *uiout = XMALLOC (struct ui_out);
+
uiout->data = data;
uiout->impl = impl;
uiout->flags = flags;