* configure.host: Add arm*-*-openbsd*.
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index 3e57b71e55696e62de77dfe4c3f7a1b5dd631c7a..18f7ea409191ad59e6cdc6e27907bed4ffd93b47 100644 (file)
@@ -197,7 +197,7 @@ s390_dwarf_reg_to_regnum (int reg)
 {
   int regnum = -1;
 
-  if (reg >= 0 || reg < ARRAY_SIZE (s390_dwarf_regmap))
+  if (reg >= 0 && reg < ARRAY_SIZE (s390_dwarf_regmap))
     regnum = s390_dwarf_regmap[reg];
 
   if (regnum == -1)
@@ -210,7 +210,7 @@ s390_dwarf_reg_to_regnum (int reg)
 
 static void
 s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-                          int regnum, void *buf)
+                          int regnum, gdb_byte *buf)
 {
   ULONGEST val;
 
@@ -227,13 +227,13 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, "invalid regnum");
+      internal_error (__FILE__, __LINE__, _("invalid regnum"));
     }
 }
 
 static void
 s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-                           int regnum, const void *buf)
+                           int regnum, const gdb_byte *buf)
 {
   ULONGEST val, psw;
 
@@ -254,13 +254,13 @@ s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, "invalid regnum");
+      internal_error (__FILE__, __LINE__, _("invalid regnum"));
     }
 }
 
 static void
 s390x_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-                           int regnum, void *buf)
+                           int regnum, gdb_byte *buf)
 {
   ULONGEST val;
 
@@ -276,13 +276,13 @@ s390x_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, "invalid regnum");
+      internal_error (__FILE__, __LINE__, _("invalid regnum"));
     }
 }
 
 static void
 s390x_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-                            int regnum, const void *buf)
+                            int regnum, const gdb_byte *buf)
 {
   ULONGEST val, psw;
 
@@ -300,7 +300,7 @@ s390x_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, "invalid regnum");
+      internal_error (__FILE__, __LINE__, _("invalid regnum"));
     }
 }
 
@@ -316,9 +316,9 @@ s390_convert_register_p (int regno, struct type *type)
 
 static void
 s390_register_to_value (struct frame_info *frame, int regnum,
-                        struct type *valtype, void *out)
+                        struct type *valtype, gdb_byte *out)
 {
-  char in[8];
+  gdb_byte in[8];
   int len = TYPE_LENGTH (valtype);
   gdb_assert (len < 8);
 
@@ -328,9 +328,9 @@ s390_register_to_value (struct frame_info *frame, int regnum,
 
 static void
 s390_value_to_register (struct frame_info *frame, int regnum,
-                        struct type *valtype, const void *in)
+                        struct type *valtype, const gdb_byte *in)
 {
-  char out[8];
+  gdb_byte out[8];
   int len = TYPE_LENGTH (valtype);
   gdb_assert (len < 8);
 
@@ -2628,7 +2628,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
              }
          }
        else
-         internal_error (__FILE__, __LINE__, "unknown argument type");
+         internal_error (__FILE__, __LINE__, _("unknown argument type"));
       }
   }
 
@@ -2694,7 +2694,8 @@ s390_return_value_convention (struct gdbarch *gdbarch, struct type *type)
 
 static enum return_value_convention
 s390_return_value (struct gdbarch *gdbarch, struct type *type, 
-                  struct regcache *regcache, void *out, const void *in)
+                  struct regcache *regcache, gdb_byte *out,
+                  const gdb_byte *in)
 {
   int word_size = gdbarch_ptr_bit (gdbarch) / 8;
   int length = TYPE_LENGTH (type);
@@ -2725,11 +2726,10 @@ s390_return_value (struct gdbarch *gdbarch, struct type *type,
          else if (length == 2*word_size)
            {
              regcache_cooked_write (regcache, S390_R2_REGNUM, in);
-             regcache_cooked_write (regcache, S390_R3_REGNUM,
-                                    (const char *)in + word_size);
+             regcache_cooked_write (regcache, S390_R3_REGNUM, in + word_size);
            }
          else
-           internal_error (__FILE__, __LINE__, "invalid return type");
+           internal_error (__FILE__, __LINE__, _("invalid return type"));
          break;
 
        case RETURN_VALUE_STRUCT_CONVENTION:
@@ -2758,11 +2758,10 @@ s390_return_value (struct gdbarch *gdbarch, struct type *type,
          else if (length == 2*word_size)
            {
              regcache_cooked_read (regcache, S390_R2_REGNUM, out);
-             regcache_cooked_read (regcache, S390_R3_REGNUM,
-                                   (char *)out + word_size);
+             regcache_cooked_read (regcache, S390_R3_REGNUM, out + word_size);
            }
          else
-           internal_error (__FILE__, __LINE__, "invalid return type");
+           internal_error (__FILE__, __LINE__, _("invalid return type"));
          break;
 
        case RETURN_VALUE_STRUCT_CONVENTION:
@@ -2777,10 +2776,10 @@ s390_return_value (struct gdbarch *gdbarch, struct type *type,
 
 /* Breakpoints.  */
 
-static const unsigned char *
+static const gdb_byte *
 s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
-  static unsigned char breakpoint[] = { 0x0, 0x1 };
+  static const gdb_byte breakpoint[] = { 0x0, 0x1 };
 
   *lenptr = sizeof (breakpoint);
   return breakpoint;
@@ -3007,6 +3006,10 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_print_insn (gdbarch, print_insn_s390);
 
+  /* Enable TLS support.  */
+  set_gdbarch_fetch_tls_load_module_address (gdbarch,
+                                             svr4_fetch_objfile_link_map);
+
   return gdbarch;
 }
 
This page took 0.027112 seconds and 4 git commands to generate.