]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/regcache.c
hurd: unwinding support over signal trampolines
[thirdparty/binutils-gdb.git] / gdb / regcache.c
index 4f079c91a7f23a2ef8f15c0537fa03b7864ea9dc..6a4359d0f36146f8cca5ef7e3140b5be97775649 100644 (file)
@@ -101,7 +101,7 @@ init_regcache_descr (struct gdbarch *gdbarch)
 
   /* Lay out the register cache.
 
-     NOTE: cagney/2002-05-22: Only register_type() is used when
+     NOTE: cagney/2002-05-22: Only register_type () is used when
      constructing the register cache.  It is assumed that the
      register's raw size, virtual size and type length are all the
      same.  */
@@ -1220,6 +1220,24 @@ regcache_read_pc (struct regcache *regcache)
   return pc_val;
 }
 
+/* See gdbsupport/common-regcache.h.  */
+
+CORE_ADDR
+regcache_read_pc_protected (regcache *regcache)
+{
+  CORE_ADDR pc;
+  try
+    {
+      pc = regcache_read_pc (regcache);
+    }
+  catch (const gdb_exception_error &ex)
+    {
+      pc = 0;
+    }
+
+  return pc;
+}
+
 void
 regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
@@ -1374,7 +1392,7 @@ register_dump::dump (ui_file *file)
          {
            static const char blt[] = "builtin_type";
 
-           t = TYPE_NAME (register_type (m_gdbarch, regnum));
+           t = register_type (m_gdbarch, regnum)->name ();
            if (t == NULL)
              {
                if (!footnote_register_type_name_null)
@@ -1792,17 +1810,17 @@ cooked_write_test (struct gdbarch *gdbarch)
       std::vector<gdb_byte> buf (register_size (gdbarch, regnum), 0);
       const auto type = register_type (gdbarch, regnum);
 
-      if (TYPE_CODE (type) == TYPE_CODE_FLT
-         || TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
+      if (type->code () == TYPE_CODE_FLT
+         || type->code () == TYPE_CODE_DECFLOAT)
        {
          /* Generate valid float format.  */
          target_float_from_string (expected.data (), type, "1.25");
        }
-      else if (TYPE_CODE (type) == TYPE_CODE_INT
-              || TYPE_CODE (type) == TYPE_CODE_ARRAY
-              || TYPE_CODE (type) == TYPE_CODE_PTR
-              || TYPE_CODE (type) == TYPE_CODE_UNION
-              || TYPE_CODE (type) == TYPE_CODE_STRUCT)
+      else if (type->code () == TYPE_CODE_INT
+              || type->code () == TYPE_CODE_ARRAY
+              || type->code () == TYPE_CODE_PTR
+              || type->code () == TYPE_CODE_UNION
+              || type->code () == TYPE_CODE_STRUCT)
        {
          if (bfd_arch == bfd_arch_ia64
              || (regnum >= gdbarch_num_regs (gdbarch)
@@ -1832,7 +1850,7 @@ cooked_write_test (struct gdbarch *gdbarch)
                expected[j] = j;
            }
        }
-      else if (TYPE_CODE (type) == TYPE_CODE_FLAGS)
+      else if (type->code () == TYPE_CODE_FLAGS)
        {
          /* No idea how to test flags.  */
          continue;