[Lldb-commits] [PATCH] D70238: [lldb] Allow loading of minidumps with no process id

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 10 02:59:08 PST 2020


labath updated this revision to Diff 237274.
labath added a comment.

PID := 1


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70238/new/

https://reviews.llvm.org/D70238

Files:
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/test/Shell/Minidump/no-process-id.yaml


Index: lldb/test/Shell/Minidump/no-process-id.yaml
===================================================================
--- /dev/null
+++ lldb/test/Shell/Minidump/no-process-id.yaml
@@ -0,0 +1,38 @@
+# RUN: yaml2obj %s > %t
+# RUN: %lldb -c %t -o "thread list" -o "register read" -b 2>&1 | FileCheck %s
+
+# CHECK: (lldb) target create --core
+# CHECK: Unable to retrieve process ID from minidump file, setting process ID to 1.
+# CHECK: Core file {{.*}} was loaded.
+
+# CHECK: (lldb) thread list
+# CHECK: Process 1 stopped
+# CHECK: * thread #1: tid = 16001, 0x0000000000401dc6 a.out
+
+# CHECK: (lldb) register read
+# CHECK: rsp = 0x00007ffceb34a210
+
+--- !minidump
+Streams:
+  - Type:            ThreadList
+    Threads:
+      - Thread Id:       0x00003E81
+        Context:         0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0010000000000033000000000000000000000006020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000010A234EBFC7F000010A234EBFC7F00000000000000000000F09C34EBFC7F0000C0A91ABCE97F00000000000000000000A0163FBCE97F00004602000000000000921C40000000000030A434EBFC7F000000000000000000000000000000000000C61D4000000000007F0300000000000000000000000000000000000000000000801F0000FFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFF00FFFFFFFFFFFFFF00FFFFFFFF25252525252525252525252525252525000000000000000000000000000000000000000000000000000000000000000000FFFF00FFFFFFFFFFFFFF00FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+        Stack:
+          Start of Memory Range: 0x00007FFCEB34A000
+          Content:         ''
+  - Type:            ModuleList
+    Modules:
+      - Base of Image:   0x0000000000400000
+        Size of Image:   0x00017000
+        Module Name:     'a.out'
+        CodeView Record: ''
+  - Type:            SystemInfo
+    Processor Arch:  AMD64
+    Platform ID:     Linux
+    CSD Version:     'Linux 3.13'
+    CPU:
+      Vendor ID:       GenuineIntel
+      Version Info:    0x00000000
+      Feature Info:    0x00000000
+...
Index: lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
===================================================================
--- lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -226,8 +226,10 @@
 
   llvm::Optional<lldb::pid_t> pid = m_minidump_parser->GetPid();
   if (!pid) {
-    error.SetErrorString("failed to parse PID");
-    return error;
+    GetTarget().GetDebugger().GetAsyncErrorStream()->PutCString(
+        "Unable to retrieve process ID from minidump file, setting process ID "
+        "to 1.\n");
+    pid = 1;
   }
   SetID(pid.getValue());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70238.237274.patch
Type: text/x-patch
Size: 4436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200110/72aa2e4d/attachment.bin>


More information about the lldb-commits mailing list