+/* This is the implementation of gdbarch method get_longjmp_target. */
+
+static int
+tilegx_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+{
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR jb_addr;
+ gdb_byte buf[8];
+
+ jb_addr = get_frame_register_unsigned (frame, TILEGX_R0_REGNUM);
+
+ /* TileGX jmp_buf contains 32 elements of type __uint_reg_t which
+ has a size of 8 bytes. The return address is stored in the 25th
+ slot. */
+ if (target_read_memory (jb_addr + 25 * 8, buf, 8))
+ return 0;
+
+ *pc = extract_unsigned_integer (buf, 8, byte_order);
+
+ return 1;
+}
+