This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] more s/value_ptr/struct value */


This cleans out the remaining easy ones leaving value.h, values.c and a 
few other large files.

Andrew
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.

Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.5
diff -p -r1.5 expprint.c
*** expprint.c	2001/03/06 08:21:07	1.5
--- expprint.c	2001/11/10 21:26:27
*************** print_subexp (register struct expression
*** 62,68 ****
    enum precedence myprec = PREC_NULL;
    /* Set to 1 for a right-associative operator.  */
    int assoc = 0;
!   value_ptr val;
    char *tempstr = NULL;
  
    op_print_tab = exp->language_defn->la_op_print_tab;
--- 62,68 ----
    enum precedence myprec = PREC_NULL;
    /* Set to 1 for a right-associative operator.  */
    int assoc = 0;
!   struct value *val;
    char *tempstr = NULL;
  
    op_print_tab = exp->language_defn->la_op_print_tab;
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.24
diff -p -r1.24 findvar.c
*** findvar.c	2001/10/16 01:58:07	1.24
--- findvar.c	2001/11/10 21:26:28
*************** store_typed_address (void *buf, struct t
*** 295,306 ****
     NOTE: returns NULL if register value is not available.
     Caller will check return value or die!  */
  
! value_ptr
  value_of_register (int regnum)
  {
    CORE_ADDR addr;
    int optim;
!   register value_ptr reg_val;
    char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    enum lval_type lval;
  
--- 295,306 ----
     NOTE: returns NULL if register value is not available.
     Caller will check return value or die!  */
  
! struct value *
  value_of_register (int regnum)
  {
    CORE_ADDR addr;
    int optim;
!   struct value *reg_val;
    char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    enum lval_type lval;
  
*************** symbol_read_needs_frame (struct symbol *
*** 412,421 ****
     If the variable cannot be found, return a zero pointer.
     If FRAME is NULL, use the selected_frame.  */
  
! value_ptr
  read_var_value (register struct symbol *var, struct frame_info *frame)
  {
!   register value_ptr v;
    struct type *type = SYMBOL_TYPE (var);
    CORE_ADDR addr;
    register int len;
--- 412,421 ----
     If the variable cannot be found, return a zero pointer.
     If FRAME is NULL, use the selected_frame.  */
  
! struct value *
  read_var_value (register struct symbol *var, struct frame_info *frame)
  {
!   register struct value *v;
    struct type *type = SYMBOL_TYPE (var);
    CORE_ADDR addr;
    register int len;
*************** addresses have not been bound by the dyn
*** 523,529 ****
      case LOC_BASEREG_ARG:
      case LOC_THREAD_LOCAL_STATIC:
        {
! 	value_ptr regval;
  
  	regval = value_from_register (lookup_pointer_type (type),
  				      SYMBOL_BASEREG (var), frame);
--- 523,529 ----
      case LOC_BASEREG_ARG:
      case LOC_THREAD_LOCAL_STATIC:
        {
! 	struct value *regval;
  
  	regval = value_from_register (lookup_pointer_type (type),
  				      SYMBOL_BASEREG (var), frame);
*************** addresses have not been bound by the dyn
*** 552,558 ****
        {
  	struct block *b;
  	int regno = SYMBOL_VALUE (var);
! 	value_ptr regval;
  
  	if (frame == NULL)
  	  return 0;
--- 552,558 ----
        {
  	struct block *b;
  	int regno = SYMBOL_VALUE (var);
! 	struct value *regval;
  
  	if (frame == NULL)
  	  return 0;
*************** addresses have not been bound by the dyn
*** 617,629 ****
     NOTE: returns NULL if register value is not available.
     Caller will check return value or die!  */
  
! value_ptr
  value_from_register (struct type *type, int regnum, struct frame_info *frame)
  {
    char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    CORE_ADDR addr;
    int optim;
!   value_ptr v = allocate_value (type);
    char *value_bytes = 0;
    int value_bytes_copied = 0;
    int num_storage_locs;
--- 617,629 ----
     NOTE: returns NULL if register value is not available.
     Caller will check return value or die!  */
  
! struct value *
  value_from_register (struct type *type, int regnum, struct frame_info *frame)
  {
    char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
    CORE_ADDR addr;
    int optim;
!   struct value *v = allocate_value (type);
    char *value_bytes = 0;
    int value_bytes_copied = 0;
    int num_storage_locs;
*************** value_from_register (struct type *type, 
*** 840,851 ****
     return a (pointer to a) struct value containing the properly typed
     address.  */
  
! value_ptr
  locate_var_value (register struct symbol *var, struct frame_info *frame)
  {
    CORE_ADDR addr = 0;
    struct type *type = SYMBOL_TYPE (var);
!   value_ptr lazy_value;
  
    /* Evaluate it first; if the result is a memory address, we're fine.
       Lazy evaluation pays off here. */
--- 840,851 ----
     return a (pointer to a) struct value containing the properly typed
     address.  */
  
! struct value *
  locate_var_value (register struct symbol *var, struct frame_info *frame)
  {
    CORE_ADDR addr = 0;
    struct type *type = SYMBOL_TYPE (var);
!   struct value *lazy_value;
  
    /* Evaluate it first; if the result is a memory address, we're fine.
       Lazy evaluation pays off here. */
*************** locate_var_value (register struct symbol
*** 857,863 ****
    if (VALUE_LAZY (lazy_value)
        || TYPE_CODE (type) == TYPE_CODE_FUNC)
      {
!       value_ptr val;
  
        addr = VALUE_ADDRESS (lazy_value);
        val = value_from_pointer (lookup_pointer_type (type), addr);
--- 857,863 ----
    if (VALUE_LAZY (lazy_value)
        || TYPE_CODE (type) == TYPE_CODE_FUNC)
      {
!       struct value *val;
  
        addr = VALUE_ADDRESS (lazy_value);
        val = value_from_pointer (lookup_pointer_type (type), addr);
Index: gnu-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-nat.c,v
retrieving revision 1.16
diff -p -r1.16 gnu-nat.c
*** gnu-nat.c	2001/05/24 20:05:07	1.16
--- gnu-nat.c	2001/11/10 21:27:02
***************
*** 1,5 ****
  /* Interface GDB to the GNU Hurd.
!    Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000
     Free Software Foundation, Inc.
  
     This file is part of GDB.
--- 1,5 ----
  /* Interface GDB to the GNU Hurd.
!    Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     Free Software Foundation, Inc.
  
     This file is part of GDB.
*************** static void
*** 2957,2970 ****
  info_port_rights (char *args, mach_port_type_t only)
  {
    struct inf *inf = active_inf ();
!   value_ptr vmark = value_mark ();
  
    if (args)
      /* Explicit list of port rights.  */
      {
        while (*args)
  	{
! 	  value_ptr val = parse_to_comma_and_eval (&args);
  	  long right = value_as_long (val);
  	  error_t err =
  	  print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,
--- 2957,2970 ----
  info_port_rights (char *args, mach_port_type_t only)
  {
    struct inf *inf = active_inf ();
!   struct value *vmark = value_mark ();
  
    if (args)
      /* Explicit list of port rights.  */
      {
        while (*args)
  	{
! 	  struct value *val = parse_to_comma_and_eval (&args);
  	  long right = value_as_long (val);
  	  error_t err =
  	  print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.32
diff -p -r1.32 infcmd.c
*** infcmd.c	2001/11/01 16:17:08	1.32
--- infcmd.c	2001/11/10 21:27:12
*************** until_command (char *arg, int from_tty)
*** 1023,1029 ****
  static void
  print_return_value (int structure_return, struct type *value_type)
  {
!   register value_ptr value;
  #ifdef UI_OUT
    static struct ui_stream *stb = NULL;
  #endif /* UI_OUT */
--- 1023,1029 ----
  static void
  print_return_value (int structure_return, struct type *value_type)
  {
!   struct value *value;
  #ifdef UI_OUT
    static struct ui_stream *stb = NULL;
  #endif /* UI_OUT */
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.16
diff -p -r1.16 language.c
*** language.c	2001/05/08 21:19:43	1.16
--- language.c	2001/11/10 21:27:13
*************** static int unk_lang_val_print (struct ty
*** 96,102 ****
  			       struct ui_file *, int, int, 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;
--- 96,102 ----
  			       struct ui_file *, int, int, int,
  			       enum val_prettyprint);
  
! static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
  
  /* Forward declaration */
  extern const struct language_defn unknown_language_defn;
*************** language_info (int quietly)
*** 537,543 ****
  #if 0				/* Currently unused */
  
  struct type *
! binop_result_type (value_ptr v1, value_ptr v2)
  {
    int size, uns;
    struct type *t1 = check_typedef (VALUE_TYPE (v1));
--- 537,543 ----
  #if 0				/* Currently unused */
  
  struct type *
! binop_result_type (struct value *v1, struct value *v2)
  {
    int size, uns;
    struct type *t1 = check_typedef (VALUE_TYPE (v1));
*************** lang_bool_type (void)
*** 1049,1055 ****
  
  /* Returns non-zero if the value VAL represents a true value. */
  int
! value_true (value_ptr val)
  {
    /* 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
--- 1049,1055 ----
  
  /* Returns non-zero if the value VAL represents a true value. */
  int
! value_true (struct value *val)
  {
    /* 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_true (value_ptr val)
*** 1066,1072 ****
  #if 0				/* Currently unused */
  
  void
! binop_type_check (value_ptr arg1, value_ptr arg2, int op)
  {
    struct type *t1, *t2;
  
--- 1066,1072 ----
  #if 0				/* Currently unused */
  
  void
! binop_type_check (struct value *arg1, struct value *arg2, int op)
  {
    struct type *t1, *t2;
  
*************** unk_lang_val_print (struct type *type, c
*** 1457,1463 ****
  }
  
  static int
! unk_lang_value_print (value_ptr val, struct ui_file *stream, int format,
  		      enum val_prettyprint pretty)
  {
    error ("internal error - unimplemented function unk_lang_value_print called.");
--- 1457,1463 ----
  }
  
  static int
! unk_lang_value_print (struct value *val, struct ui_file *stream, int format,
  		      enum val_prettyprint pretty)
  {
    error ("internal error - unimplemented function unk_lang_value_print called.");
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.11
diff -p -r1.11 linespec.c
*** linespec.c	2001/04/27 00:19:09	1.11
--- linespec.c	2001/11/10 21:27:14
*************** decode_line_1 (char **argptr, int funfir
*** 1082,1088 ****
  
    if (*copy == '$')
      {
!       value_ptr valx;
        int index = 0;
        int need_canonical = 0;
  
--- 1082,1088 ----
  
    if (*copy == '$')
      {
!       struct value *valx;
        int index = 0;
        int need_canonical = 0;
  
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.30
diff -p -r1.30 printcmd.c
*** printcmd.c	2001/10/16 01:58:07	1.30
--- printcmd.c	2001/11/10 21:27:17
*************** static CORE_ADDR last_examine_address;
*** 75,81 ****
  /* Contents of last address examined.
     This is not valid past the end of the `x' command!  */
  
! static value_ptr last_examine_value;
  
  /* Largest offset between a symbolic value and an address, that will be
     printed as `0x1234 <symbol+offset>'.  */
--- 75,81 ----
  /* Contents of last address examined.
     This is not valid past the end of the `x' command!  */
  
! static struct value *last_examine_value;
  
  /* Largest offset between a symbolic value and an address, that will be
     printed as `0x1234 <symbol+offset>'.  */
*************** static void validate_format (struct form
*** 172,178 ****
  static void do_examine (struct format_data, CORE_ADDR addr,
  			asection * section);
  
! static void print_formatted (value_ptr, int, int, struct ui_file *);
  
  static struct format_data decode_format (char **, int, int);
  
--- 172,178 ----
  static void do_examine (struct format_data, CORE_ADDR addr,
  			asection * section);
  
! static void print_formatted (struct value *, int, int, struct ui_file *);
  
  static struct format_data decode_format (char **, int, int);
  
*************** decode_format (char **string_ptr, int of
*** 280,286 ****
     This is used to pad hex numbers so they line up.  */
  
  static void
! print_formatted (register value_ptr val, register int format, int size,
  		 struct ui_file *stream)
  {
    struct type *type = check_typedef (VALUE_TYPE (val));
--- 280,286 ----
     This is used to pad hex numbers so they line up.  */
  
  static void
! print_formatted (struct value *val, register int format, int size,
  		 struct ui_file *stream)
  {
    struct type *type = check_typedef (VALUE_TYPE (val));
*************** print_command_1 (char *exp, int inspect,
*** 894,900 ****
    struct expression *expr;
    register struct cleanup *old_chain = 0;
    register char format = 0;
!   register value_ptr val;
    struct format_data fmt;
    int cleanup = 0;
  
--- 894,900 ----
    struct expression *expr;
    register struct cleanup *old_chain = 0;
    register char format = 0;
!   struct value *val;
    struct format_data fmt;
    int cleanup = 0;
  
*************** print_command_1 (char *exp, int inspect,
*** 932,938 ****
  	  && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
  	      || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION))
  	{
! 	  value_ptr v;
  
  	  v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
  	  if (v != 0)
--- 932,938 ----
  	  && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
  	      || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION))
  	{
! 	  struct value *v;
  
  	  v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
  	  if (v != 0)
*************** output_command (char *exp, int from_tty)
*** 1012,1018 ****
    struct expression *expr;
    register struct cleanup *old_chain;
    register char format = 0;
!   register value_ptr val;
    struct format_data fmt;
  
    if (exp && *exp == '/')
--- 1012,1018 ----
    struct expression *expr;
    register struct cleanup *old_chain;
    register char format = 0;
!   struct value *val;
    struct format_data fmt;
  
    if (exp && *exp == '/')
*************** do_one_display (struct display *d)
*** 1563,1569 ****
    if (d->format.size)
      {
        CORE_ADDR addr;
!       value_ptr val;
  
        annotate_display_format ();
  
--- 1563,1569 ----
    if (d->format.size)
      {
        CORE_ADDR addr;
!       struct value *val;
  
        annotate_display_format ();
  
*************** void
*** 1765,1771 ****
  print_variable_value (struct symbol *var, struct frame_info *frame,
  		      struct ui_file *stream)
  {
!   value_ptr val = read_var_value (var, frame);
  
    value_print (val, stream, 0, Val_pretty_default);
  }
--- 1765,1771 ----
  print_variable_value (struct symbol *var, struct frame_info *frame,
  		      struct ui_file *stream)
  {
!   struct value *val = read_var_value (var, frame);
  
    value_print (val, stream, 0, Val_pretty_default);
  }
*************** print_frame_args (struct symbol *func, s
*** 1786,1792 ****
    int first = 1;
    register int i;
    register struct symbol *sym;
!   register value_ptr val;
    /* Offset of next stack argument beyond the one we have seen that is
       at the highest offset.
       -1 if we haven't come to a stack argument yet.  */
--- 1786,1792 ----
    int first = 1;
    register int i;
    register struct symbol *sym;
!   struct value *val;
    /* Offset of next stack argument beyond the one we have seen that is
       at the highest offset.
       -1 if we haven't come to a stack argument yet.  */
*************** printf_command (char *arg, int from_tty)
*** 2036,2042 ****
    register char *f = NULL;
    register char *s = arg;
    char *string = NULL;
!   value_ptr *val_args;
    char *substrings;
    char *current_substring;
    int nargs = 0;
--- 2036,2042 ----
    register char *f = NULL;
    register char *s = arg;
    char *string = NULL;
!   struct value **val_args;
    char *substrings;
    char *current_substring;
    int nargs = 0;
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.25
diff -p -r1.25 stack.c
*** stack.c	2001/11/06 23:38:14	1.25
--- stack.c	2001/11/10 21:27:21
*************** parse_frame_specification (char *frame_e
*** 695,701 ****
  	  addr_string = savestring (frame_exp, p - frame_exp);
  
  	  {
! 	    value_ptr vp;
  
  	    tmp_cleanup = make_cleanup (xfree, addr_string);
  
--- 695,701 ----
  	  addr_string = savestring (frame_exp, p - frame_exp);
  
  	  {
! 	    struct value *vp;
  
  	    tmp_cleanup = make_cleanup (xfree, addr_string);
  
*************** return_command (char *retval_exp, int fr
*** 1757,1763 ****
    CORE_ADDR selected_frame_addr;
    CORE_ADDR selected_frame_pc;
    struct frame_info *frame;
!   value_ptr return_value = NULL;
  
    if (selected_frame == NULL)
      error ("No selected frame.");
--- 1757,1763 ----
    CORE_ADDR selected_frame_addr;
    CORE_ADDR selected_frame_pc;
    struct frame_info *frame;
!   struct value *return_value = NULL;
  
    if (selected_frame == NULL)
      error ("No selected frame.");
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.47
diff -p -r1.47 top.c
*** top.c	2001/10/21 19:43:41	1.47
--- top.c	2001/11/10 21:27:26
*************** get_prompt_1 (void *data)
*** 1339,1345 ****
      /* formatted prompt */
      {
        char fmt[40], *promptp, *outp, *tmp;
!       value_ptr arg_val;
        DOUBLEST doubleval;
        LONGEST longval;
        CORE_ADDR addrval;
--- 1339,1345 ----
      /* formatted prompt */
      {
        char fmt[40], *promptp, *outp, *tmp;
!       struct value *arg_val;
        DOUBLEST doubleval;
        LONGEST longval;
        CORE_ADDR addrval;
*************** quit_force (char *args, int from_tty)
*** 1621,1627 ****
       value of that expression. */
    if (args)
      {
!       value_ptr val = parse_and_eval (args);
  
        exit_code = (int) value_as_long (val);
      }
--- 1621,1627 ----
       value of that expression. */
    if (args)
      {
!       struct value *val = parse_and_eval (args);
  
        exit_code = (int) value_as_long (val);
      }
Index: typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/typeprint.c,v
retrieving revision 1.9
diff -p -r1.9 typeprint.c
*** typeprint.c	2001/04/27 00:19:09	1.9
--- typeprint.c	2001/11/10 21:27:26
***************
*** 1,6 ****
  /* Language independent support for printing types for GDB, the GNU debugger.
     Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
!    2000 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
--- 1,6 ----
  /* Language independent support for printing types for GDB, the GNU debugger.
     Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
!    2000, 2001 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
*************** static void
*** 126,132 ****
  whatis_exp (char *exp, int show)
  {
    struct expression *expr;
!   register value_ptr val;
    register struct cleanup *old_chain = NULL;
    struct type *real_type = NULL;
    struct type *type;
--- 126,132 ----
  whatis_exp (char *exp, int show)
  {
    struct expression *expr;
!   struct value *val;
    register struct cleanup *old_chain = NULL;
    struct type *real_type = NULL;
    struct type *type;
*************** print_type_scalar (struct type *type, LO
*** 333,339 ****
  void
  maintenance_print_type (char *typename, int from_tty)
  {
!   register value_ptr val;
    register struct type *type;
    register struct cleanup *old_chain;
    struct expression *expr;
--- 333,339 ----
  void
  maintenance_print_type (char *typename, int from_tty)
  {
!   struct value *val;
    register struct type *type;
    register struct cleanup *old_chain;
    struct expression *expr;
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.17
diff -p -r1.17 valprint.c
*** valprint.c	2001/10/20 05:13:45	1.17
--- valprint.c	2001/11/10 21:27:27
*************** val_print (struct type *type, char *vala
*** 159,165 ****
     the number of string bytes printed.  */
  
  int
! value_print (value_ptr val, struct ui_file *stream, int format,
  	     enum val_prettyprint pretty)
  {
    if (val == 0)
--- 159,165 ----
     the number of string bytes printed.  */
  
  int
! value_print (struct value *val, struct ui_file *stream, int format,
  	     enum val_prettyprint pretty)
  {
    if (val == 0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]