================
@@ -686,16 +692,10 @@ Status MinidumpFileBuilder::AddExceptions() {
   for (const ThreadSP &thread_sp : thread_list) {
     StopInfoSP stop_info_sp = thread_sp->GetStopInfo();
     bool add_exception = false;
-    if (stop_info_sp) {
-      switch (stop_info_sp->GetStopReason()) {
-      case eStopReasonSignal:
-      case eStopReasonException:
+    if (stop_info_sp && 
thread_stop_reasons.count(stop_info_sp->GetStopReason()) > 0) {
         add_exception = true;
-        break;
-      default:
-        break;
-      }
     }
+
----------------
clayborg wrote:

Down below we should do something like:
```
const StopReason stop_reason = stop_info_sp->GetStopReason();
if (stop_reason == eStopReasonSignal || stop_reason == eStopReasonException)
  exp_record.ExceptionCode = 
static_cast<llvm::support::ulittle32_t>(stop_info_sp->GetValue());
else
  exp_record.ExceptionCode = lldb::StopReason::eStopReasonLLDB;
```
Then fill in the arguments for each stop reason into:
```
  size_t data_count = ...; // See SBThread::GetStopReasonDataCount()
  exp_record.NumberParameters = data_count; // See 
SBThread::GetStopReasonDataCount()
  for (i=0; i<data_count; ++i)
    exp_record.ExceptionInformation[i] = ...; // See 
SBThread::GetStopReasonDataAtIndex()
```
Then we learn to load this information into a StopReason using this data. Then 
we never lose any signal.


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

Reply via email to