putting breakpoint in a file using “rbreak filename.c:.” doesn't work

前端 未结 2 1961
长发绾君心
长发绾君心 2020-12-11 19:07

I want to put breakpoint on all functions of a file. I came across this link : http://sourceware.org/gdb/download/onlinedocs/gdb/Set-Breaks.html#Set-Breaks

It sugges

相关标签:
2条回答
  • 2020-12-11 19:46

    rbreak filename.cpp:.* works fine for me.

    Note that in order to put breakpoint in a file you need to compile the program with debug info, e.g

    g++ -g filename.cpp
    
    0 讨论(0)
  • 2020-12-11 19:47

    rbreak filename.c:.

    That isn't supposed to work. From the document you linked to:

    rbreak regex
    Set breakpoints on all *functions* matching the regular expression regex.
    

    This is different from locations, where filename.c:... is intended to be used.

    I want to put breakpoint on all functions of a file.

    This is an unusual request. In my many years of debugging, I've never needed to do that.

    You'll have to prepare a list, and set the breakpoints individually. A recipe for doing this can be found here.

    0 讨论(0)
提交回复
热议问题