Remove else clause to #if UI_OUT.

This commit is contained in:
Andrew Cagney 2002-01-17 22:15:18 +00:00
parent db728ff7cd
commit 8926118ce2
25 changed files with 81 additions and 798 deletions

View File

@ -1,3 +1,17 @@
2002-01-17 Andrew Cagney <ac131313@redhat.com>
* breakpoint.c: Update assuming #if UI_OUT is always true. Update
copyright.
* defs.h, event-top.c, gdbcmd.h: Ditto.
* infcmd.c, infrun.c, main.c, printcmd.c, remote.c: Ditto.
* source.c, stack.c, symfile.c, symtab.c, thread.c: Ditto.
* top.c, cli/cli-cmds.c, cli/cli-decode.c: Ditto.
* cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.c: Ditto.
* mi/ChangeLog, mi/mi-cmd-break.c, mi/mi-cmd-stack.c: Ditto.
* mi/mi-main.c:Ditto.
* stack.c, symfile.c: Update copyright.
2002-01-17 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/low-hppabsd.c, gdbserver/low-lynx.c,

View File

@ -1,6 +1,8 @@
/* Everything about breakpoints, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -42,9 +44,7 @@
#include "linespec.h"
#include "completer.h"
#include "gdb.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "gdb-events.h"
@ -1873,12 +1873,10 @@ top:
static enum print_stop_action
print_it_typical (bpstat bs)
{
#ifdef UI_OUT
struct cleanup *old_chain;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
/* bs->breakpoint_at can be NULL if it was a momentary breakpoint
which has since been deleted. */
if (bs->breakpoint_at == NULL)
@ -1888,7 +1886,6 @@ print_it_typical (bpstat bs)
{
case bp_breakpoint:
case bp_hardware_breakpoint:
#ifdef UI_OUT
annotate_breakpoint (bs->breakpoint_at->number);
ui_out_text (uiout, "\nBreakpoint ");
if (ui_out_is_mi_like_p (uiout))
@ -1896,13 +1893,6 @@ print_it_typical (bpstat bs)
ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
ui_out_text (uiout, ", ");
return PRINT_SRC_AND_LOC;
#else
/* I think the user probably only wants to see one breakpoint
number, not all of them. */
annotate_breakpoint (bs->breakpoint_at->number);
printf_filtered ("\nBreakpoint %d, ", bs->breakpoint_at->number);
return PRINT_SRC_AND_LOC;
#endif
break;
case bp_shlib_event:
@ -2035,7 +2025,6 @@ print_it_typical (bpstat bs)
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "watchpoint-trigger");
mention (bs->breakpoint_at);
@ -2048,15 +2037,6 @@ print_it_typical (bpstat bs)
ui_out_field_stream (uiout, "new", stb);
ui_out_tuple_end (uiout);
ui_out_text (uiout, "\n");
#else
mention (bs->breakpoint_at);
printf_filtered ("\nOld value = ");
value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
printf_filtered ("\nNew value = ");
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
#endif
value_free (bs->old_val);
bs->old_val = NULL;
}
@ -2065,7 +2045,6 @@ print_it_typical (bpstat bs)
break;
case bp_read_watchpoint:
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
mention (bs->breakpoint_at);
@ -2075,18 +2054,10 @@ print_it_typical (bpstat bs)
ui_out_field_stream (uiout, "value", stb);
ui_out_tuple_end (uiout);
ui_out_text (uiout, "\n");
#else
mention (bs->breakpoint_at);
printf_filtered ("\nValue = ");
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
#endif
return PRINT_UNKNOWN;
break;
case bp_access_watchpoint:
#ifdef UI_OUT
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
@ -2113,26 +2084,6 @@ print_it_typical (bpstat bs)
ui_out_field_stream (uiout, "new", stb);
ui_out_tuple_end (uiout);
ui_out_text (uiout, "\n");
#else
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
mention (bs->breakpoint_at);
printf_filtered ("\nOld value = ");
value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
value_free (bs->old_val);
bs->old_val = NULL;
printf_filtered ("\nNew value = ");
}
else
{
mention (bs->breakpoint_at);
printf_filtered ("\nValue = ");
}
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
Val_pretty_default);
printf_filtered ("\n");
#endif
return PRINT_UNKNOWN;
break;
@ -2140,18 +2091,14 @@ print_it_typical (bpstat bs)
here. */
case bp_finish:
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "function-finished");
#endif
return PRINT_UNKNOWN;
break;
case bp_until:
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "location-reached");
#endif
return PRINT_UNKNOWN;
break;
@ -2363,18 +2310,12 @@ watchpoint_check (PTR p)
in this case, by the time we call print_it_typical() this bp
will be deleted already. So we have no choice but print the
information here. */
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "watchpoint-scope");
ui_out_text (uiout, "\nWatchpoint ");
ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
ui_out_text (uiout, " deleted because the program has left the block in\n\
which its expression is valid.\n");
#else
printf_filtered ("\
Watchpoint %d deleted because the program has left the block in\n\
which its expression is valid.\n", bs->breakpoint_at->number);
#endif
if (b->related_breakpoint)
b->related_breakpoint->disposition = disp_del_at_next_stop;
@ -3141,23 +3082,15 @@ print_one_breakpoint (struct breakpoint *b,
{"del", "dstp", "dis", "keep"};
static char bpenables[] = "nynny";
char wrap_indent[80];
#ifdef UI_OUT
struct ui_stream *stb = ui_out_stream_new (uiout);
struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif
annotate_record ();
#ifdef UI_OUT
ui_out_tuple_begin (uiout, "bkpt");
#endif
/* 1 */
annotate_field (0);
#ifdef UI_OUT
ui_out_field_int (uiout, "number", b->number);
#else
printf_filtered ("%-3d ", b->number);
#endif
/* 2 */
annotate_field (1);
@ -3166,28 +3099,16 @@ print_one_breakpoint (struct breakpoint *b,
internal_error (__FILE__, __LINE__,
"bptypes table does not describe type #%d.",
(int) b->type);
#ifdef UI_OUT
ui_out_field_string (uiout, "type", bptypes[(int) b->type].description);
#else
printf_filtered ("%-14s ", bptypes[(int) b->type].description);
#endif
/* 3 */
annotate_field (2);
#ifdef UI_OUT
ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]);
#else
printf_filtered ("%-4s ", bpdisps[(int) b->disposition]);
#endif
/* 4 */
annotate_field (3);
#ifdef UI_OUT
ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable_state]);
ui_out_spaces (uiout, 2);
#else
printf_filtered ("%-3c ", bpenables[(int) b->enable_state]);
#endif
/* 5 and 6 */
strcpy (wrap_indent, " ");
@ -3212,16 +3133,11 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
print_expression (b->exp, stb->stream);
ui_out_field_stream (uiout, "what", stb);
#else
annotate_field (5);
print_expression (b->exp, gdb_stdout);
#endif
break;
case bp_catch_load:
@ -3229,7 +3145,6 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
@ -3244,13 +3159,6 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_field_string (uiout, "what", b->dll_pathname);
ui_out_text (uiout, "\" ");
}
#else
annotate_field (5);
if (b->dll_pathname == NULL)
printf_filtered ("<any library> ");
else
printf_filtered ("library \"%s\" ", b->dll_pathname);
#endif
break;
case bp_catch_fork:
@ -3258,7 +3166,6 @@ print_one_breakpoint (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
@ -3268,18 +3175,11 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_field_int (uiout, "what", b->forked_inferior_pid);
ui_out_spaces (uiout, 1);
}
#else
annotate_field (5);
if (b->forked_inferior_pid != 0)
printf_filtered ("process %d ", b->forked_inferior_pid);
break;
#endif
case bp_catch_exec:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
@ -3289,43 +3189,28 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_field_string (uiout, "what", b->exec_pathname);
ui_out_text (uiout, "\" ");
}
#else
annotate_field (5);
if (b->exec_pathname != NULL)
printf_filtered ("program \"%s\" ", b->exec_pathname);
#endif
break;
case bp_catch_catch:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
ui_out_field_string (uiout, "what", "exception catch");
ui_out_spaces (uiout, 1);
#else
annotate_field (5);
printf_filtered ("exception catch ");
#endif
break;
case bp_catch_throw:
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
#ifdef UI_OUT
if (addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
ui_out_field_string (uiout, "what", "exception throw");
ui_out_spaces (uiout, 1);
#else
annotate_field (5);
printf_filtered ("exception throw ");
#endif
break;
case bp_breakpoint:
@ -3340,7 +3225,6 @@ print_one_breakpoint (struct breakpoint *b,
case bp_call_dummy:
case bp_shlib_event:
case bp_thread_event:
#ifdef UI_OUT
if (addressprint)
{
annotate_field (4);
@ -3368,106 +3252,47 @@ print_one_breakpoint (struct breakpoint *b,
print_address_symbolic (b->address, stb->stream, demangle, "");
ui_out_field_stream (uiout, "at", stb);
}
#else
if (addressprint)
{
char *tmp;
annotate_field (4);
if (TARGET_ADDR_BIT <= 32)
tmp = longest_local_hex_string_custom (b->address
& (CORE_ADDR) 0xffffffff,
"08l");
else
tmp = longest_local_hex_string_custom (b->address, "016l");
printf_filtered ("%s ", tmp);
}
annotate_field (5);
*last_addr = b->address;
if (b->source_file)
{
sym = find_pc_sect_function (b->address, b->section);
if (sym)
{
fputs_filtered ("in ", gdb_stdout);
fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
wrap_here (wrap_indent);
fputs_filtered (" at ", gdb_stdout);
}
fputs_filtered (b->source_file, gdb_stdout);
printf_filtered (":%d", b->line_number);
}
else
print_address_symbolic (b->address, gdb_stdout, demangle, " ");
#endif
break;
}
if (b->thread != -1)
{
#ifdef UI_OUT
/* FIXME: This seems to be redundant and lost here; see the
"stop only in" line a little further down. */
ui_out_text (uiout, " thread ");
ui_out_field_int (uiout, "thread", b->thread);
#else
printf_filtered (" thread %d", b->thread);
#endif
}
#ifdef UI_OUT
ui_out_text (uiout, "\n");
#else
printf_filtered ("\n");
#endif
if (b->frame)
{
annotate_field (6);
#ifdef UI_OUT
ui_out_text (uiout, "\tstop only in stack frame at ");
ui_out_field_core_addr (uiout, "frame", b->frame);
ui_out_text (uiout, "\n");
#else
printf_filtered ("\tstop only in stack frame at ");
print_address_numeric (b->frame, 1, gdb_stdout);
printf_filtered ("\n");
#endif
}
if (b->cond)
{
annotate_field (7);
#ifdef UI_OUT
ui_out_text (uiout, "\tstop only if ");
print_expression (b->cond, stb->stream);
ui_out_field_stream (uiout, "cond", stb);
ui_out_text (uiout, "\n");
#else
printf_filtered ("\tstop only if ");
print_expression (b->cond, gdb_stdout);
printf_filtered ("\n");
#endif
}
if (b->thread != -1)
{
/* FIXME should make an annotation for this */
#ifdef UI_OUT
ui_out_text (uiout, "\tstop only in thread ");
ui_out_field_int (uiout, "thread", b->thread);
ui_out_text (uiout, "\n");
#else
printf_filtered ("\tstop only in thread %d\n", b->thread);
#endif
}
if (show_breakpoint_hit_counts && b->hit_count)
{
/* FIXME should make an annotation for this */
#ifdef UI_OUT
if (ep_is_catchpoint (b))
ui_out_text (uiout, "\tcatchpoint");
else
@ -3478,55 +3303,31 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_text (uiout, " time\n");
else
ui_out_text (uiout, " times\n");
#else
if (ep_is_catchpoint (b))
printf_filtered ("\tcatchpoint");
else
printf_filtered ("\tbreakpoint");
printf_filtered (" already hit %d time%s\n",
b->hit_count, (b->hit_count == 1 ? "" : "s"));
#endif
}
#ifdef UI_OUT
/* Output the count also if it is zero, but only if this is
mi. FIXME: Should have a better test for this. */
if (ui_out_is_mi_like_p (uiout))
if (show_breakpoint_hit_counts && b->hit_count == 0)
ui_out_field_int (uiout, "times", b->hit_count);
#endif
if (b->ignore_count)
{
annotate_field (8);
#ifdef UI_OUT
ui_out_text (uiout, "\tignore next ");
ui_out_field_int (uiout, "ignore", b->ignore_count);
ui_out_text (uiout, " hits\n");
#else
printf_filtered ("\tignore next %d hits\n", b->ignore_count);
#endif
}
if ((l = b->commands))
{
annotate_field (9);
#ifdef UI_OUT
ui_out_tuple_begin (uiout, "script");
print_command_lines (uiout, l, 4);
ui_out_tuple_end (uiout);
#else
while (l)
{
print_command_line (l, 4, gdb_stdout);
l = l->next;
}
#endif
}
#ifdef UI_OUT
ui_out_tuple_end (uiout);
do_cleanups (old_chain);
#endif
}
struct captured_breakpoint_query_args
@ -3604,14 +3405,11 @@ breakpoint_1 (int bnum, int allflag)
nr_printable_breakpoints++;
}
#ifdef UI_OUT
if (addressprint)
ui_out_table_begin (uiout, 6, nr_printable_breakpoints, "BreakpointTable");
else
ui_out_table_begin (uiout, 5, nr_printable_breakpoints, "BreakpointTable");
#endif /* UI_OUT */
#ifdef UI_OUT
if (nr_printable_breakpoints > 0)
annotate_breakpoints_headers ();
if (nr_printable_breakpoints > 0)
@ -3641,31 +3439,6 @@ breakpoint_1 (int bnum, int allflag)
ui_out_table_body (uiout);
if (nr_printable_breakpoints > 0)
annotate_breakpoints_table ();
#else
if (nr_printable_breakpoints > 0)
{
annotate_breakpoints_headers ();
annotate_field (0);
printf_filtered ("Num ");
annotate_field (1);
printf_filtered ("Type ");
annotate_field (2);
printf_filtered ("Disp ");
annotate_field (3);
printf_filtered ("Enb ");
if (addressprint)
{
annotate_field (4);
if (TARGET_ADDR_BIT <= 32)
printf_filtered ("Address ");
else
printf_filtered ("Address ");
}
annotate_field (5);
printf_filtered ("What\n");
annotate_breakpoints_table ();
}
#endif /* UI_OUT */
ALL_BREAKPOINTS (b)
if (bnum == -1
@ -3677,25 +3450,15 @@ breakpoint_1 (int bnum, int allflag)
print_one_breakpoint (b, &last_addr);
}
#ifdef UI_OUT
ui_out_table_end (uiout);
#endif /* UI_OUT */
if (nr_printable_breakpoints == 0)
{
#ifdef UI_OUT
if (bnum == -1)
ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
else
ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n",
bnum);
#else
if (bnum == -1)
printf_filtered ("No breakpoints or watchpoints.\n");
else
printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
#endif /* UI_OUT */
}
else
{
@ -4436,13 +4199,11 @@ static void
mention (struct breakpoint *b)
{
int say_where = 0;
#ifdef UI_OUT
struct cleanup *old_chain;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
/* FIXME: This is misplaced; mention() is called by things (like hitting a
watchpoint) other than breakpoint creation. It should be possible to
@ -4458,7 +4219,6 @@ mention (struct breakpoint *b)
case bp_none:
printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
break;
#ifdef UI_OUT
case bp_watchpoint:
ui_out_text (uiout, "Watchpoint ");
ui_out_tuple_begin (uiout, "wpt");
@ -4477,17 +4237,6 @@ mention (struct breakpoint *b)
ui_out_field_stream (uiout, "exp", stb);
ui_out_tuple_end (uiout);
break;
#else
case bp_watchpoint:
printf_filtered ("Watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
break;
case bp_hardware_watchpoint:
printf_filtered ("Hardware watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
break;
#endif
#ifdef UI_OUT
case bp_read_watchpoint:
ui_out_text (uiout, "Hardware read watchpoint ");
ui_out_tuple_begin (uiout, "hw-rwpt");
@ -4506,36 +4255,21 @@ mention (struct breakpoint *b)
ui_out_field_stream (uiout, "exp", stb);
ui_out_tuple_end (uiout);
break;
#else
case bp_read_watchpoint:
printf_filtered ("Hardware read watchpoint %d: ", b->number);
print_expression (b->exp, gdb_stdout);
break;
case bp_access_watchpoint:
printf_filtered ("Hardware access (read/write) watchpoint %d: ",
b->number);
print_expression (b->exp, gdb_stdout);
break;
#endif
case bp_breakpoint:
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
{
say_where = 0;
break;
}
#endif
printf_filtered ("Breakpoint %d", b->number);
say_where = 1;
break;
case bp_hardware_breakpoint:
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
{
say_where = 0;
break;
}
#endif
printf_filtered ("Hardware assisted breakpoint %d", b->number);
say_where = 1;
break;
@ -4587,13 +4321,9 @@ mention (struct breakpoint *b)
printf_filtered (": file %s, line %d.",
b->source_file, b->line_number);
}
#ifdef UI_OUT
do_cleanups (old_chain);
#endif
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
return;
#endif
printf_filtered ("\n");
}
@ -5593,39 +5323,36 @@ can_use_hardware_watchpoint (struct value *v)
return found_memory_cnt;
}
#ifdef UI_OUT
void
watch_command_wrapper (char *arg, int from_tty)
{
watch_command (arg, from_tty);
}
#endif
static void
watch_command (char *arg, int from_tty)
{
watch_command_1 (arg, hw_write, from_tty);
}
#ifdef UI_OUT
void
rwatch_command_wrapper (char *arg, int from_tty)
{
rwatch_command (arg, from_tty);
}
#endif
static void
rwatch_command (char *arg, int from_tty)
{
watch_command_1 (arg, hw_read, from_tty);
}
#ifdef UI_OUT
void
awatch_command_wrapper (char *arg, int from_tty)
{
awatch_command (arg, from_tty);
}
#endif
static void
awatch_command (char *arg, int from_tty)
{

View File

@ -1,5 +1,6 @@
/* GDB CLI commands.
Copyright 2000, 2001 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@ -25,9 +26,7 @@
#include "gdb_regex.h" /* Used by apropos_command */
#include "filenames.h" /* for DOSish file names */
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "top.h"
#include "cli/cli-decode.h"

View File

@ -1,6 +1,7 @@
/* Handle lists of commands, their decoding and documentation, for GDB.
Copyright 1986, 1989, 1990, 1991, 1998, 2000, 2001
Free Software Foundation, Inc.
Copyright 1986, 1989, 1990, 1991, 1998, 2000, 2001, 2002 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -22,9 +23,7 @@
#include <ctype.h>
#include "gdb_regex.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
@ -654,11 +653,7 @@ print_doc_line (struct ui_file *stream, char *str)
line_buffer[p - str] = '\0';
if (islower (line_buffer[0]))
line_buffer[0] = toupper (line_buffer[0]);
#ifdef UI_OUT
ui_out_text (uiout, line_buffer);
#else
fputs_filtered (line_buffer, stream);
#endif
}
/*

View File

@ -1,6 +1,8 @@
/* GDB CLI command scripting.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -24,9 +26,7 @@
#include "language.h" /* For value_true */
#include <ctype.h>
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "top.h"
#include "cli/cli-cmds.h"
@ -126,7 +126,7 @@ get_command_line (enum command_control_type type, char *arg)
}
/* Recursively print a command (including full control structures). */
#ifdef UI_OUT
void
print_command_lines (struct ui_out *uiout, struct command_line *cmd,
unsigned int depth)
@ -212,86 +212,6 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd,
list = list->next;
} /* while (list) */
}
#else
void
print_command_line (struct command_line *cmd, unsigned int depth,
struct ui_file *stream)
{
unsigned int i;
if (depth)
{
for (i = 0; i < depth; i++)
fputs_filtered (" ", stream);
}
/* A simple command, print it and return. */
if (cmd->control_type == simple_control)
{
fputs_filtered (cmd->line, stream);
fputs_filtered ("\n", stream);
return;
}
/* loop_continue to jump to the start of a while loop, print it
and return. */
if (cmd->control_type == continue_control)
{
fputs_filtered ("loop_continue\n", stream);
return;
}
/* loop_break to break out of a while loop, print it and return. */
if (cmd->control_type == break_control)
{
fputs_filtered ("loop_break\n", stream);
return;
}
/* A while command. Recursively print its subcommands before returning. */
if (cmd->control_type == while_control)
{
struct command_line *list;
fputs_filtered ("while ", stream);
fputs_filtered (cmd->line, stream);
fputs_filtered ("\n", stream);
list = *cmd->body_list;
while (list)
{
print_command_line (list, depth + 1, stream);
list = list->next;
}
}
/* An if command. Recursively print both arms before returning. */
if (cmd->control_type == if_control)
{
fputs_filtered ("if ", stream);
fputs_filtered (cmd->line, stream);
fputs_filtered ("\n", stream);
/* The true arm. */
print_command_line (cmd->body_list[0], depth + 1, stream);
/* Show the false arm if it exists. */
if (cmd->body_count == 2)
{
if (depth)
{
for (i = 0; i < depth; i++)
fputs_filtered (" ", stream);
}
fputs_filtered ("else\n", stream);
print_command_line (cmd->body_list[1], depth + 1, stream);
}
if (depth)
{
for (i = 0; i < depth; i++)
fputs_filtered (" ", stream);
}
fputs_filtered ("end\n", stream);
}
}
#endif
/* Execute the command in CMD. */
@ -1302,16 +1222,7 @@ show_user_1 (struct cmd_list_element *c, struct ui_file *stream)
fputs_filtered (c->name, stream);
fputs_filtered (":\n", stream);
#ifdef UI_OUT
print_command_lines (uiout, cmdlines, 1);
fputs_filtered ("\n", stream);
#else
while (cmdlines)
{
print_command_line (cmdlines, 4, stream);
cmdlines = cmdlines->next;
}
fputs_filtered ("\n", stream);
#endif
}

