================
@@ -70,27 +77,49 @@ lldb::RegisterContextSP 
ThreadMachCore::GetRegisterContext() {
 
 lldb::RegisterContextSP
 ThreadMachCore::CreateRegisterContextForFrame(StackFrame *frame) {
-  lldb::RegisterContextSP reg_ctx_sp;
   uint32_t concrete_frame_idx = 0;
 
   if (frame)
     concrete_frame_idx = frame->GetConcreteFrameIndex();
+  if (concrete_frame_idx > 0)
+    return GetUnwinder().CreateRegisterContextForFrame(frame);
+
+  if (m_thread_reg_ctx_sp)
+    return m_thread_reg_ctx_sp;
 
-  if (concrete_frame_idx == 0) {
-    if (!m_thread_reg_ctx_sp) {
-      ProcessSP process_sp(GetProcess());
+  ProcessSP process_sp(GetProcess());
----------------
JDevlieghere wrote:

The old code didn't check either, but let's assert that you must have a process 
at this point.
```suggestion
  ProcessSP process_sp(GetProcess());
  assert(process_sp);
```

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

Reply via email to