]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdbserver/linux-s390-low.cc
New Romanian translation for gas sub-directory
[thirdparty/binutils-gdb.git] / gdbserver / linux-s390-low.cc
index 3ab14d884ee6ca745663c900aa98166db7d367c2..79937f00d6f1edb599157df3da75d9882b806d24 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU/Linux S/390 specific low level interface, for the remote server
    for GDB.
-   Copyright (C) 2001-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2024 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -85,6 +85,8 @@ public:
 
   struct emit_ops *emit_ops () override;
 
+  int get_ipa_tdesc_idx () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -590,7 +592,7 @@ s390_target::low_arch_setup ()
   /* Determine word size and HWCAP.  */
   int pid = pid_of (current_thread);
   int wordsize = s390_get_wordsize (pid);
-  unsigned long hwcap = linux_get_hwcap (wordsize);
+  unsigned long hwcap = linux_get_hwcap (pid, wordsize);
 
   /* Check whether the kernel supports extra register sets.  */
   int have_regset_last_break
@@ -1445,10 +1447,10 @@ s390_target::get_min_fast_tracepoint_insn_len ()
   return 6;
 }
 
-/* Implementation of linux_target_ops method "get_ipa_tdesc_idx".  */
+/* Implementation of target ops method "get_ipa_tdesc_idx".  */
 
-static int
-s390_get_ipa_tdesc_idx (void)
+int
+s390_target::get_ipa_tdesc_idx ()
 {
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
   const struct target_desc *tdesc = regcache->tdesc;
@@ -1501,9 +1503,8 @@ add_insns (const unsigned char *start, int len)
 {
   CORE_ADDR buildaddr = current_insn_ptr;
 
-  if (debug_threads)
-    debug_printf ("Adding %d bytes of insn at %s\n",
-                 len, paddress (buildaddr));
+  threads_debug_printf ("Adding %d bytes of insn at %s",
+                       len, paddress (buildaddr));
 
   append_insns (&buildaddr, len, start);
   current_insn_ptr = buildaddr;
@@ -1906,15 +1907,13 @@ s390_emit_const (LONGEST num)
     0x98, 0x23, 0x10, 0x00,    /* lm %r2, %r3, 0(%r1) */
   };
   if (num < 0x8000 && num >= 0)
-  {
     add_insns (buf_s, sizeof buf_s);
-  }
   else
-  {
-    s390_emit_litpool (8);
-    add_insns ((unsigned char *) &n, sizeof n);
-    add_insns (buf_l, sizeof buf_l);
-  }
+    {
+      s390_emit_litpool (8);
+      add_insns ((unsigned char *) &n, sizeof n);
+      add_insns (buf_l, sizeof buf_l);
+    }
 }
 
 /* The "emit_call" emit_ops method for s390.  */
@@ -2025,15 +2024,13 @@ s390_emit_set_r2 (int arg1)
     0x58, 0x20, 0x10, 0x00,    /* l %r2, 0(%r1) */
   };
   if (arg1 < 0x8000 && arg1 >= -0x8000)
-  {
     add_insns (buf_s, sizeof buf_s);
-  }
   else
-  {
-    s390_emit_litpool (4);
-    add_insns ((unsigned char *) &arg1, sizeof arg1);
-    add_insns (buf_l, sizeof buf_l);
-  }
+    {
+      s390_emit_litpool (4);
+      add_insns ((unsigned char *) &arg1, sizeof arg1);
+      add_insns (buf_l, sizeof buf_l);
+    }
 }
 
 /* The "emit_int_call_1" emit_ops method for s390.  */
@@ -2551,15 +2548,13 @@ s390x_emit_const (LONGEST num)
     0xe3, 0x20, 0x10, 0x00, 0x00, 0x04,        /* lg %r2, 0(%r1) */
   };
   if (num < 0x8000 && num >= -0x8000)
-  {
     add_insns (buf_s, sizeof buf_s);
-  }
   else
-  {
-    s390_emit_litpool (8);
-    add_insns ((unsigned char *) &n, sizeof n);
-    add_insns (buf_l, sizeof buf_l);
-  }
+    {
+      s390_emit_litpool (8);
+      add_insns ((unsigned char *) &n, sizeof n);
+      add_insns (buf_l, sizeof buf_l);
+    }
 }
 
 /* The "emit_call" emit_ops method for s390x.  */
@@ -2854,11 +2849,6 @@ s390_target::emit_ops ()
     return &s390_emit_ops_impl;
 }
 
-struct linux_target_ops the_low_target = {
-  NULL, /* get_syscall_trapinfo */
-  s390_get_ipa_tdesc_idx,
-};
-
 /* The linux target ops object.  */
 
 linux_process_target *the_linux_target = &the_s390_target;