================
@@ -244,6 +244,12 @@ bool ProcessFreeBSDKernel::DoUpdateThreadList(ThreadList 
&old_thread_list,
 
         ThreadSP thread_sp{
             new ThreadFreeBSDKernel(*this, tid, pcb_addr, thread_desc)};
+
+        if (tid == dumptid) {
+          static_cast<ThreadFreeBSDKernel *>(thread_sp.get())
+              ->SetIsCrashedThread(true);
+        }
----------------
DavidSpickett wrote:

I wonder if you can avoid a cast by doing:
```
auto thread = new ThreadFreeBSDKernel...
thread->SetIsCrashed(...
new_thread_list.AddThread(thread)
```
Maybe you'd need a static cast on the last line anyway, but it makes a bit more 
sense to me to write it as:
```
allocate a freebsd thread
do things knowing it's a freebsd thread
hand it off as a pointer to the base class
```
Rather than:
```
allocate a thread as a base class pointer
cast it back to freebsd thread
hand it off as a pointer to base class
```
Casting itself is fine though, so just a style suggestion. Keep it as is if you 
prefer that.

https://github.com/llvm/llvm-project/pull/178069
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to