================
@@ -0,0 +1,559 @@
+//===-- NativeRegisterContextFreeBSD_riscv64.cpp 
--------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#if defined(__riscv) && __riscv_xlen == 64
+
+#include "NativeRegisterContextFreeBSD_riscv64.h"
+
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/RegisterValue.h"
+#include "lldb/Utility/Status.h"
+
+#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
+#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+
+// clang-format off
+#include <sys/param.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+// clang-format on
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::process_freebsd;
+
+// Translation between RegisterInfoPosix_riscv64 and reg.h
+// https://github.com/freebsd/freebsd-src/blob/main/sys/riscv/include/reg.h:
+//
+// struct reg {
+//     __uint64_t      ra;             /* return address */
+//     __uint64_t      sp;             /* stack pointer */
+//     __uint64_t      gp;             /* global pointer */
+//     __uint64_t      tp;             /* thread pointer */
+//     __uint64_t      t[7];           /* temporaries */
+//     __uint64_t      s[12];          /* saved registers */
+//     __uint64_t      a[8];           /* function arguments */
+//     __uint64_t      sepc;           /* exception program counter */
+//     __uint64_t      sstatus;        /* status register */
+// };
+//
+// struct fpreg {
+//     __uint64_t      fp_x[32][2];    /* Floating point registers */
+//     __uint64_t      fp_fcsr;        /* Floating point control reg */
+// };
+//
+// struct dbreg {
+//     int dummy;
----------------
DavidSpickett wrote:

Can you point me to the POSIX version of the layout? I want to see what differs 
beyond names.

https://github.com/llvm/llvm-project/pull/180549
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to