View File

@ -1,5 +1,5 @@
/* Header file for GDB CLI command implementation library.
Copyright 2000 Free Software Foundation, Inc.
Copyright 2000, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -38,10 +38,8 @@ extern void show_user_1 (struct cmd_list_element *c, struct ui_file *stream);
extern enum command_control_type
execute_control_command (struct command_line *cmd);
#ifdef UI_OUT
extern void print_command_lines (struct ui_out *,
struct command_line *, unsigned int);
#endif
/* Exported to gdb/infrun.c */

View File

@ -1,5 +1,6 @@
/* Handle set and show GDB commands.
Copyright 2000, 2001 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,9 +24,7 @@
#include "gdb_string.h"
#endif
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "cli/cli-decode.h"
#include "cli/cli-cmds.h"
@ -258,14 +257,12 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
}
else if (c->type == show_cmd)
{
#ifdef UI_OUT
struct cleanup *old_chain;
struct ui_stream *stb;
int quote;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
/* Possibly call the pre hook. */
if (c->pre_show_hook)
@ -274,7 +271,6 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
/* Print doc minus "show" at start. */
print_doc_line (gdb_stdout, c->doc + 5);
#ifdef UI_OUT
ui_out_text (uiout, " is ");
ui_out_wrap_hint (uiout, " ");
quote = 0;
@ -346,72 +342,6 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
ui_out_text (uiout, "\"");
ui_out_text (uiout, ".\n");
do_cleanups (old_chain);
#else
fputs_filtered (" is ", gdb_stdout);
wrap_here (" ");
switch (c->var_type)
{
case var_string:
{
fputs_filtered ("\"", gdb_stdout);
if (*(unsigned char **) c->var)
fputstr_filtered (*(unsigned char **) c->var, '"', gdb_stdout);
fputs_filtered ("\"", gdb_stdout);
}
break;
case var_string_noescape:
case var_filename:
case var_enum:
fputs_filtered ("\"", gdb_stdout);
if (*(char **) c->var)
fputs_filtered (*(char **) c->var, gdb_stdout);
fputs_filtered ("\"", gdb_stdout);
break;
case var_boolean:
fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
break;
case var_auto_boolean:
switch (*(enum cmd_auto_boolean*) c->var)
{
case CMD_AUTO_BOOLEAN_TRUE:
fputs_filtered ("on", gdb_stdout);
break;
case CMD_AUTO_BOOLEAN_FALSE:
fputs_filtered ("off", gdb_stdout);
break;
case CMD_AUTO_BOOLEAN_AUTO:
fputs_filtered ("auto", gdb_stdout);
break;
default:
internal_error (__FILE__, __LINE__,
"do_setshow_command: invalid var_auto_boolean");
break;
}
break;
case var_uinteger:
if (*(unsigned int *) c->var == UINT_MAX)
{
fputs_filtered ("unlimited", gdb_stdout);
break;
}
/* else fall through */
case var_zinteger:
fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
break;
case var_integer:
if (*(int *) c->var == INT_MAX)
{
fputs_filtered ("unlimited", gdb_stdout);
}
else
fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
break;
default:
error ("gdb internal error: bad var_type in do_setshow_command");
}
fputs_filtered (".\n", gdb_stdout);
#endif
}
else
error ("gdb internal error: bad cmd_type in do_setshow_command");
@ -425,14 +355,11 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
void
cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
{
#ifdef UI_OUT
ui_out_tuple_begin (uiout, "showlist");
#endif
for (; list != NULL; list = list->next)
{
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
#ifdef UI_OUT
if (list->prefixlist && !list->abbrev_flag)
{
ui_out_tuple_begin (uiout, "optionlist");
@ -449,20 +376,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
do_setshow_command ((char *) NULL, from_tty, list);
ui_out_tuple_end (uiout);
}
#else
if (list->prefixlist && !list->abbrev_flag)
cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
if (list->type == show_cmd)
{
fputs_filtered (prefix, gdb_stdout);
fputs_filtered (list->name, gdb_stdout);
fputs_filtered (": ", gdb_stdout);
do_setshow_command ((char *) NULL, from_tty, list);
}
#endif
}
#ifdef UI_OUT
ui_out_tuple_end (uiout);
#endif
}

