主题行基本上都说明了一切.
如果我根据文件和行号给出位置,则在编辑文件时该值可能会更改.事实上,如果我在重构期间编辑多个函数,它往往会经常变化并且不方便.但是,如果相对于函数的开头是(line-),它就不太可能改变.
如果不能从函数的开头给出行偏移量,那么是否可以使用便利变量来模拟它?即如果我将声明方便变量映射到特定函数的开头(我会不断更新的列表)?
根据help break
似乎没有,但我想我最好要求确定.
(gdb) help break
Set breakpoint at specified line or function.
break [PROBE_MODIFIER] [LOCATION] [thread THREADNUM] [if CONDITION]
PROBE_MODIFIER shall be present if the command is to be placed in a
probe point. Accepted values are `-probe' (for a generic, automatically
guessed probe type) or `-probe-stap' (for a SystemTap probe).
LOCATION may be a line number, function name, or "*" and an address.
If a line number is specified, break at start of code …
Run Code Online (Sandbox Code Playgroud)