10

gdb 不肯加载调试信息怎么办?

 3 years ago
source link: https://blog.lilydjwg.me/2019/9/9/gdb-force-load-symbols.214783.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

gdb 不肯加载调试信息怎么办?

本文来自依云's Blog,转载请注明。

更新完 buster,我的 morerssplz 崩了好几次了。第一次收到 Grafana 的通知时还以为出什么大事了呢,结果只是进程崩了。

这只 Debian 没有安装 systemd-coredumpctl 所以手动 ulimit -c unlimited 搞到了个 coredump。可随后问题来了:

(gdb) bt
#0  0x00007f9a5bd8b013 in ?? ()
#1  0x00007f9a5bd8bcfa in ?? ()
#2  0x0000000002bdb890 in ?? ()
#3  0x0000000000000000 in ?? ()

啥也没有?

我安装了 python3-dbg 啥的,它还是如此显示,以至于我一度认为 Debian 的 python3-dbg 包只包含调试版本的 Python 而没有 python3 包对应的调试信息。后来才发现不是这样的,因为直接加载 python3 是会读调试信息的:

>>> gdb python3
...
Reading symbols from python3...Reading symbols from /usr/lib/debug/.build-id/66/44f05b3a3ab9727ecee55c58681bc43b94d92e.debug...done.

然而 gdb 读这个 coredump 的时候压根就没尝试读取……即使我使用 symbol-file 命令加载了 python3 的调试信息也依旧如此。以至于我还以为函数调用栈被破坏了,但我越看越是感觉不像。

后来看到一个命令——sharedlibrary,让 gdb 加载动态链接库的调试信息的。这个也执行之后,终于能打出完整的调用栈了!

所以就是这程序崩在了动态链接库里,而 gdb 太懒根本不肯自动加载相关的调试信息,所以才什么都看不到的。

发送到 Kindle

Category: 编程 | Tags: gdb | Read Count: 247080

评论 (7)

AL 说:
大约 1 年前

依云大大用debian做服务器哇。服务端我还是喜欢Centos啊,发型版太多了我不学不动了。

Grafana这个会吃资源吗?回头用公司的测试机装一个玩玩。

其他的内容,假装看懂了。

仙子的博客像是在写日记啊。

依云 说:
大约 1 年前

感觉 grafana 占用的资源并不多呢。

博客 = blog = web log = 放在网上的记录,所以本来就是记日记的嘛。

矿泉水 说:
大约 1 年前

仙子的博客昨天变灰了!今天又恢复了。不晓得仙子在纪念什么。

9月15日是国际民主日。

依云 说:
大约 1 年前

呃,怎么还有这么个日子……
我纪念的是个人私事啦。

mike 说:
大约 1 年前

依云大大,
不知道为何我在自己的ubuntu16.04里wps wpp texstudio均不能调用fcitx中文输入,但zim vim firefox octave shell spyder均可
======================================================
在fcitx-diagnose里有这条提示:
**Xim 服务名称: "ibus" 与环境变量中设置的值 "fcitx" 不同.**

我在~/.profile文件中加入了:
export XIM_PROGRAM="fcitx"
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE="fcitx"
export QT_IM_MODULE="fcitx"
export XIM="fcitx"
在wps配置文件/usr/bin/wps文件开头加入了:
#!/bin/bash
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE="fcitx"
gOpt=
#gOptExt=-multiply
gTemplateExt=("wpt" "dot" "dotx" "dotm")
但仍然不见效

maid agency dubai 说:
16 小时前

Octoclean can be a commercial washing franchise that is in business for your past 19 years. Over the last five decades, it provides experienced any 30% boost in yucky, giving that brand-name recognition across the nation. This business cleaning operation offers washing and servicing services to be able to businesses of most sizes. It's got a comparatively low original cash investment to get a commercial washing franchise. As a possible Octoclean franchisee, you'll get well versed in running this type of type regarding business along with marketing and also financial support.

[取消回复评论]

昵称 登录 E-mail: *
Web:
Twitter:
当有新评论通过 E-mail 通知我

loading captcha image...
(输入验证码)

or Ctrl+Enter


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK