[Lldb-commits] [PATCH] D74657: [lldb/Target] Add process crash-info command

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 14 16:48:46 PST 2020


mib created this revision.
mib added reviewers: JDevlieghere, friss, jingham.
mib added a project: LLDB.
Herald added a subscriber: lldb-commits.

Currently, in macOS, when a process crashes, lldb halts inside the implementation
disassembly without yielding any useful information. The only way to get more
information is to detach from the process, then wait
for ReportCrash to generate a report, find the report, then see what error
message was included in it. Instead of waiting for this to happen, lldb could
locate the error_string and make it available to the user.

This patch addresses this issue by introducing the command `process crash-info`.

When invoked, lldb will iterate over each of the target's images, extract their
`__crash_info` section and generated a StructuredData::Array (mostly a JSON
Array) containing, in each entry, the module spec, its UUID, the crash messages
and the abort cause.

This crash information can also be fetched using the SB API or lldb-rpc protocol
using SBProcess::GetCrashInfo().

rdar://37736535

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74657

Files:
  lldb/bindings/interface/SBProcess.i
  lldb/include/lldb/API/SBProcess.h
  lldb/include/lldb/API/SBStructuredData.h
  lldb/include/lldb/Target/Process.h
  lldb/packages/Python/lldbsuite/test/commands/process/crash-info/Makefile
  lldb/packages/Python/lldbsuite/test/commands/process/crash-info/TestProcessCrashInfo.py
  lldb/packages/Python/lldbsuite/test/commands/process/crash-info/main.c
  lldb/source/API/SBProcess.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Target/Process.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74657.244792.patch
Type: text/x-patch
Size: 13914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200215/dbe9fe45/attachment-0001.bin>


More information about the lldb-commits mailing list