The list of changes is too long to fit in the cvs log (since it truncates!).

Look at the ChangeLog for Apr 30 and May 1.
This commit is contained in:
Jim Kingdon 1991-05-02 04:28:42 +00:00
parent 04a0511c0a
commit e1ce8aa5ed
30 changed files with 393 additions and 145 deletions

View file

@ -488,14 +488,10 @@ gdb.cxref: $(SFILES)
force_update : force_update :
# When used with GDB, the demangler should never look for leading underscores # When used with GDB, the demangler should never look for leading
# because GDB strips them off during symbol read-in. Thus -Dnounderscore. # underscores because GDB strips them off during symbol read-in. Thus
# Adding "param.h" gets us the USG define without having to edit cplus-dem.c # -Dnounderscore.
# (which is used by other programs which may or may not have a "param.h").
# (no newline is added, so line numbers still work right).
cplus-dem.o : cplus-dem.c cplus-dem.o : cplus-dem.c
sed <`echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` \ ${CC} -c ${CFLAGS} -Dnounderscore \
>cplus.tmp.c \ `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
'1s,^,#include "param.h" ,'
${CC} -c ${CFLAGS} -Dnounderscore cplus.tmp.c
mv cplus.tmp.o cplus-dem.o

View file

@ -488,14 +488,10 @@ gdb.cxref: $(SFILES)
force_update : force_update :
# When used with GDB, the demangler should never look for leading underscores # When used with GDB, the demangler should never look for leading
# because GDB strips them off during symbol read-in. Thus -Dnounderscore. # underscores because GDB strips them off during symbol read-in. Thus
# Adding "param.h" gets us the USG define without having to edit cplus-dem.c # -Dnounderscore.
# (which is used by other programs which may or may not have a "param.h").
# (no newline is added, so line numbers still work right).
cplus-dem.o : cplus-dem.c cplus-dem.o : cplus-dem.c
sed <`echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` \ ${CC} -c ${CFLAGS} -Dnounderscore \
>cplus.tmp.c \ `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
'1s,^,#include "param.h" ,'
${CC} -c ${CFLAGS} -Dnounderscore cplus.tmp.c
mv cplus.tmp.o cplus-dem.o

View file

@ -394,7 +394,7 @@ make_blockvector ()
/* Manage the vector of line numbers. */ /* Manage the vector of line numbers. */
static static void
record_line (line, pc) record_line (line, pc)
int line; int line;
CORE_ADDR pc; CORE_ADDR pc;
@ -616,6 +616,7 @@ coff_symfile_init (sf)
of the line table (minimum and maximum file offset) so that the of the line table (minimum and maximum file offset) so that the
mainline code can read the whole thing for efficiency. */ mainline code can read the whole thing for efficiency. */
/* ARGSUSED */
static void static void
find_linenos (abfd, asect, vpinfo) find_linenos (abfd, asect, vpinfo)
bfd *abfd; bfd *abfd;
@ -653,6 +654,11 @@ find_linenos (abfd, asect, vpinfo)
} }
/* The BFD for this file -- only good while we're actively reading
symbols into a psymtab or a symtab. */
static bfd *symfile_bfd;
/* Read a symbol file, after initialization by coff_symfile_init. */ /* Read a symbol file, after initialization by coff_symfile_init. */
/* FIXME! Addr and Mainline are not used yet -- this will not work for /* FIXME! Addr and Mainline are not used yet -- this will not work for
shared libraries or add_file! */ shared libraries or add_file! */
@ -1897,6 +1903,7 @@ read_struct_type (index, length, lastsym)
/* Read a definition of an enumeration type, /* Read a definition of an enumeration type,
and create and return a suitable type object. and create and return a suitable type object.
Also defines the symbols that represent the values of the type. */ Also defines the symbols that represent the values of the type. */
/* Currently assumes it's sizeof (int) and doesn't use length. */
static struct type * static struct type *
read_enum_type (index, length, lastsym) read_enum_type (index, length, lastsym)
@ -1960,6 +1967,7 @@ read_enum_type (index, length, lastsym)
/* Now fill in the fields of the type-structure. */ /* Now fill in the fields of the type-structure. */
/* FIXME: Should be sizeof (int) on target, not host. */
TYPE_LENGTH (type) = sizeof (int); TYPE_LENGTH (type) = sizeof (int);
TYPE_CODE (type) = TYPE_CODE_ENUM; TYPE_CODE (type) = TYPE_CODE_ENUM;
TYPE_NFIELDS (type) = nsyms; TYPE_NFIELDS (type) = nsyms;

View file

@ -15,11 +15,11 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include "defs.h" #include "defs.h"
#include "command.h" #include "command.h"
#include "symtab.h" #include "symtab.h"
#include "value.h" #include "value.h"
#include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
@ -160,6 +160,7 @@ add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
return c; return c;
} }
/* ARGSUSED */
void void
not_just_help_class_command (args, from_tty, c) not_just_help_class_command (args, from_tty, c)
char *args; char *args;
@ -254,8 +255,6 @@ delete_cmd (name, list)
} }
} }
void help_cmd (), help_list (), help_cmd_list ();
/* This command really has to deal with two things: /* This command really has to deal with two things:
* 1) I want documentation on *this string* (usually called by * 1) I want documentation on *this string* (usually called by
* "help commandname"). * "help commandname").
@ -1083,6 +1082,7 @@ cmd_show_list (list, from_tty, prefix)
} }
} }
/* ARGSUSED */
static void static void
shell_escape (arg, from_tty) shell_escape (arg, from_tty)
char *arg; char *arg;

View file

@ -56,6 +56,7 @@ extern struct target_ops core_ops;
/* Discard all vestiges of any previous core file /* Discard all vestiges of any previous core file
and mark data and stack spaces as empty. */ and mark data and stack spaces as empty. */
/* ARGSUSED */
void void
core_close (quitting) core_close (quitting)
int quitting; int quitting;
@ -390,6 +391,8 @@ core_xfer_memory (memaddr, myaddr, len, write)
independent part. Fetch_core_registers is the machine-dependent independent part. Fetch_core_registers is the machine-dependent
part, typically implemented in the xm-file for each architecture. */ part, typically implemented in the xm-file for each architecture. */
/* We just get all the registers, so we don't use regno. */
/* ARGSUSED */
static int static int
get_core_registers (regno) get_core_registers (regno)
int regno; int regno;

View file

@ -64,6 +64,10 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
/* GDB-specific, FIXME. */
#include "defs.h"
#include "param.h"
#ifdef USG #ifdef USG
#include <memory.h> #include <memory.h>
#include <string.h> #include <string.h>
@ -194,21 +198,19 @@ static void remember_type ();
#endif #endif
/* Takes operator name as e.g. "++" and returns mangled /* Takes operator name as e.g. "++" and returns mangled
operator name (e.g. "postincrement_expr"). */ operator name (e.g. "postincrement_expr"), or NULL if not found. */
char * char *
cplus_mangle_opname (opname) cplus_mangle_opname (opname)
char *opname; char *opname;
{ {
int i, len = strlen (opname); int i, len = strlen (opname);
string name;
for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++) for (i = 0; i < sizeof (optable)/sizeof (optable[0]); i++)
{ {
if (strlen (optable[i].out) == len if (strlen (optable[i].out) == len
&& memcmp (optable[i].out, opname, len) == 0) && memcmp (optable[i].out, opname, len) == 0)
return optable[i].in; return (char *)optable[i].in;
} }
error ("no mangling for `%s'", opname);
return 0; return 0;
} }
@ -440,7 +442,7 @@ do_type (type, result, arg_mode)
success = 0; success = 0;
*type += 2; *type += 2;
while (n-- > 0) while (n-- > 0)
do_type (type, result); do_type (type, result, arg_mode);
break; break;
case 'P': case 'P':

View file

