如何用lldb在manjaro中调试lz4文件格式的coredump?

问题描述 投票:0回答:1

我正在Manjaro Linux中使用C ++ 14 / clang / cmake / lldb工具链开发应用程序。并且在测试时会产生一些核心转储。例如:

$ ls -la /var/lib/systemd/coredump/
core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.lz4

我该如何调试呢?我尝试了2种选择:

  1. 解压缩lz4文件并使用lldb -c
  2. 使用coredumpctl debug

对于选项-1:

$ sudo unlz4 core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.lz4

它给我:core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000

然后lldb -c core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000

然后是bt all,这给了我:

(lldb) target create --core "core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000"
error: Unable to find process plug-in for core file '/var/lib/systemd/coredump/core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000'
(lldb) bt all
error: invalid process

选项1失败。

对于选项2:

$ coredumpctl list

它给了我:

TIME                            PID   UID   GID SIG COREFILE  EXE
Sat 2020-05-23 19:04:24 CST    1973  1000  1000   6 present   /home/linrongbin/workspace/myapp/debug/test/myapp-test

然后:$coredumpctl debug 1973

它给了我:

...
Failed to invoke gdb: No such file or directory

选项2也失败。

因此,对于选项1,如何成功解压缩lz4 coredump并对其进行调试?对于选项2,如何在lldb中调用coredumpctl

c++ linux clang lldb coredump
1个回答
0
投票

我已经自己解决了这个问题。使用以下命令将调用lldb调试coredump:

coredumpctl --debugger=lldb debug 1973
© www.soinside.com 2019 - 2024. All rights reserved.