更多 Memcheck 上下文行

More Memcheck context lines

在程序的最后运行,"leak check full" "show leak kinds all" 以这样的部分形式显示了一些泄漏事件 ,举个例子:

[...]
==12522== 
==12522== x bytes in 1 blocks are still reachable in loss record y of z
==12522==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==12522==    by 0x42350D: whatever_1 (whatever_1.c:3401)
==12522==    by 0x4225B9: whatever_2 (whatever_2.c:2948)
==12522==    by 0x41D93E: whatever_3 (whatever_3.c:1185)
==12522==    by 0x423A07: whatever_4 (whatever_4.c:1370)
==12522==    by 0x4294A4: whatever_5 (whatever_5.y:1413)
==12522==    by 0x403998: whatever_6 (whatever_6.c:205)
==12522==    by 0x4038AC: whatever_7 (whatever_7.c:180)
==12522==    by 0x4036AF: whatever_8 (whatever_8.c:143)
==12522==    by 0x413C7F: whatever_test_0 (whatever_9.c:53)
==12522==    by 0x413F92: whatever_tests (whatever_10.c:177)
==12522==    by 0x45AD69: run_tests (whatever_11.c:153)
==12522==
[...]

最顶层的作用域是 main,在多个块中,就像这个块一样,调用堆栈的深度足够大,不会显示到 main。在其他 事件 中,有足够的上下文来显示每个级别。

我看到,在此主机中,此处仅显示 12 个级别(vg_replace_malloc.c 然后是我的 11 个用户级别)。

这可以配置为显示超过 12 个级别吗?

我已经阅读了 Valgrind 参数、Memcheck 参数,这些参数增加了冗长,但没有成功。

使用选项 --num-callers(默认值为 12):

--num-callers=<number>    show <number> callers in stack traces [12]