@ -769,7 +769,9 @@ really_free_pendings (foo)
int foo; int foo;
{ {
struct pending *next, *next1; struct pending *next, *next1;
#if 0
struct pending_block *bnext, *bnext1; struct pending_block *bnext, *bnext1;
#endif
for (next = free_pendings; next; next = next1) for (next = free_pendings; next; next = next1)
{ {
@ -1252,6 +1254,11 @@ record_misc_function (name, address, type)
address, misc_type); address, misc_type);
} }
/* The BFD for this file -- only good while we're actively reading
symbols into a psymtab or a symtab. */
static bfd *symfile_bfd;
/* Scan and build partial symbols for a symbol file. /* Scan and build partial symbols for a symbol file.
We have been initialized by a call to dbx_symfile_init, which We have been initialized by a call to dbx_symfile_init, which
put all the relevant info into a "struct dbx_symfile_info" put all the relevant info into a "struct dbx_symfile_info"
@ -2888,7 +2895,7 @@ read_ofile_symtab (desc, stringtab, stringtab_size, sym_offset,
if (type & N_STAB) if (type & N_STAB)
{ {
short desc = bufp->n_desc; short bufp_n_desc = bufp->n_desc;
unsigned long valu = bufp->n_value; unsigned long valu = bufp->n_value;
/* Check for a pair of N_SO symbols. */ /* Check for a pair of N_SO symbols. */
@ -2912,15 +2919,15 @@ read_ofile_symtab (desc, stringtab, stringtab_size, sym_offset,
bufp->n_un.n_strx); bufp->n_un.n_strx);
namestring2 = bufp->n_un.n_strx + stringtab; namestring2 = bufp->n_un.n_strx + stringtab;
process_symbol_pair (N_SO, desc, valu, namestring, process_symbol_pair (N_SO, bufp_n_desc, valu, namestring,
N_SO, bufp->n_desc, bufp->n_value, N_SO, bufp->n_desc, bufp->n_value,
namestring2); namestring2);
} }
else else
process_one_symbol(type, desc, valu, namestring); process_one_symbol(type, bufp_n_desc, valu, namestring);
} }
else else
process_one_symbol (type, desc, valu, namestring); process_one_symbol (type, bufp_n_desc, valu, namestring);
} }
/* We skip checking for a new .o or -l file; that should never /* We skip checking for a new .o or -l file; that should never
happen in this routine. */ happen in this routine. */
@ -3377,13 +3384,14 @@ define_symbol (valu, string, desc, type)
case 'r': case 'r':
{ {
double d = atof (p); double d = atof (p);
char *valu; char *dbl_valu;
SYMBOL_TYPE (sym) = builtin_type_double; SYMBOL_TYPE (sym) = builtin_type_double;
valu = (char *) obstack_alloc (symbol_obstack, sizeof (double)); dbl_valu =
bcopy (&d, valu, sizeof (double)); (char *) obstack_alloc (symbol_obstack, sizeof (double));
SWAP_TARGET_AND_HOST (valu, sizeof (double)); bcopy (&d, dbl_valu, sizeof (double));
SYMBOL_VALUE_BYTES (sym) = valu; SWAP_TARGET_AND_HOST (dbl_valu, sizeof (double));
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
SYMBOL_CLASS (sym) = LOC_CONST_BYTES; SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
} }
break; break;
@ -3433,7 +3441,7 @@ define_symbol (valu, string, desc, type)
} }
else else
{ {
struct type *type; struct type *type_read;
synonym = *p == 't'; synonym = *p == 't';
if (synonym) if (synonym)
@ -3443,13 +3451,13 @@ define_symbol (valu, string, desc, type)
strlen (SYMBOL_NAME (sym))); strlen (SYMBOL_NAME (sym)));
} }
type = read_type (&p); type_read = read_type (&p);
if ((deftype == 'F' || deftype == 'f') if ((deftype == 'F' || deftype == 'f')
&& TYPE_CODE (type) != TYPE_CODE_FUNC) && TYPE_CODE (type_read) != TYPE_CODE_FUNC)
SYMBOL_TYPE (sym) = lookup_function_type (type); SYMBOL_TYPE (sym) = lookup_function_type (type_read);
else else
SYMBOL_TYPE (sym) = type; SYMBOL_TYPE (sym) = type_read;
} }
switch (deftype) switch (deftype)
@ -4330,7 +4338,8 @@ read_struct_type (pp, type)
/* Special GNU C++ name. */ /* Special GNU C++ name. */
if (*++p == 'v') if (*++p == 'v')
{ {
char *prefix, *name = 0; const char *prefix;
char *name = 0;
struct type *context; struct type *context;
switch (*++p) switch (*++p)

View file

@ -118,6 +118,11 @@ extern void free_current_contents ();
extern int myread (); extern int myread ();
extern int query (); extern int query ();
extern int lines_to_list (); extern int lines_to_list ();
extern void wrap_here (
#ifdef __STDC__
char *
#endif
);
extern void reinitialize_more_filter (); extern void reinitialize_more_filter ();
extern void fputs_filtered (); extern void fputs_filtered ();
extern void puts_filtered (); extern void puts_filtered ();
@ -136,6 +141,13 @@ extern void print_sys_errmsg ();
extern void print_address_symbolic (); extern void print_address_symbolic ();
extern void print_address (); extern void print_address ();
/* From source.c */
void mod_path (
#ifdef __STDC__
char *, char **
#endif
);
/* From readline (but not in any readline .h files). */ /* From readline (but not in any readline .h files). */
extern char *tilde_expand (); extern char *tilde_expand ();
@ -170,6 +182,15 @@ char *baud_rate;
#define LONG_MAX 0x7fffffff #define LONG_MAX 0x7fffffff
#endif #endif
#if !defined (INT_MAX)
#define INT_MAX 0x7fffffff
#endif
#if !defined (INT_MIN)
/* Two's complement, 32 bit. */
#define INT_MIN -0x80000000
#endif
/* Just like CHAR_BIT in <limits.h> but describes the target machine. */ /* Just like CHAR_BIT in <limits.h> but describes the target machine. */
#if !defined (TARGET_CHAR_BIT) #if !defined (TARGET_CHAR_BIT)
#define TARGET_CHAR_BIT 8 #define TARGET_CHAR_BIT 8
@ -181,4 +202,18 @@ char *baud_rate;
#define TARGET_LONG_LONG_BIT 64 #define TARGET_LONG_LONG_BIT 64
#endif #endif
/* Convert a LONGEST to an int. This is used in contexts (e.g. number
of arguments to a function, number in a value history, register
number, etc.) where the value must not be larger than can fit
in an int. */
#if !defined (longest_to_int)
#if defined (LONG_LONG)
#define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \
? error ("Value out of range.") : (int) (x))
#else /* No LONG_LONG. */
/* Assume sizeof (int) == sizeof (long). */
#define longest_to_int(x) ((int) (x))
#endif /* No LONG_LONG. */
#endif /* No longest_to_int. */
#endif /* no DEFS_H */ #endif /* no DEFS_H */

View file

@ -108,11 +108,18 @@ struct symtoken
An array should be preceded in the list by the size of the array. */ An array should be preceded in the list by the size of the array. */
enum type_pieces enum type_pieces
{tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function}; {tp_end = -1, tp_pointer, tp_reference, tp_array, tp_function};
static enum type_pieces *type_stack; /* The stack can contain either an enum type_pieces or an int. */
union type_stack_elt {
enum type_pieces piece;
int int_val;
};
static union type_stack_elt *type_stack;
static int type_stack_depth, type_stack_size; static int type_stack_depth, type_stack_size;
static void push_type (); static void push_type ();
static void push_type_int ();
static enum type_pieces pop_type (); static enum type_pieces pop_type ();
static int pop_type_int ();
/* Allow debugging of parsing. */ /* Allow debugging of parsing. */
#define YYDEBUG 1 #define YYDEBUG 1
@ -646,12 +653,33 @@ variable: name_not_typename
{ {
case LOC_REGISTER: case LOC_REGISTER:
case LOC_ARG: case LOC_ARG:
case LOC_REF_ARG:
case LOC_REGPARM:
case LOC_LOCAL: case LOC_LOCAL:
case LOC_LOCAL_ARG: case LOC_LOCAL_ARG:
if (innermost_block == 0 || if (innermost_block == 0 ||
contained_in (block_found, contained_in (block_found,
innermost_block)) innermost_block))
innermost_block = block_found; innermost_block = block_found;
case LOC_UNDEF:
case LOC_CONST:
case LOC_STATIC:
case LOC_TYPEDEF:
case LOC_LABEL:
case LOC_BLOCK:
case LOC_EXTERNAL:
case LOC_CONST_BYTES:
/* In this case the expression can
be evaluated regardless of what
frame we are in, so there is no
need to check for the
innermost_block. These cases are
listed so that gcc -Wall will
report types that may not have
been considered. */
break;
} }
write_exp_elt_opcode (OP_VAR_VALUE); write_exp_elt_opcode (OP_VAR_VALUE);
write_exp_elt_sym (sym); write_exp_elt_sym (sym);
@ -732,7 +760,7 @@ ptype : typebase
follow_type = lookup_reference_type (follow_type); follow_type = lookup_reference_type (follow_type);
break; break;
case tp_array: case tp_array:
array_size = (int) pop_type (); array_size = pop_type_int ();
if (array_size != -1) if (array_size != -1)
follow_type = create_array_type (follow_type, follow_type = create_array_type (follow_type,
array_size); array_size);
@ -762,12 +790,12 @@ direct_abs_decl: '(' abs_decl ')'
{ $$ = $2; } { $$ = $2; }
| direct_abs_decl array_mod | direct_abs_decl array_mod
{ {
push_type ((enum type_pieces) $2); push_type_int ($2);
push_type (tp_array); push_type (tp_array);
} }
| array_mod | array_mod
{ {
push_type ((enum type_pieces) $1); push_type_int ($1);
push_type (tp_array); push_type (tp_array);
$$ = 0; $$ = 0;
} }
@ -1915,25 +1943,47 @@ push_type (tp)
if (type_stack_depth == type_stack_size) if (type_stack_depth == type_stack_size)
{ {
type_stack_size *= 2; type_stack_size *= 2;
type_stack = (enum type_pieces *) type_stack = (union type_stack_elt *)
xrealloc (type_stack, type_stack_size * sizeof (enum type_pieces)); xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
} }
type_stack[type_stack_depth++] = tp; type_stack[type_stack_depth++].piece = tp;
}
static void
push_type_int (n)
int n;
{
if (type_stack_depth == type_stack_size)
{
type_stack_size *= 2;
type_stack = (union type_stack_elt *)
xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
}
type_stack[type_stack_depth++].int_val = n;
} }
static enum type_pieces static enum type_pieces
pop_type () pop_type ()
{ {
if (type_stack_depth) if (type_stack_depth)
return type_stack[--type_stack_depth]; return type_stack[--type_stack_depth].piece;
return tp_end; return tp_end;
} }
static int
pop_type_int ()
{
if (type_stack_depth)
return type_stack[--type_stack_depth].int_val;
/* "Can't happen". */
return 0;
}
void void
_initialize_expread () _initialize_expread ()
{ {
type_stack_size = 80; type_stack_size = 80;
type_stack_depth = 0; type_stack_depth = 0;
type_stack = (enum type_pieces *) type_stack = (union type_stack_elt *)
xmalloc (type_stack_size * sizeof (enum type_pieces)); xmalloc (type_stack_size * sizeof (*type_stack));
} }

