-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[lldb] Implement RISCV function unwinding using instruction emulation #147434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,11 +57,12 @@ class EmulateInstructionRISCV : public EmulateInstruction { | |
|
||
static bool SupportsThisInstructionType(InstructionType inst_type) { | ||
switch (inst_type) { | ||
case eInstructionTypeAny: | ||
case eInstructionTypePCModifying: | ||
case lldb_private::eInstructionTypeAny: | ||
case lldb_private::eInstructionTypePrologueEpilogue: | ||
return true; | ||
case eInstructionTypePrologueEpilogue: | ||
case eInstructionTypeAll: | ||
|
||
case lldb_private::eInstructionTypePCModifying: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. EmulateInstructionRISCV is currently used to correctly predict where a given instruction will branch to next, for instruction stepping on hardware that does not support instruction step. By changing |
||
case lldb_private::eInstructionTypeAll: | ||
return false; | ||
} | ||
llvm_unreachable("Fully covered switch above!"); | ||
|
@@ -94,6 +95,8 @@ class EmulateInstructionRISCV : public EmulateInstruction { | |
std::optional<RegisterInfo> GetRegisterInfo(lldb::RegisterKind reg_kind, | ||
uint32_t reg_num) override; | ||
|
||
bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override; | ||
|
||
std::optional<DecodeResult> ReadInstructionAt(lldb::addr_t addr); | ||
std::optional<DecodeResult> Decode(uint32_t inst); | ||
bool Execute(DecodeResult inst, bool ignore_cond); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is inside a
namespace lldb_private
, please don't addlldb_private::
specifiers.