[Lldb-commits] [PATCH] D132510: [RISCV][LLDB] Add initial SysV ABI support
kasper via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 24 06:04:38 PDT 2022
kasper81 updated this revision to Diff 455176.
kasper81 added a comment.
Reuse existing dwarf enum.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132510/new/
https://reviews.llvm.org/D132510
Files:
lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
Index: lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
===================================================================
--- lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
+++ lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
@@ -30,78 +30,13 @@
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
+#include "Utility/RISCV_DWARF_Registers.h"
+
using namespace lldb;
using namespace lldb_private;
LLDB_PLUGIN_DEFINE(ABISysV_riscv)
-enum riscv_dwarf_regnums {
- dwarf_x0 = 0,
- dwarf_x1,
- dwarf_x2,
- dwarf_x3,
- dwarf_x4,
- dwarf_x5,
- dwarf_x6,
- dwarf_x7,
- dwarf_x8,
- dwarf_x9,
- dwarf_x10,
- dwarf_x11,
- dwarf_x12,
- dwarf_x13,
- dwarf_x14,
- dwarf_x15,
- dwarf_x16,
- dwarf_x17,
- dwarf_x18,
- dwarf_x19,
- dwarf_x20,
- dwarf_x21,
- dwarf_x22,
- dwarf_x23,
- dwarf_x24,
- dwarf_x25,
- dwarf_x26,
- dwarf_x27,
- dwarf_x28,
- dwarf_x29,
- dwarf_x30,
- dwarf_x31,
- dwarf_f0 = 32,
- dwarf_f1,
- dwarf_f2,
- dwarf_f3,
- dwarf_f4,
- dwarf_f5,
- dwarf_f6,
- dwarf_f7,
- dwarf_f8,
- dwarf_f9,
- dwarf_f10,
- dwarf_f11,
- dwarf_f12,
- dwarf_f13,
- dwarf_f14,
- dwarf_f15,
- dwarf_f16,
- dwarf_f17,
- dwarf_f18,
- dwarf_f19,
- dwarf_f20,
- dwarf_f21,
- dwarf_f22,
- dwarf_f23,
- dwarf_f24,
- dwarf_f25,
- dwarf_f26,
- dwarf_f27,
- dwarf_f28,
- dwarf_f29,
- dwarf_f30,
- dwarf_f31
-};
-
bool ABISysV_riscv::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
unwind_plan.Clear();
unwind_plan.SetRegisterKind(eRegisterKindGeneric);
@@ -173,11 +108,11 @@
std::pair<uint32_t, uint32_t>
ABISysV_riscv::GetEHAndDWARFNums(llvm::StringRef name) {
if (name == "ra")
- return {LLDB_INVALID_REGNUM, riscv_dwarf_regnums::dwarf_x1};
+ return {LLDB_INVALID_REGNUM, dwarf_gpr_x1};
if (name == "sp")
- return {LLDB_INVALID_REGNUM, riscv_dwarf_regnums::dwarf_x2};
+ return {LLDB_INVALID_REGNUM, dwarf_gpr_x2};
if (name == "fp")
- return {LLDB_INVALID_REGNUM, riscv_dwarf_regnums::dwarf_x8};
+ return {LLDB_INVALID_REGNUM, dwarf_gpr_x8};
return MCBasedABI::GetEHAndDWARFNums(name);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132510.455176.patch
Type: text/x-patch
Size: 2108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220824/73184d4c/attachment.bin>
More information about the lldb-commits
mailing list