llvm-project/lldb/source/Plugins/Process
Pavel Labath 468ca490c6 [lldb] Allow loading of minidumps with no process id
Summary:
Normally, on linux we retrieve the process ID from the LinuxProcStatus
stream (which is just the contents of /proc/%d/status pseudo-file).

However, this stream is not strictly required (it's a breakpad
extension), and we are encountering a fair amount of minidumps which do
not have it present. It's not clear whether this is the case with all
these minidumps, but the two known situations where this stream can be
missing are:
- /proc filesystem not mounted (or something to that effect)
- process crashing after exhausting (almost) all file descriptors (so
  the minidump writer may not be able to open the /proc file)

Since this is a corner case which will become less and less relevant
(crashpad-generated minidumps should not suffer from this problem), I
work around this problem by hardcoding the PID to 1 in these cases.
The same thing is done by the gdb plugin when talking to a stub which
does not report a process id (e.g. a hardware probe).

Reviewers: jingham, clayborg

Subscribers: markmentovai, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70238
2020-01-20 13:08:58 +01:00
..
Darwin factor out an abstract base class for File 2019-10-03 04:31:46 +00:00
FreeBSD Fix process launch failure on FreeBSD after r365761 2019-10-10 20:26:59 +00:00
Linux Cleanup and speedup NativeRegisterContextLinux_arm64 2019-12-06 22:18:57 +05:00
MacOSX-Kernel [lldb] Qualify includes of Properties[Enum].inc files. NFC 2019-07-29 17:22:10 +00:00
NetBSD [lldb] [Process/NetBSD] Remove unused orig_*ax use 2020-01-06 17:10:55 +01:00
POSIX [lldb] Fix ARM32 inferior calls 2019-12-21 11:12:17 +01:00
Utility [lldb/MachO] "Fix" intentional out-of-bounds error (NFC) 2019-12-18 12:54:04 -08:00
Windows/Common [LLDB] Avoid using InitializeContext for zero-initializing a CONTEXT. NFC. 2019-11-27 10:44:42 +02:00
elf-core Fix ELF core file memory reading for PT_LOAD program headers with no p_filesz 2019-09-09 21:45:49 +00:00
gdb-remote When reading Aux file in chunks, read consecutive byte ranges 2020-01-09 16:05:38 -08:00
mach-core [Logging] Replace Log::Printf with LLDB_LOG macro (NFC) 2019-07-24 17:56:10 +00:00
minidump [lldb] Allow loading of minidumps with no process id 2020-01-20 13:08:58 +01:00
CMakeLists.txt Enable ProcessMachCore plugin on non-apple platforms 2018-05-22 16:33:43 +00:00