================
@@ -209,7 +208,23 @@ Status ProcessMinidump::DoLoadCore() {
GetTarget().SetArchitecture(arch, true /*set_platform*/);
m_thread_list = m_minidump_parser->GetThreads();
- m_active_exception = m_minidump_parser->GetExceptionStream();
+ auto exception_stream_it = m_minidump_parser->GetExceptionStreams();
+ for (auto exception_stream : exception_stream_it) {
+ // If we can't read an exception stream skip it
+ // We should probably serve a warning
+ if (!exception_stream)
+ continue;
+
+ if (!m_exceptions_by_tid
+ .try_emplace(exception_stream->ThreadId, exception_stream.get())
+ .second) {
+ // We only cast to avoid the warning around converting little endian in
+ // printf.
+ return Status::FromErrorStringWithFormat(
+ "Duplicate exception stream for tid %" PRIu32,
+ (uint32_t)exception_stream->ThreadId);
+ }
----------------
labath wrote:
This wasn't just an idle warning. The cast is actually necessary to make the
code correct. But it's even better to use a formatting function that handles
this for you.
```suggestion
return Status::FromErrorStringWithFormatv(
"Duplicate exception stream for tid {0}",
exception_stream->ThreadId);
}
```
https://github.com/llvm/llvm-project/pull/97470
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits