================
@@ -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();
+    if (!instrSizeOpt)
+      return Status("Read instruction failed!");
----------------
jasonmolenda wrote:

We've defined the new GetLastInstrSize() method for the RISCV 
EmulateInstruction plugin, but others like AArch64 won't have that, so this 
will error out on them, won't it?  What we really want to express is "if 
`arch.GetTriple().isRISCV()` and we couldn't decode the length of the last 
instruction, then error out" isn't it? 

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