I was trying a program with GDB, I did a ‘break x’ and then was running step by step. So when I want to quit, I would say ‘quit’, it would return an ‘inferior process will be killed warning message’. What happens if I do ‘Y’. Because I want to somehow come out of the process. And what would happen If I attach a running process and quit. Will it be detached or the running process will be exited? Different sources give different ideas. Please advise.
Also, when I try to run a program it says, and I am running the standard program from peter’s tutorial. It gives this error when I do an step to line 16.
_IO_puts (str=0x40075e "In display():") at ioputs.c:35
35 ioputs.c: No such file or directory.
in ioputs.c
Program
14 void display(int z, int *zptr) {
15 printf("In display():\n");
**16 printf(" z is %d and is stored at %p.\n", z, &z);**
17 printf(" zptr points to %p which holds %d.\n", zptr, *zptr);
18 }
If you run the process in the debugger and quit the debugger, the running program is killed (just as you would with SIGKILL). To end the program normally, say
continue(possibly with a number large of ignores) until the program is done.If you attach the debugger to a running program and exit the debugger, the debugger will just detach and the program continues running, unless you kill it beforehand.