View File

@ -1299,10 +1299,8 @@ extern int watchdog;
/* Hooks for alternate command interfaces. */
#ifdef UI_OUT
/* The name of the interpreter if specified on the command line. */
extern char *interpreter_p;
#endif
/* If a given interpreter matches INTERPRETER_P then it should update
command_loop_hook and init_ui_hook with the per-interpreter

View File

@ -250,12 +250,10 @@ display_gdb_prompt (char *new_prompt)
int prompt_length = 0;
char *gdb_prompt = get_prompt ();
#ifdef UI_OUT
/* When an alternative interpreter has been installed, do not
display the comand prompt. */
if (interpreter_p)
return;
#endif
if (target_executing && sync_execution)
{

View File

@ -6,8 +6,8 @@
fnasser@redhat.com */
/* Header file for GDB-specific command-line stuff.
Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000
Free Software Foundation, Inc.
Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1998, 1999,
2000, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -28,9 +28,7 @@
#define GDBCMD_H 1
#include "command.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
/* Chain containing all defined commands. */
@ -118,9 +116,7 @@ enum command_control_type execute_control_command (struct command_line *);
extern void print_command_line (struct command_line *, unsigned int,
struct ui_file *);
#ifdef UI_OUT
extern void print_command_lines (struct ui_out *,
struct command_line *, unsigned int);
#endif
#endif /* !defined (GDBCMD_H) */

View File

@ -1,6 +1,6 @@
/* Memory-access and commands for "inferior" process, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001
1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@ -37,9 +37,7 @@
#include "symfile.h"
#include "objfiles.h"
#include "completer.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
#include "event-top.h"
#include "parser-defs.h"
@ -442,7 +440,6 @@ Start it from the beginning? "))
if (from_tty)
{
#ifdef UI_OUT
ui_out_field_string (uiout, NULL, "Starting program");
ui_out_text (uiout, ": ");
if (exec_file)
@ -453,17 +450,6 @@ Start it from the beginning? "))
ui_out_field_string (uiout, "infargs", get_inferior_args ());
ui_out_text (uiout, "\n");
ui_out_flush (uiout);
#else
puts_filtered ("Starting program: ");
if (exec_file)
puts_filtered (exec_file);
puts_filtered (" ");
/* We call get_inferior_args() because we might need to compute
the value now. */
puts_filtered (get_inferior_args ());
puts_filtered ("\n");
gdb_flush (gdb_stdout);
#endif
}
/* We call get_inferior_args() because we might need to compute
@ -1147,14 +1133,11 @@ static void
print_return_value (int structure_return, struct type *value_type)
{
struct value *value;
#ifdef UI_OUT
static struct ui_stream *stb = NULL;
#endif /* UI_OUT */
if (!structure_return)
{
value = value_being_returned (value_type, stop_registers, structure_return);
#ifdef UI_OUT
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
@ -1162,11 +1145,6 @@ print_return_value (int structure_return, struct type *value_type)
value_print (value, stb->stream, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
#else /* UI_OUT */
printf_filtered ("Value returned is $%d = ", record_latest_value (value));
value_print (value, gdb_stdout, 0, Val_no_prettyprint);
printf_filtered ("\n");
#endif /* UI_OUT */
}
else
{
@ -1175,18 +1153,12 @@ print_return_value (int structure_return, struct type *value_type)
initiate the call, as opposed to the call_function_by_hand case */
#ifdef VALUE_RETURNED_FROM_STACK
value = 0;
#ifdef UI_OUT
ui_out_text (uiout, "Value returned has type: ");
ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
ui_out_text (uiout, ".");
ui_out_text (uiout, " Cannot determine contents\n");
#else /* UI_OUT */
printf_filtered ("Value returned has type: %s.", TYPE_NAME (value_type));
printf_filtered (" Cannot determine contents\n");
#endif /* UI_OUT */
#else
value = value_being_returned (value_type, stop_registers, structure_return);
#ifdef UI_OUT
stb = ui_out_stream_new (uiout);
ui_out_text (uiout, "Value returned is ");
ui_out_field_fmt (uiout, "gdb-result-var", "$%d", record_latest_value (value));
@ -1194,11 +1166,6 @@ print_return_value (int structure_return, struct type *value_type)
value_print (value, stb->stream, 0, Val_no_prettyprint);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
#else
printf_filtered ("Value returned is $%d = ", record_latest_value (value));
value_print (value, gdb_stdout, 0, Val_no_prettyprint);
printf_filtered ("\n");
#endif
#endif
}
}
@ -1857,13 +1824,13 @@ detach_command (char *args, int from_tty)
/* Stop the execution of the target while running in async mode, in
the backgound. */
#ifdef UI_OUT
void
interrupt_target_command_wrapper (char *args, int from_tty)
{
interrupt_target_command (args, from_tty);
}
#endif
static void
interrupt_target_command (char *args, int from_tty)
{

View File

@ -1,6 +1,8 @@
/* Target-struct-independent code to start (run) and stop an inferior process.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -1469,13 +1471,9 @@ handle_inferior_event (struct execution_control_state *ecs)
{
add_thread (ecs->ptid);
#ifdef UI_OUT
ui_out_text (uiout, "[New ");
ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
ui_out_text (uiout, "]\n");
#else
printf_filtered ("[New %s]\n", target_pid_or_tid_to_str (ecs->ptid));
#endif
#if 0
/* NOTE: This block is ONLY meant to be invoked in case of a
@ -3284,13 +3282,11 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
case END_STEPPING_RANGE:
/* We are done with a step/next/si/ni command. */
/* For now print nothing. */
#ifdef UI_OUT
/* Print a message only if not in the middle of doing a "step n"
operation for n > 1 */
if (!step_multi || !stop_step)
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "end-stepping-range");
#endif
break;
case BREAKPOINT_HIT:
/* We found a breakpoint. */
@ -3298,7 +3294,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
break;
case SIGNAL_EXITED:
/* The inferior was terminated by a signal. */
#ifdef UI_OUT
annotate_signalled ();
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "exited-signalled");
@ -3312,25 +3307,9 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
annotate_signal_string_end ();
ui_out_text (uiout, ".\n");
ui_out_text (uiout, "The program no longer exists.\n");
#else
annotate_signalled ();
printf_filtered ("\nProgram terminated with signal ");
annotate_signal_name ();
printf_filtered ("%s", target_signal_to_name (stop_info));
annotate_signal_name_end ();
printf_filtered (", ");
annotate_signal_string ();
printf_filtered ("%s", target_signal_to_string (stop_info));
annotate_signal_string_end ();
printf_filtered (".\n");
printf_filtered ("The program no longer exists.\n");
gdb_flush (gdb_stdout);
#endif
break;
case EXITED:
/* The inferior program is finished. */
#ifdef UI_OUT
annotate_exited (stop_info);
if (stop_info)
{
@ -3346,19 +3325,10 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
ui_out_field_string (uiout, "reason", "exited-normally");
ui_out_text (uiout, "\nProgram exited normally.\n");
}
#else
annotate_exited (stop_info);
if (stop_info)
printf_filtered ("\nProgram exited with code 0%o.\n",
(unsigned int) stop_info);
else
printf_filtered ("\nProgram exited normally.\n");
#endif
break;
case SIGNAL_RECEIVED:
/* Signal received. The signal table tells us to print about
it. */
#ifdef UI_OUT
annotate_signal ();
ui_out_text (uiout, "\nProgram received signal ");
annotate_signal_name ();
@ -3371,19 +3341,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
annotate_signal_string_end ();
ui_out_text (uiout, ".\n");
#else
annotate_signal ();
printf_filtered ("\nProgram received signal ");
annotate_signal_name ();
printf_filtered ("%s", target_signal_to_name (stop_info));
annotate_signal_name_end ();
printf_filtered (", ");
annotate_signal_string ();
printf_filtered ("%s", target_signal_to_string (stop_info));
annotate_signal_string_end ();
printf_filtered (".\n");
gdb_flush (gdb_stdout);
#endif
break;
default:
internal_error (__FILE__, __LINE__,
@ -3527,18 +3484,14 @@ and/or watchpoints.\n");
internal_error (__FILE__, __LINE__,
"Unknown value.");
}
#ifdef UI_OUT
/* For mi, have the same behavior every time we stop:
print everything but the source line. */
if (ui_out_is_mi_like_p (uiout))
source_flag = LOC_AND_ADDRESS;
#endif
#ifdef UI_OUT
if (ui_out_is_mi_like_p (uiout))
ui_out_field_int (uiout, "thread-id",
pid_to_thread_id (inferior_ptid));
#endif
/* The behavior of this routine with respect to the source
flag is:
SRC_LINE: Print only source line

View File

@ -51,10 +51,8 @@ int display_space;
processes UI events asynchronously. */
int event_loop_p = 1;
#ifdef UI_OUT
/* Has an interpreter been specified and if so, which. */
char *interpreter_p;
#endif
/* Whether this is the command line version or not */
int tui_version = 0;
@ -250,11 +248,9 @@ captured_main (void *data)
{"enable-external-editor", no_argument, 0, 'y'},
{"editor-command", required_argument, 0, 'w'},
#endif
#ifdef UI_OUT
{"ui", required_argument, 0, 'i'},
{"interpreter", required_argument, 0, 'i'},
{"i", required_argument, 0, 'i'},
#endif
{"directory", required_argument, 0, 'd'},
{"d", required_argument, 0, 'd'},
{"cd", required_argument, 0, 11},
@ -357,11 +353,9 @@ extern int gdbtk_test (char *);
break;
}
#endif /* GDBTK */
#ifdef UI_OUT
case 'i':
interpreter_p = optarg;
break;
#endif
case 'd':
dirarg[ndir++] = optarg;
if (ndir >= dirsize)

