Is there a similar method in gdb?
Yes: break *function_name
.
From (gdb) help break
:
Address locations begin with "*" and specify an exact address in the
program. Example: To specify the fourth byte past the start function
"main", use "*main + 4".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…