远程调试慢,我如何过滤哪些库已加载

发布于 2025-01-22 09:08:04 字数 785 浏览 0 评论 0原文

我正在尝试在远程服务器上调试我们的代码。我们的代码库很大,从我们的办公室到服务器的带宽非常慢。不可能进行调试(每个步骤需要10秒至几分钟)。

该项目基于CPP,在Clion IDE上具有CMAKE。

基本的调试流程起作用(我使用RSYNC上传了在调试中编译为远程服务器的库,我可以附加调试器),但是大约需要30分钟,直到所有符号都从远程目标加载为止。

例如:

Reading /usr/pgsql-12/lib/libpq.so.5 from remote target...
Reading /lib64/libgssapi_krb5.so.2 from remote target...
Reading /lib64/libkrb5.so.3 from remote target...
Reading /lib64/libcom_err.so.2 from remote target...
.. and so on for lots of libraries  (this take almost 30 minutes )

我正在尝试使用.gdbinit的以下内容,但没有运气:

  1. 仅适用于我们自己的库(它们位于文件夹上,一个副本,在遥控器上,另一个在本地)
  2. 不加载系统或STD的调试符号库
  3. 使用库的本地副本,而不是遥控器节省更多时间,并提高

我尝试使用Sysroot和.gdbinit中的其他命令的调试器的响应能力,但我无法使其正常工作。

主机上的libs在/home/iLia/debug/lib中,在/tmp/clion/debug中

I am trying to debug our code on remote server. Our code base is large and the bandwidth to the server from our office is quite slow. It is impossible to debug (each step takes from 10 seconds to few minutes).

The project is based on cpp, with CMake on clion IDE.

The basic debug flow works (I upload the libraries that compiled in debug to the remote server using rsync, and I can attach the debugger) but it takes around 30 minutes until all symbols are loaded from remote target.

For example:

Reading /usr/pgsql-12/lib/libpq.so.5 from remote target...
Reading /lib64/libgssapi_krb5.so.2 from remote target...
Reading /lib64/libkrb5.so.3 from remote target...
Reading /lib64/libcom_err.so.2 from remote target...
.. and so on for lots of libraries  (this take almost 30 minutes )

I am trying the following using .gdbinit but with no luck:

  1. load debug symbols only for our own libraries (they are located on a folder , one copy on the remote and another locally)
  2. do not load debug symbols for system or std libraries
  3. use the local copy of the libraries and not the remote to save some more time and to improve the responsiveness of the debugger

I tried to sysroot and another commands in .gdbinit but i cannot make it work.

The libs on the host are in /home/ilia/debug/lib, and on the remote in /tmp/clion/debug

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文