View File

@ -1,3 +1,11 @@
2002-01-13 Andrew Cagney <ac131313@redhat.com>
* mi-cmd-stack.c:
* mi-cmd-break.c:
* mi-main.c:
2001-12-30 Eli Zaretskii <eliz@is.elta.co.il>
* gdbmi.texinfo: Fix the application of GFDL in the Copyright notice.

View File

@ -1,5 +1,5 @@
/* MI Command Set - breakpoint and watchpoint commands.
Copyright 2000, 2001 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@ -230,19 +230,13 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
switch (type)
{
case REG_WP:
#ifdef UI_OUT
watch_command_wrapper (expr, FROM_TTY);
#endif
break;
case READ_WP:
#ifdef UI_OUT
rwatch_command_wrapper (expr, FROM_TTY);
#endif
break;
case ACCESS_WP:
#ifdef UI_OUT
awatch_command_wrapper (expr, FROM_TTY);
#endif
break;
default:
error ("mi_cmd_break_watch: Unknown watchpoint type.");

View File

@ -1,5 +1,5 @@
/* MI Command Set - stack commands.
Copyright 2000 Free Software Foundation, Inc.
Copyright 2000, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@ -27,12 +27,10 @@
#include "ui-out.h"
#include "symtab.h"
#ifdef UI_OUT
/* FIXME: these should go in some .h file but stack.c doesn't have a
corresponding .h file. These wrappers will be obsolete anyway, once
we pull the plug on the sanitization. */
extern void select_frame_command_wrapper (char *, int);
#endif
static void list_args_or_locals (int locals, int values, struct frame_info *fi);
@ -295,7 +293,6 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
enum mi_cmd_result
mi_cmd_stack_select_frame (char *command, char **argv, int argc)
{
#ifdef UI_OUT
if (!target_has_stack)
error ("mi_cmd_stack_select_frame: No stack.");
@ -307,6 +304,5 @@ mi_cmd_stack_select_frame (char *command, char **argv, int argc)
select_frame_command_wrapper (0, 1 /* not used */ );
else
select_frame_command_wrapper (argv[0], 1 /* not used */ );
#endif
return MI_CMD_DONE;
}

