Details
Description
Attaching to process only shows disassembly
The situation:
Linux cgi build under qt. When it starts there is a delay, allowing me to attach to the process, which is started from a web form. (pid is owned by me still).
When I attach to the process only the disassembly shows. No source. Debugging without attaching is no problem.
qtcreator shows error
target:/home/chris/testsite.com/public_html/cgi-bin/webtest": could not open as an executable file: Operation not permitted.
`target:/home/chris/testsite.com/public_html/cgi-bin/webtest': can't open to read symbols: Operation not permitted.
Could not load vsyscall page because no executable was specified
If I use dgb and attach to the pid I can list the source.
But am unable to step (Cannot find bounds of current function)
If I start debugging the process with qtcreator, it shows source and steps normally.
ls -l webtest
-rwxrwxr-x 1 chris chris 11240 Jul 10 15:05 webtest
shows that permissions are not a problem
ps aux | greb webtest shows:
chris 6883 0.0 0.0 4376 756 ? S 15:35 0:00 /var/www/testsite.com/public_html/cgi-bin/webtest
So the user is me.
Sample code: #include <stdio.h> #include <unistd.h> # define UNUSED(x) (void)x; int main(int argc, char *argv[]) { UNUSED(argc); UNUSED(argv); if (access("pause",0)==0) { int g=100; while(g>0) { // for debugging sleep(1); if(access("pause",0)!=0) g = 0; g--; } } printf("past the pause"); return 0; }
<HTML> <HEAD> <TITLE>web cgi debug test</TITLE> </HEAD> <BODY> <FORM action="http://www.testsite.com/cgi-bin/webtest" method="POST"> <INPUT type="submit" value=" web cgi debug test start Now "> </FORM> </BODY> </HTML>