View file

@ -177,7 +177,7 @@ read_relative_register_raw_bytes (regnum, myaddr)
return 0; return 0;
} }
get_saved_register (myaddr, &optim, (CORE_ADDR) NULL, selected_frame, get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, selected_frame,
regnum, (enum lval_type *)NULL); regnum, (enum lval_type *)NULL);
return optim; return optim;
} }
@ -366,7 +366,6 @@ read_var_value (var, frame)
struct frame_info *fi; struct frame_info *fi;
struct type *type = SYMBOL_TYPE (var); struct type *type = SYMBOL_TYPE (var);
CORE_ADDR addr; CORE_ADDR addr;
int val;
register int len; register int len;
v = allocate_value (type); v = allocate_value (type);
@ -378,8 +377,7 @@ read_var_value (var, frame)
switch (SYMBOL_CLASS (var)) switch (SYMBOL_CLASS (var))
{ {
case LOC_CONST: case LOC_CONST:
val = SYMBOL_VALUE (var); bcopy (&SYMBOL_VALUE (var), VALUE_CONTENTS_RAW (v), len);
bcopy (&val, VALUE_CONTENTS_RAW (v), len);
SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (v), len); SWAP_TARGET_AND_HOST (VALUE_CONTENTS_RAW (v), len);
VALUE_LVAL (v) = not_lval; VALUE_LVAL (v) = not_lval;
return v; return v;
@ -430,7 +428,7 @@ read_var_value (var, frame)
return 0; return 0;
} }
addr += SYMBOL_VALUE (var); addr += SYMBOL_VALUE (var);
addr = read_memory_integer (addr, sizeof (CORE_ADDR)); read_memory (addr, &addr, sizeof (CORE_ADDR));
break; break;
case LOC_LOCAL: case LOC_LOCAL:
@ -460,7 +458,7 @@ read_var_value (var, frame)
v = value_from_register (type, SYMBOL_VALUE (var), frame); v = value_from_register (type, SYMBOL_VALUE (var), frame);
if (REG_STRUCT_HAS_ADDR(b->gcc_compile_flag) if (REG_STRUCT_HAS_ADDR (BLOCK_GCC_COMPILED (b))
&& TYPE_CODE (type) == TYPE_CODE_STRUCT) && TYPE_CODE (type) == TYPE_CODE_STRUCT)
addr = *(CORE_ADDR *)VALUE_CONTENTS (v); addr = *(CORE_ADDR *)VALUE_CONTENTS (v);
else else
@ -665,7 +663,7 @@ locate_var_value (var, frame)
{ {
char *buf = alloca (TYPE_LENGTH (type)); char *buf = alloca (TYPE_LENGTH (type));
read_memory (addr, buf, TYPE_LENGTH (type)); read_memory (addr, buf, TYPE_LENGTH (type));
addr = unpack_long (type, buf); addr = unpack_pointer (type, buf);
type = TYPE_TARGET_TYPE (type); type = TYPE_TARGET_TYPE (type);
} }

View file

@ -45,6 +45,12 @@ void read_memory ();
/* Read an integer from debugged memory, given address and number of bytes. */ /* Read an integer from debugged memory, given address and number of bytes. */
long read_memory_integer (); long read_memory_integer ();
void write_memory (
#ifdef __STDC__
CORE_ADDR, char *, int
#endif
);
/* Hook for `exec_file_command' command to call. */ /* Hook for `exec_file_command' command to call. */
extern void (*exec_file_display_hook) (); extern void (*exec_file_display_hook) ();

View file

@ -34,30 +34,30 @@ ieee_extended_to_double (ext_format, from, to)
{ {
unsigned char *ufrom = (unsigned char *)from; unsigned char *ufrom = (unsigned char *)from;
double dto; double dto;
unsigned long mant0, mant1, exp; unsigned long mant0, mant1, exponent;
bcopy (&from[MANBYTE_H], &mant0, 4); bcopy (&from[MANBYTE_H], &mant0, 4);
bcopy (&from[MANBYTE_L], &mant1, 4); bcopy (&from[MANBYTE_L], &mant1, 4);
exp = ((ufrom[EXPBYTE_H] & (unsigned char)~SIGNMASK) << 8) | ufrom[EXPBYTE_L]; exponent = ((ufrom[EXPBYTE_H] & (unsigned char)~SIGNMASK) << 8) | ufrom[EXPBYTE_L];
#if 0 #if 0
/* We can't do anything useful with a NaN anyway, so ignore its /* We can't do anything useful with a NaN anyway, so ignore its
difference. It will end up as Infinity or something close. */ difference. It will end up as Infinity or something close. */
if (exp == EXT_EXP_NAN) { if (exponent == EXT_EXP_NAN) {
/* We have a NaN source. */ /* We have a NaN source. */
dto = 0.123456789; /* Not much else useful to do -- we don't know if dto = 0.123456789; /* Not much else useful to do -- we don't know if
the host system even *has* NaNs, nor how to the host system even *has* NaNs, nor how to
generate an innocuous one if it does. */ generate an innocuous one if it does. */
} else } else
#endif #endif
if (exp == 0 && mant0 == 0 && mant1 == 0) { if (exponent == 0 && mant0 == 0 && mant1 == 0) {
dto = 0; dto = 0;
} else { } else {
/* Build the result algebraically. Might go infinite, underflow, etc; /* Build the result algebraically. Might go infinite, underflow, etc;
who cares. */ who cares. */
mant0 |= 0x80000000; mant0 |= 0x80000000;
dto = ldexp ((double)mant0, exp - EXT_EXP_BIAS - 31); dto = ldexp ((double)mant0, exponent - EXT_EXP_BIAS - 31);
dto += ldexp ((double)mant1, exp - EXT_EXP_BIAS - 31 - 32); dto += ldexp ((double)mant1, exponent - EXT_EXP_BIAS - 31 - 32);
if (ufrom[EXPBYTE_H] & SIGNMASK) /* If negative... */ if (ufrom[EXPBYTE_H] & SIGNMASK) /* If negative... */
dto = -dto; /* ...negate. */ dto = -dto; /* ...negate. */
} }
@ -75,7 +75,7 @@ double_to_ieee_extended (ext_format, from, to)
{ {
double dfrom = *from; double dfrom = *from;
unsigned long twolongs[2]; unsigned long twolongs[2];
unsigned long mant0, mant1, exp; unsigned long mant0, mant1, exponent;
unsigned char twobytes[2]; unsigned char twobytes[2];
bzero (to, TOTALSIZE); bzero (to, TOTALSIZE);
@ -97,27 +97,27 @@ double_to_ieee_extended (ext_format, from, to)
bcopy (from, twolongs, 8); bcopy (from, twolongs, 8);
bcopy (from, twobytes, 2); bcopy (from, twobytes, 2);
#if HOST_BYTE_ORDER == BIG_ENDIAN #if HOST_BYTE_ORDER == BIG_ENDIAN
exp = ((twobytes[1] & 0xF0) >> 4) | (twobytes[0] & 0x7F) << 4; exponent = ((twobytes[1] & 0xF0) >> 4) | (twobytes[0] & 0x7F) << 4;
mant0 = (twolongs[0] << 11) | twolongs[1] >> 21; mant0 = (twolongs[0] << 11) | twolongs[1] >> 21;
mant1 = (twolongs[1] << 11); mant1 = (twolongs[1] << 11);
#else #else
exp = ((twobytes[0] & 0xF0) >> 4) | (twobytes[1] & 0x7F) << 4; exponent = ((twobytes[0] & 0xF0) >> 4) | (twobytes[1] & 0x7F) << 4;
mant0 = (twolongs[1] << 11) | twolongs[0] >> 21; mant0 = (twolongs[1] << 11) | twolongs[0] >> 21;
mant1 = (twolongs[0] << 11); mant1 = (twolongs[0] << 11);
#endif #endif
/* Fiddle with leading 1-bit, implied in double, explicit in extended. */ /* Fiddle with leading 1-bit, implied in double, explicit in extended. */
if (exp == 0) if (exponent == 0)
mant0 &= 0x7FFFFFFF; mant0 &= 0x7FFFFFFF;
else else
mant0 |= 0x80000000; mant0 |= 0x80000000;
exp -= DBL_EXP_BIAS; /* Get integer exp */ exponent -= DBL_EXP_BIAS; /* Get integer exp */
exp += EXT_EXP_BIAS; /* Offset for extended *&/ exponent += EXT_EXP_BIAS; /* Offset for extended */
/* OK, now store it in extended format. */ /* OK, now store it in extended format. */
to[EXPBYTE_H] |= (unsigned char)(exp >> 8); /* Retain sign */ to[EXPBYTE_H] |= (unsigned char)(exponent >> 8); /* Retain sign */
to[EXPBYTE_L] = (unsigned char) exp; to[EXPBYTE_L] = (unsigned char) exponent;
bcopy (&mant0, &to[MANBYTE_H], 4); bcopy (&mant0, &to[MANBYTE_H], 4);
bcopy (&mant1, &to[MANBYTE_L], 4); bcopy (&mant1, &to[MANBYTE_L], 4);

View file

@ -122,6 +122,7 @@ CORE_ADDR read_pc ();
void breakpoint_clear_ignore_counts (); void breakpoint_clear_ignore_counts ();
/* ARGSUSED */
void void
tty_command (file, from_tty) tty_command (file, from_tty)
char *file; char *file;
@ -218,6 +219,7 @@ continue_command (proc_count_exp, from_tty)
/* Step until outside of current statement. */ /* Step until outside of current statement. */
static void step_1 (); static void step_1 ();
/* ARGSUSED */
static void static void
step_command (count_string, from_tty) step_command (count_string, from_tty)
char * count_string; char * count_string;
@ -228,6 +230,7 @@ step_command (count_string, from_tty)
/* Likewise, but skip over subroutine calls as if single instructions. */ /* Likewise, but skip over subroutine calls as if single instructions. */
/* ARGSUSED */
static void static void
next_command (count_string, from_tty) next_command (count_string, from_tty)
char * count_string; char * count_string;
@ -238,6 +241,7 @@ next_command (count_string, from_tty)
/* Likewise, but step only one instruction. */ /* Likewise, but step only one instruction. */
/* ARGSUSED */
static void static void
stepi_command (count_string, from_tty) stepi_command (count_string, from_tty)
char * count_string; char * count_string;
@ -246,6 +250,7 @@ stepi_command (count_string, from_tty)
step_1 (0, 1, count_string); step_1 (0, 1, count_string);
} }
/* ARGSUSED */
static void static void
nexti_command (count_string, from_tty) nexti_command (count_string, from_tty)
char * count_string; char * count_string;
@ -453,6 +458,7 @@ The expression which contained the function call has been discarded.");
we set. I'm going to postpone this until after a hopeful rewrite we set. I'm going to postpone this until after a hopeful rewrite
of wait_for_inferior and the proceed status code. -- randy */ of wait_for_inferior and the proceed status code. -- randy */
/* ARGSUSED */
void void
until_next_command (from_tty) until_next_command (from_tty)
int from_tty; int from_tty;
@ -584,6 +590,7 @@ finish_command (arg, from_tty)
} }
} }
/* ARGSUSED */
static void static void
program_info (args, from_tty) program_info (args, from_tty)
char *args; char *args;
@ -732,6 +739,7 @@ unset_environment_command (var, from_tty)
const static char path_var_name[] = "PATH"; const static char path_var_name[] = "PATH";
/* ARGSUSED */
void void
path_info (args, from_tty) path_info (args, from_tty)
char *args; char *args;
@ -752,11 +760,11 @@ path_command (dirname, from_tty)
dont_repeat (); dont_repeat ();
exec_path = strsave (get_in_environ (inferior_environ, path_var_name)); exec_path = strsave (get_in_environ (inferior_environ, path_var_name));
mod_path (dirname, from_tty, &exec_path); mod_path (dirname, &exec_path);
set_in_environ (inferior_environ, path_var_name, exec_path); set_in_environ (inferior_environ, path_var_name, exec_path);
free (exec_path); free (exec_path);
if (from_tty) if (from_tty)
path_info (); path_info ((char *)NULL, from_tty);
} }
CORE_ADDR CORE_ADDR

View file

@ -260,6 +260,7 @@ void normal_stop ();
/* Things to clean up if we QUIT out of resume (). */ /* Things to clean up if we QUIT out of resume (). */
/* ARGSUSED */
static void static void
resume_cleanups (arg) resume_cleanups (arg)
int arg; int arg;

View file

@ -123,6 +123,8 @@ child_prepare_to_store ()
/* Convert data from raw format for register REGNUM /* Convert data from raw format for register REGNUM
to virtual format for register REGNUM. */ to virtual format for register REGNUM. */
/* Some machines won't need to use regnum. */
/* ARGSUSED */
void void
host_convert_to_virtual (regnum, from, to) host_convert_to_virtual (regnum, from, to)
int regnum; int regnum;
@ -135,6 +137,7 @@ host_convert_to_virtual (regnum, from, to)
/* Convert data from virtual format for register REGNUM /* Convert data from virtual format for register REGNUM
to raw format for register REGNUM. */ to raw format for register REGNUM. */
/* ARGSUSED */
void void
host_convert_from_virtual (regnum, from, to) host_convert_from_virtual (regnum, from, to)
int regnum; int regnum;
@ -153,6 +156,7 @@ child_files_info ()
attach_flag? "attached": "child", inferior_pid); attach_flag? "attached": "child", inferior_pid);
} }
/* ARGSUSED */
static void static void
child_open (arg, from_tty) child_open (arg, from_tty)
char *arg; char *arg;

View file

@ -1455,6 +1455,7 @@ error_no_arg (why)
error ("Argument required (%s).", why); error ("Argument required (%s).", why);
} }
/* ARGSUSED */
static void static void
help_command (command, from_tty) help_command (command, from_tty)
char *command; char *command;
@ -1584,6 +1585,7 @@ GDB is free software and you are welcome to distribute copies of it\n\
under certain conditions; type \"info copying\" to see the conditions.\n"); under certain conditions; type \"info copying\" to see the conditions.\n");
} }
/* ARGSUSED */
static void static void
show_version (args, from_tty) show_version (args, from_tty)
char *args; char *args;
@ -1629,6 +1631,7 @@ input_from_terminal_p ()
return (instream == stdin) & caution; return (instream == stdin) & caution;
} }
/* ARGSUSED */
static void static void
pwd_command (args, from_tty) pwd_command (args, from_tty)
char *args; char *args;
@ -1710,6 +1713,7 @@ cd_command (dir, from_tty)
pwd_command ((char *) 0, 1); pwd_command ((char *) 0, 1);
} }
/* ARGSUSED */
static void static void
source_command (args, from_tty) source_command (args, from_tty)
char *args; char *args;
@ -1885,6 +1889,7 @@ show_commands (args, from_tty)
} }
/* Called by do_setshow_command. */ /* Called by do_setshow_command. */
/* ARGSUSED */
static void static void
set_history_size_command (args, from_tty, c) set_history_size_command (args, from_tty, c)
char *args; char *args;
@ -1897,6 +1902,7 @@ set_history_size_command (args, from_tty, c)
stifle_history (history_size); stifle_history (history_size);
} }
/* ARGSUSED */
static void static void
set_history (args, from_tty) set_history (args, from_tty)
char *args; char *args;
@ -1906,6 +1912,7 @@ set_history (args, from_tty)
help_list (sethistlist, "set history ", -1, stdout); help_list (sethistlist, "set history ", -1, stdout);
} }
/* ARGSUSED */
static void static void
show_history (args, from_tty) show_history (args, from_tty)
char *args; char *args;
@ -1917,6 +1924,7 @@ show_history (args, from_tty)
int info_verbose = 0; /* Default verbose msgs off */ int info_verbose = 0; /* Default verbose msgs off */
/* Called by do_setshow_command. An elaborate joke. */ /* Called by do_setshow_command. An elaborate joke. */
/* ARGSUSED */
static void static void
set_verbose (args, from_tty, c) set_verbose (args, from_tty, c)
char *args; char *args;

View file

@ -21,8 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
param-no-tm.h. Any future inclusions of param.h will be protected param-no-tm.h. Any future inclusions of param.h will be protected
against by the #if !defined stuff below. */ against by the #if !defined stuff below. */
/* Some tm files need CORE_ADDR, for example. */ /* This file requires defs.h. */
#include "defs.h"
#if !defined (PARAM_H) #if !defined (PARAM_H)
#include "tm.h" #include "tm.h"

View file

@ -363,7 +363,7 @@ print_scalar_formatted (valaddr, type, format, size, stream)
break; break;
case 'a': case 'a':
print_address ((CORE_ADDR) val_long, stream); print_address (unpack_pointer (type, valaddr), stream);
break; break;
case 'c': case 'c':
@ -670,6 +670,7 @@ print_command_1 (exp, inspect, voidprint)
inspect_it = 0; /* Reset print routines to normal */ inspect_it = 0; /* Reset print routines to normal */
} }
/* ARGSUSED */
static void static void
print_command (exp, from_tty) print_command (exp, from_tty)
char *exp; char *exp;
@ -679,6 +680,7 @@ print_command (exp, from_tty)
} }
/* Same as print, except in epoch, it gets its own window */ /* Same as print, except in epoch, it gets its own window */
/* ARGSUSED */
static void static void
inspect_command (exp, from_tty) inspect_command (exp, from_tty)
char *exp; char *exp;
@ -690,6 +692,7 @@ inspect_command (exp, from_tty)
} }
/* Same as print, except it doesn't print void results. */ /* Same as print, except it doesn't print void results. */
/* ARGSUSED */
static void static void
call_command (exp, from_tty) call_command (exp, from_tty)
char *exp; char *exp;
@ -698,6 +701,7 @@ call_command (exp, from_tty)
print_command_1 (exp, 0, 0); print_command_1 (exp, 0, 0);
} }
/* ARGSUSED */
static void static void
output_command (exp, from_tty) output_command (exp, from_tty)
char *exp; char *exp;
@ -727,6 +731,7 @@ output_command (exp, from_tty)
do_cleanups (old_chain); do_cleanups (old_chain);
} }
/* ARGSUSED */
static void static void
set_command (exp, from_tty) set_command (exp, from_tty)
char *exp; char *exp;
@ -739,13 +744,14 @@ set_command (exp, from_tty)
do_cleanups (old_chain); do_cleanups (old_chain);
} }
/* ARGSUSED */
static void static void
address_info (exp, from_tty) address_info (exp, from_tty)
char *exp; char *exp;
int from_tty; int from_tty;
{ {
register struct symbol *sym; register struct symbol *sym;
register CORE_ADDR val; register long val;
int is_a_field_of_this; /* C++: lookup_symbol sets this to nonzero int is_a_field_of_this; /* C++: lookup_symbol sets this to nonzero
if exp is a field of `this'. */ if exp is a field of `this'. */
@ -803,19 +809,19 @@ address_info (exp, from_tty)
break; break;
case LOC_ARG: case LOC_ARG:
printf ("an argument at offset %d", (int)val); printf ("an argument at offset %ld", val);
break; break;
case LOC_LOCAL_ARG: case LOC_LOCAL_ARG:
printf ("an argument at frame offset %d", (int)val); printf ("an argument at frame offset %ld", val);
break; break;
case LOC_LOCAL: case LOC_LOCAL:
printf ("a local variable at frame offset %d", (int)val); printf ("a local variable at frame offset %ld", val);
break; break;
case LOC_REF_ARG: case LOC_REF_ARG:
printf ("a reference argument at offset %d", (int)val); printf ("a reference argument at offset %ld", val);
break; break;
case LOC_TYPEDEF: case LOC_TYPEDEF:
@ -882,7 +888,7 @@ x_command (exp, from_tty)
&& VALUE_LVAL (val) == lval_memory) && VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val); next_address = VALUE_ADDRESS (val);
else else
next_address = (CORE_ADDR) value_as_long (val); next_address = value_as_pointer (val);
do_cleanups (old_chain); do_cleanups (old_chain);
} }
@ -931,6 +937,7 @@ whatis_exp (exp, show)
do_cleanups (old_chain); do_cleanups (old_chain);
} }
/* ARGSUSED */
static void static void
whatis_command (exp, from_tty) whatis_command (exp, from_tty)
char *exp; char *exp;
@ -943,6 +950,7 @@ whatis_command (exp, from_tty)
} }
/* TYPENAME is either the name of a type, or an expression. */ /* TYPENAME is either the name of a type, or an expression. */
/* ARGSUSED */
static void static void
ptype_command (typename, from_tty) ptype_command (typename, from_tty)
char *typename; char *typename;
@ -1256,7 +1264,7 @@ do_one_display (d)
else else
printf_filtered (" "); printf_filtered (" ");
addr = (CORE_ADDR) value_as_long (evaluate_expression (d->exp)); addr = value_as_pointer (evaluate_expression (d->exp));
if (d->format.format == 'i') if (d->format.format == 'i')
addr = ADDR_BITS_REMOVE (addr); addr = ADDR_BITS_REMOVE (addr);
@ -1385,6 +1393,7 @@ enable_display (args)
} }
} }
/* ARGSUSED */
void void
disable_display_command (args, from_tty) disable_display_command (args, from_tty)
char *args; char *args;
@ -1454,7 +1463,7 @@ print_frame_args (func, fi, num, stream)
/* Offset of next stack argument beyond the one we have seen that is /* Offset of next stack argument beyond the one we have seen that is
at the highest offset. at the highest offset.
-1 if we haven't come to a stack argument yet. */ -1 if we haven't come to a stack argument yet. */
int highest_offset = -1; long highest_offset = -1;
int arg_size; int arg_size;
/* Number of ints of arguments that we have printed so far. */ /* Number of ints of arguments that we have printed so far. */
int args_printed = 0; int args_printed = 0;
@ -1489,7 +1498,7 @@ print_frame_args (func, fi, num, stream)
case LOC_ARG: case LOC_ARG:
case LOC_REF_ARG: case LOC_REF_ARG:
{ {
int current_offset = SYMBOL_VALUE (sym); long current_offset = SYMBOL_VALUE (sym);
arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
@ -1536,7 +1545,7 @@ print_frame_args (func, fi, num, stream)
enough about the stack to find them. */ enough about the stack to find them. */
if (num != -1) if (num != -1)
{ {
int start; long start;
CORE_ADDR addr; CORE_ADDR addr;
if (highest_offset == -1) if (highest_offset == -1)
@ -1559,7 +1568,7 @@ print_frame_args (func, fi, num, stream)
static void static void
print_frame_nameless_args (argsaddr, start, num, first, stream) print_frame_nameless_args (argsaddr, start, num, first, stream)
CORE_ADDR argsaddr; CORE_ADDR argsaddr;
int start; long start;
int num; int num;
int first; int first;
FILE *stream; FILE *stream;
@ -1584,6 +1593,7 @@ print_frame_nameless_args (argsaddr, start, num, first, stream)
} }
} }
/* ARGSUSED */
static void static void
printf_command (arg, from_tty) printf_command (arg, from_tty)
char *arg; char *arg;
@ -1740,8 +1750,9 @@ printf_command (arg, from_tty)
if (argclass[i] == string_arg) if (argclass[i] == string_arg)
{ {
char *str; char *str;
int tem, j; CORE_ADDR tem;
tem = value_as_long (val_args[i]); int j;
tem = value_as_pointer (val_args[i]);
/* This is a %s argument. Find the length of the string. */ /* This is a %s argument. Find the length of the string. */
for (j = 0; ; j++) for (j = 0; ; j++)
@ -1777,8 +1788,8 @@ printf_command (arg, from_tty)
else else
#endif #endif
{ {
*((int *) &arg_bytes[argindex]) = value_as_long (val_args[i]); *((long *) &arg_bytes[argindex]) = value_as_long (val_args[i]);
argindex += sizeof (int); argindex += sizeof (long);
} }
} }
} }
@ -1831,6 +1842,7 @@ containing_function_bounds (pc, low, high)
Two arguments are interpeted as bounds within which to dump Two arguments are interpeted as bounds within which to dump
assembly. */ assembly. */
/* ARGSUSED */
static void static void
disassemble_command (arg, from_tty) disassemble_command (arg, from_tty)
char *arg; char *arg;

View file

@ -138,6 +138,7 @@ remote_start()
/* Clean up connection to a remote debugger. */ /* Clean up connection to a remote debugger. */
/* ARGSUSED */
void void
remote_close (quitting) remote_close (quitting)
int quitting; int quitting;
@ -196,7 +197,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
#endif #endif
/* Set up read timeout timer. */ /* Set up read timeout timer. */
if ((void (*)) signal (SIGALRM, remote_timer) == (void (*)) -1) if ((void (*)()) signal (SIGALRM, remote_timer) == (void (*)()) -1)
perror ("remote_open: error in signal"); perror ("remote_open: error in signal");
#endif #endif
@ -276,7 +277,9 @@ remote_resume (step, siggnal)
} }
/* Wait until the remote machine stops, then return, /* Wait until the remote machine stops, then return,
storing status in STATUS just as `wait' would. */ storing status in STATUS just as `wait' would.
Returns "pid" (though it's not clear what, if anything, that
means in the case of this target). */
int int
remote_wait (status) remote_wait (status)
@ -291,10 +294,13 @@ remote_wait (status)
if (buf[0] != 'S') if (buf[0] != 'S')
error ("Invalid remote reply: %s", buf); error ("Invalid remote reply: %s", buf);
WSETSTOP ((*status), (((fromhex (buf[1])) << 4) + (fromhex (buf[2])))); WSETSTOP ((*status), (((fromhex (buf[1])) << 4) + (fromhex (buf[2]))));
return 0;
} }
/* Read the remote registers into the block REGS. */ /* Read the remote registers into the block REGS. */
/* Currently we just read all the registers, so we don't use regno. */
/* ARGSUSED */
int int
remote_fetch_registers (regno) remote_fetch_registers (regno)
int regno; int regno;
@ -336,6 +342,7 @@ remote_prepare_to_store ()
/* Store the remote registers from the contents of the block REGISTERS. /* Store the remote registers from the contents of the block REGISTERS.
FIXME, eventually just store one register if that's all that is needed. */ FIXME, eventually just store one register if that's all that is needed. */
/* ARGSUSED */
int int
remote_store_registers (regno) remote_store_registers (regno)
int regno; int regno;
@ -466,15 +473,15 @@ remote_read_bytes (memaddr, myaddr, len)
} }
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring /* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if WRITE is to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
nonzero. Returns length of data written or read; 0 for error. */ nonzero. Returns length of data written or read; 0 for error. */
int int
remote_xfer_inferior_memory(memaddr, myaddr, len, write) remote_xfer_inferior_memory(memaddr, myaddr, len, should_write)
CORE_ADDR memaddr; CORE_ADDR memaddr;
char *myaddr; char *myaddr;
int len; int len;
int write; int should_write;
{ {
int origlen = len; int origlen = len;
int xfersize; int xfersize;
@ -485,7 +492,7 @@ remote_xfer_inferior_memory(memaddr, myaddr, len, write)
else else
xfersize = len; xfersize = len;
if (write) if (should_write)
remote_write_bytes(memaddr, myaddr, xfersize); remote_write_bytes(memaddr, myaddr, xfersize);
else else
remote_read_bytes (memaddr, myaddr, xfersize); remote_read_bytes (memaddr, myaddr, xfersize);

View file

@ -158,7 +158,7 @@ int i;
status = target_read_memory ( status = target_read_memory (
(CORE_ADDR)so_list_ptr->inferior_lm_add, (CORE_ADDR)so_list_ptr->inferior_lm_add,
&so_list_ptr->inferior_lm, (char *)&so_list_ptr->inferior_lm,
sizeof(struct link_map)); sizeof(struct link_map));
if (status == 0) if (status == 0)
inferior_lm = so_list_ptr->inferior_lm.lm_next; inferior_lm = so_list_ptr->inferior_lm.lm_next;

View file

@ -756,6 +756,7 @@ print_frame_label_vars (frame, this_level_only, stream)
return values_printed; return values_printed;
} }
/* ARGSUSED */
static void static void
locals_info (args, from_tty) locals_info (args, from_tty)
char *args; char *args;
@ -972,6 +973,7 @@ frame_command (level_exp, from_tty)
/* Select the frame up one or COUNT stack levels /* Select the frame up one or COUNT stack levels
from the previously selected frame, and print it briefly. */ from the previously selected frame, and print it briefly. */
/* ARGSUSED */
static void static void
up_silently_command (count_exp, from_tty) up_silently_command (count_exp, from_tty)
char *count_exp; char *count_exp;
@ -1004,6 +1006,7 @@ up_command (count_exp, from_tty)
/* Select the frame down one or COUNT stack levels /* Select the frame down one or COUNT stack levels
from the previously selected frame, and print it briefly. */ from the previously selected frame, and print it briefly. */
/* ARGSUSED */
static void static void
down_silently_command (count_exp, from_tty) down_silently_command (count_exp, from_tty)
char *count_exp; char *count_exp;