View File

@ -1,5 +1,5 @@
/* MI Command Set.
Copyright 2000, 2001 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@ -81,13 +81,11 @@ static void mi_load_progress (const char *section_name,
unsigned long total_sent,
unsigned long grand_total);
#ifdef UI_OUT
/* FIXME: these should go in some .h file, but infcmd.c doesn't have a
corresponding .h file. These wrappers will be obsolete anyway, once
we pull the plug on the sanitization. */
extern void interrupt_target_command_wrapper (char *, int);
extern void return_command_wrapper (char *, int);
#endif
/* Command implementations. FIXME: Is this libgdb? No. This is the MI
layer that calls libgdb. Any operation used in the below should be
@ -158,7 +156,6 @@ mi_cmd_exec_until (char *args, int from_tty)
enum mi_cmd_result
mi_cmd_exec_return (char *args, int from_tty)
{
#ifdef UI_OUT
/* This command doesn't really execute the target, it just pops the
specified number of frames. */
if (*args)
@ -175,7 +172,6 @@ mi_cmd_exec_return (char *args, int from_tty)
show_and_print_stack_frame (selected_frame,
selected_frame_level,
LOC_AND_ADDRESS);
#endif
return MI_CMD_DONE;
}
@ -195,7 +191,6 @@ mi_cmd_exec_continue (char *args, int from_tty)
enum mi_cmd_result
mi_cmd_exec_interrupt (char *args, int from_tty)
{
#ifdef UI_OUT
if (!target_executing)
{
xasprintf (&mi_error_message,
@ -214,7 +209,6 @@ mi_cmd_exec_interrupt (char *args, int from_tty)
mi_out_put (uiout, raw_stdout);
mi_out_rewind (uiout);
fputs_unfiltered ("\n", raw_stdout);
#endif
return MI_CMD_QUIET;
}
@ -250,9 +244,7 @@ mi_cmd_thread_list_ids (char *command, char **argv, int argc)
return MI_CMD_ERROR;
}
else
#ifdef UI_OUT
rc = gdb_list_thread_ids (uiout);
#endif
if (rc == GDB_RC_FAIL)
return MI_CMD_CAUGHT_ERROR;

View File

@ -1,7 +1,8 @@
/* Print values for GNU debugger GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -38,9 +39,7 @@
#include "symfile.h" /* for overlay functions */
#include "objfiles.h" /* ditto */
#include "completer.h" /* for completion functions */
#ifdef UI_OUT
#include "ui-out.h"
#endif
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@ -1796,13 +1795,11 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
int arg_size;
/* Number of ints of arguments that we have printed so far. */
int args_printed = 0;
#ifdef UI_OUT
struct cleanup *old_chain, *list_chain;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
if (func)
{
@ -1903,7 +1900,6 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
sym = nsym;
}
#ifdef UI_OUT
/* Print the current arg. */
if (!first)
ui_out_text (uiout, ", ");
@ -1917,19 +1913,6 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
ui_out_field_stream (uiout, "name", stb);
annotate_arg_name_end ();
ui_out_text (uiout, "=");
#else
/* Print the current arg. */
if (!first)
fprintf_filtered (stream, ", ");
wrap_here (" ");
annotate_arg_begin ();
fprintf_symbol_filtered (stream, SYMBOL_SOURCE_NAME (sym),
SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
annotate_arg_name_end ();
fputs_filtered ("=", stream);
#endif
/* Avoid value_print because it will deref ref parameters. We just
want to print their addresses. Print ??? for args whose address
@ -1942,7 +1925,6 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
if (val)
{
#ifdef UI_OUT
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val),
stb->stream, 0, 0, 2, Val_no_prettyprint);
@ -1953,14 +1935,6 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
/* Invoke ui_out_tuple_end. */
do_cleanups (list_chain);
#else
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val),
stream, 0, 0, 2, Val_no_prettyprint);
}
else
fputs_filtered ("???", stream);
#endif
annotate_arg_end ();
@ -1982,9 +1956,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
print_frame_nameless_args (fi, start, num - args_printed,
first, stream);
}
#ifdef UI_OUT
do_cleanups (old_chain);
#endif /* no UI_OUT */
}
/* Print nameless args on STREAM.

View File

@ -1,6 +1,7 @@
/* Remote target communications for serial-line targets in custom GDB protocol
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@ -1001,14 +1002,9 @@ record_currthread (int currthread)
if (!in_thread_list (pid_to_ptid (currthread)))
{
add_thread (pid_to_ptid (currthread));
#ifdef UI_OUT
ui_out_text (uiout, "[New ");
ui_out_text (uiout, target_pid_to_str (pid_to_ptid (currthread)));
ui_out_text (uiout, "]\n");
#else
printf_filtered ("[New %s]\n",
target_pid_to_str (pid_to_ptid (currthread)));
#endif
}
}

View File

@ -43,9 +43,7 @@
#include "linespec.h"
#include "filenames.h" /* for DOSish file names */
#include "completer.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
#ifdef CRLF_SOURCE_FILES
@ -970,11 +968,9 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
current_source_line = line;
first_line_listed = line;
#ifdef UI_OUT
/* If printing of source lines is disabled, just print file and line number */
if (ui_out_test_flags (uiout, ui_source_list))
{
#endif
/* Only prints "No such file or directory" once */
if ((s != last_source_visited) || (!last_source_error))
{
@ -986,14 +982,12 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
desc = last_source_error;
noerror = 1;
}
#ifdef UI_OUT
}
else
{
desc = -1;
noerror = 1;
}
#endif
if (desc < 0)
{
@ -1006,14 +1000,10 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
print_sys_errmsg (name, errno);
}
else
#ifdef UI_OUT
ui_out_field_int (uiout, "line", line);
ui_out_text (uiout, "\tin ");
ui_out_field_string (uiout, "file", s->filename);
ui_out_text (uiout, "\n");
#else
printf_filtered ("%d\tin %s\n", line, s->filename);
#endif
return;
}
@ -1041,7 +1031,6 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
while (nlines-- > 0)
{
#ifdef UI_OUT
char buf[20];
c = fgetc (stream);
@ -1078,29 +1067,6 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
}
}
while (c != '\n' && (c = fgetc (stream)) >= 0);
#else
c = fgetc (stream);
if (c == EOF)
break;
last_line_listed = current_source_line;
printf_filtered ("%d\t", current_source_line++);
do
{
if (c < 040 && c != '\t' && c != '\n' && c != '\r')
printf_filtered ("^%c", c + 0100);
else if (c == 0177)
printf_filtered ("^?");
#ifdef CRLF_SOURCE_FILES
else if (c == '\r')
{
/* Just skip \r characters. */
}
#endif
else
printf_filtered ("%c", c);
}
while (c != '\n' && (c = fgetc (stream)) >= 0);
#endif
}
fclose (stream);

