我在 ARM9 板上运行嵌入式应用程序,总闪存大小仅为 180MB。我能够运行 gdb
,但是当我运行时
(gdb) 生成核心转储
我得到一个错误
warning: Memory read failed for corefile section, 1048576 bytes at 0x4156c000.
warning: Memory read failed for corefile section, 1048576 bytes at 0x50c00000.
Saved corefile core.5546
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Tamper Detected
**********OUTSIDE ifelse 0*********
length validation is failed
我还设置了 ulimit -c 50000
但核心转储仍然超过了这个限制。当我执行 ls -l
检查文件大小时,它超过了 300 MB。在这种情况下,我应该如何限制核心转储的大小?
最佳答案
GDB 不遵守“ulimit -c”,只有内核遵守。
不清楚您是在目标板上运行 GDB,还是在开发主机上运行(并在目标上使用 gdbserver)。您可能应该使用后者,这将允许您收集完整的核心转储。
无论如何,截断的核心转储都是一种痛苦,因为它们通常不会包含调试问题所需的准确信息。
关于linux - 使用 GDB 生成核心转储文件时如何限制其大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7737465/