s/value_ptr/struct value */

This commit is contained in:
Andrew Cagney 2001-11-10 21:34:56 +00:00
parent 6943961c98
commit 3d6d86c64b
12 changed files with 46 additions and 40 deletions

View file

@ -1,3 +1,9 @@
2001-11-10 Andrew Cagney <ac131313@redhat.com>
* printcmd.c, valprint.c, language.c, linespec.c, infcmd.c,
gnu-nat.c, findvar.c, expprint.c, typeprint.c, stack.c, top.c:
Replace value_ptr with struct value.
2001-11-10 Andrew Cagney <ac131313@redhat.com> 2001-11-10 Andrew Cagney <ac131313@redhat.com>
* c-valprint.c, ch-lang.c, ch-valprint.c, cp-valprint.c, * c-valprint.c, ch-lang.c, ch-valprint.c, cp-valprint.c,

View file

@ -62,7 +62,7 @@ print_subexp (register struct expression *exp, register int *pos,
enum precedence myprec = PREC_NULL; enum precedence myprec = PREC_NULL;
/* Set to 1 for a right-associative operator. */ /* Set to 1 for a right-associative operator. */
int assoc = 0; int assoc = 0;
value_ptr val; struct value *val;
char *tempstr = NULL; char *tempstr = NULL;
op_print_tab = exp->language_defn->la_op_print_tab; op_print_tab = exp->language_defn->la_op_print_tab;

View file

@ -295,12 +295,12 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
NOTE: returns NULL if register value is not available. NOTE: returns NULL if register value is not available.
Caller will check return value or die! */ Caller will check return value or die! */
value_ptr struct value *
value_of_register (int regnum) value_of_register (int regnum)
{ {
CORE_ADDR addr; CORE_ADDR addr;
int optim; int optim;
register value_ptr reg_val; struct value *reg_val;
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval; enum lval_type lval;
@ -412,10 +412,10 @@ symbol_read_needs_frame (struct symbol *sym)
If the variable cannot be found, return a zero pointer. If the variable cannot be found, return a zero pointer.
If FRAME is NULL, use the selected_frame. */ If FRAME is NULL, use the selected_frame. */
value_ptr struct value *
read_var_value (register struct symbol *var, struct frame_info *frame) read_var_value (register struct symbol *var, struct frame_info *frame)
{ {
register value_ptr v; register struct value *v;
struct type *type = SYMBOL_TYPE (var); struct type *type = SYMBOL_TYPE (var);
CORE_ADDR addr; CORE_ADDR addr;
register int len; register int len;
@ -523,7 +523,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
case LOC_BASEREG_ARG: case LOC_BASEREG_ARG:
case LOC_THREAD_LOCAL_STATIC: case LOC_THREAD_LOCAL_STATIC:
{ {
value_ptr regval; struct value *regval;
regval = value_from_register (lookup_pointer_type (type), regval = value_from_register (lookup_pointer_type (type),
SYMBOL_BASEREG (var), frame); SYMBOL_BASEREG (var), frame);
@ -552,7 +552,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
{ {
struct block *b; struct block *b;
int regno = SYMBOL_VALUE (var); int regno = SYMBOL_VALUE (var);
value_ptr regval; struct value *regval;
if (frame == NULL) if (frame == NULL)
return 0; return 0;
@ -617,13 +617,13 @@ addresses have not been bound by the dynamic loader. Try again when executable i
NOTE: returns NULL if register value is not available. NOTE: returns NULL if register value is not available.
Caller will check return value or die! */ Caller will check return value or die! */
value_ptr struct value *
value_from_register (struct type *type, int regnum, struct frame_info *frame) value_from_register (struct type *type, int regnum, struct frame_info *frame)
{ {
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
CORE_ADDR addr; CORE_ADDR addr;
int optim; int optim;
value_ptr v = allocate_value (type); struct value *v = allocate_value (type);
char *value_bytes = 0; char *value_bytes = 0;
int value_bytes_copied = 0; int value_bytes_copied = 0;
int num_storage_locs; int num_storage_locs;
@ -840,12 +840,12 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
return a (pointer to a) struct value containing the properly typed return a (pointer to a) struct value containing the properly typed
address. */ address. */
value_ptr struct value *
locate_var_value (register struct symbol *var, struct frame_info *frame) locate_var_value (register struct symbol *var, struct frame_info *frame)
{ {
CORE_ADDR addr = 0; CORE_ADDR addr = 0;
struct type *type = SYMBOL_TYPE (var); struct type *type = SYMBOL_TYPE (var);
value_ptr lazy_value; struct value *lazy_value;
/* Evaluate it first; if the result is a memory address, we're fine. /* Evaluate it first; if the result is a memory address, we're fine.
Lazy evaluation pays off here. */ Lazy evaluation pays off here. */
@ -857,7 +857,7 @@ locate_var_value (register struct symbol *var, struct frame_info *frame)
if (VALUE_LAZY (lazy_value) if (VALUE_LAZY (lazy_value)
|| TYPE_CODE (type) == TYPE_CODE_FUNC) || TYPE_CODE (type) == TYPE_CODE_FUNC)
{ {
value_ptr val; struct value *val;
addr = VALUE_ADDRESS (lazy_value); addr = VALUE_ADDRESS (lazy_value);
val = value_from_pointer (lookup_pointer_type (type), addr); val = value_from_pointer (lookup_pointer_type (type), addr);

View file

@ -1,5 +1,5 @@
/* Interface GDB to the GNU Hurd. /* Interface GDB to the GNU Hurd.
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000 Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -2957,14 +2957,14 @@ static void
info_port_rights (char *args, mach_port_type_t only) info_port_rights (char *args, mach_port_type_t only)
{ {
struct inf *inf = active_inf (); struct inf *inf = active_inf ();
value_ptr vmark = value_mark (); struct value *vmark = value_mark ();
if (args) if (args)
/* Explicit list of port rights. */ /* Explicit list of port rights. */
{ {
while (*args) while (*args)
{ {
value_ptr val = parse_to_comma_and_eval (&args); struct value *val = parse_to_comma_and_eval (&args);
long right = value_as_long (val); long right = value_as_long (val);
error_t err = error_t err =
print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS, print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,

View file

@ -1023,7 +1023,7 @@ until_command (char *arg, int from_tty)
static void static void
print_return_value (int structure_return, struct type *value_type) print_return_value (int structure_return, struct type *value_type)
{ {
register value_ptr value; struct value *value;
#ifdef UI_OUT #ifdef UI_OUT
static struct ui_stream *stb = NULL; static struct ui_stream *stb = NULL;
#endif /* UI_OUT */ #endif /* UI_OUT */

View file

@ -96,7 +96,7 @@ static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
struct ui_file *, int, int, int, struct ui_file *, int, int, int,
enum val_prettyprint); enum val_prettyprint);
static int unk_lang_value_print (value_ptr, struct ui_file *, int, enum val_prettyprint); static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
/* Forward declaration */ /* Forward declaration */
extern const struct language_defn unknown_language_defn; extern const struct language_defn unknown_language_defn;
@ -537,7 +537,7 @@ language_info (int quietly)
#if 0 /* Currently unused */ #if 0 /* Currently unused */
struct type * struct type *
binop_result_type (value_ptr v1, value_ptr v2) binop_result_type (struct value *v1, struct value *v2)
{ {
int size, uns; int size, uns;
struct type *t1 = check_typedef (VALUE_TYPE (v1)); struct type *t1 = check_typedef (VALUE_TYPE (v1));
@ -1049,7 +1049,7 @@ lang_bool_type (void)
/* Returns non-zero if the value VAL represents a true value. */ /* Returns non-zero if the value VAL represents a true value. */
int int
value_true (value_ptr val) value_true (struct value *val)
{ {
/* It is possible that we should have some sort of error if a non-boolean /* It is possible that we should have some sort of error if a non-boolean
value is used in this context. Possibly dependent on some kind of value is used in this context. Possibly dependent on some kind of
@ -1066,7 +1066,7 @@ value_true (value_ptr val)
#if 0 /* Currently unused */ #if 0 /* Currently unused */
void void
binop_type_check (value_ptr arg1, value_ptr arg2, int op) binop_type_check (struct value *arg1, struct value *arg2, int op)
{ {
struct type *t1, *t2; struct type *t1, *t2;
@ -1457,7 +1457,7 @@ unk_lang_val_print (struct type *type, char *valaddr, int embedded_offset,
} }
static int static int
unk_lang_value_print (value_ptr val, struct ui_file *stream, int format, unk_lang_value_print (struct value *val, struct ui_file *stream, int format,
enum val_prettyprint pretty) enum val_prettyprint pretty)
{ {
error ("internal error - unimplemented function unk_lang_value_print called."); error ("internal error - unimplemented function unk_lang_value_print called.");

View file

@ -1082,7 +1082,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if (*copy == '$') if (*copy == '$')
{ {
value_ptr valx; struct value *valx;
int index = 0; int index = 0;
int need_canonical = 0; int need_canonical = 0;

View file

@ -75,7 +75,7 @@ static CORE_ADDR last_examine_address;
/* Contents of last address examined. /* Contents of last address examined.
This is not valid past the end of the `x' command! */ This is not valid past the end of the `x' command! */
static value_ptr last_examine_value; static struct value *last_examine_value;
/* Largest offset between a symbolic value and an address, that will be /* Largest offset between a symbolic value and an address, that will be
printed as `0x1234 <symbol+offset>'. */ printed as `0x1234 <symbol+offset>'. */
@ -172,7 +172,7 @@ static void validate_format (struct format_data, char *);
static void do_examine (struct format_data, CORE_ADDR addr, static void do_examine (struct format_data, CORE_ADDR addr,
asection * section); asection * section);
static void print_formatted (value_ptr, int, int, struct ui_file *); static void print_formatted (struct value *, int, int, struct ui_file *);
static struct format_data decode_format (char **, int, int); static struct format_data decode_format (char **, int, int);
@ -280,7 +280,7 @@ decode_format (char **string_ptr, int oformat, int osize)
This is used to pad hex numbers so they line up. */ This is used to pad hex numbers so they line up. */
static void static void
print_formatted (register value_ptr val, register int format, int size, print_formatted (struct value *val, register int format, int size,
struct ui_file *stream) struct ui_file *stream)
{ {
struct type *type = check_typedef (VALUE_TYPE (val)); struct type *type = check_typedef (VALUE_TYPE (val));
@ -894,7 +894,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
struct expression *expr; struct expression *expr;
register struct cleanup *old_chain = 0; register struct cleanup *old_chain = 0;
register char format = 0; register char format = 0;
register value_ptr val; struct value *val;
struct format_data fmt; struct format_data fmt;
int cleanup = 0; int cleanup = 0;
@ -932,7 +932,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
|| TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION)) || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION))
{ {
value_ptr v; struct value *v;
v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type)); v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
if (v != 0) if (v != 0)
@ -1012,7 +1012,7 @@ output_command (char *exp, int from_tty)
struct expression *expr; struct expression *expr;
register struct cleanup *old_chain; register struct cleanup *old_chain;
register char format = 0; register char format = 0;
register value_ptr val; struct value *val;
struct format_data fmt; struct format_data fmt;
if (exp && *exp == '/') if (exp && *exp == '/')
@ -1563,7 +1563,7 @@ do_one_display (struct display *d)
if (d->format.size) if (d->format.size)
{ {
CORE_ADDR addr; CORE_ADDR addr;
value_ptr val; struct value *val;
annotate_display_format (); annotate_display_format ();
@ -1765,7 +1765,7 @@ void
print_variable_value (struct symbol *var, struct frame_info *frame, print_variable_value (struct symbol *var, struct frame_info *frame,
struct ui_file *stream) struct ui_file *stream)
{ {
value_ptr val = read_var_value (var, frame); struct value *val = read_var_value (var, frame);
value_print (val, stream, 0, Val_pretty_default); value_print (val, stream, 0, Val_pretty_default);
} }
@ -1786,7 +1786,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
int first = 1; int first = 1;
register int i; register int i;
register struct symbol *sym; register struct symbol *sym;
register value_ptr val; struct value *val;
/* 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. */
@ -2036,7 +2036,7 @@ printf_command (char *arg, int from_tty)
register char *f = NULL; register char *f = NULL;
register char *s = arg; register char *s = arg;
char *string = NULL; char *string = NULL;
value_ptr *val_args; struct value **val_args;
char *substrings; char *substrings;
char *current_substring; char *current_substring;
int nargs = 0; int nargs = 0;

View file

@ -695,7 +695,7 @@ parse_frame_specification (char *frame_exp)
addr_string = savestring (frame_exp, p - frame_exp); addr_string = savestring (frame_exp, p - frame_exp);
{ {
value_ptr vp; struct value *vp;
tmp_cleanup = make_cleanup (xfree, addr_string); tmp_cleanup = make_cleanup (xfree, addr_string);
@ -1757,7 +1757,7 @@ return_command (char *retval_exp, int from_tty)
CORE_ADDR selected_frame_addr; CORE_ADDR selected_frame_addr;
CORE_ADDR selected_frame_pc; CORE_ADDR selected_frame_pc;
struct frame_info *frame; struct frame_info *frame;
value_ptr return_value = NULL; struct value *return_value = NULL;
if (selected_frame == NULL) if (selected_frame == NULL)
error ("No selected frame."); error ("No selected frame.");

View file

@ -1339,7 +1339,7 @@ get_prompt_1 (void *data)
/* formatted prompt */ /* formatted prompt */
{ {
char fmt[40], *promptp, *outp, *tmp; char fmt[40], *promptp, *outp, *tmp;
value_ptr arg_val; struct value *arg_val;
DOUBLEST doubleval; DOUBLEST doubleval;
LONGEST longval; LONGEST longval;
CORE_ADDR addrval; CORE_ADDR addrval;
@ -1621,7 +1621,7 @@ quit_force (char *args, int from_tty)
value of that expression. */ value of that expression. */
if (args) if (args)
{ {
value_ptr val = parse_and_eval (args); struct value *val = parse_and_eval (args);
exit_code = (int) value_as_long (val); exit_code = (int) value_as_long (val);
} }

View file

@ -1,6 +1,6 @@
/* Language independent support for printing types for GDB, the GNU debugger. /* Language independent support for printing types for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999, Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
2000 Free Software Foundation, Inc. 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -126,7 +126,7 @@ static void
whatis_exp (char *exp, int show) whatis_exp (char *exp, int show)
{ {
struct expression *expr; struct expression *expr;
register value_ptr val; struct value *val;
register struct cleanup *old_chain = NULL; register struct cleanup *old_chain = NULL;
struct type *real_type = NULL; struct type *real_type = NULL;
struct type *type; struct type *type;
@ -333,7 +333,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
void void
maintenance_print_type (char *typename, int from_tty) maintenance_print_type (char *typename, int from_tty)
{ {
register value_ptr val; struct value *val;
register struct type *type; register struct type *type;
register struct cleanup *old_chain; register struct cleanup *old_chain;
struct expression *expr; struct expression *expr;

View file

@ -159,7 +159,7 @@ val_print (struct type *type, char *valaddr, int embedded_offset,
the number of string bytes printed. */ the number of string bytes printed. */
int int
value_print (value_ptr val, struct ui_file *stream, int format, value_print (struct value *val, struct ui_file *stream, int format,
enum val_prettyprint pretty) enum val_prettyprint pretty)
{ {
if (val == 0) if (val == 0)