View File

@ -1,6 +1,8 @@
/* Print and select stack frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -35,9 +37,7 @@
#include "demangle.h"
#include "inferior.h"
#include "annotate.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
/* Prototypes for exported functions. */
@ -413,13 +413,8 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
ability to decide for themselves if it is desired. */
if (addressprint && mid_statement)
{
#ifdef UI_OUT
ui_out_field_core_addr (uiout, "addr", fi->pc);
ui_out_text (uiout, "\t");
#else
print_address_numeric (fi->pc, 1, gdb_stdout);
printf_filtered ("\t");
#endif
}
print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
@ -446,14 +441,12 @@ print_frame (struct frame_info *fi,
struct symbol *func;
register char *funname = 0;
enum language funlang = language_unknown;
#ifdef UI_OUT
struct ui_stream *stb;
struct cleanup *old_chain;
struct cleanup *list_chain;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
func = find_pc_function (fi->pc);
if (func)
@ -532,82 +525,49 @@ print_frame (struct frame_info *fi,
annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
#ifdef UI_OUT
list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
#endif
if (level >= 0)
{
#ifdef UI_OUT
ui_out_text (uiout, "#");
ui_out_field_fmt (uiout, "level", "%-2d", level);
ui_out_spaces (uiout, 1);
#else
printf_filtered ("#%-2d ", level);
#endif
}
if (addressprint)
if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
{
annotate_frame_address ();
#ifdef UI_OUT
ui_out_field_core_addr (uiout, "addr", fi->pc);
annotate_frame_address_end ();
ui_out_text (uiout, " in ");
#else
print_address_numeric (fi->pc, 1, gdb_stdout);
annotate_frame_address_end ();
printf_filtered (" in ");
#endif
}
annotate_frame_function_name ();
#ifdef UI_OUT
fprintf_symbol_filtered (stb->stream, funname ? funname : "??", funlang,
DMGL_ANSI);
ui_out_field_stream (uiout, "func", stb);
ui_out_wrap_hint (uiout, " ");
#else
fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
DMGL_ANSI);
wrap_here (" ");
#endif
annotate_frame_args ();
#ifdef UI_OUT
ui_out_text (uiout, " (");
#else
fputs_filtered (" (", gdb_stdout);
#endif
if (args)
{
struct print_args_args args;
#ifdef UI_OUT
struct cleanup *args_list_chain;
#endif
args.fi = fi;
args.func = func;
args.stream = gdb_stdout;
#ifdef UI_OUT
args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
/* FIXME: args must be a list. If one argument is a string it will
have " that will not be properly escaped. */
/* Invoke ui_out_tuple_end. */
do_cleanups (args_list_chain);
#else
catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
#endif
QUIT;
}
#ifdef UI_OUT
ui_out_text (uiout, ")");
#else
printf_filtered (")");
#endif
if (sal.symtab && sal.symtab->filename)
{
annotate_frame_source_begin ();
#ifdef UI_OUT
ui_out_wrap_hint (uiout, " ");
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
@ -616,16 +576,6 @@ print_frame (struct frame_info *fi,
ui_out_text (uiout, ":");
annotate_frame_source_line ();
ui_out_field_int (uiout, "line", sal.line);
#else
wrap_here (" ");
printf_filtered (" at ");
annotate_frame_source_file ();
printf_filtered ("%s", sal.symtab->filename);
annotate_frame_source_file_end ();
printf_filtered (":");
annotate_frame_source_line ();
printf_filtered ("%d", sal.line);
#endif
annotate_frame_source_end ();
}
@ -636,26 +586,17 @@ print_frame (struct frame_info *fi,
if (lib)
{
annotate_frame_where ();
#ifdef UI_OUT
ui_out_wrap_hint (uiout, " ");
ui_out_text (uiout, " from ");
ui_out_field_string (uiout, "from", lib);
#else
wrap_here (" ");
printf_filtered (" from %s", lib);
#endif
}
}
#endif /* PC_SOLIB */
#ifdef UI_OUT
/* do_cleanups will call ui_out_tuple_end() for us. */
do_cleanups (list_chain);
ui_out_text (uiout, "\n");
do_cleanups (old_chain);
#else
printf_filtered ("\n");
#endif
}
@ -1618,13 +1559,12 @@ find_relative_frame (register struct frame_info *frame,
frame expressions. */
/* ARGSUSED */
#ifdef UI_OUT
void
select_frame_command_wrapper (char *level_exp, int from_tty)
{
select_frame_command (level_exp, from_tty);
}
#endif
static void
select_frame_command (char *level_exp, int from_tty)
{
@ -1754,13 +1694,12 @@ down_command (char *count_exp, int from_tty)
show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
}
#ifdef UI_OUT
void
return_command_wrapper (char *retval_exp, int from_tty)
{
return_command (retval_exp, from_tty);
}
#endif
static void
return_command (char *retval_exp, int from_tty)
{

View File

@ -1,6 +1,8 @@
/* Generic symbol file reading for the GNU debugger, GDB.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001 Free Software Foundation, Inc.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@ -1222,14 +1224,8 @@ load_section_callback (bfd *abfd, asection *asec, void *data)
/* Is this really necessary? I guess it gives the user something
to look at during a long download. */
#ifdef UI_OUT
ui_out_message (uiout, 0, "Loading section %s, size 0x%s lma 0x%s\n",
sect_name, paddr_nz (size), paddr_nz (lma));
#else
fprintf_unfiltered (gdb_stdout,
"Loading section %s, size 0x%s lma 0x%s\n",
sect_name, paddr_nz (size), paddr_nz (lma));
#endif
bfd_get_section_contents (abfd, asec, buffer, 0, size);
@ -1355,17 +1351,11 @@ generic_load (char *args, int from_tty)
end_time = time (NULL);
entry = bfd_get_start_address (loadfile_bfd);
#ifdef UI_OUT
ui_out_text (uiout, "Start address ");
ui_out_field_fmt (uiout, "address", "0x%s", paddr_nz (entry));
ui_out_text (uiout, ", load size ");
ui_out_field_fmt (uiout, "load-size", "%lu", cbdata.data_count);
ui_out_text (uiout, "\n");
#else
fprintf_unfiltered (gdb_stdout,
"Start address 0x%s, load size %lu\n",
paddr_nz (entry), cbdata.data_count);
#endif
/* We were doing this in remote-mips.c, I suspect it is right
for other targets too. */
write_pc (entry);
@ -1402,7 +1392,6 @@ print_transfer_performance (struct ui_file *stream,
unsigned long write_count,
unsigned long time_count)
{
#ifdef UI_OUT
ui_out_text (uiout, "Transfer rate: ");
if (time_count > 0)
{
@ -1422,16 +1411,6 @@ print_transfer_performance (struct ui_file *stream,
ui_out_text (uiout, " bytes/write");
}
ui_out_text (uiout, ".\n");
#else
fprintf_unfiltered (stream, "Transfer rate: ");
if (time_count > 0)
fprintf_unfiltered (stream, "%lu bits/sec", (data_count * 8) / time_count);
else
fprintf_unfiltered (stream, "%lu bits in <1 sec", (data_count * 8));
if (write_count > 0)
fprintf_unfiltered (stream, ", %lu bytes/write", data_count / write_count);
fprintf_unfiltered (stream, ".\n");
#endif
}
/* This function allows the addition of incrementally linked object files.

View File

@ -1,7 +1,8 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of GDB.
@ -2829,13 +2830,13 @@ methods_info (char *regexp)
#endif /* 0 */
/* Breakpoint all functions matching regular expression. */
#ifdef UI_OUT
void
rbreak_command_wrapper (char *regexp, int from_tty)
{
rbreak_command (regexp, from_tty);
}
#endif
static void
rbreak_command (char *regexp, int from_tty)
{

View File

@ -1,9 +1,9 @@
/* Multi-process/thread control for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
This file is part of GDB.
@ -38,9 +38,7 @@
#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
#ifdef UI_OUT
#include "ui-out.h"
#endif
/*#include "lynxos-core.h" */
@ -253,7 +251,7 @@ in_thread_list (ptid_t ptid)
return 0; /* Never heard of 'im */
}
#ifdef UI_OUT
/* Print a list of thread ids currently known, and the total number of
threads. To be used from within catch_errors. */
static int
@ -284,7 +282,6 @@ gdb_list_thread_ids (struct ui_out *uiout)
return catch_exceptions (uiout, do_captured_list_thread_ids, NULL,
NULL, RETURN_MASK_ALL);
}
#endif
/* Load infrun state for the thread PID. */
@ -698,21 +695,14 @@ do_captured_thread_select (struct ui_out *uiout,
tp = find_thread_id (num);
#ifdef UI_OUT
if (!tp)
error ("Thread ID %d not known.", num);
#else
if (!tp)
error ("Thread ID %d not known. Use the \"info threads\" command to\n\
see the IDs of currently known threads.", num);
#endif
if (!thread_alive (tp))
error ("Thread ID %d has terminated.\n", num);
switch_to_thread (tp->ptid);
#ifdef UI_OUT
ui_out_text (uiout, "[Switching to thread ");
ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid));
ui_out_text (uiout, " (");
@ -722,16 +712,6 @@ see the IDs of currently known threads.", num);
ui_out_text (uiout, target_pid_to_str (inferior_ptid));
#endif
ui_out_text (uiout, ")]");
#else /* UI_OUT */
printf_filtered ("[Switching to thread %d (%s)]\n",
pid_to_thread_id (inferior_ptid),
#if defined(HPUXHPPA)
target_tid_to_str (inferior_ptid)
#else
target_pid_to_str (inferior_ptid)
#endif
);
#endif /* UI_OUT */
print_stack_frame (selected_frame, selected_frame_level, 1);
return GDB_RC_OK;

View File

@ -60,10 +60,8 @@
#include "gdb_string.h"
#include "gdb_stat.h"
#include <ctype.h>
#ifdef UI_OUT
#include "ui-out.h"
#include "cli-out.h"
#endif
/* Default command line prompt. This is overriden in some configs. */
@ -2089,7 +2087,6 @@ gdb_init (char *argv0)
if (init_ui_hook)
init_ui_hook (argv0);
#ifdef UI_OUT
/* Install the default UI */
if (!init_ui_hook)
{
@ -2104,5 +2101,4 @@ gdb_init (char *argv0)
exit (1);
}
}
#endif
}