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]

[PATCH]: Read `const' and `volatile' in Dwarf 2 info



2001-01-23  Jim Blandy  <jimb@redhat.com>

	* dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
	Implement these correctly, using make_cv_type.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.20
diff -c -r1.20 dwarf2read.c
*** dwarf2read.c	2000/12/15 01:01:46	1.20
--- dwarf2read.c	2001/01/24 00:15:35
***************
*** 2653,2678 ****
  read_tag_const_type (struct die_info *die, struct objfile *objfile,
  		     const struct comp_unit_head *cu_header)
  {
    if (die->type)
      {
        return;
      }
  
!   complain (&dwarf2_const_ignored);
!   die->type = die_type (die, objfile, cu_header);
  }
  
  static void
  read_tag_volatile_type (struct die_info *die, struct objfile *objfile,
  			const struct comp_unit_head *cu_header)
  {
    if (die->type)
      {
        return;
      }
  
!   complain (&dwarf2_volatile_ignored);
!   die->type = die_type (die, objfile, cu_header);
  }
  
  /* Extract all information from a DW_TAG_string_type DIE and add to
--- 2653,2682 ----
  read_tag_const_type (struct die_info *die, struct objfile *objfile,
  		     const struct comp_unit_head *cu_header)
  {
+   struct type *base_type;
+ 
    if (die->type)
      {
        return;
      }
  
!   base_type = die_type (die, objfile, cu_header);
!   die->type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0);
  }
  
  static void
  read_tag_volatile_type (struct die_info *die, struct objfile *objfile,
  			const struct comp_unit_head *cu_header)
  {
+   struct type *base_type;
+ 
    if (die->type)
      {
        return;
      }
  
!   base_type = die_type (die, objfile, cu_header);
!   die->type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0);
  }
  
  /* Extract all information from a DW_TAG_string_type DIE and add to

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