[lldb] [llvm] [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (PR #108448)
Greg Clayton via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 28 15:48:43 PDT 2024
================
@@ -685,50 +684,42 @@ Status MinidumpFileBuilder::AddExceptions() {
Status error;
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:
- add_exception = true;
- break;
- default:
- break;
- }
- }
- if (add_exception) {
- constexpr size_t minidump_exception_size =
- sizeof(llvm::minidump::ExceptionStream);
- error = AddDirectory(StreamType::Exception, minidump_exception_size);
- if (error.Fail())
- return error;
+ if (!stop_info_sp)
+ continue;
- StopInfoSP stop_info_sp = thread_sp->GetStopInfo();
- RegisterContextSP reg_ctx_sp(thread_sp->GetRegisterContext());
- Exception exp_record = {};
- exp_record.ExceptionCode =
- static_cast<llvm::support::ulittle32_t>(stop_info_sp->GetValue());
- exp_record.ExceptionFlags = static_cast<llvm::support::ulittle32_t>(0);
- exp_record.ExceptionRecord = static_cast<llvm::support::ulittle64_t>(0);
- exp_record.ExceptionAddress = reg_ctx_sp->GetPC();
- exp_record.NumberParameters = static_cast<llvm::support::ulittle32_t>(0);
- exp_record.UnusedAlignment = static_cast<llvm::support::ulittle32_t>(0);
- // exp_record.ExceptionInformation;
-
- ExceptionStream exp_stream;
- exp_stream.ThreadId =
- static_cast<llvm::support::ulittle32_t>(thread_sp->GetID());
- exp_stream.UnusedAlignment = static_cast<llvm::support::ulittle32_t>(0);
- exp_stream.ExceptionRecord = exp_record;
- auto Iter = m_tid_to_reg_ctx.find(thread_sp->GetID());
- if (Iter != m_tid_to_reg_ctx.end()) {
- exp_stream.ThreadContext = Iter->second;
- } else {
- exp_stream.ThreadContext.DataSize = 0;
- exp_stream.ThreadContext.RVA = 0;
- }
- m_data.AppendData(&exp_stream, minidump_exception_size);
+ constexpr size_t minidump_exception_size =
+ sizeof(llvm::minidump::ExceptionStream);
+ error = AddDirectory(StreamType::Exception, minidump_exception_size);
+ if (error.Fail())
+ return error;
+
+ RegisterContextSP reg_ctx_sp(thread_sp->GetRegisterContext());
+ Exception exp_record = {};
+ exp_record.ExceptionCode = static_cast<llvm::support::ulittle32_t>(stop_info_sp->GetValue());
+ exp_record.ExceptionCode =
+ static_cast<llvm::support::ulittle32_t>(stop_info_sp->GetValue());
----------------
clayborg wrote:
This is being done twice?
https://github.com/llvm/llvm-project/pull/108448
More information about the llvm-commits
mailing list