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.
This commit is contained in:
parent
72508ac0bf
commit
f99d8bf46c
@ -1,3 +1,38 @@
|
|||||||
|
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>
|
2012-03-27 Oza Pawandeep <oza.pawandeep@gmail.com>
|
||||||
|
|
||||||
* arm-linux-tdep.c (arm_linux_init_abi): Call
|
* arm-linux-tdep.c (arm_linux_init_abi): Call
|
||||||
|
@ -5277,10 +5277,10 @@ print_breakpoint_location (struct breakpoint *b,
|
|||||||
}
|
}
|
||||||
else if (loc)
|
else if (loc)
|
||||||
{
|
{
|
||||||
struct ui_stream *stb = ui_out_stream_new (uiout);
|
struct ui_file *stb = mem_fileopen ();
|
||||||
struct cleanup *stb_chain = make_cleanup_ui_out_stream_delete (stb);
|
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, "");
|
demangle, "");
|
||||||
ui_out_field_stream (uiout, "at", stb);
|
ui_out_field_stream (uiout, "at", stb);
|
||||||
|
|
||||||
@ -9222,8 +9222,8 @@ print_one_detail_ranged_breakpoint (const struct breakpoint *b,
|
|||||||
{
|
{
|
||||||
CORE_ADDR address_start, address_end;
|
CORE_ADDR address_start, address_end;
|
||||||
struct bp_location *bl = b->loc;
|
struct bp_location *bl = b->loc;
|
||||||
struct ui_stream *stb = ui_out_stream_new (uiout);
|
struct ui_file *stb = mem_fileopen ();
|
||||||
struct cleanup *cleanup = make_cleanup_ui_out_stream_delete (stb);
|
struct cleanup *cleanup = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
gdb_assert (bl);
|
gdb_assert (bl);
|
||||||
|
|
||||||
@ -9231,7 +9231,7 @@ print_one_detail_ranged_breakpoint (const struct breakpoint *b,
|
|||||||
address_end = address_start + bl->length - 1;
|
address_end = address_start + bl->length - 1;
|
||||||
|
|
||||||
ui_out_text (uiout, "\taddress range: ");
|
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_start),
|
||||||
print_core_address (bl->gdbarch, address_end));
|
print_core_address (bl->gdbarch, address_end));
|
||||||
ui_out_field_stream (uiout, "addr", stb);
|
ui_out_field_stream (uiout, "addr", stb);
|
||||||
@ -9666,7 +9666,7 @@ print_it_watchpoint (bpstat bs)
|
|||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
const struct bp_location *bl;
|
const struct bp_location *bl;
|
||||||
struct ui_stream *stb;
|
struct ui_file *stb;
|
||||||
enum print_stop_action result;
|
enum print_stop_action result;
|
||||||
struct watchpoint *w;
|
struct watchpoint *w;
|
||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
@ -9677,8 +9677,8 @@ print_it_watchpoint (bpstat bs)
|
|||||||
b = bs->breakpoint_at;
|
b = bs->breakpoint_at;
|
||||||
w = (struct watchpoint *) b;
|
w = (struct watchpoint *) b;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
switch (b->type)
|
switch (b->type)
|
||||||
{
|
{
|
||||||
@ -9692,10 +9692,10 @@ print_it_watchpoint (bpstat bs)
|
|||||||
mention (b);
|
mention (b);
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
||||||
ui_out_text (uiout, "\nOld 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_field_stream (uiout, "old", stb);
|
||||||
ui_out_text (uiout, "\nNew value = ");
|
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_field_stream (uiout, "new", stb);
|
||||||
ui_out_text (uiout, "\n");
|
ui_out_text (uiout, "\n");
|
||||||
/* More than one watchpoint may have been triggered. */
|
/* More than one watchpoint may have been triggered. */
|
||||||
@ -9710,7 +9710,7 @@ print_it_watchpoint (bpstat bs)
|
|||||||
mention (b);
|
mention (b);
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
||||||
ui_out_text (uiout, "\nValue = ");
|
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_field_stream (uiout, "value", stb);
|
||||||
ui_out_text (uiout, "\n");
|
ui_out_text (uiout, "\n");
|
||||||
result = PRINT_UNKNOWN;
|
result = PRINT_UNKNOWN;
|
||||||
@ -9727,7 +9727,7 @@ print_it_watchpoint (bpstat bs)
|
|||||||
mention (b);
|
mention (b);
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
||||||
ui_out_text (uiout, "\nOld 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_field_stream (uiout, "old", stb);
|
||||||
ui_out_text (uiout, "\nNew value = ");
|
ui_out_text (uiout, "\nNew value = ");
|
||||||
}
|
}
|
||||||
@ -9741,7 +9741,7 @@ print_it_watchpoint (bpstat bs)
|
|||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
make_cleanup_ui_out_tuple_begin_end (uiout, "value");
|
||||||
ui_out_text (uiout, "\nValue = ");
|
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_field_stream (uiout, "new", stb);
|
||||||
ui_out_text (uiout, "\n");
|
ui_out_text (uiout, "\n");
|
||||||
result = PRINT_UNKNOWN;
|
result = PRINT_UNKNOWN;
|
||||||
|
@ -314,10 +314,10 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
|||||||
else if (c->type == show_cmd)
|
else if (c->type == show_cmd)
|
||||||
{
|
{
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
struct ui_stream *stb;
|
struct ui_file *stb;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
/* Possibly call the pre hook. */
|
/* Possibly call the pre hook. */
|
||||||
if (c->pre_show_hook)
|
if (c->pre_show_hook)
|
||||||
@ -327,29 +327,29 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
|||||||
{
|
{
|
||||||
case var_string:
|
case var_string:
|
||||||
if (*(char **) c->var)
|
if (*(char **) c->var)
|
||||||
fputstr_filtered (*(char **) c->var, '"', stb->stream);
|
fputstr_filtered (*(char **) c->var, '"', stb);
|
||||||
break;
|
break;
|
||||||
case var_string_noescape:
|
case var_string_noescape:
|
||||||
case var_optional_filename:
|
case var_optional_filename:
|
||||||
case var_filename:
|
case var_filename:
|
||||||
case var_enum:
|
case var_enum:
|
||||||
if (*(char **) c->var)
|
if (*(char **) c->var)
|
||||||
fputs_filtered (*(char **) c->var, stb->stream);
|
fputs_filtered (*(char **) c->var, stb);
|
||||||
break;
|
break;
|
||||||
case var_boolean:
|
case var_boolean:
|
||||||
fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
|
fputs_filtered (*(int *) c->var ? "on" : "off", stb);
|
||||||
break;
|
break;
|
||||||
case var_auto_boolean:
|
case var_auto_boolean:
|
||||||
switch (*(enum auto_boolean*) c->var)
|
switch (*(enum auto_boolean*) c->var)
|
||||||
{
|
{
|
||||||
case AUTO_BOOLEAN_TRUE:
|
case AUTO_BOOLEAN_TRUE:
|
||||||
fputs_filtered ("on", stb->stream);
|
fputs_filtered ("on", stb);
|
||||||
break;
|
break;
|
||||||
case AUTO_BOOLEAN_FALSE:
|
case AUTO_BOOLEAN_FALSE:
|
||||||
fputs_filtered ("off", stb->stream);
|
fputs_filtered ("off", stb);
|
||||||
break;
|
break;
|
||||||
case AUTO_BOOLEAN_AUTO:
|
case AUTO_BOOLEAN_AUTO:
|
||||||
fputs_filtered ("auto", stb->stream);
|
fputs_filtered ("auto", stb);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
internal_error (__FILE__, __LINE__,
|
internal_error (__FILE__, __LINE__,
|
||||||
@ -362,17 +362,17 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
|||||||
case var_zuinteger:
|
case var_zuinteger:
|
||||||
if (c->var_type == var_uinteger
|
if (c->var_type == var_uinteger
|
||||||
&& *(unsigned int *) c->var == UINT_MAX)
|
&& *(unsigned int *) c->var == UINT_MAX)
|
||||||
fputs_filtered ("unlimited", stb->stream);
|
fputs_filtered ("unlimited", stb);
|
||||||
else
|
else
|
||||||
fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
|
fprintf_filtered (stb, "%u", *(unsigned int *) c->var);
|
||||||
break;
|
break;
|
||||||
case var_integer:
|
case var_integer:
|
||||||
case var_zinteger:
|
case var_zinteger:
|
||||||
if (c->var_type == var_integer
|
if (c->var_type == var_integer
|
||||||
&& *(int *) c->var == INT_MAX)
|
&& *(int *) c->var == INT_MAX)
|
||||||
fputs_filtered ("unlimited", stb->stream);
|
fputs_filtered ("unlimited", stb);
|
||||||
else
|
else
|
||||||
fprintf_filtered (stb->stream, "%d", *(int *) c->var);
|
fprintf_filtered (stb, "%d", *(int *) c->var);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -389,7 +389,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
|||||||
ui_out_field_stream (uiout, "value", stb);
|
ui_out_field_stream (uiout, "value", stb);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *value = ui_file_xstrdup (stb->stream, NULL);
|
char *value = ui_file_xstrdup (stb, NULL);
|
||||||
|
|
||||||
make_cleanup (xfree, value);
|
make_cleanup (xfree, value);
|
||||||
if (c->show_value_func != NULL)
|
if (c->show_value_func != NULL)
|
||||||
|
22
gdb/disasm.c
22
gdb/disasm.c
@ -97,7 +97,7 @@ static int
|
|||||||
dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||||
struct disassemble_info * di,
|
struct disassemble_info * di,
|
||||||
CORE_ADDR low, CORE_ADDR high,
|
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;
|
int num_displayed = 0;
|
||||||
CORE_ADDR pc;
|
CORE_ADDR pc;
|
||||||
@ -145,7 +145,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
xfree (name);
|
xfree (name);
|
||||||
|
|
||||||
ui_file_rewind (stb->stream);
|
ui_file_rewind (stb);
|
||||||
if (flags & DISASSEMBLY_RAW_INSN)
|
if (flags & DISASSEMBLY_RAW_INSN)
|
||||||
{
|
{
|
||||||
CORE_ADDR old_pc = pc;
|
CORE_ADDR old_pc = pc;
|
||||||
@ -155,9 +155,9 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
|
|
||||||
/* Build the opcodes using a temporary stream so we can
|
/* Build the opcodes using a temporary stream so we can
|
||||||
write them out in a single go for the MI. */
|
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 =
|
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);
|
pc += gdbarch_print_insn (gdbarch, pc, di);
|
||||||
for (;old_pc < pc; old_pc++)
|
for (;old_pc < pc; old_pc++)
|
||||||
@ -165,7 +165,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
status = (*di->read_memory_func) (old_pc, &data, 1, di);
|
status = (*di->read_memory_func) (old_pc, &data, 1, di);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
(*di->memory_error_func) (status, old_pc, di);
|
(*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, (unsigned) data);
|
||||||
spacer = " ";
|
spacer = " ";
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
else
|
else
|
||||||
pc += gdbarch_print_insn (gdbarch, pc, di);
|
pc += gdbarch_print_insn (gdbarch, pc, di);
|
||||||
ui_out_field_stream (uiout, "inst", stb);
|
ui_out_field_stream (uiout, "inst", stb);
|
||||||
ui_file_rewind (stb->stream);
|
ui_file_rewind (stb);
|
||||||
do_cleanups (ui_out_chain);
|
do_cleanups (ui_out_chain);
|
||||||
ui_out_text (uiout, "\n");
|
ui_out_text (uiout, "\n");
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
struct linetable_entry *le,
|
struct linetable_entry *le,
|
||||||
CORE_ADDR low, CORE_ADDR high,
|
CORE_ADDR low, CORE_ADDR high,
|
||||||
struct symtab *symtab,
|
struct symtab *symtab,
|
||||||
int how_many, int flags, struct ui_stream *stb)
|
int how_many, int flags, struct ui_file *stb)
|
||||||
{
|
{
|
||||||
int newlines = 0;
|
int newlines = 0;
|
||||||
struct dis_line_entry *mle;
|
struct dis_line_entry *mle;
|
||||||
@ -342,7 +342,7 @@ static void
|
|||||||
do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
|
do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||||
struct disassemble_info * di,
|
struct disassemble_info * di,
|
||||||
CORE_ADDR low, CORE_ADDR high,
|
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;
|
int num_displayed = 0;
|
||||||
struct cleanup *ui_out_chain;
|
struct cleanup *ui_out_chain;
|
||||||
@ -402,9 +402,9 @@ gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
|||||||
char *file_string, int flags, int how_many,
|
char *file_string, int flags, int how_many,
|
||||||
CORE_ADDR low, CORE_ADDR high)
|
CORE_ADDR low, CORE_ADDR high)
|
||||||
{
|
{
|
||||||
struct ui_stream *stb = ui_out_stream_new (uiout);
|
struct ui_file *stb = mem_fileopen ();
|
||||||
struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
|
struct cleanup *cleanups = make_cleanup_ui_file_delete (stb);
|
||||||
struct disassemble_info di = gdb_disassemble_info (gdbarch, stb->stream);
|
struct disassemble_info di = gdb_disassemble_info (gdbarch, stb);
|
||||||
/* To collect the instruction outputted from opcodes. */
|
/* To collect the instruction outputted from opcodes. */
|
||||||
struct symtab *symtab = NULL;
|
struct symtab *symtab = NULL;
|
||||||
struct linetable_entry *le = NULL;
|
struct linetable_entry *le = NULL;
|
||||||
|
10
gdb/infcmd.c
10
gdb/infcmd.c
@ -1471,23 +1471,23 @@ static void
|
|||||||
print_return_value (struct type *func_type, struct type *value_type)
|
print_return_value (struct type *func_type, struct type *value_type)
|
||||||
{
|
{
|
||||||
struct value *value = get_return_value (func_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;
|
struct ui_out *uiout = current_uiout;
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
|
struct ui_file *stb;
|
||||||
|
struct cleanup *old_chain;
|
||||||
|
|
||||||
/* Print it. */
|
/* Print it. */
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
ui_out_text (uiout, "Value returned is ");
|
ui_out_text (uiout, "Value returned is ");
|
||||||
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
|
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
|
||||||
record_latest_value (value));
|
record_latest_value (value));
|
||||||
ui_out_text (uiout, " = ");
|
ui_out_text (uiout, " = ");
|
||||||
get_raw_print_options (&opts);
|
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_field_stream (uiout, "return-value", stb);
|
||||||
ui_out_text (uiout, "\n");
|
ui_out_text (uiout, "\n");
|
||||||
do_cleanups (old_chain);
|
do_cleanups (old_chain);
|
||||||
|
@ -250,9 +250,13 @@ static void
|
|||||||
list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
||||||
enum print_values values)
|
enum print_values values)
|
||||||
{
|
{
|
||||||
|
struct cleanup *old_chain;
|
||||||
struct cleanup *cleanup_tuple = NULL;
|
struct cleanup *cleanup_tuple = NULL;
|
||||||
struct ui_out *uiout = current_uiout;
|
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 (!arg->val || !arg->error);
|
||||||
gdb_assert ((values == PRINT_NO_VALUES && arg->val == NULL
|
gdb_assert ((values == PRINT_NO_VALUES && arg->val == NULL
|
||||||
@ -267,9 +271,9 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
|||||||
if (values != PRINT_NO_VALUES || what == all)
|
if (values != PRINT_NO_VALUES || what == all)
|
||||||
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
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)
|
if (arg->entry_kind == print_entry_values_only)
|
||||||
fputs_filtered ("@entry", stb->stream);
|
fputs_filtered ("@entry", stb);
|
||||||
ui_out_field_stream (uiout, "name", stb);
|
ui_out_field_stream (uiout, "name", stb);
|
||||||
|
|
||||||
if (what == all && SYMBOL_IS_ARGUMENT (arg->sym))
|
if (what == all && SYMBOL_IS_ARGUMENT (arg->sym))
|
||||||
@ -278,7 +282,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
|||||||
if (values == PRINT_SIMPLE_VALUES)
|
if (values == PRINT_SIMPLE_VALUES)
|
||||||
{
|
{
|
||||||
check_typedef (arg->sym->type);
|
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);
|
ui_out_field_stream (uiout, "type", stb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,19 +302,19 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
|
|||||||
|
|
||||||
get_raw_print_options (&opts);
|
get_raw_print_options (&opts);
|
||||||
opts.deref_ref = 1;
|
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)));
|
language_def (SYMBOL_LANGUAGE (arg->sym)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (except.message)
|
if (except.message)
|
||||||
fprintf_filtered (stb->stream, _("<error reading variable: %s>"),
|
fprintf_filtered (stb, _("<error reading variable: %s>"),
|
||||||
except.message);
|
except.message);
|
||||||
ui_out_field_stream (uiout, "value", stb);
|
ui_out_field_stream (uiout, "value", stb);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_out_stream_delete (stb);
|
|
||||||
if (values != PRINT_NO_VALUES || what == all)
|
if (values != PRINT_NO_VALUES || what == all)
|
||||||
do_cleanups (cleanup_tuple);
|
do_cleanups (cleanup_tuple);
|
||||||
|
do_cleanups (old_chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print a list of the locals or the arguments for the currently
|
/* Print a list of the locals or the arguments for the currently
|
||||||
@ -326,13 +330,10 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
|
|||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct dict_iterator iter;
|
struct dict_iterator iter;
|
||||||
struct cleanup *cleanup_list;
|
struct cleanup *cleanup_list;
|
||||||
struct ui_stream *stb;
|
|
||||||
struct type *type;
|
struct type *type;
|
||||||
char *name_of_result;
|
char *name_of_result;
|
||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
|
||||||
|
|
||||||
block = get_frame_block (fi, 0);
|
block = get_frame_block (fi, 0);
|
||||||
|
|
||||||
switch (what)
|
switch (what)
|
||||||
@ -437,7 +438,6 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
|
|||||||
block = BLOCK_SUPERBLOCK (block);
|
block = BLOCK_SUPERBLOCK (block);
|
||||||
}
|
}
|
||||||
do_cleanups (cleanup_list);
|
do_cleanups (cleanup_list);
|
||||||
ui_out_stream_delete (stb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1133,11 +1133,8 @@ get_register (struct frame_info *frame, int regnum, int format)
|
|||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
enum lval_type lval;
|
enum lval_type lval;
|
||||||
struct ui_stream *stb;
|
|
||||||
struct value *val;
|
struct value *val;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
|
||||||
|
|
||||||
if (format == 'N')
|
if (format == 'N')
|
||||||
format = 0;
|
format = 0;
|
||||||
|
|
||||||
@ -1167,15 +1164,20 @@ get_register (struct frame_info *frame, int regnum, int format)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct value_print_options opts;
|
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);
|
get_formatted_print_options (&opts, format);
|
||||||
opts.deref_ref = 1;
|
opts.deref_ref = 1;
|
||||||
val_print (value_type (val),
|
val_print (value_type (val),
|
||||||
value_contents_for_printing (val),
|
value_contents_for_printing (val),
|
||||||
value_embedded_offset (val), 0,
|
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_field_stream (uiout, "value", stb);
|
||||||
ui_out_stream_delete (stb);
|
do_cleanups (old_chain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1247,34 +1249,31 @@ void
|
|||||||
mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
|
mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
|
||||||
{
|
{
|
||||||
struct expression *expr;
|
struct expression *expr;
|
||||||
struct cleanup *old_chain = NULL;
|
struct cleanup *old_chain;
|
||||||
struct value *val;
|
struct value *val;
|
||||||
struct ui_stream *stb = NULL;
|
struct ui_file *stb;
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
struct ui_out *uiout = current_uiout;
|
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)
|
if (argc != 1)
|
||||||
{
|
error (_("-data-evaluate-expression: "
|
||||||
ui_out_stream_delete (stb);
|
"Usage: -data-evaluate-expression expression"));
|
||||||
error (_("-data-evaluate-expression: "
|
|
||||||
"Usage: -data-evaluate-expression expression"));
|
|
||||||
}
|
|
||||||
|
|
||||||
expr = parse_expression (argv[0]);
|
expr = parse_expression (argv[0]);
|
||||||
|
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
make_cleanup (free_current_contents, &expr);
|
||||||
|
|
||||||
val = evaluate_expression (expr);
|
val = evaluate_expression (expr);
|
||||||
|
|
||||||
/* Print the result of the expression evaluation. */
|
/* Print the result of the expression evaluation. */
|
||||||
get_user_print_options (&opts);
|
get_user_print_options (&opts);
|
||||||
opts.deref_ref = 0;
|
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_field_stream (uiout, "value", stb);
|
||||||
ui_out_stream_delete (stb);
|
|
||||||
|
|
||||||
do_cleanups (old_chain);
|
do_cleanups (old_chain);
|
||||||
}
|
}
|
||||||
@ -1420,12 +1419,15 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
|
|||||||
|
|
||||||
/* Build the result as a two dimentional table. */
|
/* Build the result as a two dimentional table. */
|
||||||
{
|
{
|
||||||
struct ui_stream *stream = ui_out_stream_new (uiout);
|
struct ui_file *stream;
|
||||||
struct cleanup *cleanup_list_memory;
|
struct cleanup *cleanup_stream;
|
||||||
int row;
|
int row;
|
||||||
int row_byte;
|
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;
|
for (row = 0, row_byte = 0;
|
||||||
row < nr_rows;
|
row < nr_rows;
|
||||||
row++, row_byte += nr_cols * word_size)
|
row++, row_byte += nr_cols * word_size)
|
||||||
@ -1452,9 +1454,9 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui_file_rewind (stream->stream);
|
ui_file_rewind (stream);
|
||||||
print_scalar_formatted (mbuf + col_byte, word_type, &opts,
|
print_scalar_formatted (mbuf + col_byte, word_type, &opts,
|
||||||
word_asize, stream->stream);
|
word_asize, stream);
|
||||||
ui_out_field_stream (uiout, NULL, stream);
|
ui_out_field_stream (uiout, NULL, stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1463,23 +1465,22 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
|
|||||||
{
|
{
|
||||||
int byte;
|
int byte;
|
||||||
|
|
||||||
ui_file_rewind (stream->stream);
|
ui_file_rewind (stream);
|
||||||
for (byte = row_byte;
|
for (byte = row_byte;
|
||||||
byte < row_byte + word_size * nr_cols; byte++)
|
byte < row_byte + word_size * nr_cols; byte++)
|
||||||
{
|
{
|
||||||
if (byte >= nr_bytes)
|
if (byte >= nr_bytes)
|
||||||
fputc_unfiltered ('X', stream->stream);
|
fputc_unfiltered ('X', stream);
|
||||||
else if (mbuf[byte] < 32 || mbuf[byte] > 126)
|
else if (mbuf[byte] < 32 || mbuf[byte] > 126)
|
||||||
fputc_unfiltered (aschar, stream->stream);
|
fputc_unfiltered (aschar, stream);
|
||||||
else
|
else
|
||||||
fputc_unfiltered (mbuf[byte], stream->stream);
|
fputc_unfiltered (mbuf[byte], stream);
|
||||||
}
|
}
|
||||||
ui_out_field_stream (uiout, "ascii", stream);
|
ui_out_field_stream (uiout, "ascii", stream);
|
||||||
}
|
}
|
||||||
do_cleanups (cleanup_tuple);
|
do_cleanups (cleanup_tuple);
|
||||||
}
|
}
|
||||||
ui_out_stream_delete (stream);
|
do_cleanups (cleanup_stream);
|
||||||
do_cleanups (cleanup_list_memory);
|
|
||||||
}
|
}
|
||||||
do_cleanups (cleanups);
|
do_cleanups (cleanups);
|
||||||
}
|
}
|
||||||
|
@ -355,13 +355,10 @@ info_osdata_command (char *type, int from_tty)
|
|||||||
ix_items++)
|
ix_items++)
|
||||||
{
|
{
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
struct ui_stream *stb;
|
|
||||||
int ix_cols;
|
int ix_cols;
|
||||||
struct osdata_column *col;
|
struct osdata_column *col;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
old_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "item");
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, "item");
|
|
||||||
|
|
||||||
for (ix_cols = 0;
|
for (ix_cols = 0;
|
||||||
VEC_iterate (osdata_column_s, item->columns,
|
VEC_iterate (osdata_column_s, item->columns,
|
||||||
|
34
gdb/stack.c
34
gdb/stack.c
@ -210,10 +210,10 @@ print_frame_arg (const struct frame_arg *arg)
|
|||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
volatile struct gdb_exception except;
|
volatile struct gdb_exception except;
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
struct ui_stream *stb;
|
struct ui_file *stb;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
gdb_assert (!arg->val || !arg->error);
|
gdb_assert (!arg->val || !arg->error);
|
||||||
gdb_assert (arg->entry_kind == print_entry_values_no
|
gdb_assert (arg->entry_kind == print_entry_values_no
|
||||||
@ -224,21 +224,21 @@ print_frame_arg (const struct frame_arg *arg)
|
|||||||
annotate_arg_begin ();
|
annotate_arg_begin ();
|
||||||
|
|
||||||
make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
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);
|
SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI);
|
||||||
if (arg->entry_kind == print_entry_values_compact)
|
if (arg->entry_kind == print_entry_values_compact)
|
||||||
{
|
{
|
||||||
/* It is OK to provide invalid MI-like stream as with
|
/* It is OK to provide invalid MI-like stream as with
|
||||||
PRINT_ENTRY_VALUE_COMPACT we never use MI. */
|
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),
|
SYMBOL_LANGUAGE (arg->sym),
|
||||||
DMGL_PARAMS | DMGL_ANSI);
|
DMGL_PARAMS | DMGL_ANSI);
|
||||||
}
|
}
|
||||||
if (arg->entry_kind == print_entry_values_only
|
if (arg->entry_kind == print_entry_values_only
|
||||||
|| arg->entry_kind == print_entry_values_compact)
|
|| arg->entry_kind == print_entry_values_compact)
|
||||||
fputs_filtered ("@entry", stb->stream);
|
fputs_filtered ("@entry", stb);
|
||||||
ui_out_field_stream (uiout, "name", stb);
|
ui_out_field_stream (uiout, "name", stb);
|
||||||
annotate_arg_name_end ();
|
annotate_arg_name_end ();
|
||||||
ui_out_text (uiout, "=");
|
ui_out_text (uiout, "=");
|
||||||
@ -279,17 +279,17 @@ print_frame_arg (const struct frame_arg *arg)
|
|||||||
/* True in "summary" mode, false otherwise. */
|
/* True in "summary" mode, false otherwise. */
|
||||||
opts.summary = !strcmp (print_frame_arguments, "scalars");
|
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)
|
if (except.message)
|
||||||
fprintf_filtered (stb->stream, _("<error reading variable: %s>"),
|
fprintf_filtered (stb, _("<error reading variable: %s>"),
|
||||||
except.message);
|
except.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_out_field_stream (uiout, "value", stb);
|
ui_out_field_stream (uiout, "value", stb);
|
||||||
|
|
||||||
/* Aleo invoke ui_out_tuple_end. */
|
/* Also invoke ui_out_tuple_end. */
|
||||||
do_cleanups (old_chain);
|
do_cleanups (old_chain);
|
||||||
|
|
||||||
annotate_arg_end ();
|
annotate_arg_end ();
|
||||||
@ -500,14 +500,14 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
|
|||||||
/* Number of ints of arguments that we have printed so far. */
|
/* Number of ints of arguments that we have printed so far. */
|
||||||
int args_printed = 0;
|
int args_printed = 0;
|
||||||
struct cleanup *old_chain, *list_chain;
|
struct cleanup *old_chain, *list_chain;
|
||||||
struct ui_stream *stb;
|
struct ui_file *stb;
|
||||||
/* True if we should print arguments, false otherwise. */
|
/* True if we should print arguments, false otherwise. */
|
||||||
int print_args = strcmp (print_frame_arguments, "none");
|
int print_args = strcmp (print_frame_arguments, "none");
|
||||||
/* True in "summary" mode, false otherwise. */
|
/* True in "summary" mode, false otherwise. */
|
||||||
int summary = !strcmp (print_frame_arguments, "scalars");
|
int summary = !strcmp (print_frame_arguments, "scalars");
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
if (func)
|
if (func)
|
||||||
{
|
{
|
||||||
@ -1103,7 +1103,7 @@ print_frame (struct frame_info *frame, int print_level,
|
|||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
const char *funname = NULL;
|
const char *funname = NULL;
|
||||||
enum language funlang = language_unknown;
|
enum language funlang = language_unknown;
|
||||||
struct ui_stream *stb;
|
struct ui_file *stb;
|
||||||
struct cleanup *old_chain, *list_chain;
|
struct cleanup *old_chain, *list_chain;
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
struct symbol *func;
|
struct symbol *func;
|
||||||
@ -1112,8 +1112,8 @@ print_frame (struct frame_info *frame, int print_level,
|
|||||||
|
|
||||||
pc_p = get_frame_pc_if_available (frame, &pc);
|
pc_p = get_frame_pc_if_available (frame, &pc);
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
stb = mem_fileopen ();
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
old_chain = make_cleanup_ui_file_delete (stb);
|
||||||
|
|
||||||
find_frame_funname (frame, &funname, &funlang, &func);
|
find_frame_funname (frame, &funname, &funlang, &func);
|
||||||
|
|
||||||
@ -1143,7 +1143,7 @@ print_frame (struct frame_info *frame, int print_level,
|
|||||||
ui_out_text (uiout, " in ");
|
ui_out_text (uiout, " in ");
|
||||||
}
|
}
|
||||||
annotate_frame_function_name ();
|
annotate_frame_function_name ();
|
||||||
fprintf_symbol_filtered (stb->stream, funname ? funname : "??",
|
fprintf_symbol_filtered (stb, funname ? funname : "??",
|
||||||
funlang, DMGL_ANSI);
|
funlang, DMGL_ANSI);
|
||||||
ui_out_field_stream (uiout, "func", stb);
|
ui_out_field_stream (uiout, "func", stb);
|
||||||
ui_out_wrap_hint (uiout, " ");
|
ui_out_wrap_hint (uiout, " ");
|
||||||
|
@ -4777,8 +4777,6 @@ print_one_static_tracepoint_marker (int count,
|
|||||||
char wrap_indent[80];
|
char wrap_indent[80];
|
||||||
char extra_field_indent[80];
|
char extra_field_indent[80];
|
||||||
struct ui_out *uiout = current_uiout;
|
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;
|
struct cleanup *bkpt_chain;
|
||||||
VEC(breakpoint_p) *tracepoints;
|
VEC(breakpoint_p) *tracepoints;
|
||||||
|
|
||||||
@ -4885,7 +4883,6 @@ print_one_static_tracepoint_marker (int count,
|
|||||||
VEC_free (breakpoint_p, tracepoints);
|
VEC_free (breakpoint_p, tracepoints);
|
||||||
|
|
||||||
do_cleanups (bkpt_chain);
|
do_cleanups (bkpt_chain);
|
||||||
do_cleanups (old_chain);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
37
gdb/ui-out.c
37
gdb/ui-out.c
@ -501,17 +501,17 @@ ui_out_field_core_addr (struct ui_out *uiout,
|
|||||||
void
|
void
|
||||||
ui_out_field_stream (struct ui_out *uiout,
|
ui_out_field_stream (struct ui_out *uiout,
|
||||||
const char *fldname,
|
const char *fldname,
|
||||||
struct ui_stream *buf)
|
struct ui_file *stream)
|
||||||
{
|
{
|
||||||
long length;
|
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);
|
struct cleanup *old_cleanup = make_cleanup (xfree, buffer);
|
||||||
|
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
ui_out_field_string (uiout, fldname, buffer);
|
ui_out_field_string (uiout, fldname, buffer);
|
||||||
else
|
else
|
||||||
ui_out_field_skip (uiout, fldname);
|
ui_out_field_skip (uiout, fldname);
|
||||||
ui_file_rewind (buf->stream);
|
ui_file_rewind (stream);
|
||||||
do_cleanups (old_cleanup);
|
do_cleanups (old_cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,37 +589,6 @@ ui_out_message (struct ui_out *uiout, int verbosity,
|
|||||||
va_end (args);
|
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
|
void
|
||||||
ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
|
ui_out_wrap_hint (struct ui_out *uiout, char *identstring)
|
||||||
{
|
{
|
||||||
|
19
gdb/ui-out.h
19
gdb/ui-out.h
@ -52,17 +52,6 @@ enum ui_flags
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* 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. */
|
/* Prototypes for ui-out API. */
|
||||||
|
|
||||||
/* A result is a recursive data structure consisting of lists and
|
/* A result is a recursive data structure consisting of lists and
|
||||||
@ -122,7 +111,7 @@ extern void ui_out_field_string (struct ui_out * uiout, const char *fldname,
|
|||||||
const char *string);
|
const char *string);
|
||||||
|
|
||||||
extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
|
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,
|
extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
|
||||||
const char *format, ...)
|
const char *format, ...)
|
||||||
@ -138,12 +127,6 @@ extern void ui_out_message (struct ui_out *uiout, int verbosity,
|
|||||||
const char *format, ...)
|
const char *format, ...)
|
||||||
ATTRIBUTE_PRINTF (3, 4);
|
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_wrap_hint (struct ui_out *uiout, char *identstring);
|
||||||
|
|
||||||
extern void ui_out_flush (struct ui_out *uiout);
|
extern void ui_out_flush (struct ui_out *uiout);
|
||||||
|
Loading…
Reference in New Issue
Block a user