How to grep on gdb print

前端 未结 3 1438
灰色年华
灰色年华 2021-02-07 22:31

Is there a way to grep on the output of print command in gdb? In my case, I am debugging a core dump using gdb and the object I am debugging contains hell lots of elements. I am

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 23:00

    You can use pipe command

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

提交回复
热议问题