gpt4 book ai didi

debugging - 如何在 gdb 上进行 grep 打印

转载 作者:行者123 更新时间:2023-12-02 14:41:43 25 4
gpt4 key购买 nike

有没有办法在 gdb 中 grep 打印命令的输出?就我而言,我正在使用 gdb 调试核心转储,并且我正在调试的对象包含大量元素。我发现很难寻找匹配的属性,即:

(gdb) print *this | grep <attribute>

谢谢。

最佳答案

您可以使用pipe命令

>>> pipe maintenance info sections | grep .text
[15] 0x5555555551c0->0x5555555554d5 at 0x000011c0: .text ...

>>> pipe maintenance info sections | grep .text | wc
1 10 100

关于debugging - 如何在 gdb 上进行 grep 打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15960180/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com