2010-05-05 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / gdb / p-lang.c
index 1722c0f4e03a04781c85403e3f6a05bb2595c9ee..44aefa4a112849533d6df7f474054d6c50c78801 100644 (file)
@@ -1,6 +1,6 @@
 /* Pascal language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -101,7 +101,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
                       struct type **char_type,
                       char **arrayname)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+  if (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT)
     {
       /* Old Borland type pascal strings from Free Pascal Compiler.  */
       /* Two fields: length and st.  */
@@ -158,9 +158,7 @@ static void
 pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
 {
 
-  c &= 0xFF;                   /* Avoid sign bit follies */
-
-  if ((c == '\'') || (PRINT_LITERAL_FORM (c)))
+  if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
     {
       if (!(*in_quotes))
        fputs_filtered ("'", stream);
@@ -214,7 +212,7 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream)
 void
 pascal_printstr (struct ui_file *stream, struct type *type,
                 const gdb_byte *string, unsigned int length,
-                int force_ellipses,
+                const char *encoding, int force_ellipses,
                 const struct value_print_options *options)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
This page took 0.02764 seconds and 4 git commands to generate.