Change the stream argument to _filtered to GDB_FILE *.
Change all references to stdout/stderr to gdb_stdout/gdb_stderr. Replace all calls to stdio output functions with calls to corresponding _unfiltered functions (`fprintf_unfiltered') Replaced calls to fopen for output to gdb_fopen. Added sufficient goo to utils.c and defs.h to make the above work. The net effect is that stdio output functions are only directly used in utils.c. Elsewhere, the _unfiltered and _filtered functions and GDB_FILE type are used. In the near future, GDB_FILE will stop being equivalant to FILE. The semantics of some commands has changed in a very subtle way: called in the right context, they may cause new occurences of prompt_for_continue() behavior. The testsuite doesn't notice anything like this, though. Please respect this change by not reintroducing stdio output dependencies in the main body of gdb code. All output from commands should go to a GDB_FILE. Target-specific code can still use stdio directly to communicate with targets.
This commit is contained in:
parent
b3c0fc577b
commit
199b2450f6
121 changed files with 1751 additions and 1236 deletions
|
@ -14,3 +14,4 @@ dir ../mmalloc
|
|||
dir ../libiberty
|
||||
dir ../bfd
|
||||
set prompt (top-gdb)
|
||||
source /.gdbinit
|
||||
|
|
|
@ -217,6 +217,32 @@ Mon Oct 25 14:57:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
|||
* breakpoint.c (mention): Add bp_call_dummy to switch.
|
||||
* symmisc.c (dump_symtab): Use %d not %ld for line number.
|
||||
|
||||
Sun Oct 24 18:29:32 1993 Tom Lord (lord@rtl.cygnus.com)
|
||||
|
||||
* every non-obsolete file except utils.c:
|
||||
Change the stream argument to _filtered to GDB_FILE *.
|
||||
Change all references to stdout/stderr to gdb_stdout/gdb_stderr.
|
||||
Replace all calls to stdio output functions with
|
||||
calls to corresponding _unfiltered functions.
|
||||
Replaced calls to fopen for output to gdb_fopen.
|
||||
Added sufficient goo to utils.c and defs.h to make the above
|
||||
work.
|
||||
|
||||
The net effect is that stdio output functions are only directly
|
||||
used in utils.c. Elsewhere, the _unfiltered and _filtered
|
||||
functions and GDB_FILE type are used.
|
||||
|
||||
In the near future, GDB_FILE will stop being equivalant to
|
||||
FILE.
|
||||
|
||||
The semantics of some commands has changed in a very subtle way:
|
||||
called in the right context, they may cause new occurences of
|
||||
prompt_for_continue() behavior.
|
||||
|
||||
Please respect this change by not reintroducing stdio output
|
||||
dependencies in the main body of gdb code. All output from
|
||||
commands should go to a GDB_FILE.
|
||||
|
||||
Sun Oct 24 20:16:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
||||
|
||||
* parse.c, parser-defs.h (write_exp_msymbol): New function to write
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -830,36 +830,36 @@ a29k_get_processor_type ()
|
|||
switch ((cfg_reg >> 28) & 0xf)
|
||||
{
|
||||
case 0:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29000");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29000");
|
||||
break;
|
||||
case 1:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29005");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29005");
|
||||
break;
|
||||
case 2:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29050");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29050");
|
||||
processor_type = a29k_freeze_mode;
|
||||
break;
|
||||
case 3:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29035");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29035");
|
||||
break;
|
||||
case 4:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29030");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29030");
|
||||
break;
|
||||
case 5:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am2920*");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am2920*");
|
||||
break;
|
||||
case 6:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am2924*");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am2924*");
|
||||
break;
|
||||
case 7:
|
||||
fprintf_filtered (stderr, "Remote debugging an Am29040");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an Am29040");
|
||||
break;
|
||||
default:
|
||||
fprintf_filtered (stderr, "Remote debugging an unknown Am29k\n");
|
||||
fprintf_filtered (gdb_stderr, "Remote debugging an unknown Am29k\n");
|
||||
/* Don't bother to print the revision. */
|
||||
return;
|
||||
}
|
||||
fprintf_filtered (stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f));
|
||||
fprintf_filtered (gdb_stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -129,7 +129,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which)
|
|||
#endif
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "Couldn't read float regs from core file\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
|
||||
}
|
||||
}
|
||||
#else /* Not sun3 target. */
|
||||
|
|
|
@ -919,7 +919,7 @@ alpha_store_return_value (valtype, valbuf)
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ core_file_command (filename, from_tty)
|
|||
reg_offset -= KERNEL_U_ADDR;
|
||||
|
||||
memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR));
|
||||
printf ("Core file is from \"%s\".\n", u.u_comm);
|
||||
printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm);
|
||||
|
||||
/* I don't know where to find this info.
|
||||
So, for now, mark it as not available. */
|
||||
|
@ -161,5 +161,5 @@ core_file_command (filename, from_tty)
|
|||
validate_files ();
|
||||
}
|
||||
else if (from_tty)
|
||||
printf ("No core file now.\n");
|
||||
printf_unfiltered ("No core file now.\n");
|
||||
}
|
||||
|
|
142
gdb/breakpoint.c
142
gdb/breakpoint.c
|
@ -30,6 +30,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
#include "ctype.h"
|
||||
#include "command.h"
|
||||
#include "inferior.h"
|
||||
#include "thread.h"
|
||||
#include "target.h"
|
||||
#include "language.h"
|
||||
#include <string.h>
|
||||
|
@ -449,7 +450,7 @@ insert_breakpoints ()
|
|||
b->enable = disabled;
|
||||
if (!disabled_breaks)
|
||||
{
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"Cannot insert breakpoint %d:\n", b->number);
|
||||
printf_filtered ("Disabling shared library breakpoints:\n");
|
||||
}
|
||||
|
@ -459,9 +460,9 @@ insert_breakpoints ()
|
|||
else
|
||||
#endif
|
||||
{
|
||||
fprintf (stderr, "Cannot insert breakpoint %d:\n", b->number);
|
||||
fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
|
||||
#ifdef ONE_PROCESS_WRITETEXT
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"The same program may be running in another process.\n");
|
||||
#endif
|
||||
memory_error (val, b->address); /* which bombs us out */
|
||||
|
@ -482,7 +483,7 @@ remove_breakpoints ()
|
|||
int val;
|
||||
|
||||
#ifdef BREAKPOINT_DEBUG
|
||||
printf ("Removing breakpoints.\n");
|
||||
printf_unfiltered ("Removing breakpoints.\n");
|
||||
#endif /* BREAKPOINT_DEBUG */
|
||||
|
||||
ALL_BREAKPOINTS (b)
|
||||
|
@ -493,11 +494,11 @@ remove_breakpoints ()
|
|||
return val;
|
||||
b->inserted = 0;
|
||||
#ifdef BREAKPOINT_DEBUG
|
||||
printf ("Removed breakpoint at %s",
|
||||
printf_unfiltered ("Removed breakpoint at %s",
|
||||
local_hex_string((unsigned long) b->address));
|
||||
printf (", shadow %s",
|
||||
printf_unfiltered (", shadow %s",
|
||||
local_hex_string((unsigned long) b->shadow_contents[0]));
|
||||
printf (", %s.\n",
|
||||
printf_unfiltered (", %s.\n",
|
||||
local_hex_string((unsigned long) b->shadow_contents[1]));
|
||||
#endif /* BREAKPOINT_DEBUG */
|
||||
}
|
||||
|
@ -552,6 +553,29 @@ breakpoint_here_p (pc)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* breakpoint_match_thread (PC, PID) returns true if the breakpoint at PC
|
||||
is valid for process/thread PID. */
|
||||
|
||||
int
|
||||
breakpoint_thread_match (pc, pid)
|
||||
CORE_ADDR pc;
|
||||
int pid;
|
||||
{
|
||||
struct breakpoint *b;
|
||||
int thread;
|
||||
|
||||
thread = pid_to_thread_id (pid);
|
||||
|
||||
ALL_BREAKPOINTS (b)
|
||||
if (b->enable != disabled
|
||||
&& b->address == pc
|
||||
&& (b->thread == -1 || b->thread == thread))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* bpstat stuff. External routines' interfaces are documented
|
||||
in breakpoint.h. */
|
||||
|
@ -740,11 +764,11 @@ print_it_normal (bs)
|
|||
if (bs->old_val != NULL)
|
||||
{
|
||||
printf_filtered ("\nWatchpoint %d, ", bs->breakpoint_at->number);
|
||||
print_expression (bs->breakpoint_at->exp, stdout);
|
||||
print_expression (bs->breakpoint_at->exp, gdb_stdout);
|
||||
printf_filtered ("\nOld value = ");
|
||||
value_print (bs->old_val, stdout, 0, Val_pretty_default);
|
||||
value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
|
||||
printf_filtered ("\nNew value = ");
|
||||
value_print (bs->breakpoint_at->val, stdout, 0,
|
||||
value_print (bs->breakpoint_at->val, gdb_stdout, 0,
|
||||
Val_pretty_default);
|
||||
printf_filtered ("\n");
|
||||
value_free (bs->old_val);
|
||||
|
@ -1406,7 +1430,7 @@ breakpoint_1 (bnum, allflag)
|
|||
switch (b->type)
|
||||
{
|
||||
case bp_watchpoint:
|
||||
print_expression (b->exp, stdout);
|
||||
print_expression (b->exp, gdb_stdout);
|
||||
break;
|
||||
|
||||
case bp_breakpoint:
|
||||
|
@ -1425,16 +1449,16 @@ breakpoint_1 (bnum, allflag)
|
|||
sym = find_pc_function (b->address);
|
||||
if (sym)
|
||||
{
|
||||
fputs_filtered ("in ", stdout);
|
||||
fputs_filtered (SYMBOL_SOURCE_NAME (sym), stdout);
|
||||
fputs_filtered ("in ", gdb_stdout);
|
||||
fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
|
||||
wrap_here (wrap_indent);
|
||||
fputs_filtered (" at ", stdout);
|
||||
fputs_filtered (" at ", gdb_stdout);
|
||||
}
|
||||
fputs_filtered (b->source_file, stdout);
|
||||
fputs_filtered (b->source_file, gdb_stdout);
|
||||
printf_filtered (":%d", b->line_number);
|
||||
}
|
||||
else
|
||||
print_address_symbolic (b->address, stdout, demangle, " ");
|
||||
print_address_symbolic (b->address, gdb_stdout, demangle, " ");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1446,7 +1470,7 @@ breakpoint_1 (bnum, allflag)
|
|||
if (b->cond)
|
||||
{
|
||||
printf_filtered ("\tstop only if ");
|
||||
print_expression (b->cond, stdout);
|
||||
print_expression (b->cond, gdb_stdout);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
if (b->ignore_count)
|
||||
|
@ -1454,9 +1478,9 @@ breakpoint_1 (bnum, allflag)
|
|||
if ((l = b->commands))
|
||||
while (l)
|
||||
{
|
||||
fputs_filtered ("\t", stdout);
|
||||
fputs_filtered (l->line, stdout);
|
||||
fputs_filtered ("\n", stdout);
|
||||
fputs_filtered ("\t", gdb_stdout);
|
||||
fputs_filtered (l->line, gdb_stdout);
|
||||
fputs_filtered ("\n", gdb_stdout);
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
|
@ -1521,17 +1545,17 @@ describe_other_breakpoints (pc)
|
|||
others++;
|
||||
if (others > 0)
|
||||
{
|
||||
printf ("Note: breakpoint%s ", (others > 1) ? "s" : "");
|
||||
printf_unfiltered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
|
||||
ALL_BREAKPOINTS (b)
|
||||
if (b->address == pc)
|
||||
{
|
||||
others--;
|
||||
printf ("%d%s%s ",
|
||||
printf_unfiltered ("%d%s%s ",
|
||||
b->number,
|
||||
(b->enable == disabled) ? " (disabled)" : "",
|
||||
(others > 1) ? "," : ((others == 1) ? " and" : ""));
|
||||
}
|
||||
printf ("also set at pc %s.\n", local_hex_string((unsigned long) pc));
|
||||
printf_unfiltered ("also set at pc %s.\n", local_hex_string((unsigned long) pc));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1597,6 +1621,7 @@ set_raw_breakpoint (sal)
|
|||
else
|
||||
b->source_file = savestring (sal.symtab->filename,
|
||||
strlen (sal.symtab->filename));
|
||||
b->thread = -1;
|
||||
b->line_number = sal.line;
|
||||
b->enable = enabled;
|
||||
b->next = 0;
|
||||
|
@ -1761,7 +1786,7 @@ mention (b)
|
|||
{
|
||||
case bp_watchpoint:
|
||||
printf_filtered ("Watchpoint %d: ", b->number);
|
||||
print_expression (b->exp, stdout);
|
||||
print_expression (b->exp, gdb_stdout);
|
||||
break;
|
||||
case bp_breakpoint:
|
||||
printf_filtered ("Breakpoint %d at %s", b->number,
|
||||
|
@ -1775,6 +1800,7 @@ mention (b)
|
|||
case bp_longjmp:
|
||||
case bp_longjmp_resume:
|
||||
case bp_step_resume:
|
||||
case bp_call_dummy:
|
||||
break;
|
||||
}
|
||||
printf_filtered ("\n");
|
||||
|
@ -1841,8 +1867,8 @@ break_command_1 (arg, tempflag, from_tty)
|
|||
struct cleanup *old_chain;
|
||||
struct cleanup *canonical_strings_chain = NULL;
|
||||
char **canonical = (char **)NULL;
|
||||
|
||||
int i;
|
||||
int thread;
|
||||
|
||||
sals.sals = NULL;
|
||||
sals.nelts = 0;
|
||||
|
@ -1904,21 +1930,48 @@ break_command_1 (arg, tempflag, from_tty)
|
|||
}
|
||||
}
|
||||
|
||||
thread = -1; /* No specific thread yet */
|
||||
|
||||
/* Resolve all line numbers to PC's, and verify that conditions
|
||||
can be parsed, before setting any breakpoints. */
|
||||
for (i = 0; i < sals.nelts; i++)
|
||||
{
|
||||
char *tok, *end_tok;
|
||||
int toklen;
|
||||
|
||||
resolve_sal_pc (&sals.sals[i]);
|
||||
|
||||
while (arg && *arg)
|
||||
tok = arg;
|
||||
|
||||
while (tok && *tok)
|
||||
{
|
||||
if (arg[0] == 'i' && arg[1] == 'f'
|
||||
&& (arg[2] == ' ' || arg[2] == '\t'))
|
||||
while (*tok == ' ' || *tok == '\t')
|
||||
tok++;
|
||||
|
||||
end_tok = tok;
|
||||
|
||||
while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
|
||||
end_tok++;
|
||||
|
||||
toklen = end_tok - tok;
|
||||
|
||||
if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
|
||||
{
|
||||
arg += 2;
|
||||
cond_start = arg;
|
||||
cond = parse_exp_1 (&arg, block_for_pc (sals.sals[i].pc), 0);
|
||||
cond_end = arg;
|
||||
tok = cond_start = end_tok + 1;
|
||||
cond = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
|
||||
cond_end = tok;
|
||||
}
|
||||
else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
|
||||
{
|
||||
char *tmptok;
|
||||
|
||||
tok = end_tok + 1;
|
||||
tmptok = tok;
|
||||
thread = strtol (tok, &tok, 0);
|
||||
if (tok == tmptok)
|
||||
error ("Junk after thread keyword.");
|
||||
if (!valid_thread_id (thread))
|
||||
error ("Unknown thread %d\n", thread);
|
||||
}
|
||||
else
|
||||
error ("Junk at end of arguments.");
|
||||
|
@ -1942,6 +1995,7 @@ break_command_1 (arg, tempflag, from_tty)
|
|||
b->number = breakpoint_count;
|
||||
b->type = bp_breakpoint;
|
||||
b->cond = cond;
|
||||
b->thread = thread;
|
||||
|
||||
/* If a canonical line spec is needed use that instead of the
|
||||
command string. */
|
||||
|
@ -1960,8 +2014,8 @@ break_command_1 (arg, tempflag, from_tty)
|
|||
|
||||
if (sals.nelts > 1)
|
||||
{
|
||||
printf ("Multiple breakpoints were set.\n");
|
||||
printf ("Use the \"delete\" command to delete unwanted breakpoints.\n");
|
||||
printf_unfiltered ("Multiple breakpoints were set.\n");
|
||||
printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
|
||||
}
|
||||
do_cleanups (old_chain);
|
||||
}
|
||||
|
@ -2182,7 +2236,7 @@ map_catch_names (args, function)
|
|||
goto win;
|
||||
}
|
||||
#endif
|
||||
printf ("No catch clause for exception %s.\n", p);
|
||||
printf_unfiltered ("No catch clause for exception %s.\n", p);
|
||||
#if 0
|
||||
win:
|
||||
#endif
|
||||
|
@ -2388,8 +2442,8 @@ catch_command_1 (arg, tempflag, from_tty)
|
|||
|
||||
if (sals.nelts > 1)
|
||||
{
|
||||
printf ("Multiple breakpoints were set.\n");
|
||||
printf ("Use the \"delete\" command to delete unwanted breakpoints.\n");
|
||||
printf_unfiltered ("Multiple breakpoints were set.\n");
|
||||
printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
|
||||
}
|
||||
free ((PTR)sals.sals);
|
||||
}
|
||||
|
@ -2503,15 +2557,15 @@ clear_command (arg, from_tty)
|
|||
}
|
||||
|
||||
if (found->next) from_tty = 1; /* Always report if deleted more than one */
|
||||
if (from_tty) printf ("Deleted breakpoint%s ", found->next ? "s" : "");
|
||||
if (from_tty) printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
|
||||
while (found)
|
||||
{
|
||||
if (from_tty) printf ("%d ", found->number);
|
||||
if (from_tty) printf_unfiltered ("%d ", found->number);
|
||||
b1 = found->next;
|
||||
delete_breakpoint (found);
|
||||
found = b1;
|
||||
}
|
||||
if (from_tty) putchar ('\n');
|
||||
if (from_tty) putchar_unfiltered ('\n');
|
||||
}
|
||||
free ((PTR)sals.sals);
|
||||
}
|
||||
|
@ -2565,7 +2619,7 @@ delete_breakpoint (bpt)
|
|||
val = target_insert_breakpoint (b->address, b->shadow_contents);
|
||||
if (val != 0)
|
||||
{
|
||||
fprintf (stderr, "Cannot insert breakpoint %d:\n", b->number);
|
||||
fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
|
||||
memory_error (val, b->address); /* which bombs us out */
|
||||
}
|
||||
else
|
||||
|
@ -2586,7 +2640,7 @@ delete_breakpoint (bpt)
|
|||
free (bpt->source_file);
|
||||
|
||||
if (xgdb_verbose && bpt->type == bp_breakpoint)
|
||||
printf ("breakpoint #%d deleted\n", bpt->number);
|
||||
printf_unfiltered ("breakpoint #%d deleted\n", bpt->number);
|
||||
|
||||
/* Be sure no bpstat's are pointing at it after it's been freed. */
|
||||
/* FIXME, how can we find all bpstat's? We just check stop_bpstat for now. */
|
||||
|
@ -2860,7 +2914,7 @@ map_breakpoint_numbers (args, function)
|
|||
function (b);
|
||||
goto win;
|
||||
}
|
||||
printf ("No breakpoint number %d.\n", num);
|
||||
printf_unfiltered ("No breakpoint number %d.\n", num);
|
||||
win:
|
||||
p = p1;
|
||||
}
|
||||
|
@ -2876,7 +2930,7 @@ enable_breakpoint (bpt)
|
|||
bpt->enable = enabled;
|
||||
|
||||
if (xgdb_verbose && bpt->type == bp_breakpoint)
|
||||
printf ("breakpoint #%d enabled\n", bpt->number);
|
||||
printf_unfiltered ("breakpoint #%d enabled\n", bpt->number);
|
||||
|
||||
check_duplicates (bpt->address);
|
||||
if (bpt->type == bp_watchpoint)
|
||||
|
|
|
@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
static void
|
||||
emit_char (c, stream, quoter)
|
||||
register int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int quoter;
|
||||
{
|
||||
|
||||
|
@ -81,7 +81,7 @@ emit_char (c, stream, quoter)
|
|||
static void
|
||||
c_printchar (c, stream)
|
||||
int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
fputs_filtered ("'", stream);
|
||||
emit_char (c, stream, '\'');
|
||||
|
@ -95,7 +95,7 @@ c_printchar (c, stream)
|
|||
|
||||
static void
|
||||
c_printstr (stream, string, length, force_ellipses)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *string;
|
||||
unsigned int length;
|
||||
int force_ellipses;
|
||||
|
@ -116,7 +116,7 @@ c_printstr (stream, string, length, force_ellipses)
|
|||
|
||||
if (length == 0)
|
||||
{
|
||||
fputs_filtered ("\"\"", stdout);
|
||||
fputs_filtered ("\"\"", gdb_stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ extern void
|
|||
c_error PARAMS ((char *)); /* Defined in c-exp.y */
|
||||
|
||||
extern void /* Defined in c-typeprint.c */
|
||||
c_print_type PARAMS ((struct type *, char *, FILE *, int, int));
|
||||
c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
|
||||
|
||||
extern int
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *, int, int,
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
|
||||
int, enum val_prettyprint));
|
||||
|
|
|
@ -39,19 +39,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
extern int demangle; /* whether to print C++ syms raw or source-form */
|
||||
|
||||
static void
|
||||
c_type_print_args PARAMS ((struct type *, FILE *));
|
||||
c_type_print_args PARAMS ((struct type *, GDB_FILE *));
|
||||
|
||||
static void
|
||||
c_type_print_varspec_suffix PARAMS ((struct type *, FILE *, int, int, int));
|
||||
c_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *, int, int, int));
|
||||
|
||||
static void
|
||||
cp_type_print_derivation_info PARAMS ((FILE *, struct type *));
|
||||
cp_type_print_derivation_info PARAMS ((GDB_FILE *, struct type *));
|
||||
|
||||
void
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
void
|
||||
c_type_print_base PARAMS ((struct type *, FILE *, int, int));
|
||||
c_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
|
||||
/* Print a description of a type in the format of a
|
||||
|
@ -62,7 +62,7 @@ void
|
|||
c_typedef_print (type, new, stream)
|
||||
struct type *type;
|
||||
struct symbol *new;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
switch (current_language->la_language)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ void
|
|||
c_print_type (type, varstring, stream, show, level)
|
||||
struct type *type;
|
||||
char *varstring;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ cp_type_print_method_args (args, prefix, varstring, staticp, stream)
|
|||
char *prefix;
|
||||
char *varstring;
|
||||
int staticp;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -199,7 +199,7 @@ cp_type_print_method_args (args, prefix, varstring, staticp, stream)
|
|||
|
||||
static void
|
||||
cp_type_print_derivation_info (stream, type)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
struct type *type;
|
||||
{
|
||||
char *name;
|
||||
|
@ -231,7 +231,7 @@ cp_type_print_derivation_info (stream, type)
|
|||
void
|
||||
c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int passed_a_ptr;
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
|
|||
|
||||
case TYPE_CODE_METHOD:
|
||||
if (passed_a_ptr)
|
||||
fprintf (stream, "(");
|
||||
fprintf_unfiltered (stream, "(");
|
||||
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
|
||||
if (passed_a_ptr)
|
||||
{
|
||||
|
@ -316,7 +316,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
|
|||
static void
|
||||
c_type_print_args (type, stream)
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int i;
|
||||
struct type **args;
|
||||
|
@ -358,7 +358,7 @@ c_type_print_args (type, stream)
|
|||
static void
|
||||
c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int passed_a_ptr;
|
||||
int demangled_args;
|
||||
|
@ -456,7 +456,7 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
|
|||
void
|
||||
c_type_print_base (type, stream, show, level)
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
|
@ -665,7 +665,7 @@ c_type_print_base (type, stream, show, level)
|
|||
if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)
|
||||
{
|
||||
/* Keep GDB from crashing here. */
|
||||
fprintf (stream, "<undefined type> %s;\n",
|
||||
fprintf_unfiltered (stream, "<undefined type> %s;\n",
|
||||
TYPE_FN_FIELD_PHYSNAME (f, j));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -32,13 +32,13 @@ extern int vtblprint; /* Controls printing of vtbl's */
|
|||
extern int demangle; /* whether to print C++ syms raw or src-form */
|
||||
|
||||
extern void
|
||||
cp_print_class_member PARAMS ((char *, struct type *, FILE *, char *));
|
||||
cp_print_class_member PARAMS ((char *, struct type *, GDB_FILE *, char *));
|
||||
|
||||
extern void
|
||||
cp_print_class_method PARAMS ((char *, struct type *, FILE *));
|
||||
cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
|
||||
|
||||
extern void
|
||||
cp_print_value_fields PARAMS ((struct type *, char *, FILE *, int, int,
|
||||
cp_print_value_fields PARAMS ((struct type *, char *, GDB_FILE *, int, int,
|
||||
enum val_prettyprint, struct type **));
|
||||
|
||||
extern int
|
||||
|
@ -53,11 +53,11 @@ cp_is_vtbl_member PARAMS ((struct type *));
|
|||
/* BEGIN-FIXME: Hooks into c-typeprint.c */
|
||||
|
||||
extern void
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
extern void
|
||||
cp_type_print_method_args PARAMS ((struct type **, char *, char *, int,
|
||||
FILE *));
|
||||
GDB_FILE *));
|
||||
/* END-FIXME */
|
||||
|
||||
|
||||
|
@ -83,7 +83,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
|
|||
struct type *type;
|
||||
char *valaddr;
|
||||
CORE_ADDR address;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int deref_ref;
|
||||
int recurse;
|
||||
|
@ -411,6 +411,6 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
|
|||
default:
|
||||
error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type));
|
||||
}
|
||||
fflush (stream);
|
||||
gdb_flush (stream);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -1988,7 +1988,7 @@ void
|
|||
yyerror (msg)
|
||||
char *msg; /* unused */
|
||||
{
|
||||
printf ("Parsing: %s\n", lexptr);
|
||||
printf_unfiltered ("Parsing: %s\n", lexptr);
|
||||
if (yychar < 256)
|
||||
{
|
||||
error ("Invalid syntax in expression near character '%c'.", yychar);
|
||||
|
|
|
@ -52,7 +52,7 @@ chill_demangle (mangled)
|
|||
static void
|
||||
chill_printchar (c, stream)
|
||||
register int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
c &= 0xFF; /* Avoid sign bit follies */
|
||||
|
||||
|
@ -79,7 +79,7 @@ chill_printchar (c, stream)
|
|||
|
||||
static void
|
||||
chill_printstr (stream, string, length, force_ellipses)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *string;
|
||||
unsigned int length;
|
||||
int force_ellipses;
|
||||
|
|
|
@ -24,8 +24,8 @@ extern void
|
|||
chill_error PARAMS ((char *)); /* Defined in ch-exp.y */
|
||||
|
||||
extern void /* Defined in ch-typeprint.c */
|
||||
chill_print_type PARAMS ((struct type *, char *, FILE *, int, int));
|
||||
chill_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
|
||||
|
||||
extern int
|
||||
chill_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *, int, int,
|
||||
chill_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
|
||||
int, enum val_prettyprint));
|
||||
|
|
|
@ -37,13 +37,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
#include <errno.h>
|
||||
|
||||
static void
|
||||
chill_type_print_base PARAMS ((struct type *, FILE *, int, int));
|
||||
chill_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
void
|
||||
chill_print_type (type, varstring, stream, show, level)
|
||||
struct type *type;
|
||||
char *varstring;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ chill_print_type (type, varstring, stream, show, level)
|
|||
static void
|
||||
chill_type_print_base (type, stream, show, level)
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
#include "c-lang.h" /* For c_val_print */
|
||||
|
||||
static void
|
||||
chill_print_value_fields PARAMS ((struct type *, char *, FILE *, int, int,
|
||||
chill_print_value_fields PARAMS ((struct type *, char *, GDB_FILE *, int, int,
|
||||
enum val_prettyprint, struct type **));
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
|
|||
struct type *type;
|
||||
char *valaddr;
|
||||
CORE_ADDR address;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int deref_ref;
|
||||
int recurse;
|
||||
|
@ -246,7 +246,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
|
|||
c_val_print (type, valaddr, address, stream, format,
|
||||
deref_ref, recurse, pretty);
|
||||
}
|
||||
fflush (stream);
|
||||
gdb_flush (stream);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
|
|||
dont_print)
|
||||
struct type *type;
|
||||
char *valaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int recurse;
|
||||
enum val_prettyprint pretty;
|
||||
|
|
|
@ -31,7 +31,7 @@ static void
|
|||
show_user PARAMS ((char *, int));
|
||||
|
||||
static void
|
||||
show_user_1 PARAMS ((struct cmd_list_element *, FILE *));
|
||||
show_user_1 PARAMS ((struct cmd_list_element *, GDB_FILE *));
|
||||
|
||||
static void
|
||||
make_command PARAMS ((char *, int));
|
||||
|
@ -43,7 +43,7 @@ static int
|
|||
parse_binary_operation PARAMS ((char *));
|
||||
|
||||
static void
|
||||
print_doc_line PARAMS ((FILE *, char *));
|
||||
print_doc_line PARAMS ((GDB_FILE *, char *));
|
||||
|
||||
/* Add element named NAME.
|
||||
CLASS is the top level category into which commands are broken down
|
||||
|
@ -247,7 +247,7 @@ add_show_from_set (setcmd, list)
|
|||
&& setcmd->doc[2] == 't' && setcmd->doc[3] == ' ')
|
||||
showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL);
|
||||
else
|
||||
fprintf (stderr, "GDB internal error: Bad docstring for set command\n");
|
||||
fprintf_unfiltered (gdb_stderr, "GDB internal error: Bad docstring for set command\n");
|
||||
|
||||
showcmd->next = *list;
|
||||
*list = showcmd;
|
||||
|
@ -303,7 +303,7 @@ delete_cmd (name, list)
|
|||
void
|
||||
help_cmd (command, stream)
|
||||
char *command;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
struct cmd_list_element *c;
|
||||
extern struct cmd_list_element *cmdlist;
|
||||
|
@ -368,7 +368,7 @@ help_list (list, cmdtype, class, stream)
|
|||
struct cmd_list_element *list;
|
||||
char *cmdtype;
|
||||
enum command_class class;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int len;
|
||||
char *cmdtype1, *cmdtype2;
|
||||
|
@ -409,7 +409,7 @@ Command name abbreviations are allowed if unambiguous.\n",
|
|||
/* Print only the first line of STR on STREAM. */
|
||||
static void
|
||||
print_doc_line (stream, str)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *str;
|
||||
{
|
||||
static char *line_buffer = 0;
|
||||
|
@ -460,7 +460,7 @@ help_cmd_list (list, class, prefix, recurse, stream)
|
|||
enum command_class class;
|
||||
char *prefix;
|
||||
int recurse;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
register struct cmd_list_element *c;
|
||||
|
||||
|
@ -1111,52 +1111,52 @@ do_setshow_command (arg, from_tty, c)
|
|||
else if (c->type == show_cmd)
|
||||
{
|
||||
/* Print doc minus "show" at start. */
|
||||
print_doc_line (stdout, c->doc + 5);
|
||||
print_doc_line (gdb_stdout, c->doc + 5);
|
||||
|
||||
fputs_filtered (" is ", stdout);
|
||||
fputs_filtered (" is ", gdb_stdout);
|
||||
wrap_here (" ");
|
||||
switch (c->var_type)
|
||||
{
|
||||
case var_string:
|
||||
{
|
||||
unsigned char *p;
|
||||
fputs_filtered ("\"", stdout);
|
||||
fputs_filtered ("\"", gdb_stdout);
|
||||
for (p = *(unsigned char **) c->var; *p != '\0'; p++)
|
||||
gdb_printchar (*p, stdout, '"');
|
||||
fputs_filtered ("\"", stdout);
|
||||
gdb_printchar (*p, gdb_stdout, '"');
|
||||
fputs_filtered ("\"", gdb_stdout);
|
||||
}
|
||||
break;
|
||||
case var_string_noescape:
|
||||
case var_filename:
|
||||
fputs_filtered ("\"", stdout);
|
||||
fputs_filtered (*(char **) c->var, stdout);
|
||||
fputs_filtered ("\"", stdout);
|
||||
fputs_filtered ("\"", gdb_stdout);
|
||||
fputs_filtered (*(char **) c->var, gdb_stdout);
|
||||
fputs_filtered ("\"", gdb_stdout);
|
||||
break;
|
||||
case var_boolean:
|
||||
fputs_filtered (*(int *) c->var ? "on" : "off", stdout);
|
||||
fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
|
||||
break;
|
||||
case var_uinteger:
|
||||
if (*(unsigned int *) c->var == UINT_MAX) {
|
||||
fputs_filtered ("unlimited", stdout);
|
||||
fputs_filtered ("unlimited", gdb_stdout);
|
||||
break;
|
||||
}
|
||||
/* else fall through */
|
||||
case var_zinteger:
|
||||
fprintf_filtered (stdout, "%u", *(unsigned int *) c->var);
|
||||
fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
|
||||
break;
|
||||
case var_integer:
|
||||
if (*(int *) c->var == INT_MAX)
|
||||
{
|
||||
fputs_filtered ("unlimited", stdout);
|
||||
fputs_filtered ("unlimited", gdb_stdout);
|
||||
}
|
||||
else
|
||||
fprintf_filtered (stdout, "%d", *(int *) c->var);
|
||||
fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
|
||||
break;
|
||||
|
||||
default:
|
||||
error ("gdb internal error: bad var_type in do_setshow_command");
|
||||
}
|
||||
fputs_filtered (".\n", stdout);
|
||||
fputs_filtered (".\n", gdb_stdout);
|
||||
}
|
||||
else
|
||||
error ("gdb internal error: bad cmd_type in do_setshow_command");
|
||||
|
@ -1178,9 +1178,9 @@ cmd_show_list (list, from_tty, prefix)
|
|||
cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
|
||||
if (list->type == show_cmd)
|
||||
{
|
||||
fputs_filtered (prefix, stdout);
|
||||
fputs_filtered (list->name, stdout);
|
||||
fputs_filtered (": ", stdout);
|
||||
fputs_filtered (prefix, gdb_stdout);
|
||||
fputs_filtered (list->name, gdb_stdout);
|
||||
fputs_filtered (": ", gdb_stdout);
|
||||
do_setshow_command ((char *)NULL, from_tty, list);
|
||||
}
|
||||
}
|
||||
|
@ -1216,7 +1216,7 @@ shell_escape (arg, from_tty)
|
|||
else
|
||||
execl (user_shell, p, "-c", arg, 0);
|
||||
|
||||
fprintf (stderr, "Exec of shell failed\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Exec of shell failed\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
@ -1250,7 +1250,7 @@ make_command (arg, from_tty)
|
|||
static void
|
||||
show_user_1 (c, stream)
|
||||
struct cmd_list_element *c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
register struct command_line *cmdlines;
|
||||
|
||||
|
@ -1283,14 +1283,14 @@ show_user (args, from_tty)
|
|||
c = lookup_cmd (&args, cmdlist, "", 0, 1);
|
||||
if (c->class != class_user)
|
||||
error ("Not a user command.");
|
||||
show_user_1 (c, stdout);
|
||||
show_user_1 (c, gdb_stdout);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (c = cmdlist; c; c = c->next)
|
||||
{
|
||||
if (c->class == class_user)
|
||||
show_user_1 (c, stdout);
|
||||
show_user_1 (c, gdb_stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ complain (va_alist)
|
|||
/* If GDB dumps core, we'd like to see the complaints first. Presumably
|
||||
GDB will not be sending so many complaints that this becomes a
|
||||
performance hog. */
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ get_core_registers (regno)
|
|||
else
|
||||
{
|
||||
cant:
|
||||
fprintf_filtered (stderr, "Couldn't fetch registers from core file: %s\n",
|
||||
fprintf_filtered (gdb_stderr, "Couldn't fetch registers from core file: %s\n",
|
||||
bfd_errmsg (bfd_error));
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ cant:
|
|||
}
|
||||
else
|
||||
{
|
||||
fprintf_filtered (stderr, "Couldn't fetch register set 2 from core file: %s\n",
|
||||
fprintf_filtered (gdb_stderr, "Couldn't fetch register set 2 from core file: %s\n",
|
||||
bfd_errmsg (bfd_error));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,20 +33,20 @@ int objectprint; /* Controls looking up an object's derived type
|
|||
struct obstack dont_print_obstack;
|
||||
|
||||
static void
|
||||
cplus_print_value PARAMS ((struct type *, char *, FILE *, int, int,
|
||||
cplus_print_value PARAMS ((struct type *, char *, GDB_FILE *, int, int,
|
||||
enum val_prettyprint, struct type **));
|
||||
|
||||
/* BEGIN-FIXME: Hooks into typeprint.c, find a better home for prototypes. */
|
||||
|
||||
extern void
|
||||
c_type_print_base PARAMS ((struct type *, FILE *, int, int));
|
||||
c_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
extern void
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, FILE *, int, int));
|
||||
c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
|
||||
|
||||
extern void
|
||||
cp_type_print_method_args PARAMS ((struct type **, char *, char *, int,
|
||||
FILE *));
|
||||
GDB_FILE *));
|
||||
|
||||
extern struct obstack dont_print_obstack;
|
||||
|
||||
|
@ -56,7 +56,7 @@ extern struct obstack dont_print_obstack;
|
|||
/* BEGIN-FIXME: Hooks into c-valprint.c */
|
||||
|
||||
extern int
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *, int, int, int,
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int, int,
|
||||
enum val_prettyprint));
|
||||
/* END-FIXME */
|
||||
|
||||
|
@ -65,7 +65,7 @@ void
|
|||
cp_print_class_method (valaddr, type, stream)
|
||||
char *valaddr;
|
||||
struct type *type;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
struct type *domain;
|
||||
struct fn_field *f = NULL;
|
||||
|
@ -136,7 +136,7 @@ cp_print_class_method (valaddr, type, stream)
|
|||
{
|
||||
fprintf_filtered (stream, "&");
|
||||
c_type_print_varspec_prefix (TYPE_FN_FIELD_TYPE (f, j), stream, 0, 0);
|
||||
fprintf (stream, kind);
|
||||
fprintf_unfiltered (stream, kind);
|
||||
if (TYPE_FN_FIELD_PHYSNAME (f, j)[0] == '_'
|
||||
&& TYPE_FN_FIELD_PHYSNAME (f, j)[1] == CPLUS_MARKER)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ cp_print_value_fields (type, valaddr, stream, format, recurse, pretty,
|
|||
dont_print)
|
||||
struct type *type;
|
||||
char *valaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int recurse;
|
||||
enum val_prettyprint pretty;
|
||||
|
@ -325,7 +325,7 @@ static void
|
|||
cplus_print_value (type, valaddr, stream, format, recurse, pretty, dont_print)
|
||||
struct type *type;
|
||||
char *valaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int recurse;
|
||||
enum val_prettyprint pretty;
|
||||
|
@ -411,7 +411,7 @@ void
|
|||
cp_print_class_member (valaddr, domain, stream, prefix)
|
||||
char *valaddr;
|
||||
struct type *domain;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *prefix;
|
||||
{
|
||||
|
||||
|
|
|
@ -1254,7 +1254,7 @@ dbx_psymtab_to_symtab_1 (pst)
|
|||
|
||||
if (pst->readin)
|
||||
{
|
||||
fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
|
||||
pst->filename);
|
||||
return;
|
||||
}
|
||||
|
@ -1266,13 +1266,13 @@ dbx_psymtab_to_symtab_1 (pst)
|
|||
/* Inform about additional files that need to be read in. */
|
||||
if (info_verbose)
|
||||
{
|
||||
fputs_filtered (" ", stdout);
|
||||
fputs_filtered (" ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
fputs_filtered ("and ", stdout);
|
||||
fputs_filtered ("and ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
printf_filtered ("%s...", pst->dependencies[i]->filename);
|
||||
wrap_here (""); /* Flush output */
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
dbx_psymtab_to_symtab_1 (pst->dependencies[i]);
|
||||
}
|
||||
|
@ -1311,7 +1311,7 @@ dbx_psymtab_to_symtab (pst)
|
|||
|
||||
if (pst->readin)
|
||||
{
|
||||
fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
|
||||
pst->filename);
|
||||
return;
|
||||
}
|
||||
|
@ -1323,7 +1323,7 @@ dbx_psymtab_to_symtab (pst)
|
|||
if (info_verbose)
|
||||
{
|
||||
printf_filtered ("Reading in symbols for %s...", pst->filename);
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
sym_bfd = pst->objfile->obfd;
|
||||
|
|
|
@ -52,7 +52,7 @@ register_addr (regno, blockend)
|
|||
return offsetof (struct user, u_fpu.regs.iaddr);
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "\
|
||||
fprintf_unfiltered (gdb_stderr, "\
|
||||
Internal error: invalid register number %d in REGISTER_U_ADDR\n",
|
||||
regno);
|
||||
return blockend;
|
||||
|
|
|
@ -127,13 +127,13 @@ set_demangling_command (ignore, from_tty)
|
|||
{
|
||||
if (*current_demangling_style_string != '\0')
|
||||
{
|
||||
printf ("Unknown demangling style `%s'.\n",
|
||||
printf_unfiltered ("Unknown demangling style `%s'.\n",
|
||||
current_demangling_style_string);
|
||||
}
|
||||
printf ("The currently understood settings are:\n\n");
|
||||
printf_unfiltered ("The currently understood settings are:\n\n");
|
||||
for (dem = demanglers; dem -> demangling_style_name != NULL; dem++)
|
||||
{
|
||||
printf ("%-10s %s\n", dem -> demangling_style_name,
|
||||
printf_unfiltered ("%-10s %s\n", dem -> demangling_style_name,
|
||||
dem -> demangling_style_doc);
|
||||
if (dem -> demangling_style == current_demangling_style)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,8 @@ Wed Oct 27 00:25:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
|
|||
|
||||
Mon Oct 25 03:25:41 1993 Tom Lord (lord@cygnus.com)
|
||||
|
||||
* libgdb.texinfo (I/O): incorporated better phrasing from rich.
|
||||
|
||||
* libgdb.texinfo (Defining Commands): made the DOC arg
|
||||
to gdb_define_app_command a char * instead of char **
|
||||
per a suggestion from kingdon.
|
||||
|
|
|
@ -436,7 +436,7 @@ place. The default vectors are called @code{default-input-vector},
|
|||
@code{default-output-vector}, &c.
|
||||
|
||||
The default query function always returns `y'. Other input functions
|
||||
always abort. The default output functions do nothing.
|
||||
always abort. The default output functions discard output silently.
|
||||
|
||||
|
||||
@node Invoking, Defining Commands, I/O, Top
|
||||
|
|
|
@ -330,7 +330,7 @@ dst_symfile_read (objfile, section_offsets, mainline)
|
|||
symfile_bfd = abfd; /* Kludge for swap routines */
|
||||
|
||||
/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
|
||||
desc = fileno ((FILE *)(abfd->iostream)); /* File descriptor */
|
||||
desc = fileno ((GDB_FILE *)(abfd->iostream)); /* File descriptor */
|
||||
|
||||
/* Read the line number table, all at once. */
|
||||
bfd_map_over_sections (abfd, find_dst_sections, (PTR)NULL);
|
||||
|
@ -707,10 +707,10 @@ get_dst_entry(buffer, ret_entry)
|
|||
}
|
||||
if (size == -1)
|
||||
{
|
||||
fprintf(stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n",
|
||||
fprintf_unfiltered(gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n",
|
||||
(int) entry->rec_type,
|
||||
last_type);
|
||||
fprintf(stderr, "Last unknown_3 value: %d\n", lu3);
|
||||
fprintf_unfiltered(gdb_stderr, "Last unknown_3 value: %d\n", lu3);
|
||||
size = 0;
|
||||
}
|
||||
else
|
||||
|
@ -1115,7 +1115,7 @@ decode_dst_locstring(locstr, sym)
|
|||
{
|
||||
if (count++ == 100)
|
||||
{
|
||||
fprintf(stderr, "Error reading locstring\n");
|
||||
fprintf_unfiltered(gdb_stderr, "Error reading locstring\n");
|
||||
break;
|
||||
}
|
||||
entry = (dst_loc_entry_t *) locstr;
|
||||
|
|
|
@ -2364,14 +2364,14 @@ psymtab_to_symtab_1 (pst)
|
|||
/* Inform about additional files that need to be read in. */
|
||||
if (info_verbose)
|
||||
{
|
||||
fputs_filtered (" ", stdout);
|
||||
fputs_filtered (" ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
fputs_filtered ("and ", stdout);
|
||||
fputs_filtered ("and ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
printf_filtered ("%s...",
|
||||
pst -> dependencies[i] -> filename);
|
||||
wrap_here ("");
|
||||
fflush (stdout); /* Flush output */
|
||||
gdb_flush (gdb_stdout); /* Flush output */
|
||||
}
|
||||
psymtab_to_symtab_1 (pst -> dependencies[i]);
|
||||
}
|
||||
|
@ -2385,7 +2385,7 @@ psymtab_to_symtab_1 (pst)
|
|||
{
|
||||
printf_filtered ("%d DIE's, sorting...", diecount);
|
||||
wrap_here ("");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
sort_symtab_syms (pst -> symtab);
|
||||
do_cleanups (old_chain);
|
||||
|
@ -2435,7 +2435,7 @@ dwarf_psymtab_to_symtab (pst)
|
|||
{
|
||||
printf_filtered ("Reading in symbols for %s...",
|
||||
pst -> filename);
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
psymtab_to_symtab_1 (pst);
|
||||
|
@ -2453,7 +2453,7 @@ dwarf_psymtab_to_symtab (pst)
|
|||
if (info_verbose)
|
||||
{
|
||||
printf_filtered ("done.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1619,7 +1619,7 @@
|
|||
{
|
||||
val_print (elttype, valaddr + i * eltlen,
|
||||
***************
|
||||
*** 841,846 ****
|
||||
Sun Oct 24 23:48:55 1993*** 841,846 ****
|
||||
--- 856,862 ----
|
||||
recurse + 1, pretty);
|
||||
things_printed++;
|
||||
|
|
|
@ -693,7 +693,7 @@ execute_command_1(va_alist)
|
|||
}
|
||||
|
||||
#ifdef KERNEL_RECORD
|
||||
FILE *kerout;
|
||||
GDB_FILE *kerout;
|
||||
|
||||
static int
|
||||
kernel_record(fd, ptr, num)
|
||||
|
|
|
@ -170,8 +170,8 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun)
|
|||
output prior to doing a fork, to avoid the possibility of both the
|
||||
parent and child flushing the same data after the fork. */
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
gdb_flush (gdb_stderr);
|
||||
|
||||
#if defined(USG) && !defined(HAVE_VFORK)
|
||||
pid = fork ();
|
||||
|
@ -228,9 +228,9 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun)
|
|||
environ = env;
|
||||
execlp (shell_file, shell_file, "-c", shell_command, (char *)0);
|
||||
|
||||
fprintf (stderr, "Cannot exec %s: %s.\n", shell_file,
|
||||
fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,
|
||||
safe_strerror (errno));
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stderr);
|
||||
_exit (0177);
|
||||
}
|
||||
|
||||
|
|
|
@ -693,9 +693,9 @@ lookup_struct_elt_type (type, name, noerr)
|
|||
TYPE_CODE (type) != TYPE_CODE_UNION)
|
||||
{
|
||||
target_terminal_ours ();
|
||||
fflush (stdout);
|
||||
fprintf (stderr, "Type ");
|
||||
type_print (type, "", stderr, -1);
|
||||
gdb_flush (gdb_stdout);
|
||||
fprintf_unfiltered (gdb_stderr, "Type ");
|
||||
type_print (type, "", gdb_stderr, -1);
|
||||
error (" is not a structure or union type.");
|
||||
}
|
||||
|
||||
|
@ -743,11 +743,11 @@ lookup_struct_elt_type (type, name, noerr)
|
|||
}
|
||||
|
||||
target_terminal_ours ();
|
||||
fflush (stdout);
|
||||
fprintf (stderr, "Type ");
|
||||
type_print (type, "", stderr, -1);
|
||||
fprintf (stderr, " has no component named ");
|
||||
fputs_filtered (name, stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
fprintf_unfiltered (gdb_stderr, "Type ");
|
||||
type_print (type, "", gdb_stderr, -1);
|
||||
fprintf_unfiltered (gdb_stderr, " has no component named ");
|
||||
fputs_filtered (name, gdb_stderr);
|
||||
error (".");
|
||||
return (struct type *)-1; /* For lint */
|
||||
}
|
||||
|
|
|
@ -695,7 +695,7 @@ extern void recursive_dump_type PARAMS ((struct type *, int));
|
|||
/* printcmd.c */
|
||||
|
||||
extern void
|
||||
print_scalar_formatted PARAMS ((char *, struct type *, int, int, FILE *));
|
||||
print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
|
||||
|
||||
#if MAINTENANCE_CMDS
|
||||
extern void maintenance_print_type PARAMS ((char *, int));
|
||||
|
|
|
@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
|
||||
static void uerror(char *s)
|
||||
{
|
||||
fprintf(stderr, "Fatal: %s!\n");
|
||||
fprintf_unfiltered(gdb_stderr, "Fatal: %s!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ h8300_skip_prologue (start_pc)
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
GDB_INIT_DISASSEMBLE_INFO(info, stream);
|
||||
|
@ -415,8 +415,8 @@ set_machine (args, from_tty)
|
|||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"set machine\" must be followed by h8300 or h8300h.\n");
|
||||
help_list (setmemorylist, "set memory ", -1, stdout);
|
||||
printf_unfiltered ("\"set machine\" must be followed by h8300 or h8300h.\n");
|
||||
help_list (setmemorylist, "set memory ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -448,37 +448,37 @@ print_register_hook (regno)
|
|||
|
||||
read_relative_register_raw_bytes (regno, b);
|
||||
l = b[1];
|
||||
printf ("\t");
|
||||
printf ("I-%d - ", (l & 0x80) != 0);
|
||||
printf ("H-%d - ", (l & 0x20) != 0);
|
||||
printf_unfiltered ("\t");
|
||||
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
|
||||
printf_unfiltered ("H-%d - ", (l & 0x20) != 0);
|
||||
N = (l & 0x8) != 0;
|
||||
Z = (l & 0x4) != 0;
|
||||
V = (l & 0x2) != 0;
|
||||
C = (l & 0x1) != 0;
|
||||
printf ("N-%d ", N);
|
||||
printf ("Z-%d ", Z);
|
||||
printf ("V-%d ", V);
|
||||
printf ("C-%d ", C);
|
||||
printf_unfiltered ("N-%d ", N);
|
||||
printf_unfiltered ("Z-%d ", Z);
|
||||
printf_unfiltered ("V-%d ", V);
|
||||
printf_unfiltered ("C-%d ", C);
|
||||
if ((C | Z) == 0)
|
||||
printf ("u> ");
|
||||
printf_unfiltered ("u> ");
|
||||
if ((C | Z) == 1)
|
||||
printf ("u<= ");
|
||||
printf_unfiltered ("u<= ");
|
||||
if ((C == 0))
|
||||
printf ("u>= ");
|
||||
printf_unfiltered ("u>= ");
|
||||
if (C == 1)
|
||||
printf ("u< ");
|
||||
printf_unfiltered ("u< ");
|
||||
if (Z == 0)
|
||||
printf ("!= ");
|
||||
printf_unfiltered ("!= ");
|
||||
if (Z == 1)
|
||||
printf ("== ");
|
||||
printf_unfiltered ("== ");
|
||||
if ((N ^ V) == 0)
|
||||
printf (">= ");
|
||||
printf_unfiltered (">= ");
|
||||
if ((N ^ V) == 1)
|
||||
printf ("< ");
|
||||
printf_unfiltered ("< ");
|
||||
if ((Z | (N ^ V)) == 0)
|
||||
printf ("> ");
|
||||
printf_unfiltered ("> ");
|
||||
if ((Z | (N ^ V)) == 1)
|
||||
printf ("<= ");
|
||||
printf_unfiltered ("<= ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ h8500_skip_prologue (start_pc)
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
GDB_INIT_DISASSEMBLE_INFO (info, stream);
|
||||
|
@ -397,36 +397,36 @@ print_register_hook (regno)
|
|||
|
||||
read_relative_register_raw_bytes (regno, b);
|
||||
l = b[1];
|
||||
printf ("\t");
|
||||
printf ("I-%d - ", (l & 0x80) != 0);
|
||||
printf_unfiltered ("\t");
|
||||
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
|
||||
N = (l & 0x8) != 0;
|
||||
Z = (l & 0x4) != 0;
|
||||
V = (l & 0x2) != 0;
|
||||
C = (l & 0x1) != 0;
|
||||
printf ("N-%d ", N);
|
||||
printf ("Z-%d ", Z);
|
||||
printf ("V-%d ", V);
|
||||
printf ("C-%d ", C);
|
||||
printf_unfiltered ("N-%d ", N);
|
||||
printf_unfiltered ("Z-%d ", Z);
|
||||
printf_unfiltered ("V-%d ", V);
|
||||
printf_unfiltered ("C-%d ", C);
|
||||
if ((C | Z) == 0)
|
||||
printf ("u> ");
|
||||
printf_unfiltered ("u> ");
|
||||
if ((C | Z) == 1)
|
||||
printf ("u<= ");
|
||||
printf_unfiltered ("u<= ");
|
||||
if ((C == 0))
|
||||
printf ("u>= ");
|
||||
printf_unfiltered ("u>= ");
|
||||
if (C == 1)
|
||||
printf ("u< ");
|
||||
printf_unfiltered ("u< ");
|
||||
if (Z == 0)
|
||||
printf ("!= ");
|
||||
printf_unfiltered ("!= ");
|
||||
if (Z == 1)
|
||||
printf ("== ");
|
||||
printf_unfiltered ("== ");
|
||||
if ((N ^ V) == 0)
|
||||
printf (">= ");
|
||||
printf_unfiltered (">= ");
|
||||
if ((N ^ V) == 1)
|
||||
printf ("< ");
|
||||
printf_unfiltered ("< ");
|
||||
if ((Z | (N ^ V)) == 0)
|
||||
printf ("> ");
|
||||
printf_unfiltered ("> ");
|
||||
if ((Z | (N ^ V)) == 1)
|
||||
printf ("<= ");
|
||||
printf_unfiltered ("<= ");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ h8500_set_pointer_size (newsize)
|
|||
|
||||
if (oldsize != newsize)
|
||||
{
|
||||
printf ("pointer size set to %d bits\n", newsize);
|
||||
printf_unfiltered ("pointer size set to %d bits\n", newsize);
|
||||
oldsize = newsize;
|
||||
if (newsize == 32)
|
||||
{
|
||||
|
@ -639,8 +639,8 @@ set_memory (args, from_tty)
|
|||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"set memory\" must be followed by the name of a memory subcommand.\n");
|
||||
help_list (setmemorylist, "set memory ", -1, stdout);
|
||||
printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n");
|
||||
help_list (setmemorylist, "set memory ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
/* See if variable name is ppc or pr[0-7] */
|
||||
|
|
|
@ -28,7 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -880,9 +880,9 @@ restore_pc_queue (fsr)
|
|||
{
|
||||
stop_signal = WTERMSIG (w);
|
||||
terminal_ours_for_output ();
|
||||
printf ("\nProgram terminated with signal %d, %s\n",
|
||||
printf_unfiltered ("\nProgram terminated with signal %d, %s\n",
|
||||
stop_signal, safe_strsignal (stop_signal));
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1061,7 +1061,7 @@ pa_do_registers_info (regnum, fpregs)
|
|||
if (regnum == -1)
|
||||
pa_print_registers (raw_regs, regnum, fpregs);
|
||||
else if (regnum < FP0_REGNUM)
|
||||
printf ("%s %x\n", reg_names[regnum], *(long *)(raw_regs +
|
||||
printf_unfiltered ("%s %x\n", reg_names[regnum], *(long *)(raw_regs +
|
||||
REGISTER_BYTE (regnum)));
|
||||
else
|
||||
pa_print_fp_reg (regnum);
|
||||
|
@ -1075,7 +1075,7 @@ pa_print_registers (raw_regs, regnum, fpregs)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 18; i++)
|
||||
printf ("%8.8s: %8x %8.8s: %8x %8.8s: %8x %8.8s: %8x\n",
|
||||
printf_unfiltered ("%8.8s: %8x %8.8s: %8x %8.8s: %8x %8.8s: %8x\n",
|
||||
reg_names[i],
|
||||
*(int *)(raw_regs + REGISTER_BYTE (i)),
|
||||
reg_names[i + 18],
|
||||
|
@ -1101,10 +1101,10 @@ pa_print_fp_reg (i)
|
|||
read_relative_register_raw_bytes (i, raw_buffer);
|
||||
REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
|
||||
|
||||
fputs_filtered (reg_names[i], stdout);
|
||||
print_spaces_filtered (15 - strlen (reg_names[i]), stdout);
|
||||
fputs_filtered (reg_names[i], gdb_stdout);
|
||||
print_spaces_filtered (15 - strlen (reg_names[i]), gdb_stdout);
|
||||
|
||||
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0,
|
||||
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, gdb_stdout, 0,
|
||||
1, 0, Val_pretty_default);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
|
@ -1211,11 +1211,11 @@ unwind_command (exp, from_tty)
|
|||
|
||||
if (!xxx.u)
|
||||
{
|
||||
printf ("Can't find unwind table entry for PC 0x%x\n", address);
|
||||
printf_unfiltered ("Can't find unwind table entry for PC 0x%x\n", address);
|
||||
return;
|
||||
}
|
||||
|
||||
printf ("%08x\n%08X\n%08X\n%08X\n", xxx.foo[0], xxx.foo[1], xxx.foo[2],
|
||||
printf_unfiltered ("%08x\n%08X\n%08X\n%08X\n", xxx.foo[0], xxx.foo[1], xxx.foo[2],
|
||||
xxx.foo[3]);
|
||||
}
|
||||
#endif /* MAINTENANCE_CMDS */
|
||||
|
|
|
@ -321,7 +321,7 @@ getpacket (buffer)
|
|||
xmitcsum += hex(ch);
|
||||
if ((remote_debug ) && (checksum != xmitcsum))
|
||||
{
|
||||
fprintf(stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
fprintf_unfiltered(gdb_stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
checksum,xmitcsum,buffer);
|
||||
}
|
||||
|
||||
|
@ -413,8 +413,8 @@ debug_error (format, parm)
|
|||
{
|
||||
if (remote_debug)
|
||||
{
|
||||
fprintf (stderr, format, parm);
|
||||
fprintf (stderr, "\n");
|
||||
fprintf_unfiltered (gdb_stderr, format, parm);
|
||||
fprintf_unfiltered (gdb_stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -834,11 +834,11 @@ main (argc, argv)
|
|||
/* Create a screen for the debugger. */
|
||||
console_screen = CreateScreen ("System Console", 0);
|
||||
if (DisplayScreen (console_screen) != ESUCCESS)
|
||||
fprintf (stderr, "DisplayScreen failed\n");
|
||||
fprintf_unfiltered (gdb_stderr, "DisplayScreen failed\n");
|
||||
|
||||
if (argc < 4)
|
||||
{
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"Usage: load gdbserver board port program [arguments]\n");
|
||||
exit (1);
|
||||
}
|
||||
|
@ -853,16 +853,16 @@ main (argc, argv)
|
|||
switch (err)
|
||||
{
|
||||
case AIO_PORT_NOT_AVAILABLE:
|
||||
fprintf (stderr, "Port not available\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Port not available\n");
|
||||
break;
|
||||
|
||||
case AIO_BOARD_NUMBER_INVALID:
|
||||
case AIO_PORT_NUMBER_INVALID:
|
||||
fprintf (stderr, "No such port\n");
|
||||
fprintf_unfiltered (gdb_stderr, "No such port\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (stderr, "Could not open port: %d\n", err);
|
||||
fprintf_unfiltered (gdb_stderr, "Could not open port: %d\n", err);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -874,7 +874,7 @@ main (argc, argv)
|
|||
AIO_HARDWARE_FLOW_CONTROL_OFF);
|
||||
if (err != AIO_SUCCESS)
|
||||
{
|
||||
fprintf (stderr, "Could not configure port: %d\n", err);
|
||||
fprintf_unfiltered (gdb_stderr, "Could not configure port: %d\n", err);
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ main (argc, argv)
|
|||
DebuggerSignature));
|
||||
if (s.DDSResourceTag == 0)
|
||||
{
|
||||
fprintf (stderr, "AllocateResourceTag failed\n");
|
||||
fprintf_unfiltered (gdb_stderr, "AllocateResourceTag failed\n");
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ main (argc, argv)
|
|||
err = RegisterDebuggerRTag (&s, AT_FIRST);
|
||||
if (err != 0)
|
||||
{
|
||||
fprintf (stderr, "RegisterDebuggerRTag failed\n");
|
||||
fprintf_unfiltered (gdb_stderr, "RegisterDebuggerRTag failed\n");
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -917,7 +917,7 @@ main (argc, argv)
|
|||
"$?#xx") sitting there. */
|
||||
if (! putDebugChar ('+'))
|
||||
{
|
||||
fprintf (stderr, "putDebugChar failed\n");
|
||||
fprintf_unfiltered (gdb_stderr, "putDebugChar failed\n");
|
||||
UnRegisterDebugger (&s);
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (1);
|
||||
|
@ -936,7 +936,7 @@ main (argc, argv)
|
|||
cmdlin, LO_DEBUG);
|
||||
if (err != 0)
|
||||
{
|
||||
fprintf (stderr, "LoadModule failed: %d\n", err);
|
||||
fprintf_unfiltered (gdb_stderr, "LoadModule failed: %d\n", err);
|
||||
UnRegisterDebugger (&s);
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (1);
|
||||
|
@ -952,7 +952,7 @@ main (argc, argv)
|
|||
/* If we are woken up, print an optional error message, deregister
|
||||
ourselves and exit. */
|
||||
if (error_message != NULL)
|
||||
fprintf (stderr, "%s\n", error_message);
|
||||
fprintf_unfiltered (gdb_stderr, "%s\n", error_message);
|
||||
UnRegisterDebugger (&s);
|
||||
AIOReleasePort (AIOhandle);
|
||||
exit (0);
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -127,46 +127,46 @@ print_387_status (status, ep)
|
|||
if (status != 0)
|
||||
{
|
||||
if (bothstatus)
|
||||
printf ("u: ");
|
||||
printf_unfiltered ("u: ");
|
||||
print_387_status_word (status);
|
||||
}
|
||||
|
||||
if (ep->status != 0)
|
||||
{
|
||||
if (bothstatus)
|
||||
printf ("e: ");
|
||||
printf_unfiltered ("e: ");
|
||||
print_387_status_word (ep->status);
|
||||
}
|
||||
|
||||
print_387_control_word (ep->control);
|
||||
printf ("last exception: ");
|
||||
printf ("opcode %s; ", local_hex_string(ep->opcode));
|
||||
printf ("pc %s:", local_hex_string(ep->code_seg));
|
||||
printf ("%s; ", local_hex_string(ep->eip));
|
||||
printf ("operand %s", local_hex_string(ep->operand_seg));
|
||||
printf (":%s\n", local_hex_string(ep->operand));
|
||||
printf_unfiltered ("last exception: ");
|
||||
printf_unfiltered ("opcode %s; ", local_hex_string(ep->opcode));
|
||||
printf_unfiltered ("pc %s:", local_hex_string(ep->code_seg));
|
||||
printf_unfiltered ("%s; ", local_hex_string(ep->eip));
|
||||
printf_unfiltered ("operand %s", local_hex_string(ep->operand_seg));
|
||||
printf_unfiltered (":%s\n", local_hex_string(ep->operand));
|
||||
|
||||
top = 7- ((ep->status >> 11) & 7);
|
||||
|
||||
printf ("regno tag msb lsb value\n");
|
||||
printf_unfiltered ("regno tag msb lsb value\n");
|
||||
for (fpreg = 7; fpreg >= 0; fpreg--)
|
||||
{
|
||||
double val;
|
||||
|
||||
printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
|
||||
printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
|
||||
|
||||
switch ((ep->tag >> ((7 - fpreg) * 2)) & 3)
|
||||
{
|
||||
case 0: printf ("valid "); break;
|
||||
case 1: printf ("zero "); break;
|
||||
case 2: printf ("trap "); break;
|
||||
case 3: printf ("empty "); break;
|
||||
case 0: printf_unfiltered ("valid "); break;
|
||||
case 1: printf_unfiltered ("zero "); break;
|
||||
case 2: printf_unfiltered ("trap "); break;
|
||||
case 3: printf_unfiltered ("empty "); break;
|
||||
}
|
||||
for (i = 9; i >= 0; i--)
|
||||
printf ("%02x", ep->regs[fpreg][i]);
|
||||
printf_unfiltered ("%02x", ep->regs[fpreg][i]);
|
||||
|
||||
i387_to_double ((char *)ep->regs[fpreg], (char *)&val);
|
||||
printf (" %#g\n", val);
|
||||
printf_unfiltered (" %#g\n", val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ i386_float_info ()
|
|||
|
||||
if (fpsaved == 0)
|
||||
{
|
||||
printf ("no floating point status saved\n");
|
||||
printf_unfiltered ("no floating point status saved\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -333,6 +333,6 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
|
|||
if (core_reg_size >= sizeof (core_env387))
|
||||
memcpy (&core_env387, core_reg_sect, core_reg_size);
|
||||
else
|
||||
fprintf (stderr, "Couldn't read float regs from core file\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
|
||||
}
|
||||
}
|
||||
|
|
284
gdb/i386lynx-nat.c
Normal file
284
gdb/i386lynx-nat.c
Normal file
|
@ -0,0 +1,284 @@
|
|||
<<<<<<< 2.6 is dead >>>>>>>
|
||||
/* Native-dependent code for Lynx running on i386's, for GDB.
|
||||
Copyright 1988, 1989, 1991, 1992, 1993
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "frame.h"
|
||||
#include "inferior.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <sys/ptrace.h>
|
||||
#include "/usr/include/sys/wait.h"
|
||||
|
||||
/* these values indicate the offset of the named register in the econtext
|
||||
structure */
|
||||
|
||||
#define EAX 10
|
||||
#define ECX 9
|
||||
#define EDX 8
|
||||
#define EBX 7
|
||||
#define ESP 16
|
||||
#define EBP 5
|
||||
#define ESI 4
|
||||
#define EDI 3
|
||||
#define EIP 13
|
||||
#define EFL 15
|
||||
#define CS 14
|
||||
#define SS 17
|
||||
#define DS 2
|
||||
#define ES 1
|
||||
|
||||
/* Currently these are not being used. So set them to 0 */
|
||||
|
||||
#define FS 0
|
||||
#define GS 0
|
||||
|
||||
/* this table must line up with REGISTER_NAMES in m-i386.h */
|
||||
static unsigned int regmap[] =
|
||||
{
|
||||
EAX, ECX, EDX, EBX,
|
||||
ESP, EBP, ESI, EDI,
|
||||
EIP, EFL, CS, SS,
|
||||
DS, ES, FS, GS,
|
||||
};
|
||||
|
||||
/* Return the address in the core dump or inferior of register REGNO.
|
||||
BLOCKEND is the address of the econtext structure */
|
||||
|
||||
static unsigned int
|
||||
register_addr (regno, blockend)
|
||||
int regno, blockend;
|
||||
{
|
||||
if (regno < 0 || regno >= NUM_REGS)
|
||||
error ("Invalid register number %d.", regno);
|
||||
|
||||
return (blockend + regmap[regno] * sizeof (long));
|
||||
}
|
||||
|
||||
/* Fetch one register. */
|
||||
|
||||
static void
|
||||
fetch_register (regno, offset, bpid)
|
||||
int regno, bpid;
|
||||
unsigned int offset;
|
||||
{
|
||||
unsigned int regaddr;
|
||||
char buf[MAX_REGISTER_RAW_SIZE];
|
||||
char mess[128]; /* For messages */
|
||||
int i;
|
||||
|
||||
regaddr = register_addr (regno, offset);
|
||||
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
|
||||
{
|
||||
errno = 0;
|
||||
*(int *) &buf[i] = ptrace (PTRACE_PEEKTHREAD, bpid,
|
||||
(PTRACE_ARG3_TYPE) regaddr, 0);
|
||||
regaddr += sizeof (int);
|
||||
if (errno != 0)
|
||||
{
|
||||
sprintf (mess, "reading register %s (#%d)", reg_names[regno], regno);
|
||||
perror_with_name (mess);
|
||||
}
|
||||
}
|
||||
supply_register (regno, buf);
|
||||
}
|
||||
|
||||
/* Store our register values back into the inferior.
|
||||
If REGNO is -1, do this for all registers.
|
||||
Otherwise, REGNO specifies which register (so we can save time). */
|
||||
|
||||
static void
|
||||
store_register (regno, offset, bpid)
|
||||
int regno, bpid;
|
||||
unsigned int offset;
|
||||
{
|
||||
unsigned int regaddr;
|
||||
char mess[128];
|
||||
extern char registers[];
|
||||
int i;
|
||||
|
||||
regaddr = register_addr (regno, offset);
|
||||
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
|
||||
{
|
||||
errno = 0;
|
||||
ptrace (PTRACE_POKEUSER, bpid, (PTRACE_ARG3_TYPE) regaddr,
|
||||
*(int *) ®isters[REGISTER_BYTE (regno) + i]);
|
||||
if (errno != 0)
|
||||
{
|
||||
sprintf (mess, "writing register number %d(%d)", regno, i);
|
||||
perror_with_name (mess);
|
||||
}
|
||||
regaddr += sizeof(int);
|
||||
}
|
||||
}
|
||||
|
||||
/* return an offset for use with register_addr() */
|
||||
|
||||
static unsigned int
|
||||
fetch_offset (pid)
|
||||
int pid;
|
||||
{
|
||||
struct st_entry s;
|
||||
unsigned int specpage_off, offset = (char *) &s.ecp - (char *) &s;
|
||||
|
||||
errno = 0;
|
||||
specpage_off = ptrace (PTRACE_THREADUSER, pid, (PTRACE_ARG3_TYPE) 0, 0);
|
||||
if (errno != 0)
|
||||
perror_with_name ("ptrace");
|
||||
errno = 0;
|
||||
offset = ptrace (PTRACE_PEEKTHREAD, pid, (PTRACE_ARG3_TYPE) offset, 0)
|
||||
- specpage_off;
|
||||
if (errno != 0)
|
||||
perror_with_name ("ptrace");
|
||||
return offset;
|
||||
}
|
||||
|
||||
/* Fetch all registers, or just one, from the child process. */
|
||||
|
||||
void
|
||||
fetch_inferior_registers (regno)
|
||||
int regno;
|
||||
{
|
||||
unsigned int offset = fetch_offset (inferior_pid);
|
||||
|
||||
if (regno == -1)
|
||||
{
|
||||
for (regno = 0; regno < NUM_REGS; regno++)
|
||||
fetch_register (regno, offset, inferior_pid);
|
||||
}
|
||||
else
|
||||
fetch_register (regno, offset, inferior_pid);
|
||||
}
|
||||
|
||||
/* Store all registers, or just one, to the child process. */
|
||||
|
||||
void
|
||||
store_inferior_registers (regno)
|
||||
int regno;
|
||||
{
|
||||
unsigned int offset = fetch_offset (inferior_pid);
|
||||
|
||||
if (regno == -1)
|
||||
{
|
||||
for (regno = 0; regno < NUM_REGS; regno++)
|
||||
store_register (regno, offset, inferior_pid);
|
||||
}
|
||||
else
|
||||
store_register (regno, offset, inferior_pid);
|
||||
}
|
||||
|
||||
/* Wait for child to do something. Return pid of child, or -1 in case
|
||||
of error; store status through argument pointer STATUS. */
|
||||
|
||||
int
|
||||
child_wait (pid, status)
|
||||
int pid;
|
||||
int *status;
|
||||
{
|
||||
int save_errno;
|
||||
int thread;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int sig;
|
||||
|
||||
if (attach_flag)
|
||||
set_sigint_trap(); /* Causes SIGINT to be passed on to the
|
||||
attached process. */
|
||||
pid = wait (status);
|
||||
save_errno = errno;
|
||||
|
||||
if (attach_flag)
|
||||
clear_sigint_trap();
|
||||
|
||||
if (pid == -1)
|
||||
{
|
||||
if (save_errno == EINTR)
|
||||
continue;
|
||||
fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
|
||||
safe_strerror (save_errno));
|
||||
*status = 42; /* Claim it exited with signal 42 */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pid != PIDGET (inferior_pid)) /* Some other process?!? */
|
||||
continue;
|
||||
|
||||
/* thread = WIFTID (*status);*/
|
||||
thread = *status >> 16;
|
||||
|
||||
/* Initial thread value can only be acquired via wait, so we have to
|
||||
resort to this hack. */
|
||||
|
||||
if (TIDGET (inferior_pid) == 0)
|
||||
{
|
||||
inferior_pid = BUILDPID (inferior_pid, thread);
|
||||
add_thread (inferior_pid);
|
||||
}
|
||||
|
||||
pid = BUILDPID (pid, thread);
|
||||
|
||||
return pid;
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert a Lynx process ID to a string. Returns the string in a static
|
||||
buffer. */
|
||||
|
||||
char *
|
||||
i386lynx_pid_to_str (pid)
|
||||
int pid;
|
||||
{
|
||||
static char buf[40];
|
||||
|
||||
sprintf (buf, "process %d thread %d", PIDGET (pid), TIDGET (pid));
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Extract the register values out of the core file and store
|
||||
them where `read_register' will find them.
|
||||
|
||||
CORE_REG_SECT points to the register values themselves, read into memory.
|
||||
CORE_REG_SIZE is the size of that area.
|
||||
WHICH says which set of registers we are handling (0 = int, 2 = float
|
||||
on machines where they are discontiguous).
|
||||
REG_ADDR is the offset from u.u_ar0 to the register values relative to
|
||||
core_reg_sect. This is used with old-fashioned core files to
|
||||
locate the registers in a large upage-plus-stack ".reg" section.
|
||||
Original upage address X is at location core_reg_sect+x+reg_addr.
|
||||
*/
|
||||
|
||||
void
|
||||
fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
|
||||
char *core_reg_sect;
|
||||
unsigned core_reg_size;
|
||||
int which;
|
||||
unsigned reg_addr;
|
||||
{
|
||||
struct st_entry s;
|
||||
unsigned int regno, addr;
|
||||
|
||||
for (regno = 0; regno < NUM_REGS; regno++)
|
||||
{
|
||||
addr = register_addr (regno, (char *) &s.ec - (char *) &s);
|
||||
supply_register (regno, core_reg_sect + addr);
|
||||
}
|
||||
}
|
|
@ -275,56 +275,56 @@ print_387_status (status, ep)
|
|||
if (status != 0)
|
||||
{
|
||||
if (bothstatus)
|
||||
printf ("u: ");
|
||||
printf_unfiltered ("u: ");
|
||||
print_387_status_word (status);
|
||||
}
|
||||
|
||||
if (ep->status != 0)
|
||||
{
|
||||
if (bothstatus)
|
||||
printf ("e: ");
|
||||
printf_unfiltered ("e: ");
|
||||
print_387_status_word (ep->status);
|
||||
}
|
||||
|
||||
print_387_control_word (ep->control);
|
||||
printf ("last exception: ");
|
||||
printf ("opcode %s; ", local_hex_string(ep->opcode));
|
||||
printf ("pc %s:", local_hex_string(ep->code_seg));
|
||||
printf ("%s; ", local_hex_string(ep->eip));
|
||||
printf ("operand %s", local_hex_string(ep->operand_seg));
|
||||
printf (":%s\n", local_hex_string(ep->operand));
|
||||
printf_unfiltered ("last exception: ");
|
||||
printf_unfiltered ("opcode %s; ", local_hex_string(ep->opcode));
|
||||
printf_unfiltered ("pc %s:", local_hex_string(ep->code_seg));
|
||||
printf_unfiltered ("%s; ", local_hex_string(ep->eip));
|
||||
printf_unfiltered ("operand %s", local_hex_string(ep->operand_seg));
|
||||
printf_unfiltered (":%s\n", local_hex_string(ep->operand));
|
||||
|
||||
top = (ep->status >> 11) & 7;
|
||||
|
||||
printf ("regno tag msb lsb value\n");
|
||||
printf_unfiltered ("regno tag msb lsb value\n");
|
||||
for (fpreg = 7; fpreg >= 0; fpreg--)
|
||||
{
|
||||
double val;
|
||||
|
||||
printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
|
||||
printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
|
||||
|
||||
switch ((ep->tag >> (fpreg * 2)) & 3)
|
||||
{
|
||||
case 0: printf ("valid "); break;
|
||||
case 1: printf ("zero "); break;
|
||||
case 2: printf ("trap "); break;
|
||||
case 3: printf ("empty "); break;
|
||||
case 0: printf_unfiltered ("valid "); break;
|
||||
case 1: printf_unfiltered ("zero "); break;
|
||||
case 2: printf_unfiltered ("trap "); break;
|
||||
case 3: printf_unfiltered ("empty "); break;
|
||||
}
|
||||
for (i = 9; i >= 0; i--)
|
||||
printf ("%02x", ep->regs[fpreg][i]);
|
||||
printf_unfiltered ("%02x", ep->regs[fpreg][i]);
|
||||
|
||||
ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg],
|
||||
&val);
|
||||
printf (" %g\n", val);
|
||||
printf_unfiltered (" %g\n", val);
|
||||
}
|
||||
if (ep->r0)
|
||||
printf ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
|
||||
printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
|
||||
if (ep->r1)
|
||||
printf ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
|
||||
printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
|
||||
if (ep->r2)
|
||||
printf ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
|
||||
printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
|
||||
if (ep->r3)
|
||||
printf ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
|
||||
printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -132,7 +132,7 @@ i386_float_info ()
|
|||
|
||||
if (fpvalid == 0)
|
||||
{
|
||||
printf ("no floating point status saved\n");
|
||||
printf_unfiltered ("no floating point status saved\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,35 +52,35 @@ void
|
|||
print_387_control_word (control)
|
||||
unsigned int control;
|
||||
{
|
||||
printf ("control %s: ", local_hex_string(control));
|
||||
printf ("compute to ");
|
||||
printf_unfiltered ("control %s: ", local_hex_string(control));
|
||||
printf_unfiltered ("compute to ");
|
||||
switch ((control >> 8) & 3)
|
||||
{
|
||||
case 0: printf ("24 bits; "); break;
|
||||
case 1: printf ("(bad); "); break;
|
||||
case 2: printf ("53 bits; "); break;
|
||||
case 3: printf ("64 bits; "); break;
|
||||
case 0: printf_unfiltered ("24 bits; "); break;
|
||||
case 1: printf_unfiltered ("(bad); "); break;
|
||||
case 2: printf_unfiltered ("53 bits; "); break;
|
||||
case 3: printf_unfiltered ("64 bits; "); break;
|
||||
}
|
||||
printf ("round ");
|
||||
printf_unfiltered ("round ");
|
||||
switch ((control >> 10) & 3)
|
||||
{
|
||||
case 0: printf ("NEAREST; "); break;
|
||||
case 1: printf ("DOWN; "); break;
|
||||
case 2: printf ("UP; "); break;
|
||||
case 3: printf ("CHOP; "); break;
|
||||
case 0: printf_unfiltered ("NEAREST; "); break;
|
||||
case 1: printf_unfiltered ("DOWN; "); break;
|
||||
case 2: printf_unfiltered ("UP; "); break;
|
||||
case 3: printf_unfiltered ("CHOP; "); break;
|
||||
}
|
||||
if (control & 0x3f)
|
||||
{
|
||||
printf ("mask:");
|
||||
if (control & 0x0001) printf (" INVALID");
|
||||
if (control & 0x0002) printf (" DENORM");
|
||||
if (control & 0x0004) printf (" DIVZ");
|
||||
if (control & 0x0008) printf (" OVERF");
|
||||
if (control & 0x0010) printf (" UNDERF");
|
||||
if (control & 0x0020) printf (" LOS");
|
||||
printf (";");
|
||||
printf_unfiltered ("mask:");
|
||||
if (control & 0x0001) printf_unfiltered (" INVALID");
|
||||
if (control & 0x0002) printf_unfiltered (" DENORM");
|
||||
if (control & 0x0004) printf_unfiltered (" DIVZ");
|
||||
if (control & 0x0008) printf_unfiltered (" OVERF");
|
||||
if (control & 0x0010) printf_unfiltered (" UNDERF");
|
||||
if (control & 0x0020) printf_unfiltered (" LOS");
|
||||
printf_unfiltered (";");
|
||||
}
|
||||
printf ("\n");
|
||||
printf_unfiltered ("\n");
|
||||
if (control & 0xe080) warning ("reserved bits on: %s\n",
|
||||
local_hex_string(control & 0xe080));
|
||||
}
|
||||
|
@ -89,20 +89,20 @@ void
|
|||
print_387_status_word (status)
|
||||
unsigned int status;
|
||||
{
|
||||
printf ("status %s: ", local_hex_string (status));
|
||||
printf_unfiltered ("status %s: ", local_hex_string (status));
|
||||
if (status & 0xff)
|
||||
{
|
||||
printf ("exceptions:");
|
||||
if (status & 0x0001) printf (" INVALID");
|
||||
if (status & 0x0002) printf (" DENORM");
|
||||
if (status & 0x0004) printf (" DIVZ");
|
||||
if (status & 0x0008) printf (" OVERF");
|
||||
if (status & 0x0010) printf (" UNDERF");
|
||||
if (status & 0x0020) printf (" LOS");
|
||||
if (status & 0x0040) printf (" FPSTACK");
|
||||
printf ("; ");
|
||||
printf_unfiltered ("exceptions:");
|
||||
if (status & 0x0001) printf_unfiltered (" INVALID");
|
||||
if (status & 0x0002) printf_unfiltered (" DENORM");
|
||||
if (status & 0x0004) printf_unfiltered (" DIVZ");
|
||||
if (status & 0x0008) printf_unfiltered (" OVERF");
|
||||
if (status & 0x0010) printf_unfiltered (" UNDERF");
|
||||
if (status & 0x0020) printf_unfiltered (" LOS");
|
||||
if (status & 0x0040) printf_unfiltered (" FPSTACK");
|
||||
printf_unfiltered ("; ");
|
||||
}
|
||||
printf ("flags: %d%d%d%d; ",
|
||||
printf_unfiltered ("flags: %d%d%d%d; ",
|
||||
(status & 0x4000) != 0,
|
||||
(status & 0x0400) != 0,
|
||||
(status & 0x0200) != 0,
|
||||
|
@ -111,5 +111,5 @@ print_387_status_word (status)
|
|||
/* FIXME: Someone claims this should be 7 - (status >> 11) & 7 for AIX.
|
||||
What's the story? Is the following just wrong or are differing
|
||||
notations in use? */
|
||||
printf ("top %d\n", (status >> 11) & 7);
|
||||
printf_unfiltered ("top %d\n", (status >> 11) & 7);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ check_host()
|
|||
*/
|
||||
for ( i = 0; i < TYPELEN; i++ ){
|
||||
if ( types[i].hostsize != types[i].i960size ){
|
||||
printf("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
|
||||
printf_unfiltered("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
|
||||
types[i].typename, types[i].i960size );
|
||||
}
|
||||
|
||||
|
@ -619,7 +619,7 @@ print_fault( siggnal )
|
|||
# define NUMMSGS ((int)( sizeof(sigmsgs) / sizeof(sigmsgs[0]) ))
|
||||
|
||||
if (siggnal < NSIG) {
|
||||
printf ("\nProgram received signal %d, %s\n",
|
||||
printf_unfiltered ("\nProgram received signal %d, %s\n",
|
||||
siggnal, safe_strsignal (siggnal));
|
||||
} else {
|
||||
/* The various target_wait()s bias the 80960 "signal number"
|
||||
|
@ -628,7 +628,7 @@ print_fault( siggnal )
|
|||
"unbias" it before using it. */
|
||||
siggnal -= NSIG;
|
||||
|
||||
printf("Program stopped for reason #%d: %s.\n", siggnal,
|
||||
printf_unfiltered("Program stopped for reason #%d: %s.\n", siggnal,
|
||||
(siggnal < NUMMSGS && siggnal >= 0)?
|
||||
sigmsgs[siggnal] : unknown );
|
||||
}
|
||||
|
|
18
gdb/infcmd.c
18
gdb/infcmd.c
|
@ -252,7 +252,7 @@ Start it from the beginning? "))
|
|||
puts_filtered(" ");
|
||||
puts_filtered(inferior_args);
|
||||
puts_filtered("\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
target_create_inferior (exec_file, inferior_args,
|
||||
|
@ -382,7 +382,7 @@ step_1 (skip_subroutines, single_inst, count_string)
|
|||
printf_filtered ("\
|
||||
Single stepping until exit from function %s, \n\
|
||||
which has no line number information.\n", name);
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -749,7 +749,7 @@ finish_command (arg, from_tty)
|
|||
BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function))));
|
||||
|
||||
printf_filtered ("Value returned is $%d = ", record_latest_value (val));
|
||||
value_print (val, stdout, 0, Val_no_prettyprint);
|
||||
value_print (val, gdb_stdout, 0, Val_no_prettyprint);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
do_cleanups(old_chain);
|
||||
|
@ -1067,8 +1067,8 @@ do_registers_info (regnum, fpregs)
|
|||
continue;
|
||||
}
|
||||
|
||||
fputs_filtered (reg_names[i], stdout);
|
||||
print_spaces_filtered (15 - strlen (reg_names[i]), stdout);
|
||||
fputs_filtered (reg_names[i], gdb_stdout);
|
||||
print_spaces_filtered (15 - strlen (reg_names[i]), gdb_stdout);
|
||||
|
||||
/* Get the data in raw format, then convert also to virtual format. */
|
||||
if (read_relative_register_raw_bytes (i, raw_buffer))
|
||||
|
@ -1086,7 +1086,7 @@ do_registers_info (regnum, fpregs)
|
|||
register int j;
|
||||
|
||||
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0,
|
||||
stdout, 0, 1, 0, Val_pretty_default);
|
||||
gdb_stdout, 0, 1, 0, Val_pretty_default);
|
||||
|
||||
printf_filtered ("\t(raw 0x");
|
||||
for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
|
||||
|
@ -1109,10 +1109,10 @@ do_registers_info (regnum, fpregs)
|
|||
else
|
||||
{
|
||||
val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
|
||||
stdout, 'x', 1, 0, Val_pretty_default);
|
||||
gdb_stdout, 'x', 1, 0, Val_pretty_default);
|
||||
printf_filtered ("\t");
|
||||
val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
|
||||
stdout, 0, 1, 0, Val_pretty_default);
|
||||
gdb_stdout, 0, 1, 0, Val_pretty_default);
|
||||
}
|
||||
|
||||
/* The SPARC wants to print even-numbered float regs as doubles
|
||||
|
@ -1280,7 +1280,7 @@ unset_command (args, from_tty)
|
|||
int from_tty;
|
||||
{
|
||||
printf_filtered ("\"unset\" must be followed by the name of an unset subcommand.\n");
|
||||
help_list (unsetlist, "unset ", -1, stdout);
|
||||
help_list (unsetlist, "unset ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
12
gdb/inflow.c
12
gdb/inflow.c
|
@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
#include "serial.h"
|
||||
#include "terminal.h"
|
||||
#include "target.h"
|
||||
#include "thread.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -146,6 +147,9 @@ gdb_has_a_terminal ()
|
|||
}
|
||||
|
||||
return gdb_has_a_terminal_flag == yes;
|
||||
default:
|
||||
/* "Can't happen". */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +157,7 @@ gdb_has_a_terminal ()
|
|||
|
||||
#define OOPSY(what) \
|
||||
if (result == -1) \
|
||||
fprintf(stderr, "[%s failed in terminal_inferior: %s]\n", \
|
||||
fprintf_unfiltered(gdb_stderr, "[%s failed in terminal_inferior: %s]\n", \
|
||||
what, strerror (errno))
|
||||
|
||||
static void terminal_ours_1 PARAMS ((int));
|
||||
|
@ -331,7 +335,7 @@ terminal_ours_1 (output_only)
|
|||
used to check for an error here, so perhaps there are other
|
||||
such situations as well. */
|
||||
if (result == -1)
|
||||
fprintf (stderr, "[tcsetpgrp failed in terminal_ours: %s]\n",
|
||||
fprintf_unfiltered (gdb_stderr, "[tcsetpgrp failed in terminal_ours: %s]\n",
|
||||
strerror (errno));
|
||||
#endif
|
||||
#endif /* termios */
|
||||
|
@ -528,12 +532,14 @@ kill_command (arg, from_tty)
|
|||
error ("Not confirmed.");
|
||||
target_kill ();
|
||||
|
||||
init_thread_list(); /* Destroy thread info */
|
||||
|
||||
/* Killing off the inferior can leave us with a core file. If so,
|
||||
print the state we are left in. */
|
||||
if (target_has_stack) {
|
||||
printf_filtered ("In %s,\n", current_target->to_longname);
|
||||
if (selected_frame == NULL)
|
||||
fputs_filtered ("No selected stack frame.\n", stdout);
|
||||
fputs_filtered ("No selected stack frame.\n", gdb_stdout);
|
||||
else
|
||||
print_stack_frame (selected_frame, selected_frame_level, 1);
|
||||
}
|
||||
|
|
29
gdb/infrun.c
29
gdb/infrun.c
|
@ -335,7 +335,6 @@ The same program may be running in another process.");
|
|||
static CORE_ADDR prev_pc;
|
||||
static CORE_ADDR prev_sp;
|
||||
static CORE_ADDR prev_func_start;
|
||||
static CORE_ADDR prev_func_end;
|
||||
static char *prev_func_name;
|
||||
|
||||
|
||||
|
@ -393,7 +392,6 @@ wait_for_inferior ()
|
|||
int random_signal;
|
||||
CORE_ADDR stop_sp = 0;
|
||||
CORE_ADDR stop_func_start;
|
||||
CORE_ADDR stop_func_end;
|
||||
char *stop_func_name;
|
||||
CORE_ADDR prologue_pc = 0, tmp;
|
||||
struct symtab_and_line sal;
|
||||
|
@ -441,7 +439,7 @@ wait_for_inferior ()
|
|||
else
|
||||
if (!batch_mode())
|
||||
printf_filtered ("\nProgram exited normally.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
target_mourn_inferior ();
|
||||
#ifdef NO_SINGLE_STEP
|
||||
one_stepped = 0;
|
||||
|
@ -471,7 +469,7 @@ wait_for_inferior ()
|
|||
printf_filtered (", %s\n", safe_strsignal (stop_signal));
|
||||
#endif
|
||||
printf_filtered ("The program no longer exists.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
#ifdef NO_SINGLE_STEP
|
||||
one_stepped = 0;
|
||||
#endif
|
||||
|
@ -520,7 +518,7 @@ wait_for_inferior ()
|
|||
|
||||
if (!in_thread_list (pid))
|
||||
{
|
||||
fprintf (stderr, "[New %s]\n", target_pid_to_str (pid));
|
||||
fprintf_unfiltered (gdb_stderr, "[New %s]\n", target_pid_to_str (pid));
|
||||
add_thread (pid);
|
||||
|
||||
target_resume (-1, 0, 0);
|
||||
|
@ -542,7 +540,7 @@ wait_for_inferior ()
|
|||
printf_filtered ("%s (%d)", signame, stop_signal);
|
||||
printf_filtered (", %s\n", safe_strsignal (stop_signal));
|
||||
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
if (stop_signal == SIGTRAP
|
||||
|
@ -604,12 +602,11 @@ switch_thread:
|
|||
stop_frame_address = FRAME_FP (get_current_frame ());
|
||||
stop_sp = read_sp ();
|
||||
stop_func_start = 0;
|
||||
stop_func_end = 0;
|
||||
stop_func_name = 0;
|
||||
/* Don't care about return value; stop_func_start and stop_func_name
|
||||
will both be 0 if it doesn't work. */
|
||||
find_pc_partial_function (stop_pc, &stop_func_name, &stop_func_start,
|
||||
&stop_func_end);
|
||||
NULL);
|
||||
stop_func_start += FUNCTION_START_OFFSET;
|
||||
another_trap = 0;
|
||||
bpstat_clear (&stop_bpstat);
|
||||
|
@ -739,7 +736,7 @@ switch_thread:
|
|||
printf_filtered ("%s (%d)", signame, stop_signal);
|
||||
printf_filtered (", %s\n", safe_strsignal (stop_signal));
|
||||
#endif /* PRINT_RANDOM_SIGNAL */
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
if (stop_signal >= NSIG
|
||||
|| signal_stop[stop_signal])
|
||||
|
@ -980,11 +977,9 @@ switch_thread:
|
|||
or the call instruction itself saves the PC on the stack. */
|
||||
|| prologue_pc != stop_func_start
|
||||
|| stop_sp != prev_sp)
|
||||
&& (/* PC is out of bounds of the current function. Note that this
|
||||
seems sorta redundant w.r.t the prior test of stop_func_start
|
||||
!= prev_func_start... */
|
||||
stop_pc < prev_func_start
|
||||
|| stop_pc >= prev_func_end
|
||||
&& (/* PC is completely out of bounds of any known objfiles. Treat
|
||||
like a subroutine call. */
|
||||
! stop_func_start
|
||||
|
||||
/* If we do a call, we will be at the start of a function. */
|
||||
|| stop_pc == stop_func_start
|
||||
|
@ -1201,7 +1196,6 @@ step_into_function:
|
|||
original pc would not have
|
||||
been at the start of a
|
||||
function. */
|
||||
prev_func_end = stop_func_end;
|
||||
prev_func_name = stop_func_name;
|
||||
prev_sp = stop_sp;
|
||||
|
||||
|
@ -1276,7 +1270,6 @@ step_into_function:
|
|||
loop. */
|
||||
prev_pc = read_pc ();
|
||||
prev_func_start = stop_func_start;
|
||||
prev_func_end = stop_func_end;
|
||||
prev_func_name = stop_func_name;
|
||||
prev_sp = stop_sp;
|
||||
}
|
||||
|
@ -1573,8 +1566,8 @@ handle_command (args, from_tty)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf ("Not confirmed, unchanged.\n");
|
||||
fflush (stdout);
|
||||
printf_unfiltered ("Not confirmed, unchanged.\n");
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -513,7 +513,7 @@ child_create_inferior (exec_file, allargs, env)
|
|||
|
||||
fprintf (stderr, "Cannot exec %s: %s.\n", shell_file,
|
||||
errno < sys_nerr ? sys_errlist[errno] : "unknown error");
|
||||
fflush (stderr);
|
||||
gdb_flush (stderr);
|
||||
_exit (0177);
|
||||
}
|
||||
|
||||
|
@ -649,7 +649,7 @@ child_open (args, from_tty)
|
|||
{
|
||||
printf ("Attaching program: %s pid %d\n",
|
||||
exec_file, pid);
|
||||
fflush (stdout);
|
||||
gdb_flush (stdout);
|
||||
}
|
||||
|
||||
attach (pid);
|
||||
|
@ -716,7 +716,7 @@ wait_for_inferior ()
|
|||
else
|
||||
if (!batch_mode())
|
||||
printf ("\nProgram exited normally.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (stdout);
|
||||
target_mourn_inferior ();
|
||||
#ifdef NO_SINGLE_STEP
|
||||
one_stepped = 0;
|
||||
|
@ -736,7 +736,7 @@ wait_for_inferior ()
|
|||
? sys_siglist[stop_signal]
|
||||
: "(undocumented)");
|
||||
printf ("The inferior process no longer exists.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (stdout);
|
||||
#ifdef NO_SINGLE_STEP
|
||||
one_stepped = 0;
|
||||
#endif
|
||||
|
@ -899,7 +899,7 @@ wait_for_inferior ()
|
|||
? sys_siglist[stop_signal]
|
||||
: "(undocumented)");
|
||||
#endif /* PRINT_RANDOM_SIGNAL */
|
||||
fflush (stdout);
|
||||
gdb_flush (stdout);
|
||||
}
|
||||
if (stop_signal >= NSIG
|
||||
|| signal_stop[stop_signal])
|
||||
|
|
|
@ -161,12 +161,12 @@ set_language_command (ignore, from_tty)
|
|||
|
||||
/* FIXME -- do this from the list, with HELP. */
|
||||
if (!language || !language[0]) {
|
||||
printf("The currently understood settings are:\n\n");
|
||||
printf ("local or auto Automatic setting based on source file\n");
|
||||
printf ("c Use the C language\n");
|
||||
printf ("c++ Use the C++ language\n");
|
||||
printf ("chill Use the Chill language\n");
|
||||
printf ("modula-2 Use the Modula-2 language\n");
|
||||
printf_unfiltered("The currently understood settings are:\n\n");
|
||||
printf_unfiltered ("local or auto Automatic setting based on source file\n");
|
||||
printf_unfiltered ("c Use the C language\n");
|
||||
printf_unfiltered ("c++ Use the C++ language\n");
|
||||
printf_unfiltered ("chill Use the Chill language\n");
|
||||
printf_unfiltered ("modula-2 Use the Modula-2 language\n");
|
||||
/* Restore the silly string. */
|
||||
set_language(current_language->la_language);
|
||||
return;
|
||||
|
@ -212,7 +212,7 @@ show_type_command(ignore, from_tty)
|
|||
int from_tty;
|
||||
{
|
||||
if (type_check != current_language->la_type_check)
|
||||
printf(
|
||||
printf_unfiltered(
|
||||
"Warning: the current type check setting does not match the language.\n");
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ show_range_command(ignore, from_tty)
|
|||
{
|
||||
|
||||
if (range_check != current_language->la_range_check)
|
||||
printf(
|
||||
printf_unfiltered(
|
||||
"Warning: the current range check setting does not match the language.\n");
|
||||
}
|
||||
|
||||
|
@ -411,14 +411,14 @@ language_info (quietly)
|
|||
return;
|
||||
|
||||
expected_language = current_language;
|
||||
printf("Current language: %s\n",language);
|
||||
printf_unfiltered("Current language: %s\n",language);
|
||||
show_language_command((char *)0, 1);
|
||||
|
||||
if (!quietly)
|
||||
{
|
||||
printf("Type checking: %s\n",type);
|
||||
printf_unfiltered("Type checking: %s\n",type);
|
||||
show_type_command((char *)0, 1);
|
||||
printf("Range checking: %s\n",range);
|
||||
printf_unfiltered("Range checking: %s\n",range);
|
||||
show_range_command((char *)0, 1);
|
||||
}
|
||||
}
|
||||
|
@ -1012,14 +1012,14 @@ type_error (va_alist)
|
|||
char *string;
|
||||
|
||||
if (type_check==type_check_warn)
|
||||
fprintf(stderr,warning_pre_print);
|
||||
fprintf_unfiltered(gdb_stderr,warning_pre_print);
|
||||
else
|
||||
target_terminal_ours();
|
||||
|
||||
va_start (args);
|
||||
string = va_arg (args, char *);
|
||||
vfprintf (stderr, string, args);
|
||||
fprintf (stderr, "\n");
|
||||
vfprintf_unfiltered (gdb_stderr, string, args);
|
||||
fprintf_unfiltered (gdb_stderr, "\n");
|
||||
va_end (args);
|
||||
if (type_check==type_check_on)
|
||||
return_to_top_level (RETURN_ERROR);
|
||||
|
@ -1033,14 +1033,14 @@ range_error (va_alist)
|
|||
char *string;
|
||||
|
||||
if (range_check==range_check_warn)
|
||||
fprintf(stderr,warning_pre_print);
|
||||
fprintf_unfiltered(gdb_stderr,warning_pre_print);
|
||||
else
|
||||
target_terminal_ours();
|
||||
|
||||
va_start (args);
|
||||
string = va_arg (args, char *);
|
||||
vfprintf (stderr, string, args);
|
||||
fprintf (stderr, "\n");
|
||||
vfprintf_unfiltered (gdb_stderr, string, args);
|
||||
fprintf_unfiltered (gdb_stderr, "\n");
|
||||
va_end (args);
|
||||
if (range_check==range_check_on)
|
||||
return_to_top_level (RETURN_ERROR);
|
||||
|
@ -1085,9 +1085,9 @@ set_check (ignore, from_tty)
|
|||
char *ignore;
|
||||
int from_tty;
|
||||
{
|
||||
printf(
|
||||
printf_unfiltered(
|
||||
"\"set check\" must be followed by the name of a check subcommand.\n");
|
||||
help_list(setchecklist, "set check ", -1, stdout);
|
||||
help_list(setchecklist, "set check ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1106,7 +1106,7 @@ add_language (lang)
|
|||
{
|
||||
if (lang->la_magic != LANG_MAGIC)
|
||||
{
|
||||
fprintf(stderr, "Magic number of %s language struct wrong\n",
|
||||
fprintf_unfiltered(gdb_stderr, "Magic number of %s language struct wrong\n",
|
||||
lang->la_name);
|
||||
abort();
|
||||
}
|
||||
|
@ -1144,14 +1144,14 @@ unk_lang_error (msg)
|
|||
static void
|
||||
unk_lang_printchar (c, stream)
|
||||
register int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
error ("internal error - unimplemented function unk_lang_printchar called.");
|
||||
}
|
||||
|
||||
static void
|
||||
unk_lang_printstr (stream, string, length, force_ellipses)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *string;
|
||||
unsigned int length;
|
||||
int force_ellipses;
|
||||
|
@ -1171,7 +1171,7 @@ void
|
|||
unk_lang_print_type (type, varstring, stream, show, level)
|
||||
struct type *type;
|
||||
char *varstring;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
|
@ -1184,7 +1184,7 @@ unk_lang_val_print (type, valaddr, address, stream, format, deref_ref,
|
|||
struct type *type;
|
||||
char *valaddr;
|
||||
CORE_ADDR address;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int deref_ref;
|
||||
int recurse;
|
||||
|
|
|
@ -126,19 +126,19 @@ struct language_defn
|
|||
|
||||
void (*la_error) PARAMS ((char *));
|
||||
|
||||
void (*la_printchar) PARAMS ((int, FILE *));
|
||||
void (*la_printchar) PARAMS ((int, GDB_FILE *));
|
||||
|
||||
void (*la_printstr) PARAMS ((FILE *, char *, unsigned int, int));
|
||||
void (*la_printstr) PARAMS ((GDB_FILE *, char *, unsigned int, int));
|
||||
|
||||
struct type *(*la_fund_type) PARAMS ((struct objfile *, int));
|
||||
|
||||
/* Print a type using syntax appropriate for this language. */
|
||||
|
||||
void (*la_print_type) PARAMS ((struct type *, char *, FILE *, int, int));
|
||||
void (*la_print_type) PARAMS ((struct type *, char *, GDB_FILE *, int, int));
|
||||
|
||||
/* Print a value using syntax appropriate for this language. */
|
||||
|
||||
int (*la_val_print) PARAMS ((struct type *, char *, CORE_ADDR, FILE *,
|
||||
int (*la_val_print) PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
|
||||
int, int, int, enum val_prettyprint));
|
||||
|
||||
/* Longest signed integral type */
|
||||
|
|
|
@ -1153,7 +1153,7 @@ void
|
|||
yyerror(msg)
|
||||
char *msg; /* unused */
|
||||
{
|
||||
printf("Parsing: %s\n",lexptr);
|
||||
printf_unfiltered("Parsing: %s\n",lexptr);
|
||||
if (yychar < 256)
|
||||
error("Invalid syntax in expression near character '%c'.",yychar);
|
||||
else
|
||||
|
|
|
@ -35,7 +35,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
static void
|
||||
emit_char (c, stream, quoter)
|
||||
register int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int quoter;
|
||||
{
|
||||
|
||||
|
@ -87,7 +87,7 @@ emit_char (c, stream, quoter)
|
|||
static void
|
||||
m2_printchar (c, stream)
|
||||
int c;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
fputs_filtered ("'", stream);
|
||||
emit_char (c, stream, '\'');
|
||||
|
@ -103,7 +103,7 @@ m2_printchar (c, stream)
|
|||
|
||||
static void
|
||||
m2_printstr (stream, string, length, force_ellipses)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
char *string;
|
||||
unsigned int length;
|
||||
int force_ellipses;
|
||||
|
@ -118,7 +118,7 @@ m2_printstr (stream, string, length, force_ellipses)
|
|||
|
||||
if (length == 0)
|
||||
{
|
||||
fputs_filtered ("\"\"", stdout);
|
||||
fputs_filtered ("\"\"", gdb_stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ extern void
|
|||
m2_error PARAMS ((char *)); /* Defined in m2-exp.y */
|
||||
|
||||
extern void /* Defined in m2-typeprint.c */
|
||||
m2_print_type PARAMS ((struct type *, char *, FILE *, int, int));
|
||||
m2_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
|
||||
|
||||
extern int
|
||||
m2_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *, int, int,
|
||||
m2_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
|
||||
int, enum val_prettyprint));
|
||||
|
|
|
@ -39,11 +39,11 @@ void
|
|||
m2_print_type (type, varstring, stream, show, level)
|
||||
struct type *type;
|
||||
char *varstring;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int show;
|
||||
int level;
|
||||
{
|
||||
extern void c_print_type PARAMS ((struct type *, char *, FILE *, int, int));
|
||||
extern void c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
|
||||
|
||||
c_print_type (type, varstring, stream, show, level); /* FIXME */
|
||||
}
|
||||
|
|
|
@ -31,14 +31,14 @@ m2_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
|
|||
struct type *type;
|
||||
char *valaddr;
|
||||
CORE_ADDR address;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int format;
|
||||
int deref_ref;
|
||||
int recurse;
|
||||
enum val_prettyprint pretty;
|
||||
{
|
||||
extern int
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *, int, int,
|
||||
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
|
||||
int, enum val_prettyprint));
|
||||
return (c_val_print (type, valaddr, address, stream, format, deref_ref,
|
||||
recurse, pretty));
|
||||
|
|
26
gdb/m3-nat.c
26
gdb/m3-nat.c
|
@ -2377,7 +2377,7 @@ map_cprocs_to_kernel_threads (cprocs, mthreads, thread_count)
|
|||
|
||||
void
|
||||
print_tl_address (stream, pc)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
CORE_ADDR pc;
|
||||
{
|
||||
if (! lookup_minimal_symbol_by_pc (pc))
|
||||
|
@ -2687,7 +2687,7 @@ thread_list_command()
|
|||
buf,
|
||||
translate_cstate (scan->state),
|
||||
wired);
|
||||
print_tl_address (stdout, kthread->pc);
|
||||
print_tl_address (gdb_stdout, kthread->pc);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2720,7 +2720,7 @@ thread_list_command()
|
|||
if (FETCH_CPROC_STATE (&state) == -1)
|
||||
puts_filtered ("???");
|
||||
else
|
||||
print_tl_address (stdout, state.pc);
|
||||
print_tl_address (gdb_stdout, state.pc);
|
||||
|
||||
neworder++;
|
||||
}
|
||||
|
@ -2787,7 +2787,7 @@ thread_list_command()
|
|||
buf,
|
||||
"", /* No cproc state */
|
||||
""); /* Can't be wired */
|
||||
print_tl_address (stdout, their_threads[index].pc);
|
||||
print_tl_address (gdb_stdout, their_threads[index].pc);
|
||||
puts_filtered ("\n");
|
||||
}
|
||||
}
|
||||
|
@ -3623,8 +3623,8 @@ thread_command (arg, from_tty)
|
|||
char *arg;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"thread\" must be followed by the name of a thread command.\n");
|
||||
help_list (cmd_thread_list, "thread ", -1, stdout);
|
||||
printf_unfiltered ("\"thread\" must be followed by the name of a thread command.\n");
|
||||
help_list (cmd_thread_list, "thread ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
@ -3633,8 +3633,8 @@ task_command (arg, from_tty)
|
|||
char *arg;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"task\" must be followed by the name of a task command.\n");
|
||||
help_list (cmd_task_list, "task ", -1, stdout);
|
||||
printf_unfiltered ("\"task\" must be followed by the name of a task command.\n");
|
||||
help_list (cmd_task_list, "task ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
add_mach_specific_commands ()
|
||||
|
@ -4082,11 +4082,11 @@ m3_attach (args, from_tty)
|
|||
exec_file = (char *) get_exec_file (0);
|
||||
|
||||
if (exec_file)
|
||||
printf ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
|
||||
printf_unfiltered ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
|
||||
else
|
||||
printf ("Attaching to %s\n", target_pid_to_str (pid));
|
||||
printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid));
|
||||
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
m3_do_attach (pid);
|
||||
|
@ -4210,9 +4210,9 @@ m3_detach (args, from_tty)
|
|||
char *exec_file = get_exec_file (0);
|
||||
if (exec_file == 0)
|
||||
exec_file = "";
|
||||
printf ("Detaching from program: %s %s\n",
|
||||
printf_unfiltered ("Detaching from program: %s %s\n",
|
||||
exec_file, target_pid_to_str (inferior_pid));
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
if (args)
|
||||
siggnal = atoi (args);
|
||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ store_inferior_registers (regno)
|
|||
ptrace (6, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register(regno));
|
||||
else
|
||||
printf ("Bad register number for store_inferior routine\n");
|
||||
printf_unfiltered ("Bad register number for store_inferior routine\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -415,7 +415,7 @@ examine_prologue (ip, limit, frame_sp, fsr, fi)
|
|||
/* (we hope...) */
|
||||
if (fsr->regs[SP_REGNUM] != 0
|
||||
&& fsr->regs[SP_REGNUM] != frame_sp - sp_offset)
|
||||
fprintf(stderr, "Bad saved SP value %x != %x, offset %x!\n",
|
||||
fprintf_unfiltered(gdb_stderr, "Bad saved SP value %x != %x, offset %x!\n",
|
||||
fsr->regs[SP_REGNUM],
|
||||
frame_sp - sp_offset, sp_offset);
|
||||
|
||||
|
|
81
gdb/main.c
81
gdb/main.c
|
@ -73,7 +73,7 @@ static void
|
|||
command_loop_marker PARAMS ((int));
|
||||
|
||||
static void
|
||||
print_gdb_version PARAMS ((FILE *));
|
||||
print_gdb_version PARAMS ((GDB_FILE *));
|
||||
|
||||
static void
|
||||
quit_command PARAMS ((char *, int));
|
||||
|
@ -687,7 +687,7 @@ main (argc, argv)
|
|||
ADDITIONAL_OPTION_CASES
|
||||
#endif
|
||||
case '?':
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"Use `%s --help' for a complete list of options.\n",
|
||||
argv[0]);
|
||||
exit (1);
|
||||
|
@ -707,7 +707,7 @@ main (argc, argv)
|
|||
corearg = argv[optind];
|
||||
break;
|
||||
case 3:
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"Excess command line arguments ignored. (%s%s)\n",
|
||||
argv[optind], (optind == argc - 1) ? "" : " ...");
|
||||
break;
|
||||
|
@ -727,7 +727,7 @@ main (argc, argv)
|
|||
after initialize_all_files. */
|
||||
if (print_version)
|
||||
{
|
||||
print_gdb_version (stdout);
|
||||
print_gdb_version (gdb_stdout);
|
||||
wrap_here ("");
|
||||
printf_filtered ("\n");
|
||||
exit (0);
|
||||
|
@ -739,14 +739,14 @@ main (argc, argv)
|
|||
are printing the version here, and the help is long enough
|
||||
already. */
|
||||
|
||||
print_gdb_version (stdout);
|
||||
print_gdb_version (gdb_stdout);
|
||||
/* Make sure the output gets printed. */
|
||||
wrap_here ("");
|
||||
printf_filtered ("\n");
|
||||
|
||||
/* But don't use *_filtered here. We don't want to prompt for continue
|
||||
no matter how small the screen or how much we're going to print. */
|
||||
fputs ("\
|
||||
fputs_unfiltered ("\
|
||||
This is the GNU debugger. Usage:\n\
|
||||
gdb [options] [executable-file [core-file or process-id]]\n\
|
||||
Options:\n\
|
||||
|
@ -767,13 +767,13 @@ Options:\n\
|
|||
-b BAUDRATE Set serial port baud rate used for remote debugging.\n\
|
||||
--mapped Use mapped symbol files if supported on this system.\n\
|
||||
--readnow Fully read symbol files on first access.\n\
|
||||
", stdout);
|
||||
", gdb_stdout);
|
||||
#ifdef ADDITIONAL_OPTION_HELP
|
||||
fputs (ADDITIONAL_OPTION_HELP, stdout);
|
||||
fputs_unfiltered (ADDITIONAL_OPTION_HELP, gdb_stdout);
|
||||
#endif
|
||||
fputs ("\n\
|
||||
fputs_unfiltered ("\n\
|
||||
For more information, type \"help\" from within GDB, or consult the\n\
|
||||
GDB manual (available as on-line info or a printed manual).\n", stdout);
|
||||
GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
@ -782,11 +782,11 @@ GDB manual (available as on-line info or a printed manual).\n", stdout);
|
|||
/* Print all the junk at the top, with trailing "..." if we are about
|
||||
to read a symbol file (possibly slowly). */
|
||||
print_gnu_advertisement ();
|
||||
print_gdb_version (stdout);
|
||||
print_gdb_version (gdb_stdout);
|
||||
if (symarg)
|
||||
printf_filtered ("..");
|
||||
wrap_here("");
|
||||
fflush (stdout); /* Force to screen during slow operations */
|
||||
gdb_flush (gdb_stdout); /* Force to screen during slow operations */
|
||||
}
|
||||
|
||||
error_pre_print = "\n\n";
|
||||
|
@ -1119,8 +1119,8 @@ gdb_readline (prrompt)
|
|||
/* Don't use a _filtered function here. It causes the assumed
|
||||
character position to be off, since the newline we read from
|
||||
the user is not accounted for. */
|
||||
fputs (prrompt, stdout);
|
||||
fflush (stdout);
|
||||
fputs_unfiltered (prrompt, gdb_stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
result = (char *) xmalloc (result_size);
|
||||
|
@ -1593,8 +1593,8 @@ int signo;
|
|||
#else
|
||||
signal (STOP_SIGNAL, stop_sig);
|
||||
#endif
|
||||
printf ("%s", prompt);
|
||||
fflush (stdout);
|
||||
printf_unfiltered ("%s", prompt);
|
||||
gdb_flush (gdb_stdout);
|
||||
|
||||
/* Forget about any previous command -- null line now will do nothing. */
|
||||
dont_repeat ();
|
||||
|
@ -1679,12 +1679,12 @@ command_line_input (prrompt, repeat)
|
|||
|
||||
while (1)
|
||||
{
|
||||
/* Reports are that some Sys V's don't flush stdout/err on reads
|
||||
/* Reports are that some Sys V's don't flush gdb_stdout/err on reads
|
||||
from stdin, when stdin/out are sockets rather than ttys. So we
|
||||
have to do it ourselves, to make emacs-gdb and xxgdb work.
|
||||
On other machines, doing this once per input should be a cheap nop. */
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
gdb_flush (gdb_stderr);
|
||||
|
||||
/* Don't use fancy stuff if not talking to stdin. */
|
||||
if (command_editing_p && instream == stdin
|
||||
|
@ -1741,7 +1741,7 @@ command_line_input (prrompt, repeat)
|
|||
if (expanded)
|
||||
{
|
||||
/* Print the changes. */
|
||||
printf ("%s\n", history_value);
|
||||
printf_unfiltered ("%s\n", history_value);
|
||||
|
||||
/* If there was an error, call this function again. */
|
||||
if (expanded < 0)
|
||||
|
@ -1939,8 +1939,8 @@ info_command (arg, from_tty)
|
|||
char *arg;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"info\" must be followed by the name of an info command.\n");
|
||||
help_list (infolist, "info ", -1, stdout);
|
||||
printf_unfiltered ("\"info\" must be followed by the name of an info command.\n");
|
||||
help_list (infolist, "info ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
/* The "show" command with no arguments shows all the settings. */
|
||||
|
@ -1991,7 +1991,7 @@ help_command (command, from_tty)
|
|||
char *command;
|
||||
int from_tty; /* Ignored */
|
||||
{
|
||||
help_cmd (command, stdout);
|
||||
help_cmd (command, gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2077,9 +2077,9 @@ define_command (comname, from_tty)
|
|||
|
||||
if (from_tty)
|
||||
{
|
||||
printf ("Type commands for definition of \"%s\".\n\
|
||||
printf_unfiltered ("Type commands for definition of \"%s\".\n\
|
||||
End with a line saying just \"end\".\n", comname);
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
cmds = read_command_lines ();
|
||||
|
@ -2118,7 +2118,7 @@ document_command (comname, from_tty)
|
|||
error ("Command \"%s\" is built-in.", comname);
|
||||
|
||||
if (from_tty)
|
||||
printf ("Type documentation for \"%s\".\n\
|
||||
printf_unfiltered ("Type documentation for \"%s\".\n\
|
||||
End with a line saying just \"end\".\n", comname);
|
||||
|
||||
doclines = read_command_lines ();
|
||||
|
@ -2149,7 +2149,7 @@ End with a line saying just \"end\".\n", comname);
|
|||
static void
|
||||
print_gnu_advertisement()
|
||||
{
|
||||
printf ("\
|
||||
printf_unfiltered ("\
|
||||
GDB is free software and you are welcome to distribute copies of it\n\
|
||||
under certain conditions; type \"show copying\" to see the conditions.\n\
|
||||
There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
|
||||
|
@ -2158,7 +2158,7 @@ There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
|
|||
|
||||
static void
|
||||
print_gdb_version (stream)
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
fprintf_filtered (stream, "\
|
||||
GDB %s (%s", version, host_canonical);
|
||||
|
@ -2179,7 +2179,7 @@ show_version (args, from_tty)
|
|||
{
|
||||
immediate_quit++;
|
||||
print_gnu_advertisement ();
|
||||
print_gdb_version (stdout);
|
||||
print_gdb_version (gdb_stdout);
|
||||
printf_filtered ("\n");
|
||||
immediate_quit--;
|
||||
}
|
||||
|
@ -2189,8 +2189,8 @@ show_version (args, from_tty)
|
|||
void
|
||||
print_prompt ()
|
||||
{
|
||||
printf ("%s", prompt);
|
||||
fflush (stdout);
|
||||
printf_unfiltered ("%s", prompt);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2240,10 +2240,10 @@ pwd_command (args, from_tty)
|
|||
getcwd (dirbuf, sizeof (dirbuf));
|
||||
|
||||
if (!STREQ (dirbuf, current_directory))
|
||||
printf ("Working directory %s\n (canonically %s).\n",
|
||||
printf_unfiltered ("Working directory %s\n (canonically %s).\n",
|
||||
current_directory, dirbuf);
|
||||
else
|
||||
printf ("Working directory %s.\n", current_directory);
|
||||
printf_unfiltered ("Working directory %s.\n", current_directory);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2386,7 +2386,7 @@ echo_command (text, from_tty)
|
|||
|
||||
/* Force this output to appear now. */
|
||||
wrap_here ("");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2497,8 +2497,8 @@ set_history (args, from_tty)
|
|||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"set history\" must be followed by the name of a history subcommand.\n");
|
||||
help_list (sethistlist, "set history ", -1, stdout);
|
||||
printf_unfiltered ("\"set history\" must be followed by the name of a history subcommand.\n");
|
||||
help_list (sethistlist, "set history ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -2790,6 +2790,15 @@ the previous command number shown.",
|
|||
add_cmd ("version", no_class, show_version,
|
||||
"Show what version of GDB this is.", &showlist);
|
||||
|
||||
/* If target is open when baud changes, it doesn't take effect until the
|
||||
next open (I think, not sure). */
|
||||
add_show_from_set (add_set_cmd ("remotebaud", no_class,
|
||||
var_zinteger, (char *)&baud_rate,
|
||||
"Set baud rate for remote serial I/O.\n\
|
||||
This value is used to set the speed of the serial port when debugging\n\
|
||||
using remote targets.", &setlist),
|
||||
&showlist);
|
||||
|
||||
add_show_from_set (
|
||||
add_set_cmd ("remotedebug", no_class, var_boolean, (char *)&remote_debug,
|
||||
"Set debugging of remote protocol.\n\
|
||||
|
|
18
gdb/maint.c
18
gdb/maint.c
|
@ -61,8 +61,8 @@ maintenance_command (args, from_tty)
|
|||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"maintenance\" must be followed by the name of a maintenance command.\n");
|
||||
help_list (maintenancelist, "maintenance ", -1, stdout);
|
||||
printf_unfiltered ("\"maintenance\" must be followed by the name of a maintenance command.\n");
|
||||
help_list (maintenancelist, "maintenance ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,19 +96,19 @@ maintenance_demangle (args, from_tty)
|
|||
|
||||
if (args == NULL || *args == '\0')
|
||||
{
|
||||
printf ("\"maintenance demangle\" takes an argument to demangle.\n");
|
||||
printf_unfiltered ("\"maintenance demangle\" takes an argument to demangle.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
demangled = cplus_demangle (args, DMGL_ANSI | DMGL_PARAMS);
|
||||
if (demangled != NULL)
|
||||
{
|
||||
printf ("%s\n", demangled);
|
||||
printf_unfiltered ("%s\n", demangled);
|
||||
free (demangled);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("Can't demangle \"%s\"\n", args);
|
||||
printf_unfiltered ("Can't demangle \"%s\"\n", args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,8 +123,8 @@ maintenance_info_command (arg, from_tty)
|
|||
char *arg;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"maintenance info\" must be followed by the name of an info command.\n");
|
||||
help_list (maintenanceinfolist, "maintenance info ", -1, stdout);
|
||||
printf_unfiltered ("\"maintenance info\" must be followed by the name of an info command.\n");
|
||||
help_list (maintenanceinfolist, "maintenance info ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -213,8 +213,8 @@ maintenance_print_command (arg, from_tty)
|
|||
char *arg;
|
||||
int from_tty;
|
||||
{
|
||||
printf ("\"maintenance print\" must be followed by the name of a print command.\n");
|
||||
help_list (maintenanceprintlist, "maintenance print ", -1, stdout);
|
||||
printf_unfiltered ("\"maintenance print\" must be followed by the name of a print command.\n");
|
||||
help_list (maintenanceprintlist, "maintenance print ", -1, gdb_stdout);
|
||||
}
|
||||
|
||||
#endif /* MAINTENANCE_CMDS */
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
|
@ -347,12 +347,9 @@ mips_frame_chain(frame)
|
|||
we loop forever if we see a zero size frame. */
|
||||
if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
|
||||
&& PROC_FRAME_OFFSET (proc_desc) == 0
|
||||
/* Frameless functions, which can happen on the innermost frame
|
||||
or a frame which was innermost when a signal happened, can
|
||||
have frame size zero. No need to check for non-frameless
|
||||
functions in these situations, though (I don't think). */
|
||||
&& frame->next != NULL
|
||||
&& !frame->next->signal_handler_caller)
|
||||
/* The previous frame from a sigtramp frame might be frameless
|
||||
and have frame size zero. */
|
||||
&& !frame->signal_handler_caller)
|
||||
return 0;
|
||||
else
|
||||
return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
|
||||
|
@ -640,7 +637,7 @@ mips_pop_frame()
|
|||
/* We let mips_init_extra_frame_info figure out the frame pointer */
|
||||
set_current_frame (create_new_frame (0, read_pc ()));
|
||||
|
||||
if (PROC_DESC_IS_DUMMY(proc_desc))
|
||||
if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc))
|
||||
{
|
||||
struct linked_proc_info *pi_ptr, *prev_ptr;
|
||||
|
||||
|
@ -695,10 +692,10 @@ mips_print_register (regnum, all)
|
|||
#endif
|
||||
printf_filtered ("(d%d: ", regnum-FP0_REGNUM);
|
||||
val_print (builtin_type_double, dbuffer, 0,
|
||||
stdout, 0, 1, 0, Val_pretty_default);
|
||||
gdb_stdout, 0, 1, 0, Val_pretty_default);
|
||||
printf_filtered ("); ");
|
||||
}
|
||||
fputs_filtered (reg_names[regnum], stdout);
|
||||
fputs_filtered (reg_names[regnum], gdb_stdout);
|
||||
|
||||
/* The problem with printing numeric register names (r26, etc.) is that
|
||||
the user can't use them on input. Probably the best solution is to
|
||||
|
@ -713,7 +710,7 @@ mips_print_register (regnum, all)
|
|||
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT
|
||||
&& ! INVALID_FLOAT (raw_buffer, REGISTER_VIRTUAL_SIZE(regnum))) {
|
||||
val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0,
|
||||
stdout, 0, 1, 0, Val_pretty_default);
|
||||
gdb_stdout, 0, 1, 0, Val_pretty_default);
|
||||
}
|
||||
/* Else print as integer in hex. */
|
||||
else
|
||||
|
@ -730,7 +727,7 @@ mips_print_register (regnum, all)
|
|||
registers line up. */
|
||||
printf_filtered (local_hex_format(), val);
|
||||
else
|
||||
printf_filtered ("%s=%d", local_hex_string(val), val);
|
||||
printf_filtered ("%s=%ld", local_hex_string(val), val);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -639,7 +639,7 @@ open_existing_mapped_file (symsfilename, mtime, mapped)
|
|||
{
|
||||
if (error_pre_print)
|
||||
{
|
||||
printf (error_pre_print);
|
||||
printf_unfiltered (error_pre_print);
|
||||
}
|
||||
print_sys_errmsg (symsfilename, errno);
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ open_mapped_file (filename, mtime, mapped)
|
|||
{
|
||||
if (error_pre_print)
|
||||
{
|
||||
printf (error_pre_print);
|
||||
printf_unfiltered (error_pre_print);
|
||||
}
|
||||
print_sys_errmsg (symsfilename, errno);
|
||||
}
|
||||
|
|
|
@ -535,7 +535,7 @@ solib_add (arg_string, from_tty, target)
|
|||
{
|
||||
if (from_tty)
|
||||
{
|
||||
printf ("Symbols already loaded for %s\n", so -> so_name);
|
||||
printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name);
|
||||
}
|
||||
}
|
||||
else if (catch_errors
|
||||
|
@ -576,7 +576,7 @@ info_sharedlibrary_command (ignore, from_tty)
|
|||
|
||||
if (exec_bfd == NULL)
|
||||
{
|
||||
printf ("No exec file.\n");
|
||||
printf_unfiltered ("No exec file.\n");
|
||||
return;
|
||||
}
|
||||
while ((so = find_solib (so)) != NULL)
|
||||
|
@ -588,7 +588,7 @@ info_sharedlibrary_command (ignore, from_tty)
|
|||
|
||||
if (!header_done)
|
||||
{
|
||||
printf("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
|
||||
printf_unfiltered("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read",
|
||||
"Shared Object Library");
|
||||
header_done++;
|
||||
}
|
||||
|
@ -597,15 +597,15 @@ info_sharedlibrary_command (ignore, from_tty)
|
|||
txt_start = (unsigned long) so -> textsection -> addr;
|
||||
txt_end = (unsigned long) so -> textsection -> endaddr;
|
||||
}
|
||||
printf ("%-20s", local_hex_string_custom (txt_start, "08l"));
|
||||
printf ("%-20s", local_hex_string_custom (txt_end, "08l"));
|
||||
printf ("%-12s", so -> symbols_loaded ? "Yes" : "No");
|
||||
printf ("%s\n", so -> so_name);
|
||||
printf_unfiltered ("%-20s", local_hex_string_custom (txt_start, "08l"));
|
||||
printf_unfiltered ("%-20s", local_hex_string_custom (txt_end, "08l"));
|
||||
printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No");
|
||||
printf_unfiltered ("%s\n", so -> so_name);
|
||||
}
|
||||
}
|
||||
if (so_list_head == NULL)
|
||||
{
|
||||
printf ("No shared libraries loaded at this time.\n");
|
||||
printf_unfiltered ("No shared libraries loaded at this time.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -741,9 +741,9 @@ parse_exp_1 (stringptr, block, comma)
|
|||
/* Convert expression from postfix form as generated by yacc
|
||||
parser, to a prefix form. */
|
||||
|
||||
DUMP_EXPRESSION (expout, stdout, "before conversion to prefix form");
|
||||
DUMP_EXPRESSION (expout, gdb_stdout, "before conversion to prefix form");
|
||||
prefixify_expression (expout);
|
||||
DUMP_EXPRESSION (expout, stdout, "after conversion to prefix form");
|
||||
DUMP_EXPRESSION (expout, gdb_stdout, "after conversion to prefix form");
|
||||
|
||||
*stringptr = lexptr;
|
||||
return expout;
|
||||
|
|
|
@ -563,8 +563,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
(dependencies_used
|
||||
* sizeof (struct partial_symtab *)));
|
||||
#ifdef DEBUG_INFO
|
||||
fprintf (stderr, "Had to reallocate dependency list.\n");
|
||||
fprintf (stderr, "New dependencies allocated: %d\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
|
||||
fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
|
||||
dependencies_allocated);
|
||||
#endif
|
||||
}
|
||||
|
|
395
gdb/printcmd.c
395
gdb/printcmd.c
|
@ -31,6 +31,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
#include "target.h"
|
||||
#include "breakpoint.h"
|
||||
#include "demangle.h"
|
||||
#include "valprint.h"
|
||||
|
||||
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
|
||||
extern int addressprint; /* Whether to print hex addresses in HLL " */
|
||||
|
@ -127,7 +128,7 @@ printf_command PARAMS ((char *, int));
|
|||
|
||||
static void
|
||||
print_frame_nameless_args PARAMS ((struct frame_info *, long, int, int,
|
||||
FILE *));
|
||||
GDB_FILE *));
|
||||
|
||||
static void
|
||||
display_info PARAMS ((char *, int));
|
||||
|
@ -273,7 +274,7 @@ decode_format (string_ptr, oformat, osize)
|
|||
return val;
|
||||
}
|
||||
|
||||
/* Print value VAL on stdout according to FORMAT, a letter or 0.
|
||||
/* Print value VAL on gdb_stdout according to FORMAT, a letter or 0.
|
||||
Do not end with a newline.
|
||||
0 means print VAL according to its own type.
|
||||
SIZE is the letter for the size of datum being printed.
|
||||
|
@ -294,7 +295,7 @@ print_formatted (val, format, size)
|
|||
{
|
||||
case 's':
|
||||
next_address = VALUE_ADDRESS (val)
|
||||
+ value_print (value_addr (val), stdout, format, Val_pretty_default);
|
||||
+ value_print (value_addr (val), gdb_stdout, format, Val_pretty_default);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
|
@ -305,7 +306,7 @@ print_formatted (val, format, size)
|
|||
/* We often wrap here if there are long symbolic names. */
|
||||
wrap_here (" ");
|
||||
next_address = VALUE_ADDRESS (val)
|
||||
+ print_insn (VALUE_ADDRESS (val), stdout);
|
||||
+ print_insn (VALUE_ADDRESS (val), gdb_stdout);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -315,10 +316,10 @@ print_formatted (val, format, size)
|
|||
|| TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRUCT
|
||||
|| TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_UNION
|
||||
|| VALUE_REPEATED (val))
|
||||
value_print (val, stdout, format, Val_pretty_default);
|
||||
value_print (val, gdb_stdout, format, Val_pretty_default);
|
||||
else
|
||||
print_scalar_formatted (VALUE_CONTENTS (val), VALUE_TYPE (val),
|
||||
format, size, stdout);
|
||||
format, size, gdb_stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,7 +336,7 @@ print_scalar_formatted (valaddr, type, format, size, stream)
|
|||
struct type *type;
|
||||
int format;
|
||||
int size;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
LONGEST val_long;
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
@ -504,7 +505,7 @@ set_next_address (addr)
|
|||
void
|
||||
print_address_symbolic (addr, stream, do_demangle, leadin)
|
||||
CORE_ADDR addr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int do_demangle;
|
||||
char *leadin;
|
||||
{
|
||||
|
@ -576,7 +577,7 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
|
|||
void
|
||||
print_address (addr, stream)
|
||||
CORE_ADDR addr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
#if 0 && defined (ADDR_BITS_REMOVE)
|
||||
/* This is wrong for pointer to char, in which we do want to print
|
||||
|
@ -597,7 +598,7 @@ print_address (addr, stream)
|
|||
void
|
||||
print_address_demangle (addr, stream, do_demangle)
|
||||
CORE_ADDR addr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
int do_demangle;
|
||||
{
|
||||
if (addr == 0) {
|
||||
|
@ -611,8 +612,16 @@ print_address_demangle (addr, stream, do_demangle)
|
|||
}
|
||||
|
||||
|
||||
/* These are the types that $__ will get after an examine command of one
|
||||
of these sizes. */
|
||||
|
||||
static struct type *examine_b_type;
|
||||
static struct type *examine_h_type;
|
||||
static struct type *examine_w_type;
|
||||
static struct type *examine_g_type;
|
||||
|
||||
/* Examine data at address ADDR in format FMT.
|
||||
Fetch it from memory and print on stdout. */
|
||||
Fetch it from memory and print on gdb_stdout. */
|
||||
|
||||
static void
|
||||
do_examine (fmt, addr)
|
||||
|
@ -636,17 +645,14 @@ do_examine (fmt, addr)
|
|||
if (format == 's' || format == 'i')
|
||||
size = 'b';
|
||||
|
||||
/* I don't think the TYPE_CODE, TYPE_NAME, or TYPE_FLAGS matter.
|
||||
This is just a (fairly twisted) way of telling print_formatted
|
||||
the right length. */
|
||||
if (size == 'b')
|
||||
val_type = init_type (TYPE_CODE_INT, 1, 0, NULL, NULL);
|
||||
val_type = examine_b_type;
|
||||
else if (size == 'h')
|
||||
val_type = init_type (TYPE_CODE_INT, 2, 0, NULL, NULL);
|
||||
val_type = examine_h_type;
|
||||
else if (size == 'w')
|
||||
val_type = init_type (TYPE_CODE_INT, 4, 0, NULL, NULL);
|
||||
val_type = examine_w_type;
|
||||
else if (size == 'g')
|
||||
val_type = init_type (TYPE_CODE_INT, 8, 0, NULL, NULL);
|
||||
val_type = examine_g_type;
|
||||
|
||||
maxelts = 8;
|
||||
if (size == 'w')
|
||||
|
@ -661,7 +667,7 @@ do_examine (fmt, addr)
|
|||
|
||||
while (count > 0)
|
||||
{
|
||||
print_address (next_address, stdout);
|
||||
print_address (next_address, gdb_stdout);
|
||||
printf_filtered (":");
|
||||
for (i = maxelts;
|
||||
i > 0 && count > 0;
|
||||
|
@ -675,9 +681,8 @@ do_examine (fmt, addr)
|
|||
print_formatted (last_examine_value, format, size);
|
||||
}
|
||||
printf_filtered ("\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
free (val_type);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -767,14 +772,14 @@ print_command_1 (exp, inspect, voidprint)
|
|||
int histindex = record_latest_value (val);
|
||||
|
||||
if (inspect)
|
||||
printf ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
|
||||
printf_unfiltered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
|
||||
else
|
||||
if (histindex >= 0) printf_filtered ("$%d = ", histindex);
|
||||
|
||||
print_formatted (val, format, fmt.size);
|
||||
printf_filtered ("\n");
|
||||
if (inspect)
|
||||
printf("\") )\030");
|
||||
printf_unfiltered("\") )\030");
|
||||
}
|
||||
|
||||
if (cleanup)
|
||||
|
@ -878,14 +883,14 @@ address_info (exp, from_tty)
|
|||
{
|
||||
if (is_a_field_of_this)
|
||||
{
|
||||
printf ("Symbol \"%s\" is a field of the local class variable `this'\n", exp);
|
||||
printf_unfiltered ("Symbol \"%s\" is a field of the local class variable `this'\n", exp);
|
||||
return;
|
||||
}
|
||||
|
||||
msymbol = lookup_minimal_symbol (exp, (struct objfile *) NULL);
|
||||
|
||||
if (msymbol != NULL)
|
||||
printf ("Symbol \"%s\" is at %s in a file compiled without debugging.\n",
|
||||
printf_unfiltered ("Symbol \"%s\" is at %s in a file compiled without debugging.\n",
|
||||
exp,
|
||||
local_hex_string((unsigned long) SYMBOL_VALUE_ADDRESS (msymbol)));
|
||||
else
|
||||
|
@ -893,7 +898,7 @@ address_info (exp, from_tty)
|
|||
return;
|
||||
}
|
||||
|
||||
printf ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
|
||||
printf_unfiltered ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
|
||||
val = SYMBOL_VALUE (sym);
|
||||
basereg = SYMBOL_BASEREG (sym);
|
||||
|
||||
|
@ -901,63 +906,63 @@ address_info (exp, from_tty)
|
|||
{
|
||||
case LOC_CONST:
|
||||
case LOC_CONST_BYTES:
|
||||
printf ("constant");
|
||||
printf_unfiltered ("constant");
|
||||
break;
|
||||
|
||||
case LOC_LABEL:
|
||||
printf ("a label at address %s",
|
||||
printf_unfiltered ("a label at address %s",
|
||||
local_hex_string((unsigned long) SYMBOL_VALUE_ADDRESS (sym)));
|
||||
break;
|
||||
|
||||
case LOC_REGISTER:
|
||||
printf ("a variable in register %s", reg_names[val]);
|
||||
printf_unfiltered ("a variable in register %s", reg_names[val]);
|
||||
break;
|
||||
|
||||
case LOC_STATIC:
|
||||
printf ("static storage at address %s",
|
||||
printf_unfiltered ("static storage at address %s",
|
||||
local_hex_string((unsigned long) SYMBOL_VALUE_ADDRESS (sym)));
|
||||
break;
|
||||
|
||||
case LOC_REGPARM:
|
||||
printf ("an argument in register %s", reg_names[val]);
|
||||
printf_unfiltered ("an argument in register %s", reg_names[val]);
|
||||
break;
|
||||
|
||||
case LOC_REGPARM_ADDR:
|
||||
printf ("address of an argument in register %s", reg_names[val]);
|
||||
printf_unfiltered ("address of an argument in register %s", reg_names[val]);
|
||||
break;
|
||||
|
||||
case LOC_ARG:
|
||||
printf ("an argument at offset %ld", val);
|
||||
printf_unfiltered ("an argument at offset %ld", val);
|
||||
break;
|
||||
|
||||
case LOC_LOCAL_ARG:
|
||||
printf ("an argument at frame offset %ld", val);
|
||||
printf_unfiltered ("an argument at frame offset %ld", val);
|
||||
break;
|
||||
|
||||
case LOC_LOCAL:
|
||||
printf ("a local variable at frame offset %ld", val);
|
||||
printf_unfiltered ("a local variable at frame offset %ld", val);
|
||||
break;
|
||||
|
||||
case LOC_REF_ARG:
|
||||
printf ("a reference argument at offset %ld", val);
|
||||
printf_unfiltered ("a reference argument at offset %ld", val);
|
||||
break;
|
||||
|
||||
case LOC_BASEREG:
|
||||
printf ("a variable at offset %ld from register %s",
|
||||
printf_unfiltered ("a variable at offset %ld from register %s",
|
||||
val, reg_names[basereg]);
|
||||
break;
|
||||
|
||||
case LOC_BASEREG_ARG:
|
||||
printf ("an argument at offset %ld from register %s",
|
||||
printf_unfiltered ("an argument at offset %ld from register %s",
|
||||
val, reg_names[basereg]);
|
||||
break;
|
||||
|
||||
case LOC_TYPEDEF:
|
||||
printf ("a typedef");
|
||||
printf_unfiltered ("a typedef");
|
||||
break;
|
||||
|
||||
case LOC_BLOCK:
|
||||
printf ("a function at address %s",
|
||||
printf_unfiltered ("a function at address %s",
|
||||
local_hex_string((unsigned long) BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
|
||||
break;
|
||||
|
||||
|
@ -966,10 +971,10 @@ address_info (exp, from_tty)
|
|||
break;
|
||||
|
||||
default:
|
||||
printf ("of unknown (botched) type");
|
||||
printf_unfiltered ("of unknown (botched) type");
|
||||
break;
|
||||
}
|
||||
printf (".\n");
|
||||
printf_unfiltered (".\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1220,7 +1225,7 @@ do_one_display (d)
|
|||
if (d->format.format != 'i' && d->format.format != 's')
|
||||
printf_filtered ("%c", d->format.size);
|
||||
printf_filtered (" ");
|
||||
print_expression (d->exp, stdout);
|
||||
print_expression (d->exp, gdb_stdout);
|
||||
if (d->format.count != 1)
|
||||
printf_filtered ("\n");
|
||||
else
|
||||
|
@ -1236,14 +1241,14 @@ do_one_display (d)
|
|||
{
|
||||
if (d->format.format)
|
||||
printf_filtered ("/%c ", d->format.format);
|
||||
print_expression (d->exp, stdout);
|
||||
print_expression (d->exp, gdb_stdout);
|
||||
printf_filtered (" = ");
|
||||
print_formatted (evaluate_expression (d->exp),
|
||||
d->format.format, d->format.size);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
current_display_number = -1;
|
||||
}
|
||||
|
||||
|
@ -1274,7 +1279,7 @@ disable_display (num)
|
|||
d->status = disabled;
|
||||
return;
|
||||
}
|
||||
printf ("No display number %d.\n", num);
|
||||
printf_unfiltered ("No display number %d.\n", num);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1283,7 +1288,7 @@ disable_current_display ()
|
|||
if (current_display_number >= 0)
|
||||
{
|
||||
disable_display (current_display_number);
|
||||
fprintf (stderr, "Disabling display %d to avoid infinite recursion.\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Disabling display %d to avoid infinite recursion.\n",
|
||||
current_display_number);
|
||||
}
|
||||
current_display_number = -1;
|
||||
|
@ -1297,7 +1302,7 @@ display_info (ignore, from_tty)
|
|||
register struct display *d;
|
||||
|
||||
if (!display_chain)
|
||||
printf ("There are no auto-display expressions now.\n");
|
||||
printf_unfiltered ("There are no auto-display expressions now.\n");
|
||||
else
|
||||
printf_filtered ("Auto-display expressions now in effect:\n\
|
||||
Num Enb Expression\n");
|
||||
|
@ -1310,11 +1315,11 @@ Num Enb Expression\n");
|
|||
d->format.format);
|
||||
else if (d->format.format)
|
||||
printf_filtered ("/%c ", d->format.format);
|
||||
print_expression (d->exp, stdout);
|
||||
print_expression (d->exp, gdb_stdout);
|
||||
if (d->block && !contained_in (get_selected_block (), d->block))
|
||||
printf_filtered (" (cannot be evaluated in the current context)");
|
||||
printf_filtered ("\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1350,7 +1355,7 @@ enable_display (args, from_tty)
|
|||
d->status = enabled;
|
||||
goto win;
|
||||
}
|
||||
printf ("No display number %d.\n", num);
|
||||
printf_unfiltered ("No display number %d.\n", num);
|
||||
win:
|
||||
p = p1;
|
||||
while (*p == ' ' || *p == '\t')
|
||||
|
@ -1398,7 +1403,7 @@ void
|
|||
print_variable_value (var, frame, stream)
|
||||
struct symbol *var;
|
||||
FRAME frame;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
value val = read_var_value (var, frame);
|
||||
value_print (val, stream, 0, Val_pretty_default);
|
||||
|
@ -1417,7 +1422,7 @@ print_frame_args (func, fi, num, stream)
|
|||
struct symbol *func;
|
||||
struct frame_info *fi;
|
||||
int num;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
struct block *b = NULL;
|
||||
int nsyms = 0;
|
||||
|
@ -1551,7 +1556,7 @@ print_frame_nameless_args (fi, start, num, first, stream)
|
|||
long start;
|
||||
int num;
|
||||
int first;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int i;
|
||||
CORE_ADDR argsaddr;
|
||||
|
@ -1587,90 +1592,6 @@ print_frame_nameless_args (fi, start, num, first, stream)
|
|||
}
|
||||
}
|
||||
|
||||
/* This is an interface which allows to us make a va_list. */
|
||||
typedef struct {
|
||||
unsigned int nargs;
|
||||
unsigned int max_arg_size;
|
||||
|
||||
/* Current position in bytes. */
|
||||
unsigned int argindex;
|
||||
|
||||
#ifdef MAKEVA_EXTRA_INFO
|
||||
/* For host dependent information. */
|
||||
MAKEVA_EXTRA_INFO
|
||||
#endif
|
||||
|
||||
/* Some systems (mips, pa) would like this to be aligned, and it never
|
||||
will hurt. */
|
||||
union
|
||||
{
|
||||
char arg_bytes[1];
|
||||
double force_double_align;
|
||||
LONGEST force_long_align;
|
||||
} aligner;
|
||||
} makeva_list;
|
||||
|
||||
/* Tell the caller how many bytes to allocate for a makeva_list with NARGS
|
||||
arguments and whose largest argument is MAX_ARG_SIZE bytes. This
|
||||
way the caller can use alloca, malloc, or some other allocator. */
|
||||
unsigned int
|
||||
makeva_size (nargs, max_arg_size)
|
||||
unsigned int nargs;
|
||||
unsigned int max_arg_size;
|
||||
{
|
||||
#if defined (MAKEVA_SIZE)
|
||||
MAKEVA_SIZE (nargs, max_arg_size);
|
||||
#else
|
||||
return sizeof (makeva_list) + nargs * max_arg_size;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Start working on LIST with NARGS arguments and whose largest
|
||||
argument is MAX_ARG_SIZE bytes. */
|
||||
void
|
||||
makeva_start (list, nargs, max_arg_size)
|
||||
makeva_list *list;
|
||||
unsigned int nargs;
|
||||
unsigned int max_arg_size;
|
||||
{
|
||||
list->nargs = nargs;
|
||||
list->max_arg_size = max_arg_size;
|
||||
#if defined (MAKEVA_START)
|
||||
MAKEVA_START (list);
|
||||
#else
|
||||
list->argindex = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Add ARG to LIST. */
|
||||
void
|
||||
makeva_arg (list, argaddr, argsize)
|
||||
makeva_list *list;
|
||||
PTR argaddr;
|
||||
unsigned int argsize;
|
||||
{
|
||||
#if defined (MAKEVA_ARG)
|
||||
MAKEVA_ARG (list, argaddr, argsize);
|
||||
#else
|
||||
memcpy (&list->aligner.arg_bytes[list->argindex], argaddr, argsize);
|
||||
list->argindex += argsize;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* From LIST, for which makeva_arg has been called for each arg,
|
||||
return a va_list containing the args. */
|
||||
va_list
|
||||
makeva_end (list)
|
||||
makeva_list *list;
|
||||
{
|
||||
#if defined (MAKEVA_END)
|
||||
MAKEVA_END (list);
|
||||
#else
|
||||
/* This works if a va_list is just a pointer to the arguments. */
|
||||
return (va_list) list->aligner.arg_bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
printf_command (arg, from_tty)
|
||||
|
@ -1681,11 +1602,14 @@ printf_command (arg, from_tty)
|
|||
register char *s = arg;
|
||||
char *string;
|
||||
value *val_args;
|
||||
char *substrings;
|
||||
char *current_substring;
|
||||
int nargs = 0;
|
||||
int allocated_args = 20;
|
||||
va_list args_to_vprintf;
|
||||
struct cleanup *old_cleanups;
|
||||
|
||||
val_args = (value *) xmalloc (allocated_args * sizeof (value));
|
||||
old_cleanups = make_cleanup (free_current_contents, &val_args);
|
||||
|
||||
if (s == 0)
|
||||
error_no_arg ("format-control string and values to print");
|
||||
|
@ -1701,6 +1625,7 @@ printf_command (arg, from_tty)
|
|||
processing some kinds of escape sequence. */
|
||||
|
||||
f = string = (char *) alloca (strlen (s) + 1);
|
||||
|
||||
while (*s != '"')
|
||||
{
|
||||
int c = *s++;
|
||||
|
@ -1708,7 +1633,6 @@ printf_command (arg, from_tty)
|
|||
{
|
||||
case '\0':
|
||||
error ("Bad format string, non-terminated '\"'.");
|
||||
/* doesn't return */
|
||||
|
||||
case '\\':
|
||||
switch (c = *s++)
|
||||
|
@ -1750,26 +1674,27 @@ printf_command (arg, from_tty)
|
|||
if (*s == ',') s++;
|
||||
while (*s == ' ' || *s == '\t') s++;
|
||||
|
||||
/* Need extra space for the '\0's. Doubling the size is sufficient. */
|
||||
substrings = alloca (strlen (string) * 2);
|
||||
current_substring = substrings;
|
||||
|
||||
{
|
||||
/* Now scan the string for %-specs and see what kinds of args they want.
|
||||
argclass[I] classifies the %-specs so we can give vprintf something
|
||||
argclass[I] classifies the %-specs so we can give vprintf_unfiltered something
|
||||
of the right size. */
|
||||
|
||||
enum argclass {int_arg, string_arg, double_arg, long_long_arg};
|
||||
|
||||
enum argclass {no_arg, int_arg, string_arg, double_arg, long_long_arg};
|
||||
enum argclass *argclass;
|
||||
enum argclass this_argclass;
|
||||
char *last_arg;
|
||||
int nargs_wanted;
|
||||
int lcount;
|
||||
int i;
|
||||
/* We build up a va_list to pass to vprintf. This is unnecessary;
|
||||
instead of calling vprintf ("%d%f", <constructed va_list>) we
|
||||
could just call printf ("%d", arg1); printf ("%f", arg2);. Funny
|
||||
how I thought of that right *after* I got the MAKEVA stuff pretty much
|
||||
working... */
|
||||
makeva_list *args_makeva;
|
||||
|
||||
argclass = (enum argclass *) alloca (strlen (s) * sizeof *argclass);
|
||||
nargs_wanted = 0;
|
||||
f = string;
|
||||
last_arg = string;
|
||||
while (*f)
|
||||
if (*f++ == '%')
|
||||
{
|
||||
|
@ -1780,15 +1705,44 @@ printf_command (arg, from_tty)
|
|||
lcount++;
|
||||
f++;
|
||||
}
|
||||
if (*f == 's')
|
||||
argclass[nargs_wanted++] = string_arg;
|
||||
else if (*f == 'e' || *f == 'f' || *f == 'g')
|
||||
argclass[nargs_wanted++] = double_arg;
|
||||
else if (lcount > 1)
|
||||
argclass[nargs_wanted++] = long_long_arg;
|
||||
else if (*f != '%')
|
||||
argclass[nargs_wanted++] = int_arg;
|
||||
switch (*f)
|
||||
{
|
||||
case 's':
|
||||
this_argclass = string_arg;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
case 'f':
|
||||
case 'g':
|
||||
this_argclass = double_arg;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
error ("`*' not supported for precision or width in printf");
|
||||
|
||||
case 'n':
|
||||
error ("Format specifier `n' not supported in printf");
|
||||
|
||||
case '%':
|
||||
this_argclass = no_arg;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (lcount > 1)
|
||||
this_argclass = long_long_arg;
|
||||
else
|
||||
this_argclass = int_arg;
|
||||
break;
|
||||
}
|
||||
f++;
|
||||
if (this_argclass != no_arg)
|
||||
{
|
||||
strncpy (current_substring, last_arg, f - last_arg);
|
||||
current_substring += f - last_arg;
|
||||
*current_substring++ = '\0';
|
||||
last_arg = f;
|
||||
argclass[nargs_wanted++] = this_argclass;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now, parse all arguments and evaluate them.
|
||||
|
@ -1823,69 +1777,85 @@ printf_command (arg, from_tty)
|
|||
if (nargs != nargs_wanted)
|
||||
error ("Wrong number of arguments for specified format-string");
|
||||
|
||||
/* Now lay out an argument-list containing the arguments
|
||||
as doubles, integers and C pointers. */
|
||||
/* FIXME: We should be using vprintf_filtered, but as long as it
|
||||
has an arbitrary limit that is unacceptable. Correct fix is
|
||||
for vprintf_filtered to scan down the format string so it knows
|
||||
how big a buffer it needs (perhaps by putting a vasprintf (see
|
||||
GNU C library) in libiberty).
|
||||
|
||||
args_makeva = (makeva_list *)
|
||||
alloca (makeva_size (nargs, sizeof (double)));
|
||||
makeva_start (args_makeva, nargs, sizeof (double));
|
||||
But for now, just force out any pending output, so at least the output
|
||||
appears in the correct order. */
|
||||
wrap_here ((char *)NULL);
|
||||
|
||||
/* Now actually print them. */
|
||||
current_substring = substrings;
|
||||
for (i = 0; i < nargs; i++)
|
||||
{
|
||||
if (argclass[i] == string_arg)
|
||||
switch (argclass[i])
|
||||
{
|
||||
char *str;
|
||||
CORE_ADDR tem;
|
||||
int j;
|
||||
tem = value_as_pointer (val_args[i]);
|
||||
|
||||
/* This is a %s argument. Find the length of the string. */
|
||||
for (j = 0; ; j++)
|
||||
{
|
||||
char c;
|
||||
QUIT;
|
||||
read_memory (tem + j, &c, 1);
|
||||
if (c == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Copy the string contents into a string inside GDB. */
|
||||
str = (char *) alloca (j + 1);
|
||||
read_memory (tem, str, j);
|
||||
str[j] = 0;
|
||||
|
||||
/* Pass address of internal copy as the arg to vprintf. */
|
||||
makeva_arg (args_makeva, &str, sizeof (str));
|
||||
}
|
||||
else if (VALUE_TYPE (val_args[i])->code == TYPE_CODE_FLT)
|
||||
{
|
||||
double val = value_as_double (val_args[i]);
|
||||
makeva_arg (args_makeva, &val, sizeof (val));
|
||||
}
|
||||
else
|
||||
#ifdef CC_HAS_LONG_LONG
|
||||
if (argclass[i] == long_long_arg)
|
||||
case string_arg:
|
||||
{
|
||||
char *str;
|
||||
CORE_ADDR tem;
|
||||
int j;
|
||||
tem = value_as_pointer (val_args[i]);
|
||||
|
||||
/* This is a %s argument. Find the length of the string. */
|
||||
for (j = 0; ; j++)
|
||||
{
|
||||
char c;
|
||||
QUIT;
|
||||
read_memory (tem + j, &c, 1);
|
||||
if (c == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Copy the string contents into a string inside GDB. */
|
||||
str = (char *) alloca (j + 1);
|
||||
read_memory (tem, str, j);
|
||||
str[j] = 0;
|
||||
|
||||
/* Don't use printf_filtered because of arbitrary limit. */
|
||||
printf_unfiltered (current_substring, str);
|
||||
}
|
||||
break;
|
||||
case double_arg:
|
||||
{
|
||||
double val = value_as_double (val_args[i]);
|
||||
/* Don't use printf_filtered because of arbitrary limit. */
|
||||
printf_unfiltered (current_substring, val);
|
||||
break;
|
||||
}
|
||||
case long_long_arg:
|
||||
#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG)
|
||||
{
|
||||
long long val = value_as_long (val_args[i]);
|
||||
makeva_arg (args_makeva, &val, sizeof (val));
|
||||
/* Don't use printf_filtered because of arbitrary limit. */
|
||||
printf_unfiltered (current_substring, val);
|
||||
break;
|
||||
}
|
||||
else
|
||||
#else
|
||||
error ("long long not supported in printf");
|
||||
#endif
|
||||
case int_arg:
|
||||
{
|
||||
/* FIXME: there should be separate int_arg and long_arg. */
|
||||
long val = value_as_long (val_args[i]);
|
||||
makeva_arg (args_makeva, &val, sizeof (val));
|
||||
/* Don't use printf_filtered because of arbitrary limit. */
|
||||
printf_unfiltered (current_substring, val);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
error ("internal error in printf_command");
|
||||
}
|
||||
/* Skip to the next substring. */
|
||||
current_substring += strlen (current_substring) + 1;
|
||||
}
|
||||
args_to_vprintf = makeva_end (args_makeva);
|
||||
/* Print the portion of the format string after the last argument. */
|
||||
/* It would be OK to use printf_filtered here. */
|
||||
printf (last_arg);
|
||||
}
|
||||
|
||||
/* FIXME: We should be using vprintf_filtered, but as long as it has an
|
||||
arbitrary limit that is unacceptable. Correct fix is for vprintf_filtered
|
||||
to scan down the format string so it knows how big a buffer it needs.
|
||||
|
||||
But for now, just force out any pending output, so at least the output
|
||||
appears in the correct order. */
|
||||
wrap_here ((char *)NULL);
|
||||
vprintf (string, args_to_vprintf);
|
||||
do_cleanups (old_cleanups);
|
||||
}
|
||||
|
||||
/* Dump a specified section of assembly code. With no command line
|
||||
|
@ -1946,13 +1916,13 @@ disassemble_command (arg, from_tty)
|
|||
for (pc = low; pc < high; )
|
||||
{
|
||||
QUIT;
|
||||
print_address (pc, stdout);
|
||||
print_address (pc, gdb_stdout);
|
||||
printf_filtered (":\t");
|
||||
pc += print_insn (pc, stdout);
|
||||
pc += print_insn (pc, gdb_stdout);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
printf_filtered ("End of assembler dump.\n");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2100,4 +2070,9 @@ environment, the value is printed in its own window.");
|
|||
"Set printing of source filename and line number with <symbol>.",
|
||||
&setprintlist),
|
||||
&showprintlist);
|
||||
|
||||
examine_b_type = init_type (TYPE_CODE_INT, 1, 0, NULL, NULL);
|
||||
examine_h_type = init_type (TYPE_CODE_INT, 2, 0, NULL, NULL);
|
||||
examine_w_type = init_type (TYPE_CODE_INT, 4, 0, NULL, NULL);
|
||||
examine_g_type = init_type (TYPE_CODE_INT, 8, 0, NULL, NULL);
|
||||
}
|
||||
|
|
40
gdb/procfs.c
40
gdb/procfs.c
|
@ -1624,7 +1624,7 @@ proc_set_exec_trap ()
|
|||
if ((fd = open (procname, O_RDWR)) < 0)
|
||||
{
|
||||
perror (procname);
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stderr);
|
||||
_exit (127);
|
||||
}
|
||||
premptyset (&exitset);
|
||||
|
@ -1648,7 +1648,7 @@ proc_set_exec_trap ()
|
|||
if (ioctl (fd, PIOCSEXIT, &exitset) < 0)
|
||||
{
|
||||
perror (procname);
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stderr);
|
||||
_exit (127);
|
||||
}
|
||||
|
||||
|
@ -1657,7 +1657,7 @@ proc_set_exec_trap ()
|
|||
if (ioctl (fd, PIOCSENTRY, &entryset) < 0)
|
||||
{
|
||||
perror (procname);
|
||||
fflush (stderr);
|
||||
gdb_flush (gdb_stderr);
|
||||
_exit (126);
|
||||
}
|
||||
|
||||
|
@ -1859,11 +1859,11 @@ procfs_attach (args, from_tty)
|
|||
exec_file = (char *) get_exec_file (0);
|
||||
|
||||
if (exec_file)
|
||||
printf ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
|
||||
printf_unfiltered ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
|
||||
else
|
||||
printf ("Attaching to %s\n", target_pid_to_str (pid));
|
||||
printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid));
|
||||
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
do_attach (pid);
|
||||
|
@ -1892,9 +1892,9 @@ procfs_detach (args, from_tty)
|
|||
char *exec_file = get_exec_file (0);
|
||||
if (exec_file == 0)
|
||||
exec_file = "";
|
||||
printf ("Detaching from program: %s %s\n",
|
||||
printf_unfiltered ("Detaching from program: %s %s\n",
|
||||
exec_file, target_pid_to_str (inferior_pid));
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
if (args)
|
||||
siggnal = atoi (args);
|
||||
|
@ -1924,7 +1924,7 @@ static void
|
|||
procfs_files_info (ignore)
|
||||
struct target_ops *ignore;
|
||||
{
|
||||
printf ("\tUsing the running image of %s %s via /proc.\n",
|
||||
printf_unfiltered ("\tUsing the running image of %s %s via /proc.\n",
|
||||
attach_flag? "attached": "child", target_pid_to_str (inferior_pid));
|
||||
}
|
||||
|
||||
|
@ -2032,7 +2032,7 @@ do_attach (pid)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf ("Ok, gdb will wait for %s to stop.\n", target_pid_to_str (pid));
|
||||
printf_unfiltered ("Ok, gdb will wait for %s to stop.\n", target_pid_to_str (pid));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2109,32 +2109,32 @@ do_detach (signal)
|
|||
if (ioctl (pi->fd, PIOCSEXIT, &pi->saved_exitset) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSEXIT failed.\n");
|
||||
printf_unfiltered ("PIOCSEXIT failed.\n");
|
||||
}
|
||||
if (ioctl (pi->fd, PIOCSENTRY, &pi->saved_entryset) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSENTRY failed.\n");
|
||||
printf_unfiltered ("PIOCSENTRY failed.\n");
|
||||
}
|
||||
if (ioctl (pi->fd, PIOCSTRACE, &pi->saved_trace) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSTRACE failed.\n");
|
||||
printf_unfiltered ("PIOCSTRACE failed.\n");
|
||||
}
|
||||
if (ioctl (pi->fd, PIOCSHOLD, &pi->saved_sighold) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOSCHOLD failed.\n");
|
||||
printf_unfiltered ("PIOSCHOLD failed.\n");
|
||||
}
|
||||
if (ioctl (pi->fd, PIOCSFAULT, &pi->saved_fltset) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSFAULT failed.\n");
|
||||
printf_unfiltered ("PIOCSFAULT failed.\n");
|
||||
}
|
||||
if (ioctl (pi->fd, PIOCSTATUS, &pi->prstatus) < 0)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSTATUS failed.\n");
|
||||
printf_unfiltered ("PIOCSTATUS failed.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2147,7 +2147,7 @@ do_detach (signal)
|
|||
if (ioctl (pi->fd, PIOCCFAULT, 0))
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCCFAULT failed.\n");
|
||||
printf_unfiltered ("PIOCCFAULT failed.\n");
|
||||
}
|
||||
|
||||
/* Make it run again when we close it. */
|
||||
|
@ -2165,7 +2165,7 @@ do_detach (signal)
|
|||
if (result)
|
||||
{
|
||||
print_sys_errmsg (pi->pathname, errno);
|
||||
printf ("PIOCSRLC or PIOCSET failed.\n");
|
||||
printf_unfiltered ("PIOCSRLC or PIOCSET failed.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2409,7 +2409,7 @@ wait_again:
|
|||
|
||||
if (rtnval == -1) /* No more children to wait for */
|
||||
{
|
||||
fprintf (stderr, "Child process unexpectedly missing.\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing.\n");
|
||||
*statloc = 42; /* Claim it exited with signal 42 */
|
||||
return rtnval;
|
||||
}
|
||||
|
@ -2593,7 +2593,7 @@ procfs_resume (pid, step, signo)
|
|||
{
|
||||
if (ioctl (procinfo->fd, PIOCSTATUS, &procinfo->prstatus) < 0)
|
||||
{
|
||||
fprintf(stderr, "PIOCSTATUS failed, errno=%d\n", errno);
|
||||
fprintf_unfiltered(gdb_stderr, "PIOCSTATUS failed, errno=%d\n", errno);
|
||||
}
|
||||
print_sys_errmsg (procinfo->pathname, errno);
|
||||
error ("PIOCRUN failed");
|
||||
|
|
|
@ -38,7 +38,7 @@ CORE_ADDR pyr_frame_chain(frame)
|
|||
CORE_ADDR frame;
|
||||
{
|
||||
int foo=frame - CONTROL_STACK_FRAME_SIZE;
|
||||
/* printf ("...following chain from %x: got %x\n", frame, foo);*/
|
||||
/* printf_unfiltered ("...following chain from %x: got %x\n", frame, foo);*/
|
||||
return foo;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ CORE_ADDR pyr_saved_pc(frame)
|
|||
{
|
||||
int foo=0;
|
||||
foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4);
|
||||
printf ("..reading pc from frame 0x%0x+%d regs: got %0x\n",
|
||||
printf_unfiltered ("..reading pc from frame 0x%0x+%d regs: got %0x\n",
|
||||
frame, 60/4, foo);
|
||||
return foo;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ print_insn (memaddr, stream)
|
|||
if (*((int *)buffer) == 0x0) {
|
||||
/* "halt" looks just like an invalid "jump" to the insn decoder,
|
||||
so is dealt with as a special case */
|
||||
fprintf (stream, "halt");
|
||||
fprintf_unfiltered (stream, "halt");
|
||||
return (4);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ print_insn (memaddr, stream)
|
|||
|
||||
if (i == NOPCODES)
|
||||
/* FIXME: Handle unrecognised instructions better. */
|
||||
fprintf (stream, "???\t#%08x\t(op=%x mode =%x)",
|
||||
fprintf_unfiltered (stream, "???\t#%08x\t(op=%x mode =%x)",
|
||||
insn, insn_decode.operator, insn_decode.mode);
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ print_insn (memaddr, stream)
|
|||
special case: check the operands of branch insn and print an
|
||||
appropriate mnemonic. */
|
||||
|
||||
fprintf (stream, "%s\t", pyr_opcodes[i].name);
|
||||
fprintf_unfiltered (stream, "%s\t", pyr_opcodes[i].name);
|
||||
|
||||
/* Print the operands of the insn (as specified in
|
||||
insn.operand_mode).
|
||||
|
@ -139,24 +139,24 @@ print_insn (memaddr, stream)
|
|||
/* Is bfc and no bits specified an unconditional branch?*/
|
||||
for (i=0;i<4;i++) {
|
||||
if ((bit_codes) & 0x1)
|
||||
fputc (cc_bit_names[i], stream);
|
||||
fputc_unfiltered (cc_bit_names[i], stream);
|
||||
bit_codes >>= 1;
|
||||
}
|
||||
|
||||
fprintf (stream, ",%0x",
|
||||
fprintf_unfiltered (stream, ",%0x",
|
||||
displacement + memaddr);
|
||||
return (insn_size);
|
||||
}
|
||||
|
||||
switch (operand_mode) {
|
||||
case 0:
|
||||
fprintf (stream, "%s,%s",
|
||||
fprintf_unfiltered (stream, "%s,%s",
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
fprintf (stream, " 0x%0x,%s",
|
||||
fprintf_unfiltered (stream, " 0x%0x,%s",
|
||||
op_1_regno,
|
||||
reg_names [op_2_regno]);
|
||||
break;
|
||||
|
@ -165,12 +165,12 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream, " $0x%0x,%s",
|
||||
fprintf_unfiltered (stream, " $0x%0x,%s",
|
||||
extra_1,
|
||||
reg_names [op_2_regno]);
|
||||
break;
|
||||
case 3:
|
||||
fprintf (stream, " (%s),%s",
|
||||
fprintf_unfiltered (stream, " (%s),%s",
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno]);
|
||||
break;
|
||||
|
@ -179,7 +179,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream, " 0x%0x(%s),%s",
|
||||
fprintf_unfiltered (stream, " 0x%0x(%s),%s",
|
||||
extra_1,
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno]);
|
||||
|
@ -187,7 +187,7 @@ print_insn (memaddr, stream)
|
|||
|
||||
/* S1 destination mode */
|
||||
case 5:
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"),
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno],
|
||||
|
@ -196,7 +196,7 @@ print_insn (memaddr, stream)
|
|||
break;
|
||||
|
||||
case 6:
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
|
||||
: " $%#0x,(%s)"),
|
||||
op_1_regno,
|
||||
|
@ -209,7 +209,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
|
||||
: " $%#0x,(%s)"),
|
||||
extra_1,
|
||||
|
@ -219,7 +219,7 @@ print_insn (memaddr, stream)
|
|||
break;
|
||||
|
||||
case 8:
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"),
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno],
|
||||
|
@ -231,7 +231,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno)
|
||||
? "%#0x(%s),(%s)[%s*%1d]"
|
||||
: "%#0x(%s),(%s)"),
|
||||
|
@ -247,7 +247,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"),
|
||||
reg_names [op_1_regno],
|
||||
extra_1,
|
||||
|
@ -259,7 +259,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ?
|
||||
" $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
|
||||
op_1_regno,
|
||||
|
@ -275,7 +275,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+8, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_2 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ?
|
||||
" $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
|
||||
extra_1,
|
||||
|
@ -289,7 +289,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+4, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_1 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno)
|
||||
? " (%s),%#0x(%s)[%s*%1d]"
|
||||
: " (%s),%#0x(%s)"),
|
||||
|
@ -306,7 +306,7 @@ print_insn (memaddr, stream)
|
|||
read_memory (memaddr+8, buffer, MAXLEN);
|
||||
insn_size += 4;
|
||||
extra_2 = * ((int *) buffer);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]"
|
||||
: "%#0x(%s),%#0x(%s) "),
|
||||
extra_1,
|
||||
|
@ -318,13 +318,13 @@ print_insn (memaddr, stream)
|
|||
break;
|
||||
|
||||
default:
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"),
|
||||
reg_names [op_1_regno],
|
||||
reg_names [op_2_regno],
|
||||
reg_names [index_reg_regno],
|
||||
index_multiplier);
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
"\t\t# unknown mode in %08x",
|
||||
insn);
|
||||
break;
|
||||
|
|
|
@ -30,7 +30,7 @@ pyr_print_registers(reg_buf, regnum)
|
|||
struct user u;
|
||||
|
||||
for (regno = 0; regno < 16; regno++) {
|
||||
printf/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n",
|
||||
printf_unfiltered/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n",
|
||||
reg_names[regno], reg_buf[regno],
|
||||
reg_names[regno+16], reg_buf[regno+16],
|
||||
reg_names[regno+32], reg_buf[regno+32],
|
||||
|
@ -42,7 +42,7 @@ pyr_print_registers(reg_buf, regnum)
|
|||
ksp = ptrace (3, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) ((char *)&u.u_pcb.pcb_ksp) -
|
||||
((char *)&u), 0);
|
||||
printf/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n",
|
||||
printf_unfiltered/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n",
|
||||
reg_names[CSP_REGNUM],reg_buf[CSP_REGNUM],
|
||||
reg_names[KSP_REGNUM], reg_buf[KSP_REGNUM], ksp,
|
||||
"usp", usp);
|
||||
|
@ -89,7 +89,7 @@ CORE_ADDR frame_locals_address (frame)
|
|||
register int addr = find_saved_register (frame,CFP_REGNUM);
|
||||
register int result = read_memory_integer (addr, 4);
|
||||
#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (stderr,
|
||||
"\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
|
||||
frame->frame,
|
||||
reg_names[CFP_REGNUM],
|
||||
|
@ -115,7 +115,7 @@ CORE_ADDR frame_args_addr (frame)
|
|||
register int result = read_memory_integer (addr, 4);
|
||||
|
||||
#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (stderr,
|
||||
"\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
|
||||
frame->frame,
|
||||
reg_names[CFP_REGNUM],
|
||||
|
|
|
@ -49,13 +49,13 @@ fetch_inferior_registers (regno)
|
|||
reg_buf[regno] = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0);
|
||||
|
||||
#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
|
||||
printf ("Fetching register %s, got %0x\n",
|
||||
printf_unfiltered ("Fetching register %s, got %0x\n",
|
||||
reg_names[regno],
|
||||
reg_buf[regno]);
|
||||
#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
|
||||
|
||||
if (reg_buf[regno] == -1 && errno == EIO) {
|
||||
printf("fetch_interior_registers: fetching register %s\n",
|
||||
printf_unfiltered("fetch_interior_registers: fetching register %s\n",
|
||||
reg_names[regno]);
|
||||
errno = 0;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ fetch_inferior_registers (regno)
|
|||
(PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0);
|
||||
if (inferior_saved_pc > 0) break;
|
||||
#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
|
||||
printf("skipping kernel frame %08x, pc=%08x\n", datum,
|
||||
printf_unfiltered("skipping kernel frame %08x, pc=%08x\n", datum,
|
||||
inferior_saved_pc);
|
||||
#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
|
||||
skipped_frames++;
|
||||
|
@ -115,7 +115,7 @@ fetch_inferior_registers (regno)
|
|||
supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM);
|
||||
#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
|
||||
if (skipped_frames) {
|
||||
fprintf (stderr,
|
||||
fprintf_unfiltered (stderr,
|
||||
"skipped %d frames from %x to %x; cfp was %x, now %x\n",
|
||||
skipped_frames, reg_buf[CSP_REGNUM]);
|
||||
}
|
||||
|
@ -277,16 +277,16 @@ core_file_command (filename, from_tty)
|
|||
|
||||
if (*(int *)buf >= 0)
|
||||
break;
|
||||
printf ("skipping frame %s\n", local_hex_string (last_frame_address));
|
||||
printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address));
|
||||
last_frame_offset -= CONTROL_STACK_FRAME_SIZE;
|
||||
last_frame_address -= CONTROL_STACK_FRAME_SIZE;
|
||||
}
|
||||
reg_offset = last_frame_offset;
|
||||
|
||||
#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
|
||||
printf ("Control stack pointer = %s\n",
|
||||
printf_unfiltered ("Control stack pointer = %s\n",
|
||||
local_hex_string (u.u_pcb.pcb_csp));
|
||||
printf ("offset to control stack %d outermost frame %d (%s)\n",
|
||||
printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n",
|
||||
reg_stack_offset, reg_offset, local_hex_string (last_frame_address));
|
||||
#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
|
||||
|
||||
|
@ -332,7 +332,7 @@ core_file_command (filename, from_tty)
|
|||
if (val < 0)
|
||||
perror_with_name (filename);
|
||||
#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
|
||||
printf ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
|
||||
printf_unfiltered ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
|
||||
reg_names[regno], regno, filename,
|
||||
register_addr(regno, reg_offset),
|
||||
regno * 4 + last_frame_address,
|
||||
|
@ -350,7 +350,7 @@ core_file_command (filename, from_tty)
|
|||
}
|
||||
|
||||
#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
|
||||
printf ("Providing CSP (%s) as nominal address of current frame.\n",
|
||||
printf_unfiltered ("Providing CSP (%s) as nominal address of current frame.\n",
|
||||
local_hex_string(last_frame_address));
|
||||
#endif PYRAMID_CONTROL_FRAME_DEBUGGING
|
||||
/* FIXME: Which of the following is correct? */
|
||||
|
@ -366,5 +366,5 @@ core_file_command (filename, from_tty)
|
|||
validate_files ();
|
||||
}
|
||||
else if (from_tty)
|
||||
printf ("No core file now.\n");
|
||||
printf_unfiltered ("No core file now.\n");
|
||||
}
|
||||
|
|
34
gdb/regex.c
34
gdb/regex.c
|
@ -1657,21 +1657,21 @@ main (argc, argv)
|
|||
for (i = 0; i < buf.used; i++)
|
||||
printchar (buf.buffer[i]);
|
||||
|
||||
putchar ('\n');
|
||||
putchar_unfiltered ('\n');
|
||||
|
||||
printf ("%d allocated, %d used.\n", buf.allocated, buf.used);
|
||||
printf_unfiltered ("%d allocated, %d used.\n", buf.allocated, buf.used);
|
||||
|
||||
re_compile_fastmap (&buf);
|
||||
printf ("Allowed by fastmap: ");
|
||||
printf_unfiltered ("Allowed by fastmap: ");
|
||||
for (i = 0; i < (1 << BYTEWIDTH); i++)
|
||||
if (fastmap[i]) printchar (i);
|
||||
putchar ('\n');
|
||||
putchar_unfiltered ('\n');
|
||||
}
|
||||
|
||||
gets (pat); /* Now read the string to match against */
|
||||
|
||||
i = re_match (&buf, pat, strlen (pat), 0, 0);
|
||||
printf ("Match value %d.\n", i);
|
||||
printf_unfiltered ("Match value %d.\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1681,23 +1681,23 @@ print_buf (bufp)
|
|||
{
|
||||
int i;
|
||||
|
||||
printf ("buf is :\n----------------\n");
|
||||
printf_unfiltered ("buf is :\n----------------\n");
|
||||
for (i = 0; i < bufp->used; i++)
|
||||
printchar (bufp->buffer[i]);
|
||||
|
||||
printf ("\n%d allocated, %d used.\n", bufp->allocated, bufp->used);
|
||||
printf_unfiltered ("\n%d allocated, %d used.\n", bufp->allocated, bufp->used);
|
||||
|
||||
printf ("Allowed by fastmap: ");
|
||||
printf_unfiltered ("Allowed by fastmap: ");
|
||||
for (i = 0; i < (1 << BYTEWIDTH); i++)
|
||||
if (bufp->fastmap[i])
|
||||
printchar (i);
|
||||
printf ("\nAllowed by translate: ");
|
||||
printf_unfiltered ("\nAllowed by translate: ");
|
||||
if (bufp->translate)
|
||||
for (i = 0; i < (1 << BYTEWIDTH); i++)
|
||||
if (bufp->translate[i])
|
||||
printchar (i);
|
||||
printf ("\nfastmap is%s accurate\n", bufp->fastmap_accurate ? "" : "n't");
|
||||
printf ("can %s be null\n----------", bufp->can_be_null ? "" : "not");
|
||||
printf_unfiltered ("\nfastmap is%s accurate\n", bufp->fastmap_accurate ? "" : "n't");
|
||||
printf_unfiltered ("can %s be null\n----------", bufp->can_be_null ? "" : "not");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1706,19 +1706,19 @@ printchar (c)
|
|||
{
|
||||
if (c < 041 || c >= 0177)
|
||||
{
|
||||
putchar ('\\');
|
||||
putchar (((c >> 6) & 3) + '0');
|
||||
putchar (((c >> 3) & 7) + '0');
|
||||
putchar ((c & 7) + '0');
|
||||
putchar_unfiltered ('\\');
|
||||
putchar_unfiltered (((c >> 6) & 3) + '0');
|
||||
putchar_unfiltered (((c >> 3) & 7) + '0');
|
||||
putchar_unfiltered ((c & 7) + '0');
|
||||
}
|
||||
else
|
||||
putchar (c);
|
||||
putchar_unfiltered (c);
|
||||
}
|
||||
|
||||
error (string)
|
||||
char *string;
|
||||
{
|
||||
puts (string);
|
||||
puts_unfiltered (string);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ readchar ()
|
|||
error ("Timeout reading from remote system.");
|
||||
|
||||
if (!quiet)
|
||||
printf ("%c", buf);
|
||||
printf_unfiltered ("%c", buf);
|
||||
|
||||
return buf & 0x7f;
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ readchar_nofail ()
|
|||
if (buf == SERIAL_TIMEOUT)
|
||||
buf = 0;
|
||||
if (!quiet)
|
||||
printf ("%c", buf);
|
||||
printf_unfiltered ("%c", buf);
|
||||
|
||||
return buf & 0x7f;
|
||||
|
||||
|
@ -446,7 +446,7 @@ hms_load (args, fromtty)
|
|||
bfd_get_section_contents (abfd, s, buffer, i, delta);
|
||||
hms_write_inferior_memory (s->vma + i, buffer, delta);
|
||||
printf_filtered ("*");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
printf_filtered ("\n");
|
||||
free (buffer);
|
||||
|
@ -744,12 +744,12 @@ hms_wait (pid, status)
|
|||
|
||||
/* Print out any characters which have been swallowed. */
|
||||
for (p = swallowed; p < swallowed_p; ++p)
|
||||
putc (*p, stdout);
|
||||
putc_unfiltered (*p, gdb_stdout);
|
||||
swallowed_p = swallowed;
|
||||
|
||||
if ((ch != '\r' && ch != '\n') || swallowed_cr > 10)
|
||||
{
|
||||
putc (ch, stdout);
|
||||
putc_unfiltered (ch, gdb_stdout);
|
||||
swallowed_cr = 10;
|
||||
}
|
||||
swallowed_cr++;
|
||||
|
@ -847,7 +847,7 @@ hms_write (a, l)
|
|||
if (!quiet)
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
printf ("%c", a[i]);
|
||||
printf_unfiltered ("%c", a[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1215,7 +1215,7 @@ hms_before_main_loop ()
|
|||
{
|
||||
char ttyname[100];
|
||||
char *p, *p2;
|
||||
extern FILE *instream;
|
||||
extern GDB_FILE *instream;
|
||||
|
||||
push_target (&hms_ops);
|
||||
}
|
||||
|
@ -1241,7 +1241,7 @@ hms_insert_breakpoint (addr, save)
|
|||
}
|
||||
else
|
||||
{
|
||||
fprintf_filtered (stderr,
|
||||
fprintf_filtered (gdb_stderr,
|
||||
"Too many break points, break point not installed\n");
|
||||
return (1);
|
||||
}
|
||||
|
|
|
@ -378,8 +378,8 @@ mips_receive_header (hdr, pgarbage, ch, timeout)
|
|||
should be filtered? */
|
||||
if (! mips_initializing || sr_get_debug () > 0)
|
||||
{
|
||||
putchar (ch);
|
||||
fflush (stdout);
|
||||
putchar_unfiltered (ch);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
++*pgarbage;
|
||||
|
@ -911,7 +911,7 @@ device is attached to the target board (e.g., /dev/ttya).");
|
|||
mips_initialize ();
|
||||
|
||||
if (from_tty)
|
||||
printf ("Remote MIPS debugging using %s\n", name);
|
||||
printf_unfiltered ("Remote MIPS debugging using %s\n", name);
|
||||
push_target (&mips_ops); /* Switch to using remote target now */
|
||||
|
||||
/* FIXME: Should we call start_remote here? */
|
||||
|
@ -948,7 +948,7 @@ mips_detach (args, from_tty)
|
|||
|
||||
pop_target ();
|
||||
if (from_tty)
|
||||
printf ("Ending remote MIPS debugging.\n");
|
||||
printf_unfiltered ("Ending remote MIPS debugging.\n");
|
||||
}
|
||||
|
||||
/* Tell the target board to resume. This does not wait for a reply
|
||||
|
@ -1212,7 +1212,7 @@ static void
|
|||
mips_files_info (ignore)
|
||||
struct target_ops *ignore;
|
||||
{
|
||||
printf ("Debugging a MIPS board over a serial line.\n");
|
||||
printf_unfiltered ("Debugging a MIPS board over a serial line.\n");
|
||||
}
|
||||
|
||||
/* Kill the process running on the board. This will actually only
|
||||
|
|
|
@ -541,7 +541,7 @@ mm_wait (status)
|
|||
i=in_msg_buf->channel1_msg.length;
|
||||
in_msg_buf->channel1_msg.data[i] = '\0';
|
||||
printf("%s", in_msg_buf->channel1_msg.data);
|
||||
fflush(stdout);
|
||||
gdb_flush(stdout);
|
||||
/* Send CHANNEL1_ACK message */
|
||||
out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK;
|
||||
out_msg_buf->channel1_ack_msg.length = 0;
|
||||
|
|
|
@ -128,7 +128,7 @@ extern char *mktemp();
|
|||
extern void generic_mourn_inferior ();
|
||||
|
||||
extern struct target_ops nindy_ops;
|
||||
extern FILE *instream;
|
||||
extern GDB_FILE *instream;
|
||||
extern struct ext_format ext_format_i960; /* i960-tdep.c */
|
||||
|
||||
extern char ninStopWhy ();
|
||||
|
@ -227,7 +227,7 @@ nindy_detach (name, from_tty)
|
|||
static void
|
||||
nindy_files_info ()
|
||||
{
|
||||
printf("\tAttached to %s at %d bps%s%s.\n", savename,
|
||||
printf_unfiltered("\tAttached to %s at %d bps%s%s.\n", savename,
|
||||
sr_get_baud_rate(),
|
||||
nindy_old_protocol? " in old protocol": "",
|
||||
nindy_initial_brk? " with initial break": "");
|
||||
|
@ -292,7 +292,7 @@ You may need to reset the 80960 and/or reload your program.\n");
|
|||
}
|
||||
|
||||
/* Wait until the remote machine stops. While waiting, operate in passthrough
|
||||
* mode; i.e., pass everything NINDY sends to stdout, and everything from
|
||||
* mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from
|
||||
* stdin to NINDY.
|
||||
*
|
||||
* Return to caller, storing status in 'status' just as `wait' would.
|
||||
|
@ -698,8 +698,8 @@ nindy_before_main_loop ()
|
|||
|
||||
while (current_target != &nindy_ops) { /* remote tty not specified yet */
|
||||
if ( instream == stdin ){
|
||||
printf("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
|
||||
fflush( stdout );
|
||||
printf_unfiltered("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
|
||||
gdb_flush( gdb_stdout );
|
||||
}
|
||||
fgets( ttyname, sizeof(ttyname)-1, stdin );
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ sim_load_standard (abfd)
|
|||
bfd_get_section_contents (abfd, s, buffer, i, sub_delta);
|
||||
sim_write (s->vma + i, buffer, sub_delta);
|
||||
printf_filtered ("*");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
printf_filtered ("\n");
|
||||
free (buffer);
|
||||
|
|
|
@ -143,7 +143,7 @@ udi_create_inferior (execfile, args, env)
|
|||
|
||||
if (udi_session_id < 0)
|
||||
{
|
||||
printf("UDI connection not open yet.\n");
|
||||
printf_unfiltered("UDI connection not open yet.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,13 +235,13 @@ udi_open (name, from_tty)
|
|||
ChipVersions, &NumberOfChips))
|
||||
error ("UDIGetTargetConfig() failed");
|
||||
if (NumberOfChips > 2)
|
||||
fprintf(stderr,"Target has more than one processor\n");
|
||||
fprintf_unfiltered(gdb_stderr,"Target has more than one processor\n");
|
||||
for (cnt=0; cnt < NumberOfRanges; cnt++)
|
||||
{
|
||||
switch(KnownMemory[cnt].Space)
|
||||
{
|
||||
default:
|
||||
fprintf(stderr, "UDIGetTargetConfig() unknown memory space\n");
|
||||
fprintf_unfiltered(gdb_stderr, "UDIGetTargetConfig() unknown memory space\n");
|
||||
break;
|
||||
case UDI29KCP_S:
|
||||
break;
|
||||
|
@ -263,7 +263,7 @@ udi_open (name, from_tty)
|
|||
a29k_get_processor_type ();
|
||||
|
||||
if (UDICreateProcess (&PId))
|
||||
fprintf(stderr, "UDICreateProcess() failed\n");
|
||||
fprintf_unfiltered(gdb_stderr, "UDICreateProcess() failed\n");
|
||||
|
||||
/* Print out some stuff, letting the user now what's going on */
|
||||
if (UDICapabilities (&TIPId, &TargetId, DFEId, DFE, &TIP, &DFEIPCId,
|
||||
|
@ -325,14 +325,14 @@ udi_attach (args, from_tty)
|
|||
error ("UDI connection not opened yet, use the 'target udi' command.\n");
|
||||
|
||||
if (from_tty)
|
||||
printf ("Attaching to remote program %s...\n", prog_name);
|
||||
printf_unfiltered ("Attaching to remote program %s...\n", prog_name);
|
||||
|
||||
UDIStop();
|
||||
From.Space = UDI29KSpecialRegs;
|
||||
From.Offset = 11;
|
||||
if (err = UDIRead(From, &PC_adds, Count, Size, &CountDone, HostEndian))
|
||||
error ("UDIRead failed in udi_attach");
|
||||
printf ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
|
||||
printf_unfiltered ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
|
||||
}
|
||||
/************************************************************* UDI_DETACH */
|
||||
/* Terminate the open connection to the TIP process.
|
||||
|
@ -352,7 +352,7 @@ udi_detach (args,from_tty)
|
|||
pop_target(); /* calls udi_close to do the real work */
|
||||
|
||||
if (from_tty)
|
||||
printf ("Ending remote debugging\n");
|
||||
printf_unfiltered ("Ending remote debugging\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -374,7 +374,7 @@ udi_resume (pid, step, sig)
|
|||
if (!tip_error)
|
||||
return;
|
||||
|
||||
fprintf (stderr, "UDIStep() error = %d\n", tip_error);
|
||||
fprintf_unfiltered (gdb_stderr, "UDIStep() error = %d\n", tip_error);
|
||||
error ("failed in udi_resume");
|
||||
}
|
||||
|
||||
|
@ -416,19 +416,19 @@ udi_wait (pid, status)
|
|||
|
||||
switch (StopReason & UDIGrossState)
|
||||
{
|
||||
case UDIStdoutReady:
|
||||
if (UDIGetStdout (sbuf, (UDISizeT)SBUF_MAX, &CountDone))
|
||||
case UDIGdb_StdoutReady:
|
||||
if (UDIGetGdb_Stdout (sbuf, (UDISizeT)SBUF_MAX, &CountDone))
|
||||
/* This is said to happen if the program tries to output
|
||||
a whole bunch of output (more than SBUF_MAX, I would
|
||||
guess). It doesn't seem to happen with the simulator. */
|
||||
warning ("UDIGetStdout() failed in udi_wait");
|
||||
fwrite (sbuf, 1, CountDone, stdout);
|
||||
fflush(stdout);
|
||||
warning ("UDIGetGdb_Stdout() failed in udi_wait");
|
||||
fwrite (sbuf, 1, CountDone, gdb_stdout);
|
||||
gdb_flush(gdb_stdout);
|
||||
continue;
|
||||
case UDIStderrReady:
|
||||
UDIGetStderr (sbuf, (UDISizeT)SBUF_MAX, &CountDone);
|
||||
fwrite (sbuf, 1, CountDone, stderr);
|
||||
fflush(stderr);
|
||||
case UDIGdb_StderrReady:
|
||||
UDIGetGdb_Stderr (sbuf, (UDISizeT)SBUF_MAX, &CountDone);
|
||||
fwrite (sbuf, 1, CountDone, gdb_stderr);
|
||||
gdb_flush(gdb_stderr);
|
||||
continue;
|
||||
|
||||
case UDIStdinNeeded:
|
||||
|
@ -460,12 +460,12 @@ udi_wait (pid, status)
|
|||
switch (StopReason & UDIGrossState)
|
||||
{
|
||||
case UDITrapped:
|
||||
printf("Am290*0 received vector number %d\n", StopReason >> 24);
|
||||
printf_unfiltered("Am290*0 received vector number %d\n", StopReason >> 24);
|
||||
|
||||
switch (StopReason >> 8)
|
||||
{
|
||||
case 0: /* Illegal opcode */
|
||||
printf(" (break point)\n");
|
||||
printf_unfiltered(" (break point)\n");
|
||||
WSETSTOP ((*status), SIGTRAP);
|
||||
break;
|
||||
case 1: /* Unaligned Access */
|
||||
|
@ -565,12 +565,12 @@ udi_pc()
|
|||
|
||||
err = UDIRead(From, To, Count, Size, &CountDone, HostEndian);
|
||||
|
||||
printf ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n",
|
||||
printf_unfiltered ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n",
|
||||
err, CountDone, pc[0], pc[1]);
|
||||
|
||||
udi_fetch_registers(-1);
|
||||
|
||||
printf("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *)®isters[4 * PC_REGNUM],
|
||||
printf_unfiltered("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *)®isters[4 * PC_REGNUM],
|
||||
*(int *)®isters[4 * NPC_REGNUM]);
|
||||
|
||||
/* Now, read all the registers globally */
|
||||
|
@ -697,8 +697,8 @@ int regno;
|
|||
|
||||
if (remote_debug)
|
||||
{
|
||||
printf("Fetching all registers\n");
|
||||
printf("Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n",
|
||||
printf_unfiltered("Fetching all registers\n");
|
||||
printf_unfiltered("Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n",
|
||||
read_register(NPC_REGNUM), read_register(PC_REGNUM),
|
||||
read_register(PC2_REGNUM));
|
||||
}
|
||||
|
@ -738,8 +738,8 @@ int regno;
|
|||
|
||||
if (remote_debug)
|
||||
{
|
||||
printf("Storing all registers\n");
|
||||
printf("PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", read_register(NPC_REGNUM),
|
||||
printf_unfiltered("Storing all registers\n");
|
||||
printf_unfiltered("PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", read_register(NPC_REGNUM),
|
||||
read_register(PC_REGNUM), read_register(PC2_REGNUM));
|
||||
}
|
||||
|
||||
|
@ -890,7 +890,7 @@ udi_xfer_inferior_memory (memaddr, myaddr, len, write)
|
|||
static void
|
||||
udi_files_info ()
|
||||
{
|
||||
printf ("\tAttached to UDI socket to %s and running program %s.\n",
|
||||
printf_unfiltered ("\tAttached to UDI socket to %s and running program %s.\n",
|
||||
udi_config_id, prog_name);
|
||||
}
|
||||
|
||||
|
@ -968,7 +968,7 @@ just invoke udi_close, which seems to get things right.
|
|||
inferior_pid = 0;
|
||||
|
||||
if (from_tty)
|
||||
printf("Target has been stopped.");
|
||||
printf_unfiltered("Target has been stopped.");
|
||||
#else
|
||||
udi_close(0);
|
||||
#endif
|
||||
|
@ -1109,7 +1109,7 @@ download(load_arg_string, from_tty)
|
|||
below starts writing before it even checks the size. */
|
||||
continue;
|
||||
|
||||
printf("[Loading section %s at %x (%d bytes)]\n",
|
||||
printf_unfiltered("[Loading section %s at %x (%d bytes)]\n",
|
||||
section_name,
|
||||
To.Offset,
|
||||
section_size);
|
||||
|
@ -1198,9 +1198,9 @@ download(load_arg_string, from_tty)
|
|||
|
||||
xerr = UDIGetErrorMsg(err, 100, message, &Count);
|
||||
if (!xerr)
|
||||
fprintf (stderr, "Error is %s\n", message);
|
||||
fprintf_unfiltered (gdb_stderr, "Error is %s\n", message);
|
||||
else
|
||||
fprintf (stderr, "xerr is %d\n", xerr);
|
||||
fprintf_unfiltered (gdb_stderr, "xerr is %d\n", xerr);
|
||||
error ("UDICopy failed, error = %d", err);
|
||||
}
|
||||
}
|
||||
|
@ -1371,7 +1371,7 @@ fetch_register (regno)
|
|||
supply_register(regno, (char *) &To);
|
||||
|
||||
if (remote_debug)
|
||||
printf("Fetching register %s = 0x%x\n", reg_names[regno], To);
|
||||
printf_unfiltered("Fetching register %s = 0x%x\n", reg_names[regno], To);
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/* Store a single register indicated by 'regno'.
|
||||
|
@ -1392,7 +1392,7 @@ store_register (regno)
|
|||
From = read_register (regno); /* get data value */
|
||||
|
||||
if (remote_debug)
|
||||
printf("Storing register %s = 0x%x\n", reg_names[regno], From);
|
||||
printf_unfiltered("Storing register %s = 0x%x\n", reg_names[regno], From);
|
||||
|
||||
if (regno == GR1_REGNUM)
|
||||
{
|
||||
|
@ -1526,7 +1526,7 @@ CORE_ADDR addr;
|
|||
|
||||
void convert16() {;}
|
||||
void convert32() {;}
|
||||
FILE* EchoFile = 0; /* used for debugging */
|
||||
GDB_FILE * EchoFile = 0; /* used for debugging */
|
||||
int QuietMode = 0; /* used for debugging */
|
||||
|
||||
#ifdef NO_HIF_SUPPORT
|
||||
|
|
|
@ -76,7 +76,7 @@ usage(proto, junk)
|
|||
char *junk;
|
||||
{
|
||||
if (junk != NULL)
|
||||
fprintf(stderr, "Unrecognized arguments: `%s'.\n", junk);
|
||||
fprintf_unfiltered(gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
|
||||
|
||||
/* FIXME-now: service@host? */
|
||||
|
||||
|
@ -217,7 +217,7 @@ sr_readchar ()
|
|||
error ("Timeout reading from remote system.");
|
||||
|
||||
if (sr_get_debug() > 0)
|
||||
printf ("%c", buf);
|
||||
printf_unfiltered ("%c", buf);
|
||||
|
||||
return buf & 0x7f;
|
||||
}
|
||||
|
@ -232,9 +232,9 @@ sr_pollchar()
|
|||
buf = 0;
|
||||
if (sr_get_debug() > 0)
|
||||
if (buf)
|
||||
printf ("%c", buf);
|
||||
printf_unfiltered ("%c", buf);
|
||||
else
|
||||
printf ("<empty character poll>");
|
||||
printf_unfiltered ("<empty character poll>");
|
||||
|
||||
return buf & 0x7f;
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ sr_write (a, l)
|
|||
|
||||
if (sr_get_debug() > 0)
|
||||
for (i = 0; i < l; i++)
|
||||
printf ("%c", a[i]);
|
||||
printf_unfiltered ("%c", a[i]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -573,9 +573,9 @@ gr_multi_scan (list, passthrough)
|
|||
if (passthrough)
|
||||
{
|
||||
for (p = swallowed; p < swallowed_p; ++p)
|
||||
putc (*p, stdout);
|
||||
putc_unfiltered (*p, gdb_stdout);
|
||||
|
||||
putc (ch, stdout);
|
||||
putc_unfiltered (ch, gdb_stdout);
|
||||
}
|
||||
|
||||
swallowed_p = swallowed;
|
||||
|
|
|
@ -557,20 +557,20 @@ vx_xfer_memory (memaddr, myaddr, len, write, target)
|
|||
static void
|
||||
vx_files_info ()
|
||||
{
|
||||
printf ("\tAttached to host `%s'", vx_host);
|
||||
printf (", which has %sfloating point", target_has_fp? "": "no ");
|
||||
printf (".\n");
|
||||
printf_unfiltered ("\tAttached to host `%s'", vx_host);
|
||||
printf_unfiltered (", which has %sfloating point", target_has_fp? "": "no ");
|
||||
printf_unfiltered (".\n");
|
||||
}
|
||||
|
||||
static void
|
||||
vx_run_files_info ()
|
||||
{
|
||||
printf ("\tRunning %s VxWorks process %s",
|
||||
printf_unfiltered ("\tRunning %s VxWorks process %s",
|
||||
vx_running? "child": "attached",
|
||||
local_hex_string((unsigned long) inferior_pid));
|
||||
if (vx_running)
|
||||
printf (", function `%s'", vx_running);
|
||||
printf(".\n");
|
||||
printf_unfiltered (", function `%s'", vx_running);
|
||||
printf_unfiltered(".\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -974,9 +974,9 @@ add_symbol_stub (arg)
|
|||
{
|
||||
struct ldfile *pLoadFile = (struct ldfile *)arg;
|
||||
|
||||
printf("\t%s: ", pLoadFile->name);
|
||||
printf_unfiltered("\t%s: ", pLoadFile->name);
|
||||
symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0, 0, 0);
|
||||
printf ("ok\n");
|
||||
printf_unfiltered ("ok\n");
|
||||
return 1;
|
||||
}
|
||||
/* Target command for VxWorks target systems.
|
||||
|
@ -1004,8 +1004,8 @@ vx_open (args, from_tty)
|
|||
target_preopen (from_tty);
|
||||
|
||||
unpush_target (&vx_ops);
|
||||
printf ("Attaching remote machine across net...\n");
|
||||
fflush (stdout);
|
||||
printf_unfiltered ("Attaching remote machine across net...\n");
|
||||
gdb_flush (gdb_stdout);
|
||||
|
||||
/* Allow the user to kill the connect attempt by typing ^C.
|
||||
Wait until the call to target_has_fp () completes before
|
||||
|
@ -1039,7 +1039,7 @@ vx_open (args, from_tty)
|
|||
"Error while reading symbols from boot file:\n", RETURN_MASK_ALL))
|
||||
puts_filtered ("ok\n");
|
||||
} else if (from_tty)
|
||||
printf ("VxWorks kernel symbols not loaded.\n");
|
||||
printf_unfiltered ("VxWorks kernel symbols not loaded.\n");
|
||||
}
|
||||
else
|
||||
error ("Can't retrieve boot file name from target machine.");
|
||||
|
@ -1103,7 +1103,7 @@ vx_attach (args, from_tty)
|
|||
error ("Invalid process-id -- give a single number in decimal or 0xhex");
|
||||
|
||||
if (from_tty)
|
||||
printf ("Attaching pid %s.\n",
|
||||
printf_unfiltered ("Attaching pid %s.\n",
|
||||
local_hex_string((unsigned long) pid));
|
||||
|
||||
memset ((char *)&ptrace_in, '\0', sizeof (ptrace_in));
|
||||
|
@ -1149,7 +1149,7 @@ vx_detach (args, from_tty)
|
|||
error ("Argument given to VxWorks \"detach\".");
|
||||
|
||||
if (from_tty)
|
||||
printf ("Detaching pid %s.\n",
|
||||
printf_unfiltered ("Detaching pid %s.\n",
|
||||
local_hex_string((unsigned long) inferior_pid));
|
||||
|
||||
if (args) /* FIXME, should be possible to leave suspended */
|
||||
|
@ -1181,7 +1181,7 @@ vx_kill ()
|
|||
Ptrace_return ptrace_out;
|
||||
int status;
|
||||
|
||||
printf ("Killing pid %s.\n", local_hex_string((unsigned long) inferior_pid));
|
||||
printf_unfiltered ("Killing pid %s.\n", local_hex_string((unsigned long) inferior_pid));
|
||||
|
||||
memset ((char *)&ptrace_in, '\0', sizeof (ptrace_in));
|
||||
memset ((char *)&ptrace_out, '\0', sizeof (ptrace_out));
|
||||
|
|
|
@ -125,7 +125,7 @@ sim_load (args, fromtty)
|
|||
bfd_get_section_contents (abfd, s, buffer, i, sub_delta);
|
||||
sim_write_inferior_memory (s->vma + i, buffer, sub_delta);
|
||||
printf_filtered ("*");
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
printf_filtered ("\n");
|
||||
free (buffer);
|
||||
|
|
14
gdb/remote.c
14
gdb/remote.c
|
@ -417,7 +417,7 @@ remote_interrupt (signo)
|
|||
signal (signo, remote_interrupt_twice);
|
||||
|
||||
if (remote_debug)
|
||||
printf ("remote_interrupt called\n");
|
||||
printf_unfiltered ("remote_interrupt called\n");
|
||||
|
||||
SERIAL_WRITE (remote_desc, "\003", 1); /* Send a ^C */
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ remote_fetch_registers (regno)
|
|||
&& (buf[0] < 'a' || buf[0] > 'f'))
|
||||
{
|
||||
if (remote_debug)
|
||||
printf ("Bad register packet; fetching a new packet\n");
|
||||
printf_unfiltered ("Bad register packet; fetching a new packet\n");
|
||||
getpkt (buf, 0);
|
||||
}
|
||||
|
||||
|
@ -997,7 +997,7 @@ putpkt (buf)
|
|||
if (remote_debug)
|
||||
{
|
||||
*p = '\0';
|
||||
printf ("Sending packet: %s...", buf2); fflush(stdout);
|
||||
printf_unfiltered ("Sending packet: %s...", buf2); gdb_flush(gdb_stdout);
|
||||
}
|
||||
if (SERIAL_WRITE (remote_desc, buf2, p - buf2))
|
||||
perror_with_name ("putpkt: write failed");
|
||||
|
@ -1011,7 +1011,7 @@ putpkt (buf)
|
|||
{
|
||||
case '+':
|
||||
if (remote_debug)
|
||||
printf("Ack\n");
|
||||
printf_unfiltered("Ack\n");
|
||||
return;
|
||||
case SERIAL_TIMEOUT:
|
||||
break; /* Retransmit buffer */
|
||||
|
@ -1021,7 +1021,7 @@ putpkt (buf)
|
|||
error ("putpkt: EOF while trying to read ACK");
|
||||
default:
|
||||
if (remote_debug)
|
||||
printf ("%02X %c ", ch&0xFF, ch);
|
||||
printf_unfiltered ("%02X %c ", ch&0xFF, ch);
|
||||
continue;
|
||||
}
|
||||
break; /* Here to retransmit */
|
||||
|
@ -1133,7 +1133,7 @@ whole:
|
|||
}
|
||||
else
|
||||
{
|
||||
printf ("Ignoring packet error, continuing...\n");
|
||||
printf_unfiltered ("Ignoring packet error, continuing...\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ out:
|
|||
SERIAL_WRITE (remote_desc, "+", 1);
|
||||
|
||||
if (remote_debug)
|
||||
fprintf (stderr,"Packet received: %s\n", buf);
|
||||
fprintf_unfiltered (gdb_stderr,"Packet received: %s\n", buf);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -102,7 +102,7 @@ fetch_inferior_registers (regno)
|
|||
(PTRACE_ARG3_TYPE) special_regs[regno-FIRST_SP_REGNUM], 0, 0);
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "gdb error: register no %d not implemented.\n", regno);
|
||||
fprintf_unfiltered (gdb_stderr, "gdb error: register no %d not implemented.\n", regno);
|
||||
|
||||
register_valid [regno] = 1;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ store_inferior_registers (regno)
|
|||
}
|
||||
|
||||
else
|
||||
fprintf (stderr, "Gdb error: register no %d not implemented.\n", regno);
|
||||
fprintf_unfiltered (gdb_stderr, "Gdb error: register no %d not implemented.\n", regno);
|
||||
|
||||
if ( errno ) {
|
||||
perror ("ptrace write"); errno = 0;
|
||||
|
@ -244,5 +244,5 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
|
|||
memcpy (®isters [REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 32 * 8);
|
||||
|
||||
else
|
||||
fprintf (stderr, "Gdb error: unknown parameter to fetch_core_registers().\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Gdb error: unknown parameter to fetch_core_registers().\n");
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int pop, eop, probable_eop; /* primary and extended opcodes */
|
||||
int min, max;
|
||||
|
@ -108,7 +108,7 @@ insn_found:
|
|||
return 4;
|
||||
|
||||
not_found:
|
||||
fprintf (stream, "0x%08x", the_insn);
|
||||
fprintf_unfiltered (stream, "0x%08x", the_insn);
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ int insn_no;
|
|||
}
|
||||
*qq = '\0';
|
||||
|
||||
fprintf (stream, "%s%s\t", rs6k_ops[insn_no].operator, buf);
|
||||
fprintf_unfiltered (stream, "%s%s\t", rs6k_ops[insn_no].operator, buf);
|
||||
|
||||
/* parse the operand now. */
|
||||
pp = rs6k_ops[insn_no].oprnd_format;
|
||||
|
@ -192,12 +192,12 @@ int insn_no;
|
|||
while (*pp != 0) {
|
||||
switch (*pp) {
|
||||
case TO :
|
||||
fprintf (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
break;
|
||||
|
||||
case RT :
|
||||
case RS :
|
||||
fprintf (stream, "r%d", (insn_word >> 21) & 0x1f);
|
||||
fprintf_unfiltered (stream, "r%d", (insn_word >> 21) & 0x1f);
|
||||
break;
|
||||
|
||||
case LI :
|
||||
|
@ -212,16 +212,16 @@ int insn_no;
|
|||
and disassembler is to switch to a match/lose style opcode
|
||||
table like the sparc. */
|
||||
if (tmp > 11) {
|
||||
fprintf (stream, "{unknown cond code: 0x%x}", insn_word);
|
||||
fprintf_unfiltered (stream, "{unknown cond code: 0x%x}", insn_word);
|
||||
tmp = 0;
|
||||
}
|
||||
fprintf (stream, "%s", cond_code [tmp]);
|
||||
fprintf_unfiltered (stream, "%s", cond_code [tmp]);
|
||||
#else
|
||||
/* So for just always use the "bbf/bbt" form. This is perfectly
|
||||
correct, just not necessarily as legible.
|
||||
|
||||
If tmp is not in the range 0-3, we can't use an XX form anyway. */
|
||||
fprintf (stream, "%d", tmp);
|
||||
fprintf_unfiltered (stream, "%d", tmp);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
@ -253,7 +253,7 @@ int insn_no;
|
|||
nocomma = 1;
|
||||
}
|
||||
else
|
||||
fprintf (stream, "%d", (insn_word >> 5) & 0x7f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 5) & 0x7f);
|
||||
break;
|
||||
|
||||
case FL1 : /* for svc only */
|
||||
|
@ -261,83 +261,83 @@ int insn_no;
|
|||
nocomma = 1;
|
||||
}
|
||||
else
|
||||
fprintf (stream, "%d", (insn_word >> 12) & 0xf);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 12) & 0xf);
|
||||
break;
|
||||
|
||||
case FL2 : /* for svc only */
|
||||
nocomma = 0;
|
||||
if (insn_word & 0x2) /* SA is set */
|
||||
fprintf (stream, "%d", (insn_word >> 2) & 0x3fff);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 2) & 0x3fff);
|
||||
else
|
||||
fprintf (stream, "%d", (insn_word >> 2) & 0x7);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 2) & 0x7);
|
||||
break;
|
||||
|
||||
case RA :
|
||||
if (nocomma) {
|
||||
fprintf (stream, "r%d)", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "r%d)", (insn_word >> 16) & 0x1f);
|
||||
nocomma = 0;
|
||||
}
|
||||
else
|
||||
fprintf (stream, "r%d", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "r%d", (insn_word >> 16) & 0x1f);
|
||||
break;
|
||||
|
||||
case RB :
|
||||
fprintf (stream, "r%d", (insn_word >> 11) & 0x1f);
|
||||
fprintf_unfiltered (stream, "r%d", (insn_word >> 11) & 0x1f);
|
||||
break;
|
||||
|
||||
case SI :
|
||||
tmp = insn_word & 0xffff;
|
||||
if (tmp & 0x8000)
|
||||
tmp -= 0x10000;
|
||||
fprintf (stream, "%d", tmp);
|
||||
fprintf_unfiltered (stream, "%d", tmp);
|
||||
break;
|
||||
|
||||
case UI :
|
||||
fprintf (stream, "%d", insn_word & 0xffff);
|
||||
fprintf_unfiltered (stream, "%d", insn_word & 0xffff);
|
||||
break;
|
||||
|
||||
case BF :
|
||||
fprintf (stream, "%d", (insn_word >> 23) & 0x7);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 23) & 0x7);
|
||||
break;
|
||||
|
||||
case BFA :
|
||||
fprintf (stream, "%d", (insn_word >> 18) & 0x7);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 18) & 0x7);
|
||||
break;
|
||||
|
||||
case BT :
|
||||
fprintf (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
break;
|
||||
|
||||
case BA :
|
||||
fprintf (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
break;
|
||||
|
||||
case BB :
|
||||
fprintf (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
break;
|
||||
|
||||
case BO :
|
||||
fprintf (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 21) & 0x1f);
|
||||
break;
|
||||
|
||||
case BI :
|
||||
fprintf (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
break;
|
||||
|
||||
case SH :
|
||||
fprintf (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
break;
|
||||
|
||||
case MB :
|
||||
fprintf (stream, "0x%x", (insn_word >> 6) & 0x1f);
|
||||
fprintf_unfiltered (stream, "0x%x", (insn_word >> 6) & 0x1f);
|
||||
break;
|
||||
|
||||
case ME :
|
||||
fprintf (stream, "0x%x", (insn_word >> 1) & 0x1f);
|
||||
fprintf_unfiltered (stream, "0x%x", (insn_word >> 1) & 0x1f);
|
||||
break;
|
||||
|
||||
case SPR :
|
||||
fprintf (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 16) & 0x1f);
|
||||
break;
|
||||
|
||||
case DIS :
|
||||
|
@ -345,50 +345,50 @@ int insn_no;
|
|||
tmp = insn_word & 0xffff;
|
||||
if (tmp & 0x8000)
|
||||
tmp -= 0x10000;
|
||||
fprintf (stream, "%d(", tmp);
|
||||
fprintf_unfiltered (stream, "%d(", tmp);
|
||||
break;
|
||||
|
||||
case FXM :
|
||||
fprintf (stream, "0x%x", (insn_word >> 12) & 0xff);
|
||||
fprintf_unfiltered (stream, "0x%x", (insn_word >> 12) & 0xff);
|
||||
break;
|
||||
|
||||
case FRT :
|
||||
case FRS :
|
||||
fprintf (stream, "f%d", (insn_word >> 21) & 0x1f);
|
||||
fprintf_unfiltered (stream, "f%d", (insn_word >> 21) & 0x1f);
|
||||
break;
|
||||
|
||||
case FRA :
|
||||
fprintf (stream, "f%d", (insn_word >> 16) & 0x1f);
|
||||
fprintf_unfiltered (stream, "f%d", (insn_word >> 16) & 0x1f);
|
||||
break;
|
||||
|
||||
case FRB :
|
||||
fprintf (stream, "f%d", (insn_word >> 11) & 0x1f);
|
||||
fprintf_unfiltered (stream, "f%d", (insn_word >> 11) & 0x1f);
|
||||
break;
|
||||
|
||||
case FRC :
|
||||
fprintf (stream, "f%d", (insn_word >> 6) & 0x1f);
|
||||
fprintf_unfiltered (stream, "f%d", (insn_word >> 6) & 0x1f);
|
||||
break;
|
||||
|
||||
case FLM :
|
||||
fprintf (stream, "0x%x", (insn_word >> 17) & 0xff);
|
||||
fprintf_unfiltered (stream, "0x%x", (insn_word >> 17) & 0xff);
|
||||
break;
|
||||
|
||||
case NB :
|
||||
fprintf (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 11) & 0x1f);
|
||||
break;
|
||||
|
||||
case I :
|
||||
fprintf (stream, "%d", (insn_word >> 12) & 0xf);
|
||||
fprintf_unfiltered (stream, "%d", (insn_word >> 12) & 0xf);
|
||||
break;
|
||||
|
||||
default :
|
||||
fprintf (stream,
|
||||
fprintf_unfiltered (stream,
|
||||
"{Internal error: Unknown operand format identifier %d}",
|
||||
*pp);
|
||||
}
|
||||
++pp;
|
||||
|
||||
if (*pp != '\0' && !nocomma)
|
||||
fputc(',', stream);
|
||||
fputc_unfiltered(',', stream);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -645,7 +645,7 @@ function_frame_info (pc, fdata)
|
|||
if (tmp == 0x93e1) {
|
||||
if (fdata->offset)
|
||||
/* fatal ("Unrecognized prolog."); */
|
||||
printf ("Unrecognized prolog!\n");
|
||||
printf_unfiltered ("Unrecognized prolog!\n");
|
||||
|
||||
fdata->saved_gpr = 31;
|
||||
tmp2 = op & 0xffff;
|
||||
|
@ -719,7 +719,7 @@ push_arguments (nargs, args, sp, struct_return, struct_addr)
|
|||
CORE_ADDR saved_sp, pc;
|
||||
|
||||
if ( dummy_frame_count <= 0)
|
||||
printf ("FATAL ERROR -push_arguments()! frame not found!!\n");
|
||||
printf_unfiltered ("FATAL ERROR -push_arguments()! frame not found!!\n");
|
||||
|
||||
/* The first eight words of ther arguments are passed in registers. Copy
|
||||
them appropriately.
|
||||
|
@ -743,7 +743,7 @@ push_arguments (nargs, args, sp, struct_return, struct_addr)
|
|||
there is no way we would run out of them. */
|
||||
|
||||
if (len > 8)
|
||||
printf (
|
||||
printf_unfiltered (
|
||||
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
|
||||
|
||||
memcpy (®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], VALUE_CONTENTS (arg),
|
||||
|
@ -834,7 +834,7 @@ ran_out_of_registers_for_arguments:
|
|||
if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FLT && f_argno < 13) {
|
||||
|
||||
if (len > 8)
|
||||
printf (
|
||||
printf_unfiltered (
|
||||
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
|
||||
|
||||
memcpy (®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], VALUE_CONTENTS (arg),
|
||||
|
|
|
@ -183,7 +183,7 @@ dos_async_rx()
|
|||
while (!dos_async_ready())
|
||||
if (kbhit())
|
||||
{
|
||||
printf("abort!\n");
|
||||
printf_unfiltered("abort!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ tcp_open(scb, name)
|
|||
|
||||
if (!hostent)
|
||||
{
|
||||
fprintf (stderr, "%s: unknown host\n", hostname);
|
||||
fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname);
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -354,7 +354,7 @@ hardwire_raw(scb)
|
|||
struct hardwire_ttystate state;
|
||||
|
||||
if (get_tty_state(scb, &state))
|
||||
fprintf(stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
|
||||
fprintf_unfiltered(gdb_stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
state.termios.c_iflag = 0;
|
||||
|
@ -384,7 +384,7 @@ hardwire_raw(scb)
|
|||
scb->current_timeout = 0;
|
||||
|
||||
if (set_tty_state (scb, &state))
|
||||
fprintf(stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
|
||||
fprintf_unfiltered(gdb_stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
|
||||
}
|
||||
|
||||
/* Wait for input on scb, with timeout seconds. Returns 0 on success,
|
||||
|
@ -440,7 +440,7 @@ wait_for(scb, timeout)
|
|||
struct hardwire_ttystate state;
|
||||
|
||||
if (get_tty_state(scb, &state))
|
||||
fprintf(stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
|
||||
fprintf_unfiltered(gdb_stderr, "get_tty_state failed: %s\n", safe_strerror(errno));
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
state.termios.c_cc[VTIME] = timeout * 10;
|
||||
|
@ -453,7 +453,7 @@ wait_for(scb, timeout)
|
|||
scb->current_timeout = timeout;
|
||||
|
||||
if (set_tty_state (scb, &state))
|
||||
fprintf(stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
|
||||
fprintf_unfiltered(gdb_stderr, "set_tty_state failed: %s\n", safe_strerror(errno));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ static void
|
|||
cleanup_tty(ttystate)
|
||||
serial_ttystate ttystate;
|
||||
{
|
||||
printf ("\r\n[Exiting connect mode]\r\n");
|
||||
printf_unfiltered ("\r\n[Exiting connect mode]\r\n");
|
||||
SERIAL_SET_TTY_STATE (tty_desc, ttystate);
|
||||
free (ttystate);
|
||||
SERIAL_CLOSE (tty_desc);
|
||||
|
@ -171,9 +171,9 @@ connect_command (args, fromtty)
|
|||
dont_repeat();
|
||||
|
||||
if (args)
|
||||
fprintf(stderr, "This command takes no args. They have been ignored.\n");
|
||||
fprintf_unfiltered(gdb_stderr, "This command takes no args. They have been ignored.\n");
|
||||
|
||||
printf("[Entering connect mode. Use ~. or ~^D to escape]\n");
|
||||
printf_unfiltered("[Entering connect mode. Use ~. or ~^D to escape]\n");
|
||||
|
||||
tty_desc = SERIAL_FDOPEN (0);
|
||||
port_desc = last_serial_opened;
|
||||
|
|
|
@ -75,7 +75,7 @@ sh_skip_prologue (start_pc)
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
GDB_INIT_DISASSEMBLE_INFO (info, stream);
|
||||
|
|
37
gdb/source.c
37
gdb/source.c
|
@ -363,7 +363,7 @@ mod_path (dirname, which_path)
|
|||
if (stat (name, &st) < 0)
|
||||
{
|
||||
int save_errno = errno;
|
||||
fprintf (stderr, "Warning: ");
|
||||
fprintf_unfiltered (gdb_stderr, "Warning: ");
|
||||
print_sys_errmsg (name, save_errno);
|
||||
}
|
||||
else if ((st.st_mode & S_IFMT) != S_IFDIR)
|
||||
|
@ -804,10 +804,10 @@ identify_source_line (s, line, mid_statement, pc)
|
|||
if (line > s->nlines)
|
||||
/* Don't index off the end of the line_charpos array. */
|
||||
return 0;
|
||||
printf ("\032\032%s:%d:%d:%s:0x%x\n", s->fullname,
|
||||
printf_unfiltered ("\032\032%s:%d:%d:%s:0x%lx\n", s->fullname,
|
||||
line, s->line_charpos[line - 1],
|
||||
mid_statement ? "middle" : "beg",
|
||||
pc);
|
||||
(unsigned long) pc);
|
||||
current_source_line = line;
|
||||
first_line_listed = line;
|
||||
last_line_listed = line;
|
||||
|
@ -961,7 +961,7 @@ list_command (arg, from_tty)
|
|||
dummy_beg = 1;
|
||||
else
|
||||
{
|
||||
sals = decode_line_1 (&arg1, 0, 0, 0);
|
||||
sals = decode_line_1 (&arg1, 0, 0, 0, 0);
|
||||
|
||||
if (! sals.nelts) return; /* C++ */
|
||||
if (sals.nelts > 1)
|
||||
|
@ -993,9 +993,9 @@ list_command (arg, from_tty)
|
|||
else
|
||||
{
|
||||
if (dummy_beg)
|
||||
sals_end = decode_line_1 (&arg1, 0, 0, 0);
|
||||
sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
|
||||
else
|
||||
sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line);
|
||||
sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
|
||||
if (sals_end.nelts == 0)
|
||||
return;
|
||||
if (sals_end.nelts > 1)
|
||||
|
@ -1025,17 +1025,19 @@ list_command (arg, from_tty)
|
|||
if (*arg == '*')
|
||||
{
|
||||
if (sal.symtab == 0)
|
||||
error ("No source file for address %s.", local_hex_string(sal.pc));
|
||||
error ("No source file for address %s.",
|
||||
local_hex_string((unsigned long) sal.pc));
|
||||
sym = find_pc_function (sal.pc);
|
||||
if (sym)
|
||||
{
|
||||
printf_filtered ("%s is in ", local_hex_string(sal.pc));
|
||||
fputs_filtered (SYMBOL_SOURCE_NAME (sym), stdout);
|
||||
printf_filtered ("%s is in ",
|
||||
local_hex_string((unsigned long) sal.pc));
|
||||
fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
|
||||
printf_filtered (" (%s:%d).\n", sal.symtab->filename, sal.line);
|
||||
}
|
||||
else
|
||||
printf_filtered ("%s is at %s:%d.\n",
|
||||
local_hex_string(sal.pc),
|
||||
local_hex_string((unsigned long) sal.pc),
|
||||
sal.symtab->filename, sal.line);
|
||||
}
|
||||
|
||||
|
@ -1116,7 +1118,7 @@ line_info (arg, from_tty)
|
|||
address. */
|
||||
printf_filtered (" for address ");
|
||||
wrap_here (" ");
|
||||
print_address (sal.pc, stdout);
|
||||
print_address (sal.pc, gdb_stdout);
|
||||
}
|
||||
else
|
||||
printf_filtered (".");
|
||||
|
@ -1131,7 +1133,7 @@ line_info (arg, from_tty)
|
|||
sal.line, sal.symtab->filename);
|
||||
wrap_here (" ");
|
||||
printf_filtered (" is at address ");
|
||||
print_address (start_pc, stdout);
|
||||
print_address (start_pc, gdb_stdout);
|
||||
wrap_here (" ");
|
||||
printf_filtered (" but contains no code.\n");
|
||||
}
|
||||
|
@ -1141,10 +1143,10 @@ line_info (arg, from_tty)
|
|||
sal.line, sal.symtab->filename);
|
||||
wrap_here (" ");
|
||||
printf_filtered (" starts at address ");
|
||||
print_address (start_pc, stdout);
|
||||
print_address (start_pc, gdb_stdout);
|
||||
wrap_here (" ");
|
||||
printf_filtered (" and ends at ");
|
||||
print_address (end_pc, stdout);
|
||||
print_address (end_pc, gdb_stdout);
|
||||
printf_filtered (".\n");
|
||||
}
|
||||
|
||||
|
@ -1166,6 +1168,7 @@ line_info (arg, from_tty)
|
|||
printf_filtered ("Line number %d is out of range for \"%s\".\n",
|
||||
sal.line, sal.symtab->filename);
|
||||
}
|
||||
free (sals.sals);
|
||||
}
|
||||
|
||||
/* Commands to search the source file for a regexp. */
|
||||
|
@ -1328,6 +1331,12 @@ _initialize_source ()
|
|||
current_source_symtab = 0;
|
||||
init_source_path ();
|
||||
|
||||
/* The intention is to use POSIX Basic Regular Expressions.
|
||||
Always use the GNU regex routine for consistency across all hosts.
|
||||
Our current GNU regex.c does not have all the POSIX features, so this is
|
||||
just an approximation. */
|
||||
re_set_syntax (RE_SYNTAX_GREP);
|
||||
|
||||
c = add_cmd ("directory", class_files, directory_command,
|
||||
"Add directory DIR to beginning of search path for source files.\n\
|
||||
Forget cached info on source file locations and line positions.\n\
|
||||
|
|
|
@ -89,7 +89,7 @@ sparc64_single_step (ignore)
|
|||
npc4 = next_pc + 4; /* branch not taken */
|
||||
|
||||
target_insert_breakpoint (next_pc, break_mem[0]);
|
||||
/* printf ("set break at %x\n",next_pc); */
|
||||
/* printf_unfiltered ("set break at %x\n",next_pc); */
|
||||
|
||||
pc = read_register (PC_REGNUM);
|
||||
pc_instruction = read_memory_integer (pc, sizeof(pc_instruction));
|
||||
|
@ -256,7 +256,7 @@ dump_ccreg (reg, val)
|
|||
char *reg;
|
||||
int val;
|
||||
{
|
||||
printf ("%s:%s,%s,%s,%s", reg,
|
||||
printf_unfiltered ("%s:%s,%s,%s,%s", reg,
|
||||
val & 8 ? "N" : "NN",
|
||||
val & 4 ? "Z" : "NZ",
|
||||
val & 2 ? "O" : "NO",
|
||||
|
@ -274,16 +274,16 @@ sparc_print_register_hook (regno)
|
|||
char doublereg[8]; /* two float regs */
|
||||
if (!read_relative_register_raw_bytes ((regno), doublereg))
|
||||
{
|
||||
printf("\t");
|
||||
print_floating (doublereg, builtin_type_double, stdout);
|
||||
printf_unfiltered("\t");
|
||||
print_floating (doublereg, builtin_type_double, gdb_stdout);
|
||||
}
|
||||
}
|
||||
else if ((regno) == CCR_REGNUM)
|
||||
{
|
||||
int ccr = read_register (CCR_REGNUM);
|
||||
printf("\t");
|
||||
printf_unfiltered("\t");
|
||||
dump_ccreg ("xcc", ccr >> 4);
|
||||
printf(", ");
|
||||
printf_unfiltered(", ");
|
||||
dump_ccreg ("icc", ccr & 15);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ fetch_inferior_registers (regno)
|
|||
CORE_ADDR sp = *(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)];
|
||||
i = REGISTER_BYTE (regno);
|
||||
if (register_valid[regno])
|
||||
printf("register %d valid and read\n", regno);
|
||||
printf_unfiltered("register %d valid and read\n", regno);
|
||||
target_xfer_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
|
||||
®isters[i], REGISTER_RAW_SIZE (regno), 0);
|
||||
register_valid[regno] = 1;
|
||||
|
@ -278,8 +278,8 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
|
|||
if (0 != target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)],
|
||||
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
|
||||
{
|
||||
/* fprintf so user can still use gdb */
|
||||
fprintf (stderr,
|
||||
/* fprintf_unfiltered so user can still use gdb */
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
"Couldn't read input and local registers from core file\n");
|
||||
}
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
|
|||
sizeof (FPU_FSR_TYPE));
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "Couldn't read float regs from core file\n");
|
||||
fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
int
|
||||
print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
FILE *stream;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
disassemble_info info;
|
||||
|
||||
|
|
73
gdb/stack.c
73
gdb/stack.c
|
@ -56,7 +56,7 @@ static void
|
|||
args_info PARAMS ((char *, int));
|
||||
|
||||
static void
|
||||
print_frame_arg_vars PARAMS ((FRAME, FILE *));
|
||||
print_frame_arg_vars PARAMS ((FRAME, GDB_FILE *));
|
||||
|
||||
static void
|
||||
catch_info PARAMS ((char *, int));
|
||||
|
@ -65,16 +65,16 @@ static void
|
|||
locals_info PARAMS ((char *, int));
|
||||
|
||||
static void
|
||||
print_frame_label_vars PARAMS ((FRAME, int, FILE *));
|
||||
print_frame_label_vars PARAMS ((FRAME, int, GDB_FILE *));
|
||||
|
||||
static void
|
||||
print_frame_local_vars PARAMS ((FRAME, FILE *));
|
||||
print_frame_local_vars PARAMS ((FRAME, GDB_FILE *));
|
||||
|
||||
static int
|
||||
print_block_frame_labels PARAMS ((struct block *, int *, FILE *));
|
||||
print_block_frame_labels PARAMS ((struct block *, int *, GDB_FILE *));
|
||||
|
||||
static int
|
||||
print_block_frame_locals PARAMS ((struct block *, FRAME, FILE *));
|
||||
print_block_frame_locals PARAMS ((struct block *, FRAME, GDB_FILE *));
|
||||
|
||||
static void
|
||||
backtrace_command PARAMS ((char *, int));
|
||||
|
@ -107,6 +107,25 @@ int selected_frame_level;
|
|||
int frame_file_full_name = 0;
|
||||
|
||||
|
||||
struct print_stack_frame_args {
|
||||
struct frame_info *fi;
|
||||
int level;
|
||||
int source;
|
||||
int args;
|
||||
};
|
||||
|
||||
static int print_stack_frame_stub PARAMS ((char *));
|
||||
|
||||
/* Pass the args the way catch_errors wants them. */
|
||||
static int
|
||||
print_stack_frame_stub (args)
|
||||
char *args;
|
||||
{
|
||||
struct print_stack_frame_args *p = (struct print_stack_frame_args *)args;
|
||||
print_frame_info (p->fi, p->level, p->source, p->args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Print a stack frame briefly. FRAME should be the frame id
|
||||
and LEVEL should be its level in the stack (or -1 for level not defined).
|
||||
This prints the level, the function executing, the arguments,
|
||||
|
@ -123,11 +142,14 @@ print_stack_frame (frame, level, source)
|
|||
int level;
|
||||
int source;
|
||||
{
|
||||
struct frame_info *fi;
|
||||
struct print_stack_frame_args args;
|
||||
|
||||
fi = get_frame_info (frame);
|
||||
args.fi = get_frame_info (frame);
|
||||
args.level = level;
|
||||
args.source = source;
|
||||
args.args = 1;
|
||||
|
||||
print_frame_info (fi, level, source, 1);
|
||||
catch_errors (print_stack_frame_stub, (char *)&args, "", RETURN_MASK_ERROR);
|
||||
}
|
||||
|
||||
struct print_args_args {
|
||||
|
@ -145,7 +167,7 @@ print_args_stub (args)
|
|||
int numargs;
|
||||
struct print_args_args *p = (struct print_args_args *)args;
|
||||
FRAME_NUM_ARGS (numargs, (p->fi));
|
||||
print_frame_args (p->func, p->fi, numargs, stdout);
|
||||
print_frame_args (p->func, p->fi, numargs, gdb_stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -257,10 +279,10 @@ print_frame_info (fi, level, source, args)
|
|||
if (addressprint)
|
||||
if (fi->pc != sal.pc || !sal.symtab)
|
||||
printf_filtered ("%s in ", local_hex_string((unsigned long) fi->pc));
|
||||
fprintf_symbol_filtered (stdout, funname ? funname : "??", funlang,
|
||||
fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
|
||||
DMGL_NO_OPTS);
|
||||
wrap_here (" ");
|
||||
fputs_filtered (" (", stdout);
|
||||
fputs_filtered (" (", gdb_stdout);
|
||||
if (args)
|
||||
{
|
||||
struct print_args_args args;
|
||||
|
@ -305,7 +327,7 @@ print_frame_info (fi, level, source, args)
|
|||
if (source != 0)
|
||||
set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
|
||||
|
||||
fflush (stdout);
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -473,7 +495,7 @@ frame_info (addr_exp, from_tty)
|
|||
if (funname)
|
||||
{
|
||||
printf_filtered (" in ");
|
||||
fprintf_symbol_filtered (stdout, funname, funlang,
|
||||
fprintf_symbol_filtered (gdb_stdout, funname, funlang,
|
||||
DMGL_ANSI | DMGL_PARAMS);
|
||||
}
|
||||
wrap_here (" ");
|
||||
|
@ -533,7 +555,7 @@ frame_info (addr_exp, from_tty)
|
|||
puts_filtered (" 1 arg: ");
|
||||
else
|
||||
printf_filtered (" %d args: ", numargs);
|
||||
print_frame_args (func, fi, numargs, stdout);
|
||||
print_frame_args (func, fi, numargs, gdb_stdout);
|
||||
puts_filtered ("\n");
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +621,7 @@ backtrace_limit_info (arg, from_tty)
|
|||
if (arg)
|
||||
error ("\"Info backtrace-limit\" takes no arguments.");
|
||||
|
||||
printf ("Backtrace limit: %d.\n", backtrace_limit);
|
||||
printf_unfiltered ("Backtrace limit: %d.\n", backtrace_limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -686,6 +708,11 @@ backtrace_command (count_exp, from_tty)
|
|||
{
|
||||
QUIT;
|
||||
fi = get_frame_info (frame);
|
||||
|
||||
/* Don't use print_stack_frame; if an error() occurs it probably
|
||||
means further attempts to backtrace would fail (on the other
|
||||
hand, perhaps the code does or could be fixed to make sure
|
||||
the frame->prev field gets set to NULL in that case). */
|
||||
print_frame_info (fi, trailing_level + i, 0, 1);
|
||||
}
|
||||
|
||||
|
@ -701,7 +728,7 @@ static int
|
|||
print_block_frame_locals (b, frame, stream)
|
||||
struct block *b;
|
||||
register FRAME frame;
|
||||
register FILE *stream;
|
||||
register GDB_FILE *stream;
|
||||
{
|
||||
int nsyms;
|
||||
register int i;
|
||||
|
@ -733,7 +760,7 @@ static int
|
|||
print_block_frame_labels (b, have_default, stream)
|
||||
struct block *b;
|
||||
int *have_default;
|
||||
register FILE *stream;
|
||||
register GDB_FILE *stream;
|
||||
{
|
||||
int nsyms;
|
||||
register int i;
|
||||
|
@ -778,7 +805,7 @@ print_block_frame_labels (b, have_default, stream)
|
|||
static void
|
||||
print_frame_local_vars (frame, stream)
|
||||
register FRAME frame;
|
||||
register FILE *stream;
|
||||
register GDB_FILE *stream;
|
||||
{
|
||||
register struct block *block = get_frame_block (frame);
|
||||
register int values_printed = 0;
|
||||
|
@ -813,7 +840,7 @@ static void
|
|||
print_frame_label_vars (frame, this_level_only, stream)
|
||||
register FRAME frame;
|
||||
int this_level_only;
|
||||
register FILE *stream;
|
||||
register GDB_FILE *stream;
|
||||
{
|
||||
register struct blockvector *bl;
|
||||
register struct block *block = get_frame_block (frame);
|
||||
|
@ -888,7 +915,7 @@ locals_info (args, from_tty)
|
|||
{
|
||||
if (!selected_frame)
|
||||
error ("No frame selected.");
|
||||
print_frame_local_vars (selected_frame, stdout);
|
||||
print_frame_local_vars (selected_frame, gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -898,13 +925,13 @@ catch_info (ignore, from_tty)
|
|||
{
|
||||
if (!selected_frame)
|
||||
error ("No frame selected.");
|
||||
print_frame_label_vars (selected_frame, 0, stdout);
|
||||
print_frame_label_vars (selected_frame, 0, gdb_stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
print_frame_arg_vars (frame, stream)
|
||||
register FRAME frame;
|
||||
register FILE *stream;
|
||||
register GDB_FILE *stream;
|
||||
{
|
||||
struct symbol *func = get_frame_function (frame);
|
||||
register struct block *b;
|
||||
|
@ -973,7 +1000,7 @@ args_info (ignore, from_tty)
|
|||
{
|
||||
if (!selected_frame)
|
||||
error ("No frame selected.");
|
||||
print_frame_arg_vars (selected_frame, stdout);
|
||||
print_frame_arg_vars (selected_frame, gdb_stdout);
|
||||
}
|
||||
|
||||
/* Select frame FRAME, and note that its stack level is LEVEL.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue