Add code to handle TAG_pointer_type DIE's (DWARF Information Entries)
authorFred Fish <fnf@specifix.com>
Mon, 17 Feb 1992 23:26:54 +0000 (23:26 +0000)
committerFred Fish <fnf@specifix.com>
Mon, 17 Feb 1992 23:26:54 +0000 (23:26 +0000)
that are produced by the i486/SVR4 MetaWare compiler, but not by the
AT&T or GCC compilers.

gdb/ChangeLog
gdb/dwarfread.c

index fe7069856e81ec8d7bf1464dc0b131631e27b4d9..ee808542472aa00804fb66839666dad3af990781 100644 (file)
@@ -1,5 +1,8 @@
 Mon Feb 17 07:13:27 1992  Fred Fish  (fnf at cygnus.com)
 
+       * dwarfread.c (process_dies):  Add case to handle TAG_pointer_type
+       DIE's.  Add new function read_tag_pointer_type() to read them.
+
        * dwarfread.c (dwarf_read_array_type, read_subroutine_type):
        When creating a new user defined type, check to see if a partial
        type already exists, and if so, bash it to fit.
index 68b479da411c62505aa981466c8e4dc7df5e4e9e..a5496fcf868b076f0180aba5fb24e047aeb00a68 100644 (file)
@@ -330,6 +330,9 @@ EXFUN(decode_subscr_data, (char *scan AND char *end));
 static void
 EXFUN(dwarf_read_array_type, (struct dieinfo *dip));
 
+static void
+EXFUN(read_tag_pointer_type, (struct dieinfo *dip));
+
 static void
 EXFUN(read_subroutine_type,
      (struct dieinfo *dip AND char *thisdie AND char *enddie));
@@ -1207,6 +1210,51 @@ DEFUN(dwarf_read_array_type, (dip), struct dieinfo *dip)
 
 /*
 
+LOCAL FUNCTION
+
+       read_tag_pointer_type -- read TAG_pointer_type DIE
+
+SYNOPSIS
+
+       static void read_tag_pointer_type (struct dieinfo *dip)
+
+DESCRIPTION
+
+       Extract all information from a TAG_pointer_type DIE and add to
+       the user defined type vector.
+ */
+
+static void
+DEFUN(read_tag_pointer_type, (dip), struct dieinfo *dip)
+{
+  struct type *type;
+  struct type *utype;
+  char *sub;
+  char *subend;
+  short temp;
+  
+  type = decode_die_type (dip);
+  if ((utype = lookup_utype (dip -> dieref)) == NULL)
+    {
+      utype = lookup_pointer_type (type);
+      (void) alloc_utype (dip -> dieref, utype);
+    }
+  else
+    {
+      TYPE_TARGET_TYPE (utype) = type;
+      TYPE_POINTER_TYPE (type) = utype;
+
+      /* We assume the machine has only one representation for pointers!  */
+      /* FIXME:  This confuses host<->target data representations, and is a
+        poor assumption besides. */
+      
+      TYPE_LENGTH (utype) = sizeof (char *);
+      TYPE_CODE (utype) = TYPE_CODE_PTR;
+    }
+}
+
+/*
+
 LOCAL FUNCTION
 
        read_subroutine_type -- process TAG_subroutine_type dies
@@ -1623,6 +1671,9 @@ DEFUN(process_dies, (thisdie, enddie, objfile),
            case TAG_array_type:
              dwarf_read_array_type (&di);
              break;
+           case TAG_pointer_type:
+             read_tag_pointer_type (&di);
+             break;
            default:
              (void) new_symbol (&di);
              break;
This page took 0.027095 seconds and 4 git commands to generate.