]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
frame_unwind_register_unsigned: Return address from capabilities.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 28 Jul 2022 22:51:03 +0000 (15:51 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:43:06 +0000 (16:43 -0700)
gdb/frame.c

index 75dfc98220386121f84df6946802c335bcf58321..44b3bd0946378713cd920c1d41159aaa7d74f8d4 100644 (file)
@@ -1320,6 +1320,7 @@ frame_unwind_register_unsigned (frame_info *next_frame, int regnum)
 {
   struct gdbarch *gdbarch = frame_unwind_arch (next_frame);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  struct type *type = register_type (gdbarch, regnum);
   int size = register_size (gdbarch, regnum);
   struct value *value = frame_unwind_register_value (next_frame, regnum);
 
@@ -1336,8 +1337,14 @@ frame_unwind_register_unsigned (frame_info *next_frame, int regnum)
                   _("Register %d is not available"), regnum);
     }
 
-  ULONGEST r = extract_unsigned_integer (value_contents_all (value).data (),
-                                        size, byte_order);
+  ULONGEST r;
+
+  if (type->code () == TYPE_CODE_CAPABILITY || TYPE_CAPABILITY (type))
+    r = gdbarch_pointer_to_address (gdbarch, type,
+                                     value_contents_all (value).data ());
+  else
+    r = extract_unsigned_integer (value_contents_all (value).data (),
+                                 size, byte_order);
 
   release_value (value);
   return r;