View file

@ -82,7 +82,7 @@ char *symfile = 0;
/* The modification date of the file when they were loaded. */ /* The modification date of the file when they were loaded. */
int symfile_mtime = 0; long /* really time_t */ symfile_mtime = 0;
/* Structures with which to manage partial symbol allocation. */ /* Structures with which to manage partial symbol allocation. */
@ -595,6 +595,7 @@ symfile_init (sym_bfd)
} }
} }
error ("I'm sorry, Dave, I can't do that. Symbol format unknown."); error ("I'm sorry, Dave, I can't do that. Symbol format unknown.");
return 0; /* Appease lint. */
} }
/* This function runs the load command of our current target. */ /* This function runs the load command of our current target. */
@ -623,6 +624,7 @@ add_symbol_file_command (args, from_tty)
/* This function allows the addition of incrementally linked object files. */ /* This function allows the addition of incrementally linked object files. */
/* ARGSUSED */
void void
add_syms_addr_command (arg_string, from_tty) add_syms_addr_command (arg_string, from_tty)
char* arg_string; char* arg_string;
@ -801,6 +803,7 @@ clear_symtab_users_once ()
/* Delete the specified psymtab, and any others that reference it. */ /* Delete the specified psymtab, and any others that reference it. */
static void
cashier_psymtab (pst) cashier_psymtab (pst)
struct partial_symtab *pst; struct partial_symtab *pst;
{ {
@ -859,7 +862,6 @@ free_named_symtabs (name)
register struct symtab *s; register struct symtab *s;
register struct symtab *prev; register struct symtab *prev;
register struct partial_symtab *ps; register struct partial_symtab *ps;
register struct partial_symtab *pprev;
struct blockvector *bv; struct blockvector *bv;
int blewit = 0; int blewit = 0;

View file

@ -226,7 +226,7 @@ check_stub_type(type)
struct symbol *sym; struct symbol *sym;
if (name == 0) if (name == 0)
{ {
complain (&stub_noname_complaint, 0, 0); complain (&stub_noname_complaint, 0);
return; return;
} }
if (sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, if (sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,

View file

@ -818,6 +818,11 @@ extern struct type *lookup_member_type ();
extern struct type *lookup_method_type (); extern struct type *lookup_method_type ();
extern struct type *lookup_class (); extern struct type *lookup_class ();
extern void smash_to_method_type (); extern void smash_to_method_type ();
void smash_to_member_type (
#ifdef __STDC__
struct type *, struct type *, struct type *
#endif
);
extern struct type *allocate_stub_method (); extern struct type *allocate_stub_method ();
/* end of C++ stuff. */ /* end of C++ stuff. */
@ -902,6 +907,16 @@ void symbol_file_add ();
/* source.c */ /* source.c */
int identify_source_line (); int identify_source_line ();
void print_source_lines (); void print_source_lines ();
void forget_cached_source_info (
#ifdef __STDC__
void
#endif
);
void select_source_symtab (
#ifdef __STDC__
struct symtab *
#endif
);
char **make_symbol_completion_list (); char **make_symbol_completion_list ();

View file

@ -76,18 +76,15 @@ struct target_ops **current_target_stack;
static struct cmd_list_element *targetlist = NULL; static struct cmd_list_element *targetlist = NULL;
/* Docstring for target (as in "help target"). */
static char *target_doc = NULL;
/* The user just typed 'target' without the name of a target. */ /* The user just typed 'target' without the name of a target. */
/* ARGSUSED */
static void static void
target_command (arg, from_tty) target_command (arg, from_tty)
char *arg; char *arg;
int from_tty; int from_tty;
{ {
fputs_filtered ("Argument required (target name).", stdout); fputs_filtered ("Argument required (target name).\n", stdout);
} }
/* Add a possible target architecture to the list. */ /* Add a possible target architecture to the list. */
@ -160,6 +157,7 @@ noprocess ()
error ("You can't do that without a process to debug"); error ("You can't do that without a process to debug");
} }
/* ARGSUSED */
static int static int
nosymbol (name, addrp) nosymbol (name, addrp)
char *name; char *name;
@ -168,6 +166,7 @@ nosymbol (name, addrp)
return 1; /* Symbol does not exist in target env */ return 1; /* Symbol does not exist in target env */
} }
/* ARGSUSED */
static void static void
default_terminal_info (args, from_tty) default_terminal_info (args, from_tty)
char *args; char *args;
@ -214,6 +213,7 @@ static void
kill_or_be_killed (from_tty) kill_or_be_killed (from_tty)
int from_tty; int from_tty;
{ {
/* FIXME: What is savecur for? Why isn't it used? */
struct target_ops *savecur; struct target_ops *savecur;
if (target_has_execution) if (target_has_execution)
@ -467,6 +467,7 @@ bump:
} }
/* ARGSUSED */
static void static void
target_info (args, from_tty) target_info (args, from_tty)
char *args; char *args;

