I have a working process, but its executable has been deleted. If I try to connect gdb, I got the following error
/home/vivek/binary/releases/20120328101511/bin/app.exe (deleted): No such file or directory.
How to connect gdb to this process?
Example: Source code:
#include<stdio.h>
#include<stdlib.h>
int main(){
for (;;){
printf("Sleeping");
sleep(1);
}
}
compile it
gcc main.cc -o a.out
gcc main.cc -o b.out
Run /a.out
Now remove a.out from another terminal. And fire gdb attach pgrep a.outb.out file This does not work.
GDB shows the following error:
/tmp/temp/a.out (deleted): No such file or directory.
A program is being debugged already. Kill it? (y or n) n
Program not killed.
source
share