*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / p-lang.c
index e743a6f812c584ff953b9a386e7d2044509063bd..c768d1bec3dc3ed6ed2cbfbe1499d085f9e8c7db 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.
@@ -214,9 +214,10 @@ 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));
   unsigned int i;
   unsigned int things_printed = 0;
   int in_quotes = 0;
@@ -227,7 +228,8 @@ pascal_printstr (struct ui_file *stream, struct type *type,
      the last byte of it is a null, we don't print that, in traditional C
      style.  */
   if ((!force_ellipses) && length > 0
-       && extract_unsigned_integer (string + (length - 1) * width, width) == 0)
+       && extract_unsigned_integer (string + (length - 1) * width, width,
+                                    byte_order) == 0)
     length--;
 
   if (length == 0)
@@ -253,13 +255,14 @@ pascal_printstr (struct ui_file *stream, struct type *type,
          need_comma = 0;
        }
 
-      current_char = extract_unsigned_integer (string + i * width, width);
+      current_char = extract_unsigned_integer (string + i * width, width,
+                                              byte_order);
 
       rep1 = i + 1;
       reps = 1;
       while (rep1 < length 
-            && extract_unsigned_integer (string + rep1 * width, width
-               == current_char)
+            && extract_unsigned_integer (string + rep1 * width, width,
+                                         byte_order) == current_char)
        {
          ++rep1;
          ++reps;
This page took 0.025206 seconds and 4 git commands to generate.