View file

@ -286,7 +286,7 @@ extern struct ext_format ext_format_68881 [];
the address in which a function should return its structure value, the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */ as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF)) #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
/* Describe the pointer in each stack frame to the previous stack frame /* Describe the pointer in each stack frame to the previous stack frame
(its caller). */ (its caller). */

View file

@ -286,7 +286,12 @@ extern CORE_ADDR skip_prologue ();
as a CORE_ADDR (or an expression that can be used as one). */ as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(read_memory_integer (((int *)(REGBUF))[SP_REGNUM]+(16*4), 4)) (sparc_extract_struct_value_address (REGBUF))
CORE_ADDR sparc_extract_struct_value_address (
#ifdef __STDC__
char [REGISTER_BYTES]
#endif
);
/* Describe the pointer in each stack frame to the previous stack frame /* Describe the pointer in each stack frame to the previous stack frame
@ -296,9 +301,6 @@ extern CORE_ADDR skip_prologue ();
of <sun4/reg.h> (also known as <machine/reg.h>). */ of <sun4/reg.h> (also known as <machine/reg.h>). */
#include <sun4/reg.h> #include <sun4/reg.h>
#define GET_RWINDOW_REG(FRAME, REG) \
(read_memory_integer ((CORE_ADDR)&((struct rwindow *)FRAME)->REG, 4))
/* FRAME_CHAIN takes a frame's nominal address /* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer. and produces the frame's chain-pointer.
@ -337,8 +339,8 @@ extern CORE_ADDR skip_prologue ();
(fci)->next->bottom : (fci)->next->frame) : \ (fci)->next->bottom : (fci)->next->frame) : \
read_register (SP_REGNUM)); read_register (SP_REGNUM));
#define FRAME_CHAIN(thisframe) \ #define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
GET_RWINDOW_REG ((thisframe)->frame, rw_in[6]) CORE_ADDR sparc_frame_chain ();
#define FRAME_CHAIN_VALID(chain, thisframe) \ #define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe)))) (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))

View file

@ -693,6 +693,7 @@ lines_to_list ()
return 10; return 10;
} }
/* ARGSUSED */
static void static void
set_width_command (args, from_tty, c) set_width_command (args, from_tty, c)
char *args; char *args;
@ -1205,11 +1206,11 @@ char *
strstr (in, find) strstr (in, find)
const char *in, *find; const char *in, *find;
{ {
register char *p = in - 1; register const char *p = in - 1;
while (0 != (p = strchr (p+1, *find))) { while (0 != (p = strchr (p+1, *find))) {
if (strcmp (p, find)) if (strcmp (p, find))
return p; return (char *)p;
} }
return 0; return 0;
} }

View file

