Code:
----------
void fun() {}
void gun() {}
void main() {
void hun() {}
}
----------
Compile with `dmd -g prog.d`.
Inside gdb:
----------
(gdb) break prog.<tab>
prog.d prog.fun() prog.gun() prog.main().hun()
----------
Notice that main() is missing from the above list. Turns out, the only way to break in the main function is to specify it as `D main` (with the space).
Worse yet, if you `break prog.main`, it will actually set the breakpoint inside hun() instead. (It's not clear from the above because the line number coincides with the body of main, but if you add some code into main and hun() and test it in the debugger, you'll see.)
Expected behaviour:
- Since all the other functions in the module are recognized by their FQN in gdb, `main` should also be recognized by its FQN.
- Setting a breakpoint on `prog.main` should not set a breakpoint inside the nested function hun()!
Comment #1 by robert.schadek — 2024-12-13T19:15:33Z