================
@@ -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()) {
----------------
jasonmolenda wrote:

Ah wait, I see.  This method is trying to decode where the next instruction 
will go, with branches and jumps decoded, so we can put a breakpoint there.  
And you're handling the case where we can't decode the current instruction (I 
now understand why you used that in your test case).  It seems harmless to call 
GetLastInstrSize() if the instruction that couldn't be decoded, and add the 
length of the instruction to pc.  We can assume the emulation engine will 
emulate all branching instructions.  I could imagine the RISCV emulation plugin 
didn't have decoding for an instruction that doesn't branch, it could fail, but 
we can still decode the size of that unknown instruction successfully, and 
assume that it does not branch.

https://github.com/llvm/llvm-project/pull/90075
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to