+2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * remote.c (getpkt_sane): New function. It is the old getpkt(),
+ which now returns a timeout indication.
+ (getpkt): New function. Wrapper for getpkt_sane(), so that return
+ value can still be ignored.
+
+Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ui-file.c, ui-file.h: Rename gdb-file.h, gdb-file.c. Rename
+ ``struct gdb_file'' to ``struct ui_file''. Delete typedef
+ GDB_FILE.
+
+ * Makefile.in: Update.
+
+ * ax-gdb.c, ax-general.c, ax.h, buildsym.c, c-lang.c, c-lang.h,
+ c-typeprint.c, c-valprint.c, ch-lang.c, ch-lang.h, ch-typeprint.c,
+ ch-valprint.c, command.c, command.h, convex-tdep.c, corefile.c,
+ cp-valprint.c, d10v-tdep.c, d30v-tdep.c, defs.h, expprint.c,
+ expression.h, f-lang.c, f-lang.h, f-typeprint.c, f-valprint.c,
+ frame.h, gdb-events.sh, gdb-file.c, gdb-file.h, gdbcmd.h,
+ gdbtypes.h, hppa-tdep.c, jv-lang.c, jv-lang.h, jv-typeprint.c,
+ jv-valprint.c, language.c, language.h, m2-lang.c, m2-lang.h,
+ m2-typeprint.c, m2-valprint.c, m3-nat.c, main.c, monitor.c,
+ printcmd.c, pyr-tdep.c, remote-mips.c, remote-sim.c, remote-udi.c,
+ remote.c, scm-lang.c, scm-lang.h, scm-valprint.c, ser-e7kpc.c,
+ ser-go32.c, ser-mac.c, ser-ocd.c, ser-unix.c, ser-unix.h,
+ serial.c, serial.h, stack.c, symfile.c, symmisc.c, tahoe-tdep.c,
+ target.c, target.h, top.c, top.h, typeprint.c, typeprint.h,
+ utils.c, v850ice.c, valprint.c, valprint.h, value.h,
+ config/pa/tm-hppa.h: Update.
+
2000-01-31 Jason Molenda (jsm@bugshack.cygnus.com)
* config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh,
-# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
# This file is part of GDB.
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-VERSION = 20000131
+VERSION = 20000201
DIST=gdb
LINT=/usr/5bin/lint
tui/tuiSource.h tui/tuiSourceWin.c tui/tuiSourceWin.h \
tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h \
tui/tui-file.h tui/tui-file.c \
- gdb-file.h gdb-file.c
+ ui-file.h ui-file.c
LINTFILES = $(SFILES) $(YYFILES) @CONFIG_SRCS@ init.c
gdbcmd_h = gdbcmd.h $(command_h)
call_cmds_h = call-cmds.h
-defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h gdb-file.h
+defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h ui-file.h
top_h = top.h
inferior_h = inferior.h $(breakpoint_h)
c-typeprint.o ch-typeprint.o f-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \
nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \
- gdb-file.o tui-file.o
+ ui-file.o tui-file.o
OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
language.h target.h gdb_string.h
-gdb-file.o: gdb-file.c $(defs_h) gdb-file.h
+ui-file.o: ui-file.c $(defs_h) ui-file.h
tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
/* GDB-specific functions for operating on agent expressions
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
struct agent_expr * ax,
struct axs_value * value));
-static void print_axs_value PARAMS ((GDB_FILE * f, struct axs_value * value));
+static void print_axs_value (struct ui_file *f, struct axs_value * value);
static void agent_command PARAMS ((char *exp, int from_tty));
\f
static void
print_axs_value (f, value)
- GDB_FILE *f;
+ struct ui_file *f;
struct axs_value *value;
{
switch (value->kind)
/* Functions for manipulating expressions designed to be executed on the agent
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Disassemble the expression EXPR, writing to F. */
void
ax_print (f, x)
- GDB_FILE *f;
+ struct ui_file *f;
struct agent_expr *x;
{
int i;
/* Definitions for expressions designed to be executed on the agent
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
things. */
/* Disassemble the expression EXPR, writing to F. */
-extern void ax_print PARAMS ((GDB_FILE * f, struct agent_expr * EXPR));
+extern void ax_print (struct ui_file *f, struct agent_expr * EXPR);
/* An entry in the opcode map. */
struct aop_map
/* Support routines for building symbol tables in GDB's internal format.
- Copyright 1986-1999 Free Software Foundation, Inc.
+ Copyright 1986-2000 Free Software Foundation, Inc.
This file is part of GDB.
long. Possible solutions include a version of
complain which takes a callback, a
sprintf_address_numeric to match
- print_address_numeric, or a way to set up a GDB_FILE
+ print_address_numeric, or a way to set up a UI_FILE
which causes sprintf rather than fprintf to be
called. */
/* C language support routines for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 2000 Free Software Foundation, Inc.
This file is part of GDB.
#include "c-lang.h"
extern void _initialize_c_language PARAMS ((void));
-static void c_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void c_emit_char (int c, struct ui_file * stream, int quoter);
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
static void
c_emit_char (c, stream, quoter)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
int quoter;
{
c &= 0xFF; /* Avoid sign bit follies */
void
c_printchar (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fputc_filtered ('\'', stream);
LA_EMIT_CHAR (c, stream, '\'');
void
c_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
/* C language support definitions for GDB, the GNU debugger.
- Copyright 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1992, 1996, 2000 Free Software Foundation, Inc.
This file is part of GDB.
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 *, GDB_FILE *, int, int));
+/* Defined in c-typeprint.c */
+extern void c_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int
-c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
+extern int c_value_print (struct value *, struct ui_file *, int,
+ enum val_prettyprint);
/* These are in c-lang.c: */
-extern void c_printchar PARAMS ((int, GDB_FILE *));
+extern void c_printchar (int, struct ui_file *);
-extern void c_printstr PARAMS ((GDB_FILE * stream, char *string,
- unsigned int length, int width,
- int force_ellipses));
+extern void c_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
extern struct type *c_create_fundamental_type PARAMS ((struct objfile *, int));
/* These are in c-typeprint.c: */
-extern void
-c_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
+extern void c_type_print_base (struct type *, struct ui_file *, int, int);
-extern void
-c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
+extern void c_type_print_varspec_prefix (struct type *, struct ui_file *,
+ int, int);
/* These are in cp-valprint.c */
extern int static_field_print;
-extern void
-cp_print_class_member PARAMS ((char *, struct type *, GDB_FILE *, char *));
+extern void cp_print_class_member (char *, struct type *, struct ui_file *,
+ char *);
-extern void
-cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
+extern void cp_print_class_method (char *, struct type *, struct ui_file *);
-extern void
-cp_print_value_fields PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR,
- GDB_FILE *, int, int, enum val_prettyprint,
- struct type **, int));
+extern void cp_print_value_fields (struct type *, struct type *, char *,
+ int, CORE_ADDR, struct ui_file *, int,
+ int, enum val_prettyprint,
+ struct type **, int);
extern int
cp_is_vtbl_ptr_type PARAMS ((struct type *));
/* Support for printing C and C++ types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 1999
+ Copyright 1986, 1988, 1989, 1991, 1993-1996, 1998-2000
Free Software Foundation, Inc.
This file is part of GDB.
/* Flag indicating target was compiled by HP compiler */
extern int hp_som_som_object_present;
-static void cp_type_print_method_args PARAMS ((struct type ** args, char *prefix, char *varstring, int staticp, GDB_FILE * stream));
+static void cp_type_print_method_args (struct type ** args, char *prefix,
+ char *varstring, int staticp,
+ struct ui_file *stream);
-static void
-c_type_print_args PARAMS ((struct type *, GDB_FILE *));
+static void c_type_print_args (struct type *, struct ui_file *);
-static void
-cp_type_print_derivation_info PARAMS ((GDB_FILE *, struct type *));
+static void cp_type_print_derivation_info (struct ui_file *, struct type *);
-void
-c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
+void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
+ int);
-static void
-c_type_print_cv_qualifier PARAMS ((struct type *, GDB_FILE *, int, int));
+static void c_type_print_cv_qualifier (struct type *, struct ui_file *,
+ int, int);
\f
c_typedef_print (type, new, stream)
struct type *type;
struct symbol *new;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
CHECK_TYPEDEF (type);
switch (current_language->la_language)
c_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
static void
cp_type_print_derivation_info (stream, type)
- GDB_FILE *stream;
+ struct ui_file *stream;
struct type *type;
{
char *name;
char *prefix;
char *varstring;
int staticp;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i;
void
c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int passed_a_ptr;
{
static void
c_type_print_cv_qualifier (type, stream, need_pre_space, need_post_space)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int need_pre_space;
int need_post_space;
{
static void
c_type_print_args (type, stream)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i;
struct type **args;
void
c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int passed_a_ptr;
int demangled_args;
void
c_type_print_base (type, stream, show, level)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
/* Support for printing C values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ Copyright 1986, 1988, 1989, 1991-1997, 2000
Free Software Foundation, Inc.
This file is part of GDB.
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
int
c_value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
/* Chill language support routines for GDB, the GNU debugger.
- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1992, 1995, 1996, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static struct type *
chill_create_fundamental_type PARAMS ((struct objfile *, int));
-static void
-chill_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
+static void chill_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
-static void
-chill_printchar PARAMS ((int, GDB_FILE *));
+static void chill_printchar (int, struct ui_file *);
/* For now, Chill uses a simple mangling algorithm whereby you simply
discard everything after the occurance of two successive CPLUS_MARKER
static void
chill_printchar (c, stream)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
c &= 0xFF; /* Avoid sign bit follies */
static void
chill_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
/* Chill language support definitions for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 2000 Free Software Foundation, Inc.
This file is part of GDB.
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 *, GDB_FILE *, int, int));
+/* Defined in ch-typeprint.c */
+extern void chill_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-chill_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int chill_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int
-chill_value_print PARAMS ((struct value *, GDB_FILE *,
- int, enum val_prettyprint));
+extern int chill_value_print (struct value *, struct ui_file *,
+ int, enum val_prettyprint);
extern LONGEST
type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));
/* Support for printing Chill types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 2000 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_string.h"
#include <errno.h>
-static void
-chill_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
+static void chill_type_print_base (struct type *, struct ui_file *, int, int);
void
chill_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
static void
chill_type_print_base (type, stream, show, level)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
/* Support for printing Chill values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1988, 1989, 1991-1994, 2000
Free Software Foundation, Inc.
This file is part of GDB.
#include "ch-lang.h"
#include "annotate.h"
-static void
-chill_print_value_fields PARAMS ((struct type *, char *, GDB_FILE *, int, int,
- enum val_prettyprint, struct type **));
+static void chill_print_value_fields (struct type *, char *,
+ struct ui_file *, int, int,
+ enum val_prettyprint, struct type **);
-static void
-chill_print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
+static void chill_print_type_scalar (struct type *, LONGEST,
+ struct ui_file *);
-static void
-chill_val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+static void chill_val_print_array_elements (struct type *, char *,
+ CORE_ADDR, struct ui_file *,
+ int, int, int,
+ enum val_prettyprint);
\f
/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
chill_print_type_scalar (type, val, stream)
struct type *type;
LONGEST val;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
switch (TYPE_CODE (type))
{
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
dont_print)
struct type *type;
char *valaddr;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
int
chill_value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
/* Handle lists of commands, their decoding and documentation, for GDB.
- Copyright 1986, 1989, 1990, 1991, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1991, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void show_user PARAMS ((char *, int));
-static void show_user_1 PARAMS ((struct cmd_list_element *, GDB_FILE *));
+static void show_user_1 (struct cmd_list_element *, struct ui_file *);
static void make_command PARAMS ((char *, int));
static int parse_binary_operation PARAMS ((char *));
-static void print_doc_line PARAMS ((GDB_FILE *, char *));
+static void print_doc_line (struct ui_file *, char *);
static struct cmd_list_element *find_cmd PARAMS ((char *command,
int len,
void
help_cmd (command, stream)
char *command;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
struct cmd_list_element *c;
extern struct cmd_list_element *cmdlist;
struct cmd_list_element *list;
char *cmdtype;
enum command_class class;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int len;
char *cmdtype1, *cmdtype2;
/* Print only the first line of STR on STREAM. */
static void
print_doc_line (stream, str)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *str;
{
static char *line_buffer = 0;
enum command_class class;
char *prefix;
int recurse;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
register struct cmd_list_element *c;
static void
show_user_1 (c, stream)
struct cmd_list_element *c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
register struct command_line *cmdlines;
/* Header file for command-reading library command.c.
- Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1989, 1990, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern void
delete_cmd PARAMS ((char *, struct cmd_list_element **));
-extern void
-help_cmd PARAMS ((char *, GDB_FILE *));
+extern void help_cmd (char *, struct ui_file *);
-extern void
-help_list PARAMS ((struct cmd_list_element *, char *, enum command_class,
- GDB_FILE *));
+extern void help_list (struct cmd_list_element *, char *,
+ enum command_class, struct ui_file *);
-extern void
-help_cmd_list PARAMS ((struct cmd_list_element *, enum command_class, char *,
- int, GDB_FILE *));
+extern void help_cmd_list (struct cmd_list_element *, enum command_class,
+ char *, int, struct ui_file *);
extern struct cmd_list_element *
add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
#define PSW_REGNUM 11
#define LIR_REGNUM 12
#define LAR_REGNUM 13
+#define E0_REGNUM 14
/* Pseudo register that contains true address of executing stack frame */
#define FP_REGNUM 31
/* Parameters for execution on any Hewlett-Packard PA-RISC machine.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995, 1999
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989-1993, 1995, 1999, 2000 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
#if 0
#define STRCAT_REGISTER(regnum, fpregs, stream, precision) pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
-extern void pa_do_strcat_registers_info PARAMS ((int, int, GDB_FILE *, enum precision_type));
+extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precision_type);
#endif
/* PA specific macro to see if the current instruction is nullified. */
/* OBSOLETE /* Convex stuff for GDB. */
-/* OBSOLETE Copyright (C) 1990, 1991, 1996 Free Software Foundation, Inc. */
+/* OBSOLETE Copyright (C) 1990, 1991, 1996, 2000 Free Software Foundation, Inc. */
/* OBSOLETE */
/* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
/* OBSOLETE If it looks like an address, print it in hex instead. *x/ */
/* OBSOLETE */
/* OBSOLETE decout (stream, type, val) */
-/* OBSOLETE GDB_FILE *stream; */
+/* OBSOLETE struct ui_file *stream; */
/* OBSOLETE struct type *type; */
/* OBSOLETE LONGEST val; */
/* OBSOLETE { */
/* Core dump and executable file functions above target vector, for GDB.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1987, 1989, 1991-1994, 2000
Free Software Foundation, Inc.
This file is part of GDB.
int status;
CORE_ADDR memaddr;
{
- struct gdb_file *tmp_stream = mem_fileopen ();
- make_cleanup_gdb_file_delete (tmp_stream);
+ struct ui_file *tmp_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_stream);
if (status == EIO)
{
/* Support for printing C++ values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1994, 1995, 1996
+ Copyright 1986, 1988, 1989, 1991, 1994-1996, 2000
Free Software Foundation, Inc.
This file is part of GDB.
extern void _initialize_cp_valprint PARAMS ((void));
-static void
-cp_print_static_field PARAMS ((struct type *, value_ptr, GDB_FILE *, int, int,
- enum val_prettyprint));
+static void cp_print_static_field (struct type *, value_ptr,
+ struct ui_file *, int, int,
+ enum val_prettyprint);
-static void
-cp_print_value PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, enum val_prettyprint, struct type **));
+static void cp_print_value (struct type *, struct type *, char *, int,
+ CORE_ADDR, struct ui_file *, int, int,
+ enum val_prettyprint, struct type **);
-static void
-cp_print_hpacc_virtual_table_entries PARAMS ((struct type *, int *, value_ptr, GDB_FILE *,
- int, int, enum val_prettyprint));
+static void cp_print_hpacc_virtual_table_entries (struct type *, int *,
+ value_ptr,
+ struct ui_file *, int,
+ int,
+ enum val_prettyprint);
void
cp_print_class_method (valaddr, type, stream)
char *valaddr;
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
struct type *domain;
struct fn_field *f = NULL;
char *valaddr;
int offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
char *valaddr;
int offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
cp_print_static_field (type, val, stream, format, recurse, pretty)
struct type *type;
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
cp_print_class_member (valaddr, domain, stream, prefix)
char *valaddr;
struct type *domain;
- GDB_FILE *stream;
+ struct ui_file *stream;
char *prefix;
{
struct type *type;
int *vfuncs;
value_ptr v;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
/* Target-dependent code for Mitsubishi D10V, for GDB.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static int
print_insn (memaddr, stream)
CORE_ADDR memaddr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
/* Target-dependent code for Mitsubishi D30V, for GDB.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static int
print_insn (memaddr, stream)
CORE_ADDR memaddr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
/* Basic, host-specific, and target-specific definitions for GDB.
- Copyright (C) 1986, 89, 91, 92, 93, 94, 95, 96, 98, 1999
+ Copyright (C) 1986, 1989, 1991-1996, 1998-2000
Free Software Foundation, Inc.
This file is part of GDB.
extern struct cleanup *make_cleanup_freeargv (char **);
-struct gdb_file;
-extern struct cleanup *make_cleanup_gdb_file_delete (struct gdb_file *);
+struct ui_file;
+extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
extern struct cleanup *make_final_cleanup (make_cleanup_func, void *);
extern void reinitialize_more_filter (void);
-struct gdb_file;
-typedef struct gdb_file GDB_FILE; /* deprecated */
-
/* Normal results */
-extern GDB_FILE *gdb_stdout;
+extern struct ui_file *gdb_stdout;
/* Serious error notifications */
-extern GDB_FILE *gdb_stderr;
+extern struct ui_file *gdb_stderr;
/* Log/debug/trace messages that should bypass normal stdout/stderr
filtering. For momement, always call this stream using
*_unfiltered. In the very near future that restriction shall be
removed - either call shall be unfiltered. (cagney 1999-06-13). */
-extern GDB_FILE *gdb_stdlog;
+extern struct ui_file *gdb_stdlog;
/* Target output that should bypass normal stdout/stderr filtering.
For momement, always call this stream using *_unfiltered. In the
very near future that restriction shall be removed - either call
shall be unfiltered. (cagney 1999-07-02). */
-extern GDB_FILE *gdb_stdtarg;
+extern struct ui_file *gdb_stdtarg;
#if defined(TUI)
#include "tui.h"
#include "tuiWin.h"
#endif
-#include "gdb-file.h"
+#include "ui-file.h"
/* More generic printf like operations */
-extern void fputs_filtered (const char *, GDB_FILE *);
+extern void fputs_filtered (const char *, struct ui_file *);
-extern void fputs_unfiltered (const char *, GDB_FILE *);
+extern void fputs_unfiltered (const char *, struct ui_file *);
-extern int fputc_filtered (int c, GDB_FILE *);
+extern int fputc_filtered (int c, struct ui_file *);
-extern int fputc_unfiltered (int c, GDB_FILE *);
+extern int fputc_unfiltered (int c, struct ui_file *);
extern int putchar_unfiltered (int c);
extern void vprintf_filtered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
-extern void vfprintf_filtered (GDB_FILE *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
+extern void vfprintf_filtered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
-extern void fprintf_filtered (GDB_FILE *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
+extern void fprintf_filtered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
-extern void fprintfi_filtered (int, GDB_FILE *, const char *, ...) ATTR_FORMAT (printf, 3, 4);
+extern void fprintfi_filtered (int, struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 3, 4);
extern void printf_filtered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
extern void vprintf_unfiltered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
-extern void vfprintf_unfiltered (GDB_FILE *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
+extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
-extern void fprintf_unfiltered (GDB_FILE *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
+extern void fprintf_unfiltered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
extern void printf_unfiltered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
-extern void print_spaces (int, GDB_FILE *);
+extern void print_spaces (int, struct ui_file *);
-extern void print_spaces_filtered (int, GDB_FILE *);
+extern void print_spaces_filtered (int, struct ui_file *);
extern char *n_spaces (int);
-extern void fputstr_filtered (const char *str, int quotr, GDB_FILE * stream);
+extern void fputstr_filtered (const char *str, int quotr, struct ui_file * stream);
-extern void fputstr_unfiltered (const char *str, int quotr, GDB_FILE * stream);
+extern void fputstr_unfiltered (const char *str, int quotr, struct ui_file * stream);
-extern void fputstrn_unfiltered (const char *str, int n, int quotr, GDB_FILE * stream);
+extern void fputstrn_unfiltered (const char *str, int n, int quotr, struct ui_file * stream);
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
-extern void gdb_print_host_address (void *addr, struct gdb_file *stream);
+extern void gdb_print_host_address (void *addr, struct ui_file *stream);
/* Convert a CORE_ADDR into a HEX string. paddr() is like %08lx.
paddr_nz() is like %lx. paddr_u() is like %lu. paddr_width() is
extern char *preg (t_reg reg);
extern char *preg_nz (t_reg reg);
-extern void fprintf_symbol_filtered (GDB_FILE *, char *,
+extern void fprintf_symbol_filtered (struct ui_file *, char *,
enum language, int);
extern NORETURN void perror_with_name (char *) ATTR_NORETURN;
extern void generic_load (char *name, int from_tty);
/* Summarise a download */
-extern void print_transfer_performance (struct gdb_file *stream,
+extern void print_transfer_performance (struct ui_file *stream,
unsigned long data_count,
unsigned long write_count,
unsigned long time_count);
extern void set_next_address (CORE_ADDR);
-extern void print_address_symbolic (CORE_ADDR, GDB_FILE *, int,
+extern void print_address_symbolic (CORE_ADDR, struct ui_file *, int,
char *);
-extern void print_address_numeric (CORE_ADDR, int, GDB_FILE *);
+extern void print_address_numeric (CORE_ADDR, int, struct ui_file *);
-extern void print_address (CORE_ADDR, GDB_FILE *);
+extern void print_address (CORE_ADDR, struct ui_file *);
/* From source.c */
/* DEPRECATED: Use error(), verror() or error_stream(). */
extern NORETURN void error_begin (void);
-extern NORETURN void error_stream (GDB_FILE *) ATTR_NORETURN;
+extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
/* Returns a freshly allocate buffer containing the last error
message. */
extern struct frame_info *parse_frame_specification (char *frame_exp);
extern int (*query_hook) (const char *, va_list);
extern void (*warning_hook) (const char *, va_list);
-extern void (*flush_hook) (GDB_FILE * stream);
+extern void (*flush_hook) (struct ui_file * stream);
extern void (*create_breakpoint_hook) (struct breakpoint * b);
extern void (*delete_breakpoint_hook) (struct breakpoint * bpt);
extern void (*modify_breakpoint_hook) (struct breakpoint * bpt);
/* Print in infix form a struct expression.
- Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1989, 1991, 2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Prototypes for local functions */
-static void
-print_subexp PARAMS ((struct expression *, int *, GDB_FILE *, enum precedence));
+static void print_subexp (struct expression *, int *, struct ui_file *,
+ enum precedence);
void
print_expression (exp, stream)
struct expression *exp;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int pc = 0;
print_subexp (exp, &pc, stream, PREC_NULL);
print_subexp (exp, pos, stream, prec)
register struct expression *exp;
register int *pos;
- GDB_FILE *stream;
+ struct ui_file *stream;
enum precedence prec;
{
register unsigned tem;
void
dump_prefix_expression (exp, stream, note)
struct expression *exp;
- GDB_FILE *stream;
+ struct ui_file *stream;
char *note;
{
int elt;
}
}
-static int dump_subexp PARAMS ((struct expression * exp, GDB_FILE * stream, int elt));
+static int dump_subexp PARAMS ((struct expression * exp, struct ui_file * stream, int elt));
static int
dump_subexp (exp, stream, elt)
struct expression *exp;
- GDB_FILE *stream;
+ struct ui_file *stream;
int elt;
{
static int indent = 0;
void
dump_postfix_expression (exp, stream, note)
struct expression *exp;
- GDB_FILE *stream;
+ struct ui_file *stream;
char *note;
{
int elt;
/* Definitions for expressions stored in reversed prefix form, for GDB.
- Copyright 1986, 1989, 1992, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1992, 1994, 2000 Free Software Foundation, Inc.
This file is part of GDB.
/* From expprint.c */
-extern void print_expression PARAMS ((struct expression *, GDB_FILE *));
+extern void print_expression (struct expression *, struct ui_file *);
extern char *op_string PARAMS ((enum exp_opcode));
-extern void dump_prefix_expression PARAMS ((struct expression *,
- GDB_FILE *,
- char *));
-extern void dump_postfix_expression PARAMS ((struct expression *,
- GDB_FILE *,
- char *));
+extern void dump_prefix_expression (struct expression *,
+ struct ui_file *,
+ char *);
+extern void dump_postfix_expression (struct expression *,
+ struct ui_file *,
+ char *);
#endif /* !defined (EXPRESSION_H) */
/* Fortran language support routines for GDB, the GNU debugger.
- Copyright 1993, 1994, 1996 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1996, 2000 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
#endif
static struct type *f_create_fundamental_type PARAMS ((struct objfile *, int));
-static void f_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
-static void f_printchar PARAMS ((int c, GDB_FILE * stream));
-static void f_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void f_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+static void f_printchar (int c, struct ui_file * stream);
+static void f_emit_char (int c, struct ui_file * stream, int quoter);
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
static void
f_emit_char (c, stream, quoter)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
int quoter;
{
c &= 0xFF; /* Avoid sign bit follies */
static void
f_printchar (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fputs_filtered ("'", stream);
LA_EMIT_CHAR (c, stream, '\'');
static void
f_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
/* This is declared in c-lang.h but it is silly to import that file for what
is already just a hack. */
-extern int
-c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
+extern int c_value_print (struct value *, struct ui_file *, int,
+ enum val_prettyprint);
const struct language_defn f_language_defn =
{
/* Fortran language support definitions for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 2000 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C definitions by Farooq Butt
(fmbutt@engage.sps.mot.com).
extern void f_error PARAMS ((char *)); /* Defined in f-exp.y */
-extern void f_print_type PARAMS ((struct type *, char *,
- GDB_FILE *, int, int));
+extern void f_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int f_val_print PARAMS ((struct type *, char *, int,
- CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+extern int f_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
/* Language-specific data structures */
/* Support for printing Fortran types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 1993, 1994, 2000 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C version by Farooq Butt
(fmbutt@engage.sps.mot.com).
#include <errno.h>
#if 0 /* Currently unused */
-static void f_type_print_args PARAMS ((struct type *, GDB_FILE *));
+static void f_type_print_args (struct type *, struct ui_file *);
#endif
-static void print_equivalent_f77_float_type PARAMS ((struct type *,
- GDB_FILE *));
+static void print_equivalent_f77_float_type (struct type *,
+ struct ui_file *);
-static void f_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *,
- int, int, int));
+static void f_type_print_varspec_suffix (struct type *, struct ui_file *,
+ int, int, int);
-void f_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *,
- int, int));
+void f_type_print_varspec_prefix (struct type *, struct ui_file *,
+ int, int);
-void f_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
+void f_type_print_base (struct type *, struct ui_file *, int, int);
\f
/* LEVEL is the depth to indent lines by. */
f_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
void
f_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int passed_a_ptr;
{
static void
f_type_print_args (type, stream)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i;
struct type **args;
static void
f_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int passed_a_ptr;
int demangled_args;
static void
print_equivalent_f77_float_type (type, stream)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
/* Override type name "float" and make it the
appropriate real. XLC stupidly outputs -12 as a type
void
f_type_print_base (type, stream, show, level)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
/* Support for printing Fortran values for GDB, the GNU debugger.
- Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1993-1995, 2000 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C definitions by Farooq Butt
(fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
extern void _initialize_f_valprint PARAMS ((void));
static void info_common_command PARAMS ((char *, int));
static void list_all_visible_commons PARAMS ((char *));
-static void f77_print_array PARAMS ((struct type *, char *, CORE_ADDR,
- GDB_FILE *, int, int, int,
- enum val_prettyprint));
-static void f77_print_array_1 PARAMS ((int, int, struct type *, char *,
- CORE_ADDR, GDB_FILE *, int, int, int,
- enum val_prettyprint));
-static void f77_create_arrayprint_offset_tbl PARAMS ((struct type *,
- GDB_FILE *));
+static void f77_print_array (struct type *, char *, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
+static void f77_print_array_1 (int, int, struct type *, char *,
+ CORE_ADDR, struct ui_file *, int, int, int,
+ enum val_prettyprint);
+static void f77_create_arrayprint_offset_tbl (struct type *,
+ struct ui_file *);
static void f77_get_dynamic_length_of_aggregate PARAMS ((struct type *));
int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
static void
f77_create_arrayprint_offset_tbl (type, stream)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
struct type *tmp_type;
int eltlen;
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
extern int frameless_look_for_prologue PARAMS ((struct frame_info *));
extern void print_frame_args PARAMS ((struct symbol *, struct frame_info *,
- int, GDB_FILE *));
+ int, struct ui_file *));
extern struct frame_info *find_relative_frame PARAMS ((struct frame_info *, int *));
#!/bin/sh
# User Interface Events.
-# Copyright 1999 Free Software Foundation, Inc.
+# Copyright 1999-2000 Free Software Foundation, Inc.
#
# Contributed by Cygnus Solutions.
#
#*:void:target_wait_loop_hook:void
#*:void:init_gdb_hook:char *argv0:argv0
#*:void:command_loop_hook:void
-#*:void:fputs_unfiltered_hook:const char *linebuff,GDB_FILE *stream:linebuff, stream
+#*:void:fputs_unfiltered_hook:const char *linebuff,struct ui_file *stream:linebuff, stream
#*:void:print_frame_info_listing_hook:struct symtab *s, int line, int stopline, int noerror:s, line, stopline, noerror
#*:int:query_hook:const char *query, va_list args:query, args
#*:void:warning_hook:const char *string, va_list args:string, args
/* Header file for GDB-specific command-line stuff.
- Copyright 1986, 1989, 1990, 1992 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990, 1992, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
enum command_control_type
execute_control_command PARAMS ((struct command_line *));
-extern void
-print_command_line PARAMS ((struct command_line *, unsigned int, GDB_FILE *));
+extern void print_command_line (struct command_line *, unsigned int,
+ struct ui_file *);
extern char **noop_completer PARAMS ((char *, char *));
/* Internal type definitions for GDB.
- Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999
- Free Software Foundation, Inc.
+ Copyright (C) 1992-1994, 1996, 1998-2000 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
/* printcmd.c */
-extern void
-print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
+extern void print_scalar_formatted (char *, struct type *, int, int,
+ struct ui_file *);
extern int can_dereference PARAMS ((struct type *));
/* typeprint.c */
-extern void print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
+extern void print_type_scalar (struct type *, LONGEST, struct ui_file *);
#endif /* GDBTYPES_H */
/* Target-dependent code for the HP PA architecture, for GDB.
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 1999
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989-1996, 1999-2000 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
asection *, unsigned int,
unsigned int, CORE_ADDR));
static void pa_print_registers PARAMS ((char *, int, int));
-static void pa_strcat_registers PARAMS ((char *, int, int, GDB_FILE *));
+static void pa_strcat_registers (char *, int, int, struct ui_file *);
static void pa_register_look_aside PARAMS ((char *, int, long *));
static void pa_print_fp_reg PARAMS ((int));
-static void pa_strcat_fp_reg PARAMS ((int, GDB_FILE *, enum precision_type));
+static void pa_strcat_fp_reg (int, struct ui_file *, enum precision_type);
static void record_text_segment_lowaddr PARAMS ((bfd *, asection *, void *));
typedef struct
pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
int regnum;
int fpregs;
- GDB_FILE *stream;
+ struct ui_file *stream;
enum precision_type precision;
{
char raw_regs[REGISTER_BYTES];
char *raw_regs;
int regnum;
int fpregs;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i, j;
long raw_val[2]; /* Alas, we are compiled so that "long long" is 32 bits */
static void
pa_strcat_fp_reg (i, stream, precision)
int i;
- GDB_FILE *stream;
+ struct ui_file *stream;
enum precision_type precision;
{
char raw_buffer[MAX_REGISTER_RAW_SIZE];
/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999-2000 Free Software Foundation, Inc.
This file is part of GDB.
static struct type *java_lookup_type PARAMS ((char *signature));
static value_ptr java_value_string PARAMS ((char *ptr, int len));
-static void java_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void java_emit_char (int c, struct ui_file * stream, int quoter);
/* This objfile contains symtabs that have been dynamically created
to record dynamically loaded Java classes and dynamically
static void
java_emit_char (c, stream, quoter)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
int quoter;
{
switch (c)
/* Java language support definitions for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997-2000 Free Software Foundation, Inc.
This file is part of GDB.
extern struct type *java_double_type;
extern struct type *java_void_type;
-extern int
-java_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int java_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int
-java_value_print PARAMS ((struct value *, GDB_FILE *, int,
- enum val_prettyprint));
+extern int java_value_print (struct value *, struct ui_file *, int,
+ enum val_prettyprint);
extern value_ptr java_class_from_object PARAMS ((value_ptr));
extern int is_object_type PARAMS ((struct type *));
-extern void /* Defined in jv-typeprint.c */
-java_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+/* Defined in jv-typeprint.c */
+extern void java_print_type (struct type *, char *, struct ui_file *, int,
+ int);
extern char *java_demangle_type_signature PARAMS ((char *));
/* Support for printing Java types for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997-2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Local functions */
-static void java_type_print_base PARAMS ((struct type * type, GDB_FILE * stream, int show, int level));
+static void java_type_print_base (struct type * type,
+ struct ui_file *stream, int show,
+ int level);
static void
java_type_print_derivation_info (stream, type)
- GDB_FILE *stream;
+ struct ui_file *stream;
struct type *type;
{
char *name;
static void
java_type_print_base (type, stream, show, level)
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
/* LEVEL is the depth to indent lines by. */
-extern void
-c_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *, int, int, int));
+extern void c_type_print_varspec_suffix (struct type *, struct ui_file *,
+ int, int, int);
void
java_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
/* Support for printing Java values for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997-2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Local functions */
-static void java_print_value_fields PARAMS ((struct type * type, char *valaddr, CORE_ADDR address, GDB_FILE * stream, int format, int recurse, enum val_prettyprint pretty));
+static void java_print_value_fields (struct type * type, char *valaddr,
+ CORE_ADDR address,
+ struct ui_file *stream, int format,
+ int recurse,
+ enum val_prettyprint pretty);
int
java_value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int recurse;
enum val_prettyprint pretty;
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
/* Multiple source language support for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 2000 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
static void
set_type_range PARAMS ((void));
-static void
-unk_lang_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
-static void
-unk_lang_printchar PARAMS ((int c, GDB_FILE * stream));
+static void unk_lang_printchar (int c, struct ui_file *stream);
-static void
-unk_lang_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
+static void unk_lang_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
static struct type *
unk_lang_create_fundamental_type PARAMS ((struct objfile *, int));
-static void
-unk_lang_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+static void unk_lang_print_type (struct type *, char *, struct ui_file *,
+ int, int);
-static int
-unk_lang_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-static int
-unk_lang_value_print PARAMS ((value_ptr, GDB_FILE *, int, enum val_prettyprint));
+static int unk_lang_value_print (value_ptr, struct ui_file *, int, enum val_prettyprint);
/* Forward declaration */
extern const struct language_defn unknown_language_defn;
static void
unk_lang_emit_char (c, stream, quoter)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
int quoter;
{
error ("internal error - unimplemented function unk_lang_emit_char called.");
static void
unk_lang_printchar (c, stream)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
error ("internal error - unimplemented function unk_lang_printchar called.");
}
static void
unk_lang_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
unk_lang_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
static int
unk_lang_value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
/* Source-language-related definitions for GDB.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 2000 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
struct value *(*evaluate_exp) PARAMS ((struct type *, struct expression *,
int *, enum noside));
- void (*la_printchar) PARAMS ((int ch, GDB_FILE * stream));
+ void (*la_printchar) (int ch, struct ui_file * stream);
- void (*la_printstr) PARAMS ((GDB_FILE * stream, char *string,
- unsigned int length, int width,
- int force_ellipses));
+ void (*la_printstr) (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
- void (*la_emitchar) PARAMS ((int ch, GDB_FILE * stream, int quoter));
+ void (*la_emitchar) (int ch, struct ui_file * stream, int quoter);
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 *, GDB_FILE *, int, int));
+ void (*la_print_type) (struct type *, char *, struct ui_file *, int,
+ int);
/* Print a value using syntax appropriate for this language. */
- int (*la_val_print) PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+ int (*la_val_print) (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
/* Print a top-level value using syntax appropriate for this language. */
- int (*la_value_print) PARAMS ((struct value *, GDB_FILE *,
- int, enum val_prettyprint));
+ int (*la_value_print) (struct value *, struct ui_file *,
+ int, enum val_prettyprint);
/* Base 2 (binary) formats. */
/* Modula 2 language support routines for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 2000 Free Software Foundation, Inc.
This file is part of GDB.
extern void _initialize_m2_language PARAMS ((void));
static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int));
-static void m2_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
-static void m2_printchar PARAMS ((int, GDB_FILE *));
-static void m2_emit_char PARAMS ((int, GDB_FILE *, int));
+static void m2_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
+static void m2_printchar (int, struct ui_file *);
+static void m2_emit_char (int, struct ui_file *, int);
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
static void
m2_emit_char (c, stream, quoter)
register int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
int quoter;
{
static void
m2_printchar (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fputs_filtered ("'", stream);
LA_EMIT_CHAR (c, stream, '\'');
static void
m2_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
/* Modula 2 language support definitions for GDB, the GNU debugger.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 2000 Free Software Foundation, Inc.
This file is part of GDB.
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 *, GDB_FILE *, int, int));
+/* Defined in m2-typeprint.c */
+extern void m2_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int
-m2_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int m2_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
/* Support for printing Modula 2 types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 2000 Free Software Foundation, Inc.
This file is part of GDB.
m2_print_type (type, varstring, stream, show, level)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
int level;
{
- extern void c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
+ extern void c_print_type (struct type *, char *, struct ui_file *, int,
+ int);
c_print_type (type, varstring, stream, show, level); /* FIXME */
}
/* Support for printing Modula 2 values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991, 2000 Free Software Foundation, Inc.
This file is part of GDB.
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
enum val_prettyprint pretty;
{
- extern int
- c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR,
- GDB_FILE *, int, int, int, enum val_prettyprint));
+ extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
return (c_val_print (type, valaddr, 0, address, stream, format, deref_ref,
recurse, pretty));
}
/* Interface GDB to Mach 3.0 operating systems.
(Most) Mach 3.0 related routines live in this file.
- Copyright (C) 1992, 1996, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1996, 1999-2000 Free Software Foundation, Inc.
This file is part of GDB.
void
print_tl_address (stream, pc)
- GDB_FILE *stream;
+ struct ui_file *stream;
CORE_ADDR pc;
{
if (!lookup_minimal_symbol_by_pc (pc))
/* Top level stuff for GDB, the GNU debugger.
- Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 1999
- Free Software Foundation, Inc.
+ Copyright 1986-1995, 1999-2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Whether dbx commands will be handled */
int dbx_commands = 0;
-GDB_FILE *gdb_stdout;
-GDB_FILE *gdb_stderr;
-GDB_FILE *gdb_stdlog;
-GDB_FILE *gdb_stdtarg;
+struct ui_file *gdb_stdout;
+struct ui_file *gdb_stderr;
+struct ui_file *gdb_stdlog;
+struct ui_file *gdb_stdtarg;
/* Used to initialize error() - defined in utils.c */
/* Whether to enable writing into executable and core files */
extern int write_files;
-static void print_gdb_help PARAMS ((GDB_FILE *));
+static void print_gdb_help (struct ui_file *);
/* These two are used to set the external editor commands when gdb is farming
out files to be edited by another program. */
#if defined (TUI) || defined (GDBTK)
/* Older code uses the tui_file and fputs_unfiltered_hook(). It
- should be using a customized GDB_FILE object and re-initializing
+ should be using a customized UI_FILE object and re-initializing
within its own _initialize function. */
gdb_stdout = tui_fileopen (stdout);
gdb_stderr = tui_fileopen (stderr);
to print. */
static void
-print_gdb_help (stream)
- GDB_FILE *stream;
+print_gdb_help (struct ui_file *stream)
{
fputs_unfiltered ("\
This is the GNU debugger. Usage:\n\n\
/* Remote debugging interface for boot monitors, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999
- Free Software Foundation, Inc.
+ Copyright 1990-1993, 1995-1997, 1999-2000 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Rob Savoye for Cygnus.
Resurrected from the ashes by Stu Grossman.
static void
monitor_rcmd (char *command,
- struct gdb_file *outbuf)
+ struct ui_file *outbuf)
{
char *p;
int resp_len;
/* Print values for GNU debugger GDB.
- Copyright 1986, 87, 88, 89, 90, 91, 93, 94, 95, 1998
- Free Software Foundation, Inc.
+ Copyright 1986-1991, 1993-1995, 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static void printf_command PARAMS ((char *, int));
-static void print_frame_nameless_args PARAMS ((struct frame_info *, long,
- int, int, GDB_FILE *));
+static void print_frame_nameless_args (struct frame_info *, long,
+ int, int, struct ui_file *);
static void display_info PARAMS ((char *, int));
static void do_examine PARAMS ((struct format_data, CORE_ADDR addr, asection * section));
-static void print_formatted PARAMS ((value_ptr, int, int, GDB_FILE *));
+static void print_formatted (value_ptr, int, int, struct ui_file *);
static struct format_data decode_format PARAMS ((char **, int, int));
-static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
+static int print_insn (CORE_ADDR, struct ui_file *);
static void sym_info PARAMS ((char *, int));
\f
register value_ptr val;
register int format;
int size;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
struct type *type = check_typedef (VALUE_TYPE (val));
int len = TYPE_LENGTH (type);
struct type *type;
int format;
int size;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
LONGEST val_long;
unsigned int len = TYPE_LENGTH (type);
void
print_address_symbolic (addr, stream, do_demangle, leadin)
CORE_ADDR addr;
- GDB_FILE *stream;
+ struct ui_file *stream;
int do_demangle;
char *leadin;
{
print_address_numeric (addr, use_local, stream)
CORE_ADDR addr;
int use_local;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
/* This assumes a CORE_ADDR can fit in a LONGEST. Probably a safe
assumption. */
void
print_address (addr, stream)
CORE_ADDR addr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
print_address_numeric (addr, 1, stream);
print_address_symbolic (addr, stream, asm_demangle, " ");
void
print_address_demangle (addr, stream, do_demangle)
CORE_ADDR addr;
- GDB_FILE *stream;
+ struct ui_file *stream;
int do_demangle;
{
if (addr == 0)
print_variable_value (var, frame, stream)
struct symbol *var;
struct frame_info *frame;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
value_ptr val = read_var_value (var, frame);
struct symbol *func;
struct frame_info *fi;
int num;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
struct block *b = NULL;
int nsyms = 0;
long start;
int num;
int first;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i;
CORE_ADDR argsaddr;
static int
print_insn (memaddr, stream)
CORE_ADDR memaddr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
/* OBSOLETE /* Pyramid target-dependent code for GDB. */
-/* OBSOLETE Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. */
+/* OBSOLETE Copyright (C) 1988, 1989, 1991, 2000 Free Software Foundation, Inc. */
/* OBSOLETE */
/* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
/* OBSOLETE int */
/* OBSOLETE pyr_print_insn (memaddr, stream) */
/* OBSOLETE CORE_ADDR memaddr; */
-/* OBSOLETE GDB_FILE *stream; */
+/* OBSOLETE struct ui_file *stream; */
/* OBSOLETE { */
/* OBSOLETE unsigned char buffer[MAXLEN]; */
/* OBSOLETE register int i, nargs, insn_size =4; */
/* Remote debugging interface for MIPS remote debugging protocol.
- Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1993-1995, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Ian Lance Taylor
<ian@cygnus.com>.
static void
fputc_readable (ch, file)
int ch;
- struct gdb_file *file;
+ struct ui_file *file;
{
if (ch == '\n')
fputc_unfiltered ('\n', file);
static void
fputs_readable (string, file)
char *string;
- struct gdb_file *file;
+ struct ui_file *file;
{
int c;
/* Generic remote debugging interface for simulators.
- Copyright 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Steve Chamberlain (sac@cygnus.com).
int i;
char b[2];
- gdb_file_write (gdb_stdtarg, buf, len);
+ ui_file_write (gdb_stdtarg, buf, len);
return len;
}
/* Remote debugging interface for AMD 29k interfaced via UDI, for GDB.
- Copyright 1990, 1992, 1995 Free Software Foundation, Inc.
+ Copyright 1990, 1992, 1995, 2000 Free Software Foundation, Inc.
Written by Daniel Mann. Contributed by AMD.
This file is part of GDB.
convert32 ()
{;
}
-GDB_FILE *EchoFile = 0; /* used for debugging */
+struct ui_file *EchoFile = 0; /* used for debugging */
int QuietMode = 0; /* used for debugging */
\f
#ifdef NO_HIF_SUPPORT
/* Remote target communications for serial-line targets in custom GDB protocol
- Copyright 1988, 91, 92, 93, 94, 95, 96, 97, 98, 1999
- Free Software Foundation, Inc.
+ Copyright 1988, 1991-2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Prototypes for local functions */
static void cleanup_sigint_signal_handler (void *dummy);
static void initialize_sigint_signal_handler (void);
+static int getpkt_sane (char *buf, long sizeof_buf, int forever);
static void handle_remote_sigint PARAMS ((int));
static void handle_remote_sigint_twice PARAMS ((int));
store it in BUF. If FOREVER, wait forever rather than timing out;
this is used (in synchronous mode) to wait for a target that is is
executing user code to stop. */
-
+/* FIXME: ezannoni 2000-02-01 this wrapper is necessary so that we
+ don't have to change all the calls to getpkt to deal with the
+ return value, because at the moment I don't know what the right
+ thing to do it for those. */
void
getpkt (char *buf,
long sizeof_buf,
int forever)
+{
+ int timed_out;
+
+ timed_out = getpkt_sane (buf, sizeof_buf, forever);
+}
+
+
+/* Read a packet from the remote machine, with error checking, and
+ store it in BUF. If FOREVER, wait forever rather than timing out;
+ this is used (in synchronous mode) to wait for a target that is is
+ executing user code to stop. If FOREVER == 0, this function is
+ allowed to time out gracefully and return an indication of this to
+ the caller. */
+int
+getpkt_sane (char *buf,
+ long sizeof_buf,
+ int forever)
{
int c;
int tries;
fprintf_unfiltered (gdb_stdlog, "\n");
}
SERIAL_WRITE (remote_desc, "+", 1);
- return;
+ return 0;
}
/* Try the whole thing again. */
printf_unfiltered ("Ignoring packet error, continuing...\n");
SERIAL_WRITE (remote_desc, "+", 1);
+ return 1;
}
\f
static void
static void
remote_rcmd (char *command,
- struct gdb_file *outbuf)
+ struct ui_file *outbuf)
{
int i;
char *buf = alloca (PBUFSIZ);
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 2000 Free Software Foundation, Inc.
This file is part of GDB.
int *, enum noside));
static value_ptr scm_lookup_name PARAMS ((char *));
static int in_eval_c PARAMS ((void));
-static void scm_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
+static void scm_printstr (struct ui_file * stream, char *string,
+ unsigned int length, int width,
+ int force_ellipses);
extern struct type **CONST_PTR (c_builtin_types[]);
void
scm_printchar (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fprintf_filtered (stream, "#\\%c", c);
}
static void
scm_printstr (stream, string, length, width, force_ellipses)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *string;
unsigned int length;
int width;
+/* Scheme/Guile language support routines for GDB, the GNU debugger.
+ Copyright 1995, 1996, 2000 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
#define SICP
#include "scm-tags.h"
#undef SCM_NCELLP
/* Forward decls for prototypes */
struct value;
-extern int scm_value_print PARAMS ((struct value *, GDB_FILE *,
- int, enum val_prettyprint));
+extern int scm_value_print (struct value *, struct ui_file *,
+ int, enum val_prettyprint);
-extern int scm_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+extern int scm_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
extern LONGEST scm_get_field PARAMS ((LONGEST, int));
-extern void scm_scmval_print PARAMS ((LONGEST, GDB_FILE *,
- int, int, int, enum val_prettyprint));
+extern void scm_scmval_print (LONGEST, struct ui_file *, int, int, int,
+ enum val_prettyprint);
extern int is_scmvalue_type PARAMS ((struct type *));
-extern void scm_printchar PARAMS ((int, GDB_FILE *));
+extern void scm_printchar (int, struct ui_file *);
extern struct value *scm_evaluate_string PARAMS ((char *, int));
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 2000 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcore.h"
/* FIXME: Should be in a header file that we import. */
-extern int
-c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-static void scm_ipruk PARAMS ((char *, LONGEST, GDB_FILE *));
-static void scm_scmlist_print PARAMS ((LONGEST, GDB_FILE *, int, int,
- int, enum val_prettyprint));
-static int scm_inferior_print PARAMS ((LONGEST, GDB_FILE *, int, int,
- int, enum val_prettyprint));
+static void scm_ipruk (char *, LONGEST, struct ui_file *);
+static void scm_scmlist_print (LONGEST, struct ui_file *, int, int,
+ int, enum val_prettyprint);
+static int scm_inferior_print (LONGEST, struct ui_file *, int, int,
+ int, enum val_prettyprint);
/* Prints the SCM value VALUE by invoking the inferior, if appropraite.
Returns >= 0 on succes; retunr -1 if the inferior cannot/should not
static int
scm_inferior_print (value, stream, format, deref_ref, recurse, pretty)
LONGEST value;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
static void
scm_scmlist_print (svalue, stream, format, deref_ref, recurse, pretty)
LONGEST svalue;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
scm_ipruk (hdr, ptr, stream)
char *hdr;
LONGEST ptr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fprintf_filtered (stream, "#<unknown-%s", hdr);
#define SCM_SIZE TYPE_LENGTH (builtin_type_scm)
void
scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
LONGEST svalue;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
int
scm_value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
/* Remote serial interface using Hitachi E7000 PC ISA card in a PC
- Copyright 1994, 1999 Free Software Foundation, Inc.
+ Copyright 1994, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static void
e7000pc_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print. */
return;
-/* Remote serial interface for local (hardwired) serial ports for
- GO32. Copyright 1992, 1993 Free Software Foundation, Inc.
+/* Remote serial interface for local (hardwired) serial ports for GO32.
+ Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
Contributed by Nigel Stephens, Algorithmics Ltd. (nigel@algor.co.uk).
static void
dos_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print */
return;
/* Remote serial interface for local (hardwired) serial ports for Macintosh.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Stan Shebs.
This file is part of GDB.
static void
mac_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print. */
return;
/* Remote serial interface for Macraigor Systems implementation of
On-Chip Debugging using serial target box or serial wiggler
- Copyright 1994, 1997, 1999 Free Software Foundation, Inc.
+ Copyright 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static void
ocd_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print. */
return;
/* Serial interface for local (hardwired) serial ports on Un*x like systems
- Copyright 1992, 1993, 1994, 1998-1999 Free Software Foundation, Inc.
+ Copyright 1992-1994, 1998-2000 Free Software Foundation, Inc.
This file is part of GDB.
static int hardwire_set_tty_state (serial_t scb, serial_ttystate state);
static int hardwire_noflush_set_tty_state (serial_t, serial_ttystate,
serial_ttystate);
-static void hardwire_print_tty_state (serial_t, serial_ttystate, struct gdb_file *);
+static void hardwire_print_tty_state (serial_t, serial_ttystate, struct ui_file *);
static int hardwire_drain_output (serial_t);
static int hardwire_flush_output (serial_t);
static int hardwire_flush_input (serial_t);
static void
hardwire_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
struct hardwire_ttystate *state = (struct hardwire_ttystate *) ttystate;
int i;
void
ser_unix_nop_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print. */
return;
/* Serial interface for UN*X file-descriptor based connection.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
extern void ser_unix_nop_raw (serial_t scb);
extern serial_ttystate ser_unix_nop_get_tty_state (serial_t scb);
extern int ser_unix_nop_set_tty_state (serial_t scb, serial_ttystate ttystate);
-extern void ser_unix_nop_print_tty_state (serial_t scb, serial_ttystate ttystate, struct gdb_file *stream);
+extern void ser_unix_nop_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *stream);
extern int ser_unix_nop_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
extern int ser_unix_nop_setbaudrate (serial_t scb, int rate);
extern int ser_unix_nop_setstopbits (serial_t scb, int rate);
/* Generic serial interface routines
- Copyright 1992, 1993, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
suitable for playback by gdbserver. */
static char *serial_logfile = NULL;
-static GDB_FILE *serial_logfp = NULL;
+static struct ui_file *serial_logfp = NULL;
static struct serial_ops *serial_interface_lookup (char *);
-static void serial_logchar (struct gdb_file *stream, int ch_type, int ch, int timeout);
+static void serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout);
static char logbase_hex[] = "hex";
static char logbase_octal[] = "octal";
static char logbase_ascii[] = "ascii";
#define SERIAL_BREAK 1235
static void
-serial_logchar (struct gdb_file *stream, int ch_type, int ch, int timeout)
+serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout)
{
if (ch_type != serial_current_type)
{
serial_current_type = 0;
/* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
- gdb_file_delete (serial_logfp);
+ ui_file_delete (serial_logfp);
serial_logfp = NULL;
}
void
serial_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
scb->ops->print_tty_state (scb, ttystate, stream);
}
/* Remote serial support interface definitions for GDB, the GNU Debugger.
- Copyright 1992, 1993, 1999 Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
the specified STREAM. FIXME: At present this sends output to the
default stream - GDB_STDOUT. */
-extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, struct gdb_file *);
+extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *);
#define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE, STREAM) serial_print_tty_state ((SERIAL_T), (TTYSTATE), (STREAM))
/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
void (*go_raw) (serial_t);
serial_ttystate (*get_tty_state) (serial_t);
int (*set_tty_state) (serial_t, serial_ttystate);
- void (*print_tty_state) (serial_t, serial_ttystate, struct gdb_file *);
+ void (*print_tty_state) (serial_t, serial_ttystate, struct ui_file *);
int (*noflush_set_tty_state) (serial_t, serial_ttystate, serial_ttystate);
int (*setbaudrate) (serial_t, int rate);
int (*setstopbits) (serial_t, int num);
/* Print and select stack frames for GDB, the GNU debugger.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 98, 1999, 2000
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991-1996, 1998-2000 Free Software Foundation, Inc.
This file is part of GDB.
static void select_frame_command PARAMS ((char *, int));
-static void print_frame_arg_vars PARAMS ((struct frame_info *, GDB_FILE *));
+static void print_frame_arg_vars (struct frame_info *, struct ui_file *);
static void catch_info PARAMS ((char *, int));
static void args_plus_locals_info PARAMS ((char *, int));
-static void print_frame_label_vars PARAMS ((struct frame_info *,
- int,
- GDB_FILE *));
+static void print_frame_label_vars (struct frame_info *, int,
+ struct ui_file *);
-static void print_frame_local_vars PARAMS ((struct frame_info *,
- int,
- GDB_FILE *));
+static void print_frame_local_vars (struct frame_info *, int,
+ struct ui_file *);
-static int print_block_frame_labels PARAMS ((struct block *, int *,
- GDB_FILE *));
+static int print_block_frame_labels (struct block *, int *,
+ struct ui_file *);
-static int print_block_frame_locals PARAMS ((struct block *,
- struct frame_info *,
- int,
- GDB_FILE *));
+static int print_block_frame_locals (struct block *,
+ struct frame_info *,
+ int,
+ struct ui_file *);
static void print_frame (struct frame_info *fi,
int level,
{
struct symbol *func;
struct frame_info *fi;
- GDB_FILE *stream;
+ struct ui_file *stream;
};
static int print_args_stub PARAMS ((PTR));
struct block *b;
register struct frame_info *fi;
int num_tabs;
- register GDB_FILE *stream;
+ register struct ui_file *stream;
{
int nsyms;
register int i, j;
print_block_frame_labels (b, have_default, stream)
struct block *b;
int *have_default;
- register GDB_FILE *stream;
+ register struct ui_file *stream;
{
int nsyms;
register int i;
print_frame_local_vars (fi, num_tabs, stream)
register struct frame_info *fi;
register int num_tabs;
- register GDB_FILE *stream;
+ register struct ui_file *stream;
{
register struct block *block = get_frame_block (fi);
register int values_printed = 0;
print_frame_label_vars (fi, this_level_only, stream)
register struct frame_info *fi;
int this_level_only;
- register GDB_FILE *stream;
+ register struct ui_file *stream;
{
register struct blockvector *bl;
register struct block *block = get_frame_block (fi);
static void
print_frame_arg_vars (fi, stream)
register struct frame_info *fi;
- register GDB_FILE *stream;
+ register struct ui_file *stream;
{
struct symbol *func = get_frame_function (fi);
register struct block *b;
/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998
- Free Software Foundation, Inc.
+ Copyright 1990-1996, 1998, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
}
void
-print_transfer_performance (struct gdb_file *stream,
+print_transfer_performance (struct ui_file *stream,
unsigned long data_count,
unsigned long write_count,
unsigned long time_count)
/* Do various things to symbol tables (other than lookup), for GDB.
- Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 1998
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991-1996, 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Prototypes for local functions */
-static void dump_symtab PARAMS ((struct objfile *, struct symtab *,
- GDB_FILE *));
+static void dump_symtab (struct objfile *, struct symtab *,
+ struct ui_file *);
-static void dump_psymtab PARAMS ((struct objfile *, struct partial_symtab *,
- GDB_FILE *));
+static void dump_psymtab (struct objfile *, struct partial_symtab *,
+ struct ui_file *);
-static void dump_msymbols PARAMS ((struct objfile *, GDB_FILE *));
+static void dump_msymbols (struct objfile *, struct ui_file *);
static void dump_objfile PARAMS ((struct objfile *));
static int block_depth PARAMS ((struct block *));
-static void print_partial_symbols PARAMS ((struct partial_symbol **, int,
- char *, GDB_FILE *));
+static void print_partial_symbols (struct partial_symbol **, int,
+ char *, struct ui_file *);
static void free_symtab_block PARAMS ((struct objfile *, struct block *));
{
struct symbol *symbol;
int depth;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
};
static int print_symbol PARAMS ((PTR));
static void
dump_msymbols (objfile, outfile)
struct objfile *objfile;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
{
struct minimal_symbol *msymbol;
int index;
dump_psymtab (objfile, psymtab, outfile)
struct objfile *objfile;
struct partial_symtab *psymtab;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
{
int i;
dump_symtab (objfile, symtab, outfile)
struct objfile *objfile;
struct symtab *symtab;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
{
register int i, j;
int len, blen;
int from_tty;
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup_gdb_file_delete (outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_SYMTABS (objfile, s)
{
struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
int depth = ((struct print_symbol_args *) args)->depth;
- GDB_FILE *outfile = ((struct print_symbol_args *) args)->outfile;
+ struct ui_file *outfile = ((struct print_symbol_args *) args)->outfile;
print_spaces (depth, outfile);
if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
int from_tty;
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *symname = NULL;
char *filename = DEV_TTY;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup_gdb_file_delete (outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_PSYMTABS (objfile, ps)
struct partial_symbol **p;
int count;
char *what;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
{
fprintf_filtered (outfile, " %s partial symbols:\n", what);
while (count-- > 0)
int from_tty;
{
char **argv;
- GDB_FILE *outfile;
+ struct ui_file *outfile;
struct cleanup *cleanups;
char *filename = DEV_TTY;
char *symname = NULL;
outfile = gdb_fopen (filename, FOPEN_WT);
if (outfile == 0)
perror_with_name (filename);
- make_cleanup_gdb_file_delete (outfile);
+ make_cleanup_ui_file_delete (outfile);
immediate_quit++;
ALL_OBJFILES (objfile)
/* OBSOLETE /* Print instructions for Tahoe target machines, for GDB. */
-/* OBSOLETE Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc. */
+/* OBSOLETE Copyright 1986, 1989, 1991, 1992, 2000 Free Software Foundation, Inc. */
/* OBSOLETE Contributed by the State University of New York at Buffalo, by the */
/* OBSOLETE Distributed Computer Systems Lab, Department of Computer Science, 1991. */
/* OBSOLETE */
/* OBSOLETE int */
/* OBSOLETE tahoe_print_insn (memaddr, stream) */
/* OBSOLETE CORE_ADDR memaddr; */
-/* OBSOLETE GDB_FILE *stream; */
+/* OBSOLETE struct ui_file *stream; */
/* OBSOLETE { */
/* OBSOLETE unsigned char buffer[MAXLEN]; */
/* OBSOLETE register int i; */
/* OBSOLETE char *d; */
/* OBSOLETE register char *p; */
/* OBSOLETE CORE_ADDR addr; */
-/* OBSOLETE GDB_FILE *stream; */
+/* OBSOLETE struct ui_file *stream; */
/* OBSOLETE { */
/* OBSOLETE int temp1 = 0; */
/* OBSOLETE register int regnum = *p & 0xf; */
/* Select target systems and architectures at runtime for GDB.
- Copyright 1990, 1992-1995, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1990, 1992-1995, 1998-2000 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
(int (*) (int, char *, char *, int *))
return_zero);
de_fault (to_rcmd,
- (void (*) (char *, struct gdb_file *))
+ (void (*) (char *, struct ui_file *))
tcomplain);
de_fault (to_enable_exception_callback,
(struct symtab_and_line * (*) (enum exception_event_kind, int))
static void
debug_to_rcmd (char *command,
- struct gdb_file *outbuf)
+ struct ui_file *outbuf)
{
debug_target.to_rcmd (command, outbuf);
fprintf_unfiltered (gdb_stdlog, "target_rcmd (%s, ...)\n", command);
/* Interface between GDB and target environments, including files and processes
- Copyright 1990, 91, 92, 93, 94, 1999 Free Software Foundation, Inc.
+ Copyright 1990-1994, 1999, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
This file is part of GDB.
char *(*to_extra_thread_info) PARAMS ((struct thread_info *));
void (*to_stop) PARAMS ((void));
int (*to_query) PARAMS ((int /*char */ , char *, char *, int *));
- void (*to_rcmd) (char *command, struct gdb_file *output);
+ void (*to_rcmd) (char *command, struct ui_file *output);
struct symtab_and_line *(*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
struct exception_event_record *(*to_get_current_exception_event) PARAMS ((void));
char *(*to_pid_to_exec_file) PARAMS ((int pid));
/* Top level stuff for GDB, the GNU debugger.
- Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
- Free Software Foundation, Inc.
+ Copyright 1986-2000 Free Software Foundation, Inc.
This file is part of GDB.
print_command_line (cmd, depth, stream)
struct command_line *cmd;
unsigned int depth;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
unsigned int i;
/* Print the GDB banner. */
void
print_gdb_version (stream)
- GDB_FILE *stream;
+ struct ui_file *stream;
{
/* From GNU coding standards, first line is meant to be easy for a
program to parse, and is just canonical program name and version
/* Top level stuff for GDB, the GNU debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986-1994, 2000 Free Software Foundation, Inc.
This file is part of GDB.
extern int epoch_interface;
extern char gdbinit[];
-extern void print_gdb_version PARAMS ((GDB_FILE *));
+extern void print_gdb_version (struct ui_file *);
extern void source_command PARAMS ((char *, int));
extern void cd_command PARAMS ((char *, int));
+Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * tui-file.c, tui-file.h, tuiDisassem.c, tuiIO.c, tuiIO.h,
+ tuiRegs.c: Update to reflect rename of gdb-file / GDB_FILE to
+ ui-file / ``struct ui_file''.
+
Mon Jan 31 18:12:43 2000 Andrew Cagney <cagney@b1.cygnus.com>
* tui-file.c (enum streamtype, struct tui_stream, tui_file_new,
-/* GDB_FILE - a generic STDIO like output stream.
+/* UI_FILE - a generic STDIO like output stream.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "gdb-file.h"
+#include "ui-file.h"
#include "tui/tui-file.h"
#include <string.h>
/* Called instead of fputs for all TUI_FILE output. */
-void (*fputs_unfiltered_hook) (const char *linebuffer, GDB_FILE * stream);
+void (*fputs_unfiltered_hook) (const char *linebuffer,
+ struct ui_file * stream);
-/* A ``struct gdb_file'' that is compatible with all the legacy
+/* A ``struct ui_file'' that is compatible with all the legacy
code. */
/* new */
int ts_buflen;
};
-static gdb_file_flush_ftype tui_file_flush;
-extern gdb_file_fputs_ftype tui_file_fputs;
-static gdb_file_isatty_ftype tui_file_isatty;
-static gdb_file_rewind_ftype tui_file_rewind;
-static gdb_file_put_ftype tui_file_put;
-static gdb_file_delete_ftype tui_file_delete;
-static struct gdb_file *tui_file_new PARAMS ((void));
+static ui_file_flush_ftype tui_file_flush;
+extern ui_file_fputs_ftype tui_file_fputs;
+static ui_file_isatty_ftype tui_file_isatty;
+static ui_file_rewind_ftype tui_file_rewind;
+static ui_file_put_ftype tui_file_put;
+static ui_file_delete_ftype tui_file_delete;
+static struct ui_file *tui_file_new PARAMS ((void));
static int tui_file_magic;
-static struct gdb_file *
+static struct ui_file *
tui_file_new ()
{
struct tui_stream *tui = xmalloc (sizeof (struct tui_stream));
- struct gdb_file *file = gdb_file_new ();
- set_gdb_file_data (file, tui, tui_file_delete);
- set_gdb_file_flush (file, tui_file_flush);
- set_gdb_file_fputs (file, tui_file_fputs);
- set_gdb_file_isatty (file, tui_file_isatty);
- set_gdb_file_rewind (file, tui_file_rewind);
- set_gdb_file_put (file, tui_file_put);
+ struct ui_file *file = ui_file_new ();
+ set_ui_file_data (file, tui, tui_file_delete);
+ set_ui_file_flush (file, tui_file_flush);
+ set_ui_file_fputs (file, tui_file_fputs);
+ set_ui_file_isatty (file, tui_file_isatty);
+ set_ui_file_rewind (file, tui_file_rewind);
+ set_ui_file_put (file, tui_file_put);
tui->ts_magic = &tui_file_magic;
return file;
}
static void
tui_file_delete (file)
- struct gdb_file *file;
+ struct ui_file *file;
{
- struct tui_stream *tmpstream = gdb_file_data (file);
+ struct tui_stream *tmpstream = ui_file_data (file);
if (tmpstream->ts_magic != &tui_file_magic)
internal_error ("tui_file_delete: bad magic number");
if ((tmpstream->ts_streamtype == astring) &&
free (tmpstream);
}
-struct gdb_file *
+struct ui_file *
tui_fileopen (stream)
FILE *stream;
{
- struct gdb_file *file = tui_file_new ();
- struct tui_stream *tmpstream = gdb_file_data (file);
+ struct ui_file *file = tui_file_new ();
+ struct tui_stream *tmpstream = ui_file_data (file);
tmpstream->ts_streamtype = afile;
tmpstream->ts_filestream = stream;
tmpstream->ts_strbuf = NULL;
return file;
}
-struct gdb_file *
+struct ui_file *
tui_sfileopen (n)
int n;
{
- struct gdb_file *file = tui_file_new ();
- struct tui_stream *tmpstream = gdb_file_data (file);
+ struct ui_file *file = tui_file_new ();
+ struct tui_stream *tmpstream = ui_file_data (file);
tmpstream->ts_streamtype = astring;
tmpstream->ts_filestream = NULL;
if (n > 0)
static int
tui_file_isatty (file)
- struct gdb_file *file;
+ struct ui_file *file;
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_isatty: bad magic number");
if (stream->ts_streamtype == afile)
static void
tui_file_rewind (file)
- struct gdb_file *file;
+ struct ui_file *file;
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_rewind: bad magic number");
stream->ts_strbuf[0] = '\0';
}
static void
-tui_file_put (struct gdb_file *file,
- gdb_file_put_method_ftype *write,
+tui_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
void *dest)
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_put: bad magic number");
if (stream->ts_streamtype == astring)
void
tui_file_fputs (linebuffer, file)
const char *linebuffer;
- GDB_FILE *file;
+ struct ui_file *file;
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
#if defined(TUI)
extern int tui_owns_terminal;
#endif
/* NOTE: cagney/1999-10-13: The use of fputs_unfiltered_hook is
seriously discouraged. Those wanting to hook output should
- instead implement their own gdb_file object and install that. See
+ instead implement their own ui_file object and install that. See
also tui_file_flush(). */
if (fputs_unfiltered_hook
&& (file == gdb_stdout
}
char *
-tui_file_get_strbuf (struct gdb_file *file)
+tui_file_get_strbuf (struct ui_file *file)
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_get_strbuf: bad magic number");
return (stream->ts_strbuf);
/* adjust the length of the buffer by the amount necessary
to accomodate appending a string of length N to the buffer contents */
void
-tui_file_adjust_strbuf (int n, struct gdb_file *file)
+tui_file_adjust_strbuf (int n, struct ui_file *file)
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
int non_null_chars;
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_adjust_strbuf: bad magic number");
static void
tui_file_flush (file)
- GDB_FILE *file;
+ struct ui_file *file;
{
- struct tui_stream *stream = gdb_file_data (file);
+ struct tui_stream *stream = ui_file_data (file);
if (stream->ts_magic != &tui_file_magic)
internal_error ("tui_file_flush: bad magic number");
/* NOTE: cagney/1999-10-12: If we've been linked with code that uses
fputs_unfiltered_hook then we assume that it doesn't need to know
about flushes. Code that does need to know about flushes can
- implement a proper gdb_file object. */
+ implement a proper ui_file object. */
if (fputs_unfiltered_hook)
return;
-/* GDB_FILE - a generic STDIO like output stream.
+/* UI_FILE - a generic STDIO like output stream.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GDB.
#ifndef TUI_FILE_H
#define TUI_FILE_H
-extern struct gdb_file *tui_fileopen (FILE *);
-extern struct gdb_file *tui_sfileopen (int);
-extern char *tui_file_get_strbuf (struct gdb_file *);
-extern void tui_file_adjust_strbuf (int, struct gdb_file *);
+extern struct ui_file *tui_fileopen (FILE *);
+extern struct ui_file *tui_sfileopen (int);
+extern char *tui_file_get_strbuf (struct ui_file *);
+extern void tui_file_adjust_strbuf (int, struct ui_file *);
/* NOTE: cagney/1999-10-14: fputs_unfiltered_hook is deprecated. Code
wanting to control GDB's output should override the gdb_std...
files. */
extern void (*fputs_unfiltered_hook) (const char *linebuffer,
- GDB_FILE * stream);
+ struct ui_file * stream);
#endif
#endif
{
TuiStatus ret = TUI_FAILURE;
- GDB_FILE *gdb_dis_out;
+ struct ui_file *gdb_dis_out;
if (startAddr != (Opaque) NULL)
{
lineWidth = disassemWin->generic.width - 1;
threshold = (lineWidth - 1) + offset;
- /* now init the gdb_file structure */
+ /* now init the ui_file structure */
gdb_dis_out = tui_sfileopen (threshold);
INIT_DISASSEMBLE_INFO_NO_ARCH (asmInfo, gdb_dis_out, (fprintf_ftype) fprintf_filtered);
/* reset the buffer to empty */
tui_file_get_strbuf (gdb_dis_out)[0] = '\0';
}
- gdb_file_delete (gdb_dis_out);
+ ui_file_delete (gdb_dis_out);
gdb_dis_out = NULL;
disassemWin->generic.contentSize = curLine;
ret = TUI_SUCCESS;
#ifdef __STDC__
tuiPuts_unfiltered (
const char *string,
- GDB_FILE * stream)
+ struct ui_file * stream)
#else
tuiPuts_unfiltered (string, stream)
char *string;
- GDB_FILE *stream;
+ struct ui_file *stream;
#endif
{
int len = strlen (string);
#include <stdio.h>
-extern void tuiPuts_unfiltered PARAMS ((const char *, GDB_FILE *));
+extern void tuiPuts_unfiltered (const char *, struct ui_file *);
extern unsigned int tuiGetc PARAMS ((void));
extern unsigned int tuiBufferGetc PARAMS ((void));
extern int tuiRead PARAMS ((int, char *, int));
{
char tmpBuf[15];
char *fmt;
- GDB_FILE *stream;
+ struct ui_file *stream;
stream = tui_sfileopen (bufLen);
pa_do_strcat_registers_info (regNum, 0, stream, precision);
strcpy (buf, tui_file_get_strbuf (stream));
- gdb_file_delete (stream);
+ ui_file_delete (stream);
return;
} /* _tuiRegisterFormat */
/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright 1986, 88, 89, 91, 92, 93, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991-1993, 1998, 2000 Free Software Foundation, Inc.
This file is part of GDB.
type_print (type, varstring, stream, show)
struct type *type;
char *varstring;
- GDB_FILE *stream;
+ struct ui_file *stream;
int show;
{
LA_PRINT_TYPE (type, varstring, stream, show, 0);
print_type_scalar (type, val, stream)
struct type *type;
LONGEST val;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
unsigned int i;
unsigned len;
/* Language independent support for printing types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1999
+ Copyright 1986, 1988, 1989, 1991-1993, 1999, 2000
Free Software Foundation, Inc.
This file is part of GDB.
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-void
-print_type_scalar PARAMS ((struct type * type, LONGEST, GDB_FILE *));
+void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
-void
-c_type_print_varspec_suffix PARAMS ((struct type *, GDB_FILE *, int, int, int));
+void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
+ int, int);
--- /dev/null
+/* UI_FILE - a generic STDIO like output stream.
+ Copyright (C) 1999, 2000 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Implement the ``struct ui_file'' object. */
+
+#include "defs.h"
+#include "ui-file.h"
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+static ui_file_isatty_ftype null_file_isatty;
+static ui_file_write_ftype null_file_write;
+static ui_file_fputs_ftype null_file_fputs;
+static ui_file_flush_ftype null_file_flush;
+static ui_file_delete_ftype null_file_delete;
+static ui_file_rewind_ftype null_file_rewind;
+static ui_file_put_ftype null_file_put;
+
+struct ui_file
+ {
+ int *magic;
+ ui_file_flush_ftype *to_flush;
+ ui_file_write_ftype *to_write;
+ ui_file_fputs_ftype *to_fputs;
+ ui_file_delete_ftype *to_delete;
+ ui_file_isatty_ftype *to_isatty;
+ ui_file_rewind_ftype *to_rewind;
+ ui_file_put_ftype *to_put;
+ void *to_data;
+ };
+int ui_file_magic;
+
+struct ui_file *
+ui_file_new ()
+{
+ struct ui_file *file = xmalloc (sizeof (struct ui_file));
+ file->magic = &ui_file_magic;
+ set_ui_file_data (file, NULL, null_file_delete);
+ set_ui_file_flush (file, null_file_flush);
+ set_ui_file_write (file, null_file_write);
+ set_ui_file_fputs (file, null_file_fputs);
+ set_ui_file_isatty (file, null_file_isatty);
+ set_ui_file_rewind (file, null_file_rewind);
+ set_ui_file_put (file, null_file_put);
+ return file;
+}
+
+void
+ui_file_delete (file)
+ struct ui_file *file;
+{
+ file->to_delete (file);
+ free (file);
+}
+
+static int
+null_file_isatty (file)
+ struct ui_file *file;
+{
+ return 0;
+}
+
+static void
+null_file_rewind (file)
+ struct ui_file *file;
+{
+ return;
+}
+
+static void
+null_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ return;
+}
+
+static void
+null_file_flush (file)
+ struct ui_file *file;
+{
+ return;
+}
+
+static void
+null_file_write (struct ui_file *file,
+ const char *buf,
+ long sizeof_buf)
+{
+ if (file->to_fputs == null_file_fputs)
+ /* Both the write and fputs methods are null. Discard the
+ request. */
+ return;
+ else
+ {
+ /* The fputs method isn't null, slowly pass the write request
+ onto that. FYI, this isn't as bad as it may look - the
+ current (as of 1999-11-07) printf_* function calls fputc and
+ fputc does exactly the below. By having a write function it
+ is possible to clean up that code. */
+ int i;
+ char b[2];
+ b[1] = '\0';
+ for (i = 0; i < sizeof_buf; i++)
+ {
+ b[0] = buf[i];
+ file->to_fputs (b, file);
+ }
+ return;
+ }
+}
+
+static void
+null_file_fputs (buf, file)
+ const char *buf;
+ struct ui_file *file;
+{
+ if (file->to_write == null_file_write)
+ /* Both the write and fputs methods are null. Discard the
+ request. */
+ return;
+ else
+ {
+ /* The write method was implemented, use that. */
+ file->to_write (file, buf, strlen (buf));
+ }
+}
+
+static void
+null_file_delete (file)
+ struct ui_file *file;
+{
+ return;
+}
+
+void *
+ui_file_data (file)
+ struct ui_file *file;
+{
+ if (file->magic != &ui_file_magic)
+ internal_error ("ui_file_data: bad magic number");
+ return file->to_data;
+}
+
+void
+gdb_flush (file)
+ struct ui_file *file;
+{
+ file->to_flush (file);
+}
+
+int
+ui_file_isatty (file)
+ struct ui_file *file;
+{
+ return file->to_isatty (file);
+}
+
+void
+ui_file_rewind (file)
+ struct ui_file *file;
+{
+ file->to_rewind (file);
+}
+
+void
+ui_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ file->to_put (file, write, dest);
+}
+
+void
+ui_file_write (struct ui_file *file,
+ const char *buf,
+ long length_buf)
+{
+ file->to_write (file, buf, length_buf);
+}
+
+void
+fputs_unfiltered (buf, file)
+ const char *buf;
+ struct ui_file *file;
+{
+ file->to_fputs (buf, file);
+}
+
+void
+set_ui_file_flush (file, flush)
+ struct ui_file *file;
+ ui_file_flush_ftype *flush;
+{
+ file->to_flush = flush;
+}
+
+void
+set_ui_file_isatty (file, isatty)
+ struct ui_file *file;
+ ui_file_isatty_ftype *isatty;
+{
+ file->to_isatty = isatty;
+}
+
+void
+set_ui_file_rewind (file, rewind)
+ struct ui_file *file;
+ ui_file_rewind_ftype *rewind;
+{
+ file->to_rewind = rewind;
+}
+
+void
+set_ui_file_put (file, put)
+ struct ui_file *file;
+ ui_file_put_ftype *put;
+{
+ file->to_put = put;
+}
+
+void
+set_ui_file_write (struct ui_file *file,
+ ui_file_write_ftype *write)
+{
+ file->to_write = write;
+}
+
+void
+set_ui_file_fputs (file, fputs)
+ struct ui_file *file;
+ ui_file_fputs_ftype *fputs;
+{
+ file->to_fputs = fputs;
+}
+
+void
+set_ui_file_data (file, data, delete)
+ struct ui_file *file;
+ void *data;
+ ui_file_delete_ftype *delete;
+{
+ file->to_data = data;
+ file->to_delete = delete;
+}
+
+/* ui_file utility function for converting a ``struct ui_file'' into
+ a memory buffer''. */
+
+struct accumulated_ui_file
+{
+ char *buffer;
+ long length;
+};
+
+static void
+do_ui_file_xstrdup (void *context, const char *buffer, long length)
+{
+ struct accumulated_ui_file *acc = context;
+ if (acc->buffer == NULL)
+ acc->buffer = xmalloc (length + 1);
+ else
+ acc->buffer = xrealloc (acc->buffer, acc->length + length + 1);
+ memcpy (acc->buffer + acc->length, buffer, length);
+ acc->length += length;
+ acc->buffer[acc->length] = '\0';
+}
+
+char *
+ui_file_xstrdup (struct ui_file *file,
+ long *length)
+{
+ struct accumulated_ui_file acc;
+ acc.buffer = NULL;
+ acc.length = 0;
+ ui_file_put (file, do_ui_file_xstrdup, &acc);
+ if (acc.buffer == NULL)
+ acc.buffer = xstrdup ("");
+ *length = acc.length;
+ return acc.buffer;
+}
+\f
+/* A pure memory based ``struct ui_file'' that can be used an output
+ buffer. The buffers accumulated contents are available via
+ ui_file_put(). */
+
+struct mem_file
+ {
+ int *magic;
+ char *buffer;
+ int sizeof_buffer;
+ int length_buffer;
+ };
+
+static ui_file_rewind_ftype mem_file_rewind;
+static ui_file_put_ftype mem_file_put;
+static ui_file_write_ftype mem_file_write;
+static ui_file_delete_ftype mem_file_delete;
+static struct ui_file *mem_file_new PARAMS ((void));
+static int mem_file_magic;
+
+static struct ui_file *
+mem_file_new (void)
+{
+ struct mem_file *stream = XMALLOC (struct mem_file);
+ struct ui_file *file = ui_file_new ();
+ set_ui_file_data (file, stream, mem_file_delete);
+ set_ui_file_rewind (file, mem_file_rewind);
+ set_ui_file_put (file, mem_file_put);
+ set_ui_file_write (file, mem_file_write);
+ stream->magic = &mem_file_magic;
+ stream->buffer = NULL;
+ stream->sizeof_buffer = 0;
+ stream->length_buffer = 0;
+ return file;
+}
+
+static void
+mem_file_delete (struct ui_file *file)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error ("mem_file_delete: bad magic number");
+ if (stream->buffer != NULL)
+ free (stream->buffer);
+ free (stream);
+}
+
+struct ui_file *
+mem_fileopen (void)
+{
+ return mem_file_new ();
+}
+
+static void
+mem_file_rewind (struct ui_file *file)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error ("mem_file_rewind: bad magic number");
+ stream->length_buffer = 0;
+}
+
+static void
+mem_file_put (struct ui_file *file,
+ ui_file_put_method_ftype *write,
+ void *dest)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error ("mem_file_put: bad magic number");
+ if (stream->length_buffer > 0)
+ write (dest, stream->buffer, stream->length_buffer);
+}
+
+void
+mem_file_write (struct ui_file *file,
+ const char *buffer,
+ long length_buffer)
+{
+ struct mem_file *stream = ui_file_data (file);
+ if (stream->magic != &mem_file_magic)
+ internal_error ("mem_file_write: bad magic number");
+ if (stream->buffer == NULL)
+ {
+ stream->length_buffer = length_buffer;
+ stream->sizeof_buffer = length_buffer;
+ stream->buffer = xmalloc (stream->sizeof_buffer);
+ memcpy (stream->buffer, buffer, length_buffer);
+ }
+ else
+ {
+ int new_length = stream->length_buffer + length_buffer;
+ if (new_length >= stream->sizeof_buffer)
+ {
+ stream->sizeof_buffer = new_length;
+ stream->buffer = xrealloc (stream->buffer, stream->sizeof_buffer);
+ }
+ memcpy (stream->buffer + stream->length_buffer, buffer, length_buffer);
+ stream->length_buffer = new_length;
+ }
+}
+\f
+/* ``struct ui_file'' implementation that maps directly onto
+ <stdio.h>'s FILE. */
+
+static ui_file_write_ftype stdio_file_write;
+static ui_file_fputs_ftype stdio_file_fputs;
+static ui_file_isatty_ftype stdio_file_isatty;
+static ui_file_delete_ftype stdio_file_delete;
+static struct ui_file *stdio_file_new PARAMS ((FILE * file, int close_p));
+static ui_file_flush_ftype stdio_file_flush;
+
+static int stdio_file_magic;
+
+struct stdio_file
+ {
+ int *magic;
+ FILE *file;
+ int close_p;
+ };
+
+static struct ui_file *
+stdio_file_new (file, close_p)
+ FILE *file;
+ int close_p;
+{
+ struct ui_file *ui_file = ui_file_new ();
+ struct stdio_file *stdio = xmalloc (sizeof (struct stdio_file));
+ stdio->magic = &stdio_file_magic;
+ stdio->file = file;
+ stdio->close_p = close_p;
+ set_ui_file_data (ui_file, stdio, stdio_file_delete);
+ set_ui_file_flush (ui_file, stdio_file_flush);
+ set_ui_file_write (ui_file, stdio_file_write);
+ set_ui_file_fputs (ui_file, stdio_file_fputs);
+ set_ui_file_isatty (ui_file, stdio_file_isatty);
+ return ui_file;
+}
+
+static void
+stdio_file_delete (file)
+ struct ui_file *file;
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error ("stdio_file_delete: bad magic number");
+ if (stdio->close_p)
+ {
+ fclose (stdio->file);
+ }
+ free (stdio);
+}
+
+static void
+stdio_file_flush (file)
+ struct ui_file *file;
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error ("stdio_file_flush: bad magic number");
+ fflush (stdio->file);
+}
+
+static void
+stdio_file_write (struct ui_file *file, const char *buf, long length_buf)
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error ("stdio_file_write: bad magic number");
+ fwrite (buf, length_buf, 1, stdio->file);
+}
+
+static void
+stdio_file_fputs (linebuffer, file)
+ const char *linebuffer;
+ struct ui_file *file;
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error ("stdio_file_fputs: bad magic number");
+ fputs (linebuffer, stdio->file);
+}
+
+static int
+stdio_file_isatty (file)
+ struct ui_file *file;
+{
+ struct stdio_file *stdio = ui_file_data (file);
+ if (stdio->magic != &stdio_file_magic)
+ internal_error ("stdio_file_isatty: bad magic number");
+ return (isatty (fileno (stdio->file)));
+}
+
+/* Like fdopen(). Create a ui_file from a previously opened FILE. */
+
+struct ui_file *
+stdio_fileopen (file)
+ FILE *file;
+{
+ return stdio_file_new (file, 0);
+}
+
+struct ui_file *
+gdb_fopen (name, mode)
+ char *name;
+ char *mode;
+{
+ FILE *f = fopen (name, mode);
+ if (f == NULL)
+ return NULL;
+ return stdio_file_new (f, 1);
+}
--- /dev/null
+/* UI_FILE - a generic STDIO like output stream.
+ Copyright (C) 1999, 2000 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef UI_FILE_H
+#define UI_FILE_H
+
+struct ui_file;
+
+/* Create a generic ui_file object with null methods. */
+
+extern struct ui_file *ui_file_new (void);
+
+/* Override methods used by specific implementations of a UI_FILE
+ object. */
+
+typedef void (ui_file_flush_ftype) (struct ui_file * stream);
+extern void set_ui_file_flush (struct ui_file *stream, ui_file_flush_ftype * flush);
+
+/* NOTE: Both fputs and write methods are available. Default
+ implementations that mapping one onto the other are included. */
+typedef void (ui_file_write_ftype) (struct ui_file * stream, const char *buf, long length_buf);
+extern void set_ui_file_write (struct ui_file *stream, ui_file_write_ftype *fputs);
+
+typedef void (ui_file_fputs_ftype) (const char *, struct ui_file * stream);
+extern void set_ui_file_fputs (struct ui_file *stream, ui_file_fputs_ftype * fputs);
+
+typedef int (ui_file_isatty_ftype) (struct ui_file * stream);
+extern void set_ui_file_isatty (struct ui_file *stream, ui_file_isatty_ftype * isatty);
+
+typedef void (ui_file_rewind_ftype) (struct ui_file * stream);
+extern void set_ui_file_rewind (struct ui_file *stream, ui_file_rewind_ftype * rewind);
+
+typedef void (ui_file_put_method_ftype) (void *object, const char *buffer, long length_buffer);
+typedef void (ui_file_put_ftype) (struct ui_file *stream, ui_file_put_method_ftype * method, void *context);
+extern void set_ui_file_put (struct ui_file *stream, ui_file_put_ftype * put);
+
+typedef void (ui_file_delete_ftype) (struct ui_file * stream);
+extern void set_ui_file_data (struct ui_file *stream, void *data, ui_file_delete_ftype * delete);
+
+extern void *ui_file_data (struct ui_file *file);
+
+
+extern void gdb_flush (struct ui_file *);
+
+extern void ui_file_delete (struct ui_file *stream);
+
+extern void ui_file_rewind (struct ui_file *stream);
+
+extern int ui_file_isatty (struct ui_file *);
+
+extern void ui_file_write (struct ui_file *file, const char *buf, long length_buf);
+
+/* NOTE: copies left to right */
+extern void ui_file_put (struct ui_file *src, ui_file_put_method_ftype *write, void *dest);
+
+/* Returns a freshly allocated buffer containing the entire contents
+ of FILE (as determined by ui_file_put()) with a NUL character
+ appended. LENGTH is set to the size of the buffer minus that
+ appended NUL. */
+extern char *ui_file_xstrdup (struct ui_file *file, long *length);
+
+
+
+/* Create/open a memory based file. Can be used as a scratch buffer
+ for collecting output. */
+extern struct ui_file *mem_fileopen (void);
+
+
+
+/* Open/create a an STDIO based UI_FILE using the already open FILE. */
+extern struct ui_file *stdio_fileopen (FILE *file);
+
+/* Open NAME returning an STDIO based UI_FILE. */
+extern struct ui_file *gdb_fopen (char *name, char *mode);
+
+#endif
/* General utility routines for GDB, the GNU debugger.
- Copyright 1986, 89, 90, 91, 92, 95, 96, 1998 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1990-1992, 1995, 1996, 1998, 2000
+ Free Software Foundation, Inc.
This file is part of GDB.
/* Holds the last error message issued by gdb */
-static GDB_FILE *gdb_lasterr;
+static struct ui_file *gdb_lasterr;
/* Prototypes for local functions */
-static void vfprintf_maybe_filtered PARAMS ((GDB_FILE *, const char *,
- va_list, int));
+static void vfprintf_maybe_filtered (struct ui_file *, const char *,
+ va_list, int);
-static void fputs_maybe_filtered PARAMS ((const char *, GDB_FILE *, int));
+static void fputs_maybe_filtered (const char *, struct ui_file *, int);
#if defined (USE_MMALLOC) && !defined (NO_MMCHECK)
static void malloc_botch PARAMS ((void));
static void
set_width PARAMS ((void));
-#ifndef GDB_FILE_ISATTY
-#define GDB_FILE_ISATTY(GDB_FILE_PTR) (gdb_file_isatty(GDB_FILE_PTR))
-#endif
-
/* Chain of cleanup actions established with make_cleanup,
to be executed if an error happens. */
}
static void
-do_gdb_file_delete (void *arg)
+do_ui_file_delete (void *arg)
{
- gdb_file_delete (arg);
+ ui_file_delete (arg);
}
struct cleanup *
-make_cleanup_gdb_file_delete (struct gdb_file *arg)
+make_cleanup_ui_file_delete (struct ui_file *arg)
{
- return make_my_cleanup (&cleanup_chain, do_gdb_file_delete, arg);
+ return make_my_cleanup (&cleanup_chain, do_ui_file_delete, arg);
}
struct cleanup *
va_list twice which works on some platforms and fails miserably on
others. */
/* Save it as the last error */
- gdb_file_rewind (gdb_lasterr);
+ ui_file_rewind (gdb_lasterr);
vfprintf_filtered (gdb_lasterr, string, args);
/* Retrieve the last error and print it to gdb_stderr */
err_string = error_last_message ();
}
NORETURN void
-error_stream (GDB_FILE *stream)
+error_stream (struct ui_file *stream)
{
long size;
- char *msg = gdb_file_xstrdup (stream, &size);
+ char *msg = ui_file_xstrdup (stream, &size);
make_cleanup (free, msg);
error ("%s", msg);
}
error_last_message (void)
{
long len;
- return gdb_file_xstrdup (gdb_lasterr, &len);
+ return ui_file_xstrdup (gdb_lasterr, &len);
}
/* This is to be called by main() at the very beginning */
void
print_spaces (n, file)
register int n;
- register GDB_FILE *file;
+ register struct ui_file *file;
{
fputs_unfiltered (n_spaces (n), file);
}
/* Print a host address. */
void
-gdb_print_host_address (void *addr, struct gdb_file *stream)
+gdb_print_host_address (void *addr, struct ui_file *stream)
{
/* We could use the %p conversion specifier to fprintf if we had any
be call for printing things which are independent of the language
of the program being debugged. */
-static void printchar PARAMS ((int c, void (*do_fputs) (const char *, GDB_FILE*), void (*do_fprintf) (GDB_FILE*, const char *, ...), GDB_FILE *stream, int quoter));
+static void printchar (int c, void (*do_fputs) (const char *, struct ui_file*), void (*do_fprintf) (struct ui_file*, const char *, ...), struct ui_file *stream, int quoter);
static void
printchar (c, do_fputs, do_fprintf, stream, quoter)
int c;
- void (*do_fputs) PARAMS ((const char *, GDB_FILE*));
- void (*do_fprintf) PARAMS ((GDB_FILE*, const char *, ...));
- GDB_FILE *stream;
+ void (*do_fputs) PARAMS ((const char *, struct ui_file*));
+ void (*do_fprintf) PARAMS ((struct ui_file*, const char *, ...));
+ struct ui_file *stream;
int quoter;
{
fputstr_filtered (str, quoter, stream)
const char *str;
int quoter;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
while (*str)
printchar (*str++, fputs_filtered, fprintf_filtered, stream, quoter);
fputstr_unfiltered (str, quoter, stream)
const char *str;
int quoter;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
while (*str)
printchar (*str++, fputs_unfiltered, fprintf_unfiltered, stream, quoter);
const char *str;
int n;
int quoter;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i;
for (i = 0; i < n; i++)
#endif
#endif
/* If the output is not a terminal, don't paginate it. */
- if (!GDB_FILE_ISATTY (gdb_stdout))
+ if (!ui_file_isatty (gdb_stdout))
lines_per_page = UINT_MAX;
} /* the command_line_version */
set_width ();
static void
fputs_maybe_filtered (linebuffer, stream, filter)
const char *linebuffer;
- GDB_FILE *stream;
+ struct ui_file *stream;
int filter;
{
const char *lineptr;
void
fputs_filtered (linebuffer, stream)
const char *linebuffer;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fputs_maybe_filtered (linebuffer, stream, 1);
}
int c;
{
char buf = c;
- gdb_file_write (gdb_stdout, &buf, 1);
+ ui_file_write (gdb_stdout, &buf, 1);
return c;
}
int
fputc_unfiltered (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
char buf = c;
- gdb_file_write (stream, &buf, 1);
+ ui_file_write (stream, &buf, 1);
return c;
}
int
fputc_filtered (c, stream)
int c;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
char buf[2];
static void
vfprintf_maybe_filtered (stream, format, args, filter)
- GDB_FILE *stream;
+ struct ui_file *stream;
const char *format;
va_list args;
int filter;
void
vfprintf_filtered (stream, format, args)
- GDB_FILE *stream;
+ struct ui_file *stream;
const char *format;
va_list args;
{
void
vfprintf_unfiltered (stream, format, args)
- GDB_FILE *stream;
+ struct ui_file *stream;
const char *format;
va_list args;
{
}
void
-fprintf_filtered (GDB_FILE * stream, const char *format,...)
+fprintf_filtered (struct ui_file * stream, const char *format,...)
{
va_list args;
va_start (args, format);
}
void
-fprintf_unfiltered (GDB_FILE * stream, const char *format,...)
+fprintf_unfiltered (struct ui_file * stream, const char *format,...)
{
va_list args;
va_start (args, format);
Called as fprintfi_filtered (spaces, stream, format, ...); */
void
-fprintfi_filtered (int spaces, GDB_FILE * stream, const char *format,...)
+fprintfi_filtered (int spaces, struct ui_file * stream, const char *format,...)
{
va_list args;
va_start (args, format);
void
print_spaces_filtered (n, stream)
int n;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
fputs_filtered (n_spaces (n), stream);
}
void
fprintf_symbol_filtered (stream, name, lang, arg_mode)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *name;
enum language lang;
int arg_mode;
init_page_info ();
/* If the output is not a terminal, don't paginate it. */
- if (!GDB_FILE_ISATTY (gdb_stdout))
+ if (!ui_file_isatty (gdb_stdout))
lines_per_page = UINT_MAX;
set_width_command ((char *) NULL, 0, c);
/* ICE interface for the NEC V850 for GDB, the GNU debugger.
- Copyright 1996, Free Software Foundation, Inc.
+ Copyright 1996, 2000 Free Software Foundation, Inc.
This file is part of GDB.
static void ice_Simulate_SymLookup PARAMS ((char *, int));
-static void ice_fputs PARAMS ((const char *, GDB_FILE *));
+static void ice_fputs (const char *, struct ui_file *);
static int ice_file PARAMS ((char *));
/* Print values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1998
+ Copyright 1986, 1988, 1989, 1991-1994, 1998, 2000
Free Software Foundation, Inc.
This file is part of GDB.
static int partial_memory_read (CORE_ADDR memaddr, char *myaddr,
int len, int *errnoptr);
-static void print_hex_chars PARAMS ((GDB_FILE *, unsigned char *,
- unsigned int));
+static void print_hex_chars (struct ui_file *, unsigned char *,
+ unsigned int);
static void show_print PARAMS ((char *, int));
char *valaddr;
int embedded_offset;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
int
value_print (val, stream, format, pretty)
value_ptr val;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
enum val_prettyprint pretty;
{
val_print_type_code_int (type, valaddr, stream)
struct type *type;
char *valaddr;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
if (TYPE_LENGTH (type) > sizeof (LONGEST))
{
*/
#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG)
-static void print_decimal PARAMS ((GDB_FILE * stream, char *sign, int use_local, ULONGEST val_ulong));
+static void print_decimal (struct ui_file * stream, char *sign,
+ int use_local, ULONGEST val_ulong);
static void
print_decimal (stream, sign, use_local, val_ulong)
- GDB_FILE *stream;
+ struct ui_file *stream;
char *sign;
int use_local;
ULONGEST val_ulong;
void
print_longest (stream, format, use_local, val_long)
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int use_local;
LONGEST val_long;
print_floating (valaddr, type, stream)
char *valaddr;
struct type *type;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
DOUBLEST doub;
int inv;
void
print_binary_chars (stream, valaddr, len)
- GDB_FILE *stream;
+ struct ui_file *stream;
unsigned char *valaddr;
unsigned len;
{
*/
void
print_octal_chars (stream, valaddr, len)
- GDB_FILE *stream;
+ struct ui_file *stream;
unsigned char *valaddr;
unsigned len;
{
*/
void
print_decimal_chars (stream, valaddr, len)
- GDB_FILE *stream;
+ struct ui_file *stream;
unsigned char *valaddr;
unsigned len;
{
static void
print_hex_chars (stream, valaddr, len)
- GDB_FILE *stream;
+ struct ui_file *stream;
unsigned char *valaddr;
unsigned len;
{
struct type *type;
char *valaddr;
CORE_ADDR address;
- GDB_FILE *stream;
+ struct ui_file *stream;
int format;
int deref_ref;
int recurse;
CORE_ADDR addr;
int len;
int width;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int force_ellipsis = 0; /* Force ellipsis to be printed if nonzero. */
int errcode; /* Errno returned from bad reads. */
/* Declarations for value printing routines for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
- Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1989, 1991-1994, 2000 Free Software Foundation, Inc.
This file is part of GDB.
extern int stop_print_at_null; /* Stop printing at null char? */
-extern void
-val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
- int, int, int, enum val_prettyprint,
- unsigned int));
+extern void val_print_array_elements (struct type *, char *, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint, unsigned int);
-extern void
-val_print_type_code_int PARAMS ((struct type *, char *, GDB_FILE *));
+extern void val_print_type_code_int (struct type *, char *,
+ struct ui_file *);
-extern void
-print_binary_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
+extern void print_binary_chars (struct ui_file *, unsigned char *,
+ unsigned int);
-extern void
-print_octal_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
+extern void print_octal_chars (struct ui_file *, unsigned char *,
+ unsigned int);
-extern void
-print_decimal_chars PARAMS ((GDB_FILE *, unsigned char *, unsigned int));
+extern void print_decimal_chars (struct ui_file *, unsigned char *,
+ unsigned int);
/* Definitions for values of C expressions, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1992-1996, 2000 Free Software Foundation, Inc.
This file is part of GDB.
struct frame_info;
struct fn_field;
-extern void
-print_address_demangle PARAMS ((CORE_ADDR, GDB_FILE *, int));
+extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
extern LONGEST value_as_long PARAMS ((value_ptr val));
extern void
modify_field PARAMS ((char *addr, LONGEST fieldval, int bitpos, int bitsize));
-extern void
-type_print PARAMS ((struct type * type, char *varstring, GDB_FILE * stream,
- int show));
+extern void type_print (struct type * type, char *varstring,
+ struct ui_file * stream, int show);
extern char *baseclass_addr PARAMS ((struct type * type, int index,
char *valaddr,
value_ptr * valuep, int *errp));
-extern void
-print_longest PARAMS ((GDB_FILE * stream, int format, int use_local,
- LONGEST val));
+extern void print_longest (struct ui_file * stream, int format,
+ int use_local, LONGEST val);
-extern void
-print_floating PARAMS ((char *valaddr, struct type * type, GDB_FILE * stream));
+extern void print_floating (char *valaddr, struct type * type,
+ struct ui_file * stream);
-extern int value_print PARAMS ((value_ptr val, GDB_FILE * stream, int format,
- enum val_prettyprint pretty));
+extern int value_print (value_ptr val, struct ui_file *stream, int format,
+ enum val_prettyprint pretty);
-extern void
-value_print_array_elements PARAMS ((value_ptr val, GDB_FILE * stream,
- int format, enum val_prettyprint pretty));
+extern void value_print_array_elements (value_ptr val,
+ struct ui_file *stream,
+ int format,
+ enum val_prettyprint pretty);
extern value_ptr
value_release_to_mark PARAMS ((value_ptr mark));
-extern int
-val_print PARAMS ((struct type * type, char *valaddr, int embedded_offset, CORE_ADDR address,
- GDB_FILE * stream, int format, int deref_ref,
- int recurse, enum val_prettyprint pretty));
+extern int val_print (struct type * type, char *valaddr,
+ int embedded_offset, CORE_ADDR address,
+ struct ui_file * stream, int format,
+ int deref_ref, int recurse,
+ enum val_prettyprint pretty);
-extern int
-val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE * stream));
+extern int val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream);
-extern void
-print_variable_value PARAMS ((struct symbol * var, struct frame_info * frame,
- GDB_FILE * stream));
+extern void print_variable_value (struct symbol * var,
+ struct frame_info * frame,
+ struct ui_file *stream);
extern int check_field PARAMS ((value_ptr, const char *));
-extern void
-c_typedef_print PARAMS ((struct type * type, struct symbol * news, GDB_FILE * stream));
+extern void c_typedef_print (struct type * type, struct symbol * news,
+ struct ui_file * stream);
extern char *
internalvar_name PARAMS ((struct internalvar * var));