首页 > 解决方案 > 如何在 Ubuntu 上为 libc++ 安装调试符号?

问题描述

如何在 Ubuntu 20.04 LTS 上为 libc++ 安装调试符号?

现在我不得不求助于使用 -fstandalone-debug 编译所有内容。

标签: libc++

解决方案


I was looking for the same thing starting yesterday and today found this wiki link: https://wiki.ubuntu.com/Debug%20Symbol%20Packages

succinctly:

  1. add the sources for their debug symbol packages
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \
sudo tee -a /etc/apt/sources.list.d/ddebs.list
  1. import the signing key for said packages
sudo apt install ubuntu-dbgsym-keyring
  1. update your package list to include the new ones
sudo apt-get update
  1. now you can install *-dbgsym packages, I found which libc++ package I had installed like so:
apt list --installed | grep libc++
  1. I had libc++1-11. I checked that the -dbgsym package existed brutishly like so:
sudo apt search libc++ | grep -P 'libc\+\+.*dbgsym'
  1. And of course installed the one I needed:
sudo apt install libc++1-11-dbgsym

I got a hint at the right solution from the final comment in this thread: https://bugs.llvm.org/show_bug.cgi?id=24202


推荐阅读