使用lldb进行调试-防止平台被覆盖到远程Linux?

时间:2019-05-21 15:30:09

标签: linux debugging clang lldb

lldb无法正确启动我的程序进行调试,无论如何都无法使用remote-linux覆盖平台。

我的版本:

$ lldb --version
lldb version 7.0.1

当我尝试调试程序时:

$ lldb ./some-executable
(lldb) platform status
  Platform: remote-linux
 Connected: no

由于我不是远程调试,所以我去尝试更改此设置:

(lldb) platform list
Available Platforms:
host: Local Linux user platform plug-in.
[...]
(lldb) platform select host
  Platform: host
    Triple: i686-pc-linux-gnu
OS Version: 4.19.0
  Hostname: 127.0.0.1
WorkingDir: /home/t/Documents/project
    Kernel: Linux
   Release: 4.19.0-5-686-pae
   Version: #1 SMP Debian 4.19.37-1 (2019-05-05)

但是发出此命令后,我立即检查并猜测是什么?重置:

(lldb) platform status
  Platform: remote-linux
 Connected: no

如果我只是尝试在lldb中直接运行可执行文件,则会发生以下情况:

(lldb) run
error: process launch failed: Lost debug server connection

正在使用以下命令编译可执行文件

$ clang --version
clang version 7.0.1-8 (tags/RELEASE_701/final)
Target: i686-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ clang -lSDL2 -g source.c -o some-executable

0 个答案:

没有答案