Given the following code sippet:
1: int main(int argc, char **argv) {
2: int i;
3:
4: i = i + 1;
5:
6: ...
7:
8: }
When you set a breakpoint on line 2: in the above code and start debugging in GDB the execution actually stops on line 4:. This is the correct behavior of course BUT is it possible to query GDB for the correct stop point number before debugging… right after the creation of the breakpoint.
This is what
info bshows:and you need to do this for address in the column “Address”:
As you can see the real breakpoint on “Line 4 of main.cpp”