2003-04-13 Michael Snyder <msnyder@redhat.com>
[binutils-gdb.git] / gdb / p-lang.c
index 6d518ee951ff89e2d4f49a170de1bd969d1577cc..827fa0e22eaeac7517325eea76f6dea5d0c18422 100644 (file)
@@ -20,6 +20,7 @@
 /* This file is derived from c-lang.c */
 
 #include "defs.h"
+#include "gdb_string.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
@@ -58,7 +59,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
           if (length_pos)
            *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
           if (length_size)
-           *length_size = TYPE_FIELD_TYPE (type, 0)->length;
+           *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0));
           if (string_pos)
            *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
           if (char_size)
@@ -76,7 +77,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
           if (length_pos)
            *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
           if (length_size)
-           *length_size = TYPE_FIELD_TYPE (type, 1)->length;
+           *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 1));
           if (string_pos)
            *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
           /* FIXME: how can I detect wide chars in GPC ?? */
@@ -293,7 +294,7 @@ pascal_create_fundamental_type (struct objfile *objfile, int typeid)
                        0, "void", objfile);
       break;
     case FT_CHAR:
-      type = init_type (TYPE_CODE_INT,
+      type = init_type (TYPE_CODE_CHAR,
                        TARGET_CHAR_BIT / TARGET_CHAR_BIT,
                        0, "char", objfile);
       break;
@@ -460,6 +461,8 @@ const struct language_defn pascal_language_defn =
   pascal_print_type,           /* Print a type using appropriate syntax */
   pascal_val_print,            /* Print a value using appropriate syntax */
   pascal_value_print,          /* Print a top-level value */
+  NULL,                                /* Language specific skip_trampoline */
+  NULL,                                /* Language specific symbol demangler */
   {"", "%", "b", ""},          /* Binary format info */
   {"0%lo", "0", "o", ""},      /* Octal format info */
   {"%ld", "", "d", ""},                /* Decimal format info */