Eliminate struct ui_stream.
* ui-out.h (struct ui_stream): Delete.
(ui_out_field_stream): Adjust prototype.
(ui_out_stream_new, ui_out_stream_delete)
(make_cleanup_ui_out_stream_delete): Delete declarations.
* ui-out.c (ui_out_field_stream): Change prototype to take a
ui_file instead of a ui_stream. Adjust.
(ui_out_stream_new, ui_out_stream_delete, do_stream_delete)
(make_cleanup_ui_out_stream_delete): Delete.
* breakpoint.c (print_breakpoint_location)
(print_one_detail_ranged_breakpoint, print_it_watchpoint): Use
ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new.
* disasm.c (dump_insns): Ditto.
(do_mixed_source_and_assembly, do_assembly_only): Adjust
prototype.
(gdb_disassembly): Use ui_file/mem_fileopen instead of
ui_stream/ui_out_stream_new.
* infcmd.c (print_return_value): Ditto.
* osdata.c (info_osdata_command): Don't allocate a local
ui_stream.
* stack.c (print_frame_arg, print_frame_args, print_frame): Use
ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new.
* tracepoint.c (print_one_static_tracepoint_marker): Don't
allocate a local ui_stream.
* mi/mi-cmd-stack.c (list_arg_or_local): Use ui_file/mem_fileopen
instead of ui_stream/ui_out_stream_new.
(list_args_or_locals): Don't allocate a local ui_stream.
* mi/mi-main.c (get_register, mi_cmd_data_evaluate_expression)
(mi_cmd_data_read_memory): Use ui_file/mem_fileopen instead of
ui_stream/ui_out_stream_new.
* cli/cli-setshow.c (do_setshow_command): Ditto.
+2012-03-27 Pedro Alves <palves@redhat.com>
+
+ Eliminate struct ui_stream.
+
+ * ui-out.h (struct ui_stream): Delete.
+ (ui_out_field_stream): Adjust prototype.
+ (ui_out_stream_new, ui_out_stream_delete)
+ (make_cleanup_ui_out_stream_delete): Delete declarations.
+ * ui-out.c (ui_out_field_stream): Change prototype to take a
+ ui_file instead of a ui_stream. Adjust.
+ (ui_out_stream_new, ui_out_stream_delete, do_stream_delete)
+ (make_cleanup_ui_out_stream_delete): Delete.
+ * breakpoint.c (print_breakpoint_location)
+ (print_one_detail_ranged_breakpoint, print_it_watchpoint): Use
+ ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new.
+ * disasm.c (dump_insns): Ditto.
+ (do_mixed_source_and_assembly, do_assembly_only): Adjust
+ prototype.
+ (gdb_disassembly): Use ui_file/mem_fileopen instead of
+ ui_stream/ui_out_stream_new.
+ * infcmd.c (print_return_value): Ditto.
+ * osdata.c (info_osdata_command): Don't allocate a local
+ ui_stream.
+ * stack.c (print_frame_arg, print_frame_args, print_frame): Use
+ ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new.
+ * tracepoint.c (print_one_static_tracepoint_marker): Don't
+ allocate a local ui_stream.
+ * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_file/mem_fileopen
+ instead of ui_stream/ui_out_stream_new.
+ (list_args_or_locals): Don't allocate a local ui_stream.
+ * mi/mi-main.c (get_register, mi_cmd_data_evaluate_expression)
+ (mi_cmd_data_read_memory): Use ui_file/mem_fileopen instead of
+ ui_stream/ui_out_stream_new.
+ * cli/cli-setshow.c (do_setshow_command): Ditto.
+
2012-03-27 Oza Pawandeep <oza.pawandeep@gmail.com>
* arm-linux-tdep.c (arm_linux_init_abi): Call
}
else if (loc)
{
- struct ui_stream *stb = ui_out_stream_new (uiout);
- struct cleanup *stb_chain = make_cleanup_ui_out_stream_delete (stb);
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *stb_chain = make_cleanup_ui_file_delete (stb);
- print_address_symbolic (loc->gdbarch, loc->address, stb->stream,
+ print_address_symbolic (loc->gdbarch, loc->address, stb,
demangle, "");
ui_out_field_stream (uiout, "at", stb);
{
CORE_ADDR address_start, address_end;
struct bp_location *bl = b->loc;
- struct ui_stream *stb = ui_out_stream_new (uiout);
- struct cleanup *cleanup = make_cleanup_ui_out_stream_delete (stb);
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *cleanup = make_cleanup_ui_file_delete (stb);
gdb_assert (bl);
address_end = address_start + bl->length - 1;
ui_out_text (uiout, "\taddress range: ");
- fprintf_unfiltered (stb->stream, "[%s, %s]",
+ fprintf_unfiltered (stb, "[%s, %s]",
print_core_address (bl->gdbarch, address_start),
print_core_address (bl->gdbarch, address_end));
ui_out_field_stream (uiout, "addr", stb);
struct cleanup *old_chain;
struct breakpoint *b;
const struct bp_location *bl;
- struct ui_stream *stb;
+ struct ui_file *stb;
enum print_stop_action result;
struct watchpoint *w;
struct ui_out *uiout = current_uiout;
b = bs->breakpoint_at;
w = (struct watchpoint *) b;
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
switch (b->type)
{
mention (b);
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
- watchpoint_value_print (bs->old_val, stb->stream);
+ watchpoint_value_print (bs->old_val, stb);
ui_out_field_stream (uiout, "old", stb);
ui_out_text (uiout, "\nNew value = ");
- watchpoint_value_print (w->val, stb->stream);
+ watchpoint_value_print (w->val, stb);
ui_out_field_stream (uiout, "new", stb);
ui_out_text (uiout, "\n");
/* More than one watchpoint may have been triggered. */
mention (b);
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
- watchpoint_value_print (w->val, stb->stream);
+ watchpoint_value_print (w->val, stb);
ui_out_field_stream (uiout, "value", stb);
ui_out_text (uiout, "\n");
result = PRINT_UNKNOWN;
mention (b);
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
- watchpoint_value_print (bs->old_val, stb->stream);
+ watchpoint_value_print (bs->old_val, stb);
ui_out_field_stream (uiout, "old", stb);
ui_out_text (uiout, "\nNew value = ");
}
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
}
- watchpoint_value_print (w->val, stb->stream);
+ watchpoint_value_print (w->val, stb);
ui_out_field_stream (uiout, "new", stb);
ui_out_text (uiout, "\n");
result = PRINT_UNKNOWN;
else if (c->type == show_cmd)
{
struct cleanup *old_chain;
- struct ui_stream *stb;
+ struct ui_file *stb;
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
/* Possibly call the pre hook. */
if (c->pre_show_hook)
{
case var_string:
if (*(char **) c->var)
- fputstr_filtered (*(char **) c->var, '"', stb->stream);
+ fputstr_filtered (*(char **) c->var, '"', stb);
break;
case var_string_noescape:
case var_optional_filename:
case var_filename:
case var_enum:
if (*(char **) c->var)
- fputs_filtered (*(char **) c->var, stb->stream);
+ fputs_filtered (*(char **) c->var, stb);
break;
case var_boolean:
- fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
+ fputs_filtered (*(int *) c->var ? "on" : "off", stb);
break;
case var_auto_boolean:
switch (*(enum auto_boolean*) c->var)
{
case AUTO_BOOLEAN_TRUE:
- fputs_filtered ("on", stb->stream);
+ fputs_filtered ("on", stb);
break;
case AUTO_BOOLEAN_FALSE:
- fputs_filtered ("off", stb->stream);
+ fputs_filtered ("off", stb);
break;
case AUTO_BOOLEAN_AUTO:
- fputs_filtered ("auto", stb->stream);
+ fputs_filtered ("auto", stb);
break;
default:
internal_error (__FILE__, __LINE__,
case var_zuinteger:
if (c->var_type == var_uinteger
&& *(unsigned int *) c->var == UINT_MAX)
- fputs_filtered ("unlimited", stb->stream);
+ fputs_filtered ("unlimited", stb);
else
- fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
+ fprintf_filtered (stb, "%u", *(unsigned int *) c->var);
break;
case var_integer:
case var_zinteger:
if (c->var_type == var_integer
&& *(int *) c->var == INT_MAX)
- fputs_filtered ("unlimited", stb->stream);
+ fputs_filtered ("unlimited", stb);
else
- fprintf_filtered (stb->stream, "%d", *(int *) c->var);
+ fprintf_filtered (stb, "%d", *(int *) c->var);
break;
default:
ui_out_field_stream (uiout, "value", stb);
else
{
- char *value = ui_file_xstrdup (stb->stream, NULL);
+ char *value = ui_file_xstrdup (stb, NULL);
make_cleanup (xfree, value);
if (c->show_value_func != NULL)
dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
struct disassemble_info * di,
CORE_ADDR low, CORE_ADDR high,
- int how_many, int flags, struct ui_stream *stb)
+ int how_many, int flags, struct ui_file *stb)
{
int num_displayed = 0;
CORE_ADDR pc;
if (name != NULL)
xfree (name);
- ui_file_rewind (stb->stream);
+ ui_file_rewind (stb);
if (flags & DISASSEMBLY_RAW_INSN)
{
CORE_ADDR old_pc = pc;
/* Build the opcodes using a temporary stream so we can
write them out in a single go for the MI. */
- struct ui_stream *opcode_stream = ui_out_stream_new (uiout);
+ struct ui_file *opcode_stream = mem_fileopen ();
struct cleanup *cleanups =
- make_cleanup_ui_out_stream_delete (opcode_stream);
+ make_cleanup_ui_file_delete (opcode_stream);
pc += gdbarch_print_insn (gdbarch, pc, di);
for (;old_pc < pc; old_pc++)
status = (*di->read_memory_func) (old_pc, &data, 1, di);
if (status != 0)
(*di->memory_error_func) (status, old_pc, di);
- fprintf_filtered (opcode_stream->stream, "%s%02x",
+ fprintf_filtered (opcode_stream, "%s%02x",
spacer, (unsigned) data);
spacer = " ";
}
else
pc += gdbarch_print_insn (gdbarch, pc, di);
ui_out_field_stream (uiout, "inst", stb);
- ui_file_rewind (stb->stream);
+ ui_file_rewind (stb);
do_cleanups (ui_out_chain);
ui_out_text (uiout, "\n");
}
struct linetable_entry *le,
CORE_ADDR low, CORE_ADDR high,
struct symtab *symtab,
- int how_many, int flags, struct ui_stream *stb)
+ int how_many, int flags, struct ui_file *stb)
{
int newlines = 0;
struct dis_line_entry *mle;
do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
struct disassemble_info * di,
CORE_ADDR low, CORE_ADDR high,
- int how_many, int flags, struct ui_stream *stb)
+ int how_many, int flags, struct ui_file *stb)
{
int num_displayed = 0;
struct cleanup *ui_out_chain;
char *file_string, int flags, int how_many,
CORE_ADDR low, CORE_ADDR high)
{
- struct ui_stream *stb = ui_out_stream_new (uiout);
- struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
- struct disassemble_info di = gdb_disassemble_info (gdbarch, stb->stream);
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *cleanups = make_cleanup_ui_file_delete (stb);
+ struct disassemble_info di = gdb_disassemble_info (gdbarch, stb);
/* To collect the instruction outputted from opcodes. */
struct symtab *symtab = NULL;
struct linetable_entry *le = NULL;
print_return_value (struct type *func_type, struct type *value_type)
{
struct value *value = get_return_value (func_type, value_type);
- struct cleanup *old_chain;
- struct ui_stream *stb;
struct ui_out *uiout = current_uiout;
if (value)
{
struct value_print_options opts;
+ struct ui_file *stb;
+ struct cleanup *old_chain;
/* Print it. */
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
record_latest_value (value));
ui_out_text (uiout, " = ");
get_raw_print_options (&opts);
- value_print (value, stb->stream, &opts);
+ value_print (value, stb, &opts);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
do_cleanups (old_chain);
list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
enum print_values values)
{
+ struct cleanup *old_chain;
struct cleanup *cleanup_tuple = NULL;
struct ui_out *uiout = current_uiout;
- struct ui_stream *stb = ui_out_stream_new (uiout);
+ struct ui_file *stb;
+
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
gdb_assert (!arg->val || !arg->error);
gdb_assert ((values == PRINT_NO_VALUES && arg->val == NULL
if (values != PRINT_NO_VALUES || what == all)
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- fputs_filtered (SYMBOL_PRINT_NAME (arg->sym), stb->stream);
+ fputs_filtered (SYMBOL_PRINT_NAME (arg->sym), stb);
if (arg->entry_kind == print_entry_values_only)
- fputs_filtered ("@entry", stb->stream);
+ fputs_filtered ("@entry", stb);
ui_out_field_stream (uiout, "name", stb);
if (what == all && SYMBOL_IS_ARGUMENT (arg->sym))
if (values == PRINT_SIMPLE_VALUES)
{
check_typedef (arg->sym->type);
- type_print (arg->sym->type, "", stb->stream, -1);
+ type_print (arg->sym->type, "", stb, -1);
ui_out_field_stream (uiout, "type", stb);
}
get_raw_print_options (&opts);
opts.deref_ref = 1;
- common_val_print (arg->val, stb->stream, 0, &opts,
+ common_val_print (arg->val, stb, 0, &opts,
language_def (SYMBOL_LANGUAGE (arg->sym)));
}
}
if (except.message)
- fprintf_filtered (stb->stream, _("<error reading variable: %s>"),
+ fprintf_filtered (stb, _("<error reading variable: %s>"),
except.message);
ui_out_field_stream (uiout, "value", stb);
}
- ui_out_stream_delete (stb);
if (values != PRINT_NO_VALUES || what == all)
do_cleanups (cleanup_tuple);
+ do_cleanups (old_chain);
}
/* Print a list of the locals or the arguments for the currently
struct symbol *sym;
struct dict_iterator iter;
struct cleanup *cleanup_list;
- struct ui_stream *stb;
struct type *type;
char *name_of_result;
struct ui_out *uiout = current_uiout;
- stb = ui_out_stream_new (uiout);
-
block = get_frame_block (fi, 0);
switch (what)
block = BLOCK_SUPERBLOCK (block);
}
do_cleanups (cleanup_list);
- ui_out_stream_delete (stb);
}
void
struct ui_out *uiout = current_uiout;
CORE_ADDR addr;
enum lval_type lval;
- struct ui_stream *stb;
struct value *val;
- stb = ui_out_stream_new (uiout);
-
if (format == 'N')
format = 0;
else
{
struct value_print_options opts;
+ struct ui_file *stb;
+ struct cleanup *old_chain;
+
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
get_formatted_print_options (&opts, format);
opts.deref_ref = 1;
val_print (value_type (val),
value_contents_for_printing (val),
value_embedded_offset (val), 0,
- stb->stream, 0, val, &opts, current_language);
+ stb, 0, val, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
- ui_out_stream_delete (stb);
+ do_cleanups (old_chain);
}
}
mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
{
struct expression *expr;
- struct cleanup *old_chain = NULL;
+ struct cleanup *old_chain;
struct value *val;
- struct ui_stream *stb = NULL;
+ struct ui_file *stb;
struct value_print_options opts;
struct ui_out *uiout = current_uiout;
- stb = ui_out_stream_new (uiout);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
if (argc != 1)
- {
- ui_out_stream_delete (stb);
- error (_("-data-evaluate-expression: "
- "Usage: -data-evaluate-expression expression"));
- }
+ error (_("-data-evaluate-expression: "
+ "Usage: -data-evaluate-expression expression"));
expr = parse_expression (argv[0]);
- old_chain = make_cleanup (free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
/* Print the result of the expression evaluation. */
get_user_print_options (&opts);
opts.deref_ref = 0;
- common_val_print (val, stb->stream, 0, &opts, current_language);
+ common_val_print (val, stb, 0, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
- ui_out_stream_delete (stb);
do_cleanups (old_chain);
}
/* Build the result as a two dimentional table. */
{
- struct ui_stream *stream = ui_out_stream_new (uiout);
- struct cleanup *cleanup_list_memory;
+ struct ui_file *stream;
+ struct cleanup *cleanup_stream;
int row;
int row_byte;
- cleanup_list_memory = make_cleanup_ui_out_list_begin_end (uiout, "memory");
+ stream = mem_fileopen ();
+ cleanup_stream = make_cleanup_ui_file_delete (stream);
+
+ make_cleanup_ui_out_list_begin_end (uiout, "memory");
for (row = 0, row_byte = 0;
row < nr_rows;
row++, row_byte += nr_cols * word_size)
}
else
{
- ui_file_rewind (stream->stream);
+ ui_file_rewind (stream);
print_scalar_formatted (mbuf + col_byte, word_type, &opts,
- word_asize, stream->stream);
+ word_asize, stream);
ui_out_field_stream (uiout, NULL, stream);
}
}
{
int byte;
- ui_file_rewind (stream->stream);
+ ui_file_rewind (stream);
for (byte = row_byte;
byte < row_byte + word_size * nr_cols; byte++)
{
if (byte >= nr_bytes)
- fputc_unfiltered ('X', stream->stream);
+ fputc_unfiltered ('X', stream);
else if (mbuf[byte] < 32 || mbuf[byte] > 126)
- fputc_unfiltered (aschar, stream->stream);
+ fputc_unfiltered (aschar, stream);
else
- fputc_unfiltered (mbuf[byte], stream->stream);
+ fputc_unfiltered (mbuf[byte], stream);
}
ui_out_field_stream (uiout, "ascii", stream);
}
do_cleanups (cleanup_tuple);
}
- ui_out_stream_delete (stream);
- do_cleanups (cleanup_list_memory);
+ do_cleanups (cleanup_stream);
}
do_cleanups (cleanups);
}
ix_items++)
{
struct cleanup *old_chain;
- struct ui_stream *stb;
int ix_cols;
struct osdata_column *col;
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
- make_cleanup_ui_out_tuple_begin_end (uiout, "item");
+ old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "item");
for (ix_cols = 0;
VEC_iterate (osdata_column_s, item->columns,
struct ui_out *uiout = current_uiout;
volatile struct gdb_exception except;
struct cleanup *old_chain;
- struct ui_stream *stb;
+ struct ui_file *stb;
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
gdb_assert (!arg->val || !arg->error);
gdb_assert (arg->entry_kind == print_entry_values_no
annotate_arg_begin ();
make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (arg->sym),
+ fprintf_symbol_filtered (stb, SYMBOL_PRINT_NAME (arg->sym),
SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
if (arg->entry_kind == print_entry_values_compact)
{
/* It is OK to provide invalid MI-like stream as with
PRINT_ENTRY_VALUE_COMPACT we never use MI. */
- fputs_filtered ("=", stb->stream);
+ fputs_filtered ("=", stb);
- fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (arg->sym),
+ fprintf_symbol_filtered (stb, SYMBOL_PRINT_NAME (arg->sym),
SYMBOL_LANGUAGE (arg->sym),
DMGL_PARAMS | DMGL_ANSI);
}
if (arg->entry_kind == print_entry_values_only
|| arg->entry_kind == print_entry_values_compact)
- fputs_filtered ("@entry", stb->stream);
+ fputs_filtered ("@entry", stb);
ui_out_field_stream (uiout, "name", stb);
annotate_arg_name_end ();
ui_out_text (uiout, "=");
/* True in "summary" mode, false otherwise. */
opts.summary = !strcmp (print_frame_arguments, "scalars");
- common_val_print (arg->val, stb->stream, 2, &opts, language);
+ common_val_print (arg->val, stb, 2, &opts, language);
}
}
if (except.message)
- fprintf_filtered (stb->stream, _("<error reading variable: %s>"),
+ fprintf_filtered (stb, _("<error reading variable: %s>"),
except.message);
}
ui_out_field_stream (uiout, "value", stb);
- /* Aleo invoke ui_out_tuple_end. */
+ /* Also invoke ui_out_tuple_end. */
do_cleanups (old_chain);
annotate_arg_end ();
/* Number of ints of arguments that we have printed so far. */
int args_printed = 0;
struct cleanup *old_chain, *list_chain;
- struct ui_stream *stb;
+ struct ui_file *stb;
/* True if we should print arguments, false otherwise. */
int print_args = strcmp (print_frame_arguments, "none");
/* True in "summary" mode, false otherwise. */
int summary = !strcmp (print_frame_arguments, "scalars");
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
if (func)
{
struct ui_out *uiout = current_uiout;
const char *funname = NULL;
enum language funlang = language_unknown;
- struct ui_stream *stb;
+ struct ui_file *stb;
struct cleanup *old_chain, *list_chain;
struct value_print_options opts;
struct symbol *func;
pc_p = get_frame_pc_if_available (frame, &pc);
- stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup_ui_out_stream_delete (stb);
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
find_frame_funname (frame, &funname, &funlang, &func);
ui_out_text (uiout, " in ");
}
annotate_frame_function_name ();
- fprintf_symbol_filtered (stb->stream, funname ? funname : "??",
+ fprintf_symbol_filtered (stb, funname ? funname : "??",
funlang, DMGL_ANSI);
ui_out_field_stream (uiout, "func", stb);
ui_out_wrap_hint (uiout, " ");
char wrap_indent[80];
char extra_field_indent[80];
struct ui_out *uiout = current_uiout;
- struct ui_stream *stb = ui_out_stream_new (uiout);
- struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
struct cleanup *bkpt_chain;
VEC(breakpoint_p) *tracepoints;
VEC_free (breakpoint_p, tracepoints);
do_cleanups (bkpt_chain);
- do_cleanups (old_chain);
}
static void
void
ui_out_field_stream (struct ui_out *uiout,
const char *fldname,
- struct ui_stream *buf)
+ struct ui_file *stream)
{
long length;
- char *buffer = ui_file_xstrdup (buf->stream, &length);
+ char *buffer = ui_file_xstrdup (stream, &length);
struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
if (length > 0)
ui_out_field_string (uiout, fldname, buffer);
else
ui_out_field_skip (uiout, fldname);
- ui_file_rewind (buf->stream);
+ ui_file_rewind (stream);
do_cleanups (old_cleanup);
}
va_end (args);
}
-struct ui_stream *
-ui_out_stream_new (struct ui_out *uiout)
-{
- struct ui_stream *tempbuf;
-
- tempbuf = XMALLOC (struct ui_stream);
- tempbuf->uiout = uiout;
- tempbuf->stream = mem_fileopen ();
- return tempbuf;
-}
-
-void
-ui_out_stream_delete (struct ui_stream *buf)
-{
- ui_file_delete (buf->stream);
- xfree (buf);
-}
-
-static void
-do_stream_delete (void *buf)
-{
- ui_out_stream_delete (buf);
-}
-
-struct cleanup *
-make_cleanup_ui_out_stream_delete (struct ui_stream *buf)
-{
- return make_cleanup (do_stream_delete, buf);
-}
-
-
void
ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
{
};
-/* The ui_out stream structure. */
-/* NOTE: cagney/2000-02-01: The ui_stream object can be subsumed by
- the more generic ui_file object. */
-
-struct ui_stream
- {
- struct ui_out *uiout;
- struct ui_file *stream;
- };
-
-
/* Prototypes for ui-out API. */
/* A result is a recursive data structure consisting of lists and
const char *string);
extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
- struct ui_stream *buf);
+ struct ui_file *stream);
extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
const char *format, ...)
const char *format, ...)
ATTRIBUTE_PRINTF (3, 4);
-extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout);
-
-extern void ui_out_stream_delete (struct ui_stream *buf);
-
-struct cleanup *make_cleanup_ui_out_stream_delete (struct ui_stream *buf);
-
extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
extern void ui_out_flush (struct ui_out *uiout);