How does GDB determine the address to break at when you do “break function-name”?
问题 A simple example that demonstrates my issue: // test.c #include <stdio.h> int foo1(int i) { i = i * 2; return i; } void foo2(int i) { printf("greetings from foo! i = %i", i); } int main() { int i = 7; foo1(i); foo2(i); return 0; } $ clang -o test -O0 -Wall -g test.c Inside GDB I do the following and start the execution: (gdb) b foo1 (gdb) b foo2 After reaching the first breakpoint, I disassemble: (gdb) disassemble Dump of assembler code for function foo1: 0x0000000000400530 <+0>: push %rbp