[Lldb-commits] [lldb] [lldb][riscv] Fix setting breakpoint for undecoded instruction (PR #90075)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed May 29 00:41:36 PDT 2024
================
@@ -115,8 +148,23 @@ Status NativeProcessSoftwareSingleStep::SetupSoftwareSingleStepping(
emulator_up->SetWriteMemCallback(&WriteMemoryCallback);
emulator_up->SetWriteRegCallback(&WriteRegisterCallback);
- if (!emulator_up->ReadInstruction())
- return Status("Read instruction failed!");
+ if (!emulator_up->ReadInstruction()) {
+ // try to get at least the size of next instruction to set breakpoint.
+ auto instrSizeOpt = emulator_up->GetLastInstrSize();
----------------
labath wrote:
https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
The rule is pretty subjective, but I think the fact you felt the need to add "opt" to the name shows the code is not completely understandable without it, and I'd say that spelling out the name is the more conventional way to express that. Also, (for better or worse) most of the lldb code (the surrounding code included) uses snake_case for variable name, so it's better to stick to that.
https://github.com/llvm/llvm-project/pull/90075
More information about the lldb-commits
mailing list