GDB如何处理大(> 1 Gb)调试文件? [英] How GDB deals with big (>1 Gb) debug files?

查看:307
本文介绍了GDB如何处理大(> 1 Gb)调试文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题调试C ++应用程序使用远程GDB会话,代码库是大的,因此它包含(当编译时带有-O2,-g,-DNDEBUG标志)一个大文件调试信息(1.1 Gb)。

I have a problem debugging C++ application using remote GDB session that codebase is big, and therefore it contains (when compiled with "-O2', '-g', '-DNDEBUG'" flags) a big file with debug information (1.1 Gb).

不幸的是,我不能在调试期间使用部分符号表,因为所有的时间调试器跳过应用程序的一部分,

Unfortunately, I can't just use partial symbol tables during debugging since all the time debugger skips the part of the application, and I'm unable to set breakpoints there and see the code while debugging.

作为这个问题的解决方案,我在连接到目标之后执行以下命令:

As the solution for this issue, I execute following command after I've got connected to target:

symbol-file -readnow [path-to-file-with-debugging-info]

这扩展了完整的符号表。但在这种情况下,GDB只是耗尽了内存,击中13 Gb或更多的RAM(而我的机器只有16 Gb可用)。此问题已列在 GDB Wiki 中,已知。

This expands full symbol tables. But in this case GDB simply runs out of memory hitting 13 Gb or even more RAM (while I have only 16 Gb available on my machine). This problem is already listed in GDB Wiki and known.

我的问题是如何处理GDB在这种情况下,当我需要完整的符号表,但GDB需要大量的内存,以扩展它吗?

My question is how to deal with GDB in this case, when I need full symbol tables, but GDB requires an enorm amount of memory in order to expand it?

提前感谢!

推荐答案

由于处理大调试文件是GDB的弱点,在这种情况下,

Since dealing with big debug files is GDB's weakness, the optimal way in this case was to reduce the size of *.dbg file with help of having debug symbols not for the all application modules, but only for those where debugging will actually occur.

在这种情况下,可以通过调试符号减少* .dbg文件的大小,而不是为所有应用程序模块, 〜150 mb * .dbg文件和使用DS-5调试器我只需要2.5 Gb RAM,这是可以接受的。

In this case with ~150 mb *.dbg file and using of DS-5 debugger I needed only 2.5 Gb RAM which is acceptable.

这篇关于GDB如何处理大(> 1 Gb)调试文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