Remove AT_SYMBOL
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index d5bc1b1f4289ef2542969f5605b2d0d8ffda4ad0..038a3ce8f699fe83eae20323bda0d4876b77f14a 100644 (file)
@@ -1,7 +1,6 @@
 /* Target-dependent code for GDB, the GNU debugger.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-   2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
 
    Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
    for IBM Deutschland Entwicklung GmbH, IBM Corporation.
 #include "linux-tdep.h"
 #include "s390-tdep.h"
 
+#include "stap-probe.h"
+#include "ax.h"
+#include "ax-gdb.h"
+#include "user-regs.h"
+#include "cli/cli-utils.h"
+#include <ctype.h>
+
 #include "features/s390-linux32.c"
 #include "features/s390-linux32v1.c"
 #include "features/s390-linux32v2.c"
@@ -56,7 +62,6 @@
 #include "features/s390x-linux64v1.c"
 #include "features/s390x-linux64v2.c"
 
-
 /* The tdep structure.  */
 
 struct gdbarch_tdep
@@ -170,7 +175,7 @@ static int s390_dwarf_regmap[] =
   S390_R8_REGNUM, S390_R9_REGNUM, S390_R10_REGNUM, S390_R11_REGNUM,
   S390_R12_REGNUM, S390_R13_REGNUM, S390_R14_REGNUM, S390_R15_REGNUM,
 
-  /* Linux-specific registers (not mapped).  */
+  /* GNU/Linux-specific registers (not mapped).  */
   -1, -1, -1,
 };
 
@@ -426,7 +431,7 @@ int s390_regmap_gregset[S390_NUM_REGS] =
   /* GPR Uppper Halves.  */
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   0x88, -1, -1,
 };
 
@@ -454,7 +459,7 @@ int s390x_regmap_gregset[S390_NUM_REGS] =
   0x30, 0x38, 0x40, 0x48,
   0x50, 0x58, 0x60, 0x68,
   0x70, 0x78, 0x80, 0x88,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   0xd0, -1, -1,
 };
 
@@ -478,7 +483,7 @@ int s390_regmap_fpregset[S390_NUM_REGS] =
   /* GPR Uppper Halves.  */
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   -1, -1, -1,
 };
 
@@ -502,7 +507,7 @@ int s390_regmap_upper[S390_NUM_REGS] =
   0x10, 0x14, 0x18, 0x1c,
   0x20, 0x24, 0x28, 0x2c,
   0x30, 0x34, 0x38, 0x3c,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   -1, -1, -1,
 };
 
@@ -524,7 +529,7 @@ int s390_regmap_last_break[S390_NUM_REGS] =
   /* GPR Uppper Halves.  */
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   -1, 4, -1,
 };
 
@@ -546,7 +551,7 @@ int s390x_regmap_last_break[S390_NUM_REGS] =
   /* GPR Uppper Halves.  */
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   -1, 0, -1,
 };
 
@@ -568,7 +573,7 @@ int s390_regmap_system_call[S390_NUM_REGS] =
   /* GPR Uppper Halves.  */
   -1, -1, -1, -1, -1, -1, -1, -1,
   -1, -1, -1, -1, -1, -1, -1, -1,
-  /* Linux-specific optional "registers".  */
+  /* GNU/Linux-specific optional "registers".  */
   -1, -1, 0,
 };
 
@@ -2749,9 +2754,15 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       }
   }
 
-  /* Store return address.  */
+  /* Store return PSWA.  In 31-bit mode, keep addressing mode bit.  */
+  if (word_size == 4)
+    {
+      ULONGEST pswa;
+      regcache_cooked_read_unsigned (regcache, S390_PSWA_REGNUM, &pswa);
+      bp_addr = (bp_addr & 0x7fffffff) | (pswa & 0x80000000);
+    }
   regcache_cooked_write_unsigned (regcache, S390_RETADDR_REGNUM, bp_addr);
-  
+
   /* Store updated stack pointer.  */
   regcache_cooked_write_unsigned (regcache, S390_SP_REGNUM, sp);
 
@@ -2948,6 +2959,18 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
     return 0;
 }
 
+/* Implementation of `gdbarch_stap_is_single_operand', as defined in
+   gdbarch.h.  */
+
+static int
+s390_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
+{
+  return ((isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement
+                                                         or indirection.  */
+         || *s == '%' /* Register access.  */
+         || isdigit (*s)); /* Literal number.  */
+}
+
 /* Set up gdbarch struct.  */
 
 static struct gdbarch *
@@ -3068,7 +3091,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        valid_p &= tdesc_numbered_register (feature, tdesc_data,
                                            S390_A0_REGNUM + i, acrs[i]);
 
-      /* Optional Linux-specific "registers".  */
+      /* Optional GNU/Linux-specific "registers".  */
       feature = tdesc_find_feature (tdesc, "org.gnu.gdb.s390.linux");
       if (feature)
        {
@@ -3278,6 +3301,12 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
 
+  /* SystemTap functions.  */
+  set_gdbarch_stap_register_prefix (gdbarch, "%");
+  set_gdbarch_stap_register_indirection_prefix (gdbarch, "(");
+  set_gdbarch_stap_register_indirection_suffix (gdbarch, ")");
+  set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand);
+
   return gdbarch;
 }
 
@@ -3290,7 +3319,7 @@ _initialize_s390_tdep (void)
   /* Hook us into the gdbarch mechanism.  */
   register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
 
-  /* Initialize the Linux target descriptions.  */
+  /* Initialize the GNU/Linux target descriptions.  */
   initialize_tdesc_s390_linux32 ();
   initialize_tdesc_s390_linux32v1 ();
   initialize_tdesc_s390_linux32v2 ();
This page took 0.02719 seconds and 4 git commands to generate.