@ -669,6 +669,10 @@ val_print (type, valaddr, address, stream, format,
switch (TYPE_CODE (type)) switch (TYPE_CODE (type))
{ {
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
/* FIXME: TYPE_LENGTH (type) is unsigned and therefore always
0. Is "> 0" meant? I'm not sure what an "array of
unspecified length" (mentioned in the comment for the else-part
of this if) is. */
if (TYPE_LENGTH (type) >= 0 if (TYPE_LENGTH (type) >= 0
&& TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
{ {
@ -762,9 +766,11 @@ val_print (type, valaddr, address, stream, format,
struct fn_field *f; struct fn_field *f;
int j, len2; int j, len2;
char *kind = ""; char *kind = "";
CORE_ADDR addr;
val = unpack_long (builtin_type_int, valaddr); addr = unpack_pointer (lookup_pointer_type (builtin_type_void),
if (val < 128) valaddr);
if (addr < 128)
{ {
len = TYPE_NFN_FIELDS (domain); len = TYPE_NFN_FIELDS (domain);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
@ -775,7 +781,7 @@ val_print (type, valaddr, address, stream, format,
for (j = 0; j < len2; j++) for (j = 0; j < len2; j++)
{ {
QUIT; QUIT;
if (TYPE_FN_FIELD_VOFFSET (f, j) == val) if (TYPE_FN_FIELD_VOFFSET (f, j) == addr)
{ {
kind = "virtual"; kind = "virtual";
goto common; goto common;
@ -785,7 +791,7 @@ val_print (type, valaddr, address, stream, format,
} }
else else
{ {
struct symbol *sym = find_pc_function ((CORE_ADDR) val); struct symbol *sym = find_pc_function (addr);
if (sym == 0) if (sym == 0)
error ("invalid pointer to member function"); error ("invalid pointer to member function");
len = TYPE_NFN_FIELDS (domain); len = TYPE_NFN_FIELDS (domain);
@ -821,7 +827,7 @@ val_print (type, valaddr, address, stream, format,
} }
fprintf_filtered (stream, "("); fprintf_filtered (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") %d", (int) val >> 3); fprintf_filtered (stream, ") %d", (int) addr >> 3);
} }
else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_MEMBER) else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_MEMBER)
{ {
@ -869,7 +875,7 @@ val_print (type, valaddr, address, stream, format,
} }
else else
{ {
CORE_ADDR addr = (CORE_ADDR) unpack_long (type, valaddr); CORE_ADDR addr = unpack_pointer (type, valaddr);
elttype = TYPE_TARGET_TYPE (type); elttype = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC) if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
@ -968,7 +974,7 @@ val_print (type, valaddr, address, stream, format,
else /* print vtbl's nicely */ else /* print vtbl's nicely */
if (is_vtbl_member(type)) if (is_vtbl_member(type))
{ {
CORE_ADDR vt_address = (CORE_ADDR) unpack_long (type, valaddr); CORE_ADDR vt_address = unpack_pointer (type, valaddr);
int vt_index = find_pc_misc_function (vt_address); int vt_index = find_pc_misc_function (vt_address);
if (vt_index >= 0 if (vt_index >= 0
@ -981,11 +987,11 @@ val_print (type, valaddr, address, stream, format,
} }
if (vtblprint) if (vtblprint)
{ {
value val; value vt_val;
val = value_at (TYPE_TARGET_TYPE (type), vt_address); vt_val = value_at (TYPE_TARGET_TYPE (type), vt_address);
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
VALUE_ADDRESS (val), stream, format, VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty); deref_ref, recurse + 1, pretty);
if (pretty) if (pretty)
{ {
@ -1018,11 +1024,13 @@ val_print (type, valaddr, address, stream, format,
{ {
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF) if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF)
{ {
value val = value_at (TYPE_TARGET_TYPE (type), value deref_val =
(CORE_ADDR) unpack_long (builtin_type_int, value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr)); valaddr));
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), val_print (VALUE_TYPE (deref_val), VALUE_CONTENTS (deref_val),
VALUE_ADDRESS (val), stream, format, VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty); deref_ref, recurse + 1, pretty);
} }
else else
@ -1066,7 +1074,11 @@ val_print (type, valaddr, address, stream, format,
if (i < len) if (i < len)
fputs_filtered (TYPE_FIELD_NAME (type, i), stream); fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
else else
fprintf_filtered (stream, "%d", (int) val); #ifdef LONG_LONG
fprintf_filtered (stream, "%lld", val);
#else
fprintf_filtered (stream, "%ld", val);
#endif
break; break;
case TYPE_CODE_FUNC: case TYPE_CODE_FUNC:
@ -1100,7 +1112,7 @@ val_print (type, valaddr, address, stream, format,
char *p; char *p;
/* Pointer to first (i.e. lowest address) nonzero character. */ /* Pointer to first (i.e. lowest address) nonzero character. */
char *first_addr; char *first_addr;
unsigned len = TYPE_LENGTH (type); len = TYPE_LENGTH (type);
#if TARGET_BYTE_ORDER == BIG_ENDIAN #if TARGET_BYTE_ORDER == BIG_ENDIAN
for (p = valaddr; for (p = valaddr;
@ -1442,8 +1454,8 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
fprintf_filtered (stream, ")"); fprintf_filtered (stream, ")");
fprintf_filtered (stream, "["); fprintf_filtered (stream, "[");
if (TYPE_LENGTH (type) >= 0 if (/* always true */ /* TYPE_LENGTH (type) >= 0
&& TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) && */ TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
fprintf_filtered (stream, "%d", fprintf_filtered (stream, "%d",
(TYPE_LENGTH (type) (TYPE_LENGTH (type)
/ TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
@ -1763,10 +1775,12 @@ type_print_base (type, stream, show, level)
} }
} }
#if 0
/* Validate an input or output radix setting, and make sure the user /* Validate an input or output radix setting, and make sure the user
knows what they really did here. Radix setting is confusing, e.g. knows what they really did here. Radix setting is confusing, e.g.
setting the input radix to "10" never changes it! */ setting the input radix to "10" never changes it! */
/* ARGSUSED */
static void static void
set_input_radix (args, from_tty, c) set_input_radix (args, from_tty, c)
char *args; char *args;
@ -1779,7 +1793,9 @@ set_input_radix (args, from_tty, c)
printf_filtered ("Input radix set to decimal %d, hex %x, octal %o\n", printf_filtered ("Input radix set to decimal %d, hex %x, octal %o\n",
radix, radix, radix); radix, radix, radix);
} }
#endif
/* ARGSUSED */
static void static void
set_output_radix (args, from_tty, c) set_output_radix (args, from_tty, c)
char *args; char *args;

View file

@ -532,6 +532,19 @@ value_as_double (val)
error ("Invalid floating value found in program."); error ("Invalid floating value found in program.");
return foo; return foo;
} }
/* Extract a value as a C pointer.
Does not deallocate the value. */
CORE_ADDR
value_as_pointer (val)
value val;
{
/* This coerces arrays and functions, which is necessary (e.g.
in disassemble_command). It also dereferences references, which
I suspect is the most logical thing to do. */
if (TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_ENUM)
COERCE_ARRAY (val);
return unpack_pointer (VALUE_TYPE (val), VALUE_CONTENTS (val));
}
/* Unpack raw data (copied from debugee, target byte order) at VALADDR /* Unpack raw data (copied from debugee, target byte order) at VALADDR
as a long, or as a double, assuming the raw data is described as a long, or as a double, assuming the raw data is described
@ -674,10 +687,13 @@ unpack_long (type, valaddr)
error ("That operation is not possible on an integer of that size."); error ("That operation is not possible on an integer of that size.");
} }
} }
#if 0
/* There is no guarantee that a pointer can fit within a LONGEST.
Callers should use unpack_pointer instead. */
else if (code == TYPE_CODE_PTR else if (code == TYPE_CODE_PTR
|| code == TYPE_CODE_REF) || code == TYPE_CODE_REF)
{ {
if (len == sizeof (char *)) if (len == sizeof (CORE_ADDR))
{ {
CORE_ADDR retval; CORE_ADDR retval;
bcopy (valaddr, &retval, sizeof (retval)); bcopy (valaddr, &retval, sizeof (retval));
@ -685,10 +701,15 @@ unpack_long (type, valaddr)
return retval; return retval;
} }
} }
#endif
else if (code == TYPE_CODE_MEMBER) else if (code == TYPE_CODE_MEMBER)
error ("not implemented: member types in unpack_long"); error ("not implemented: member types in unpack_long");
#if 0
error ("Value not integer or pointer."); error ("Value not integer or pointer.");
#else
error ("Value not integer.");
#endif
return 0; /* For lint -- never reached */ return 0; /* For lint -- never reached */
} }
@ -735,6 +756,7 @@ unpack_double (type, valaddr, invp)
else else
{ {
error ("Unexpected type of floating point number."); error ("Unexpected type of floating point number.");
return 0; /* Placate lint. */
} }
} }
else if (nosign) { else if (nosign) {
@ -749,6 +771,46 @@ unpack_double (type, valaddr, invp)
return unpack_long (type, valaddr); return unpack_long (type, valaddr);
} }
} }
/* Unpack raw data (copied from debugee, target byte order) at VALADDR
as a CORE_ADDR, assuming the raw data is described by type TYPE.
We don't assume any alignment for the raw data. Return value is in
host byte order.
If you want functions and arrays to be coerced to pointers, and
references to be dereferenced, call value_as_pointer() instead.
C++: It is assumed that the front-end has taken care of
all matters concerning pointers to members. A pointer
to member which reaches here is considered to be equivalent
to an INT (or some size). After all, it is only an offset. */
CORE_ADDR
unpack_pointer (type, valaddr)
struct type *type;
char *valaddr;
{
register enum type_code code = TYPE_CODE (type);
register int len = TYPE_LENGTH (type);
if (code == TYPE_CODE_PTR
|| code == TYPE_CODE_REF)
{
if (len == sizeof (CORE_ADDR))
{
CORE_ADDR retval;
bcopy (valaddr, &retval, sizeof (retval));
SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
return retval;
}
error ("Unrecognized pointer size.");
}
else if (code == TYPE_CODE_MEMBER)
error ("not implemented: member types in unpack_pointer");
error ("Value is not a pointer.");
return 0; /* For lint -- never reached */
}
/* Given a value ARG1 (offset by OFFSET bytes) /* Given a value ARG1 (offset by OFFSET bytes)
of a struct or union type ARG_TYPE, of a struct or union type ARG_TYPE,
@ -922,6 +984,7 @@ value_headof (arg, btype, dtype)
/* First collect the vtables we must look at for this object. */ /* First collect the vtables we must look at for this object. */
/* FIXME-tiemann: right now, just look at top-most vtable. */ /* FIXME-tiemann: right now, just look at top-most vtable. */
value vtbl, entry, best_entry = 0; value vtbl, entry, best_entry = 0;
/* FIXME: entry_type is never used. */
struct type *entry_type; struct type *entry_type;
int i, nelems; int i, nelems;
int offset, best_offset = 0; int offset, best_offset = 0;
@ -954,11 +1017,11 @@ value_headof (arg, btype, dtype)
/* Now search through the virtual function table. */ /* Now search through the virtual function table. */
entry = value_ind (vtbl); entry = value_ind (vtbl);
entry_type = VALUE_TYPE (entry); entry_type = VALUE_TYPE (entry);
nelems = value_as_long (value_field (entry, 2)); nelems = longest_to_int (value_as_long (value_field (entry, 2)));
for (i = 1; i <= nelems; i++) for (i = 1; i <= nelems; i++)
{ {
entry = value_subscript (vtbl, value_from_long (builtin_type_int, i)); entry = value_subscript (vtbl, value_from_long (builtin_type_int, i));
offset = value_as_long (value_field (entry, 0)); offset = longest_to_int (value_as_long (value_field (entry, 0)));
if (offset < best_offset) if (offset < best_offset)
{ {
best_offset = offset; best_offset = offset;
@ -970,7 +1033,7 @@ value_headof (arg, btype, dtype)
/* Move the pointer according to BEST_ENTRY's offset, and figure /* Move the pointer according to BEST_ENTRY's offset, and figure
out what type we should return as the new pointer. */ out what type we should return as the new pointer. */
pc_for_sym = value_as_long (value_field (best_entry, 2)); pc_for_sym = value_as_pointer (value_field (best_entry, 2));
sym = find_pc_function (pc_for_sym); sym = find_pc_function (pc_for_sym);
demangled_name = cplus_demangle (SYMBOL_NAME (sym), -1); demangled_name = cplus_demangle (SYMBOL_NAME (sym), -1);
*(strchr (demangled_name, ':')) = '\0'; *(strchr (demangled_name, ':')) = '\0';
@ -1111,7 +1174,8 @@ baseclass_addr (type, index, valaddr, valuep, errp)
CORE_ADDR addr; CORE_ADDR addr;
int status; int status;
addr = unpack_long (TYPE_FIELD_TYPE (type, i), addr
= unpack_pointer (TYPE_FIELD_TYPE (type, i),
valaddr + (TYPE_FIELD_BITPOS (type, i) / 8)); valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
status = target_read_memory (addr, status = target_read_memory (addr,
@ -1143,7 +1207,7 @@ baseclass_addr (type, index, valaddr, valuep, errp)
{ {
char *baddr; char *baddr;
baddr = baseclass_addr (type, i, valaddr, valuep); baddr = baseclass_addr (type, i, valaddr, valuep, errp);
if (baddr) if (baddr)
return baddr; return baddr;
} }
@ -1190,6 +1254,8 @@ check_stub_method (type, i, j)
if (OPNAME_PREFIX_P (field_name)) if (OPNAME_PREFIX_P (field_name))
{ {
char *opname = cplus_mangle_opname (field_name + 3); char *opname = cplus_mangle_opname (field_name + 3);
if (opname == NULL)
error ("No mangling for \"%s\"", field_name);
mangled_name_len += strlen (opname); mangled_name_len += strlen (opname);
mangled_name = (char *)xmalloc (mangled_name_len); mangled_name = (char *)xmalloc (mangled_name_len);