Oh, sorry. I tried on a different machine, and realized one have to use "run&".
So, here's what I did:
$ cat main.c
#include <stdio.h>
#include <unistd.h>
int main(void) {
for (int i = 0; ; i++) {
printf("%d\n", i);
sleep(1);
}
}
$ gcc -g -o break main.c
$ emacs -Q main.c
M-x gdb RET
# in *gud-break*, NOTE it's "run&"
(gdb) run&
# in main.c
(goto-line 6)
(gud-break 1) ; or C-x C-a C-b
# nothing happens
M-: (gud-call "break 6") RET
# breakpoint is set and process execution is paused on hitting that breakpoint
Hope that's more clear now!