[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements

Kamil Rytarowski via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 29 07:24:43 PDT 2017


krytarowski added inline comments.


================
Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:249
+      // Initialize new thread
+      struct ptrace_lwpinfo info = {};
+      Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
----------------
labath wrote:
> This is the third place i'm seeing this code. Any chance of turning it into a function?
Everything that touches threads will be refactored in future.

I suspect that at the end this code will lost its capability to iterate threads after exec() as all of them are terminated.

Here is a code that handles it in an expanded way and fore 1 thread only.


================
Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:447
+    for (const auto &thread_sp : m_threads) {
+      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStepping();
+    }
----------------
labath wrote:
> I guess you should be playing with the pt_suspend/resume here to step only the requested thread(s). Is that something you plan to do as a follow up?
I'm planning to reuse PT_RESUME/PT_SUSPEND to select thread/s for execution.

And reuse PT_SETSTEP/PT_CLEARSTEP to mark them optionally for single-step mode.

And at the end use global PT_CONTINUE as it has option to emit a signal (PT_STEP cannot send a signal).


Repository:
  rL LLVM

https://reviews.llvm.org/D31450





More information about the lldb-commits mailing list