nginx - How to use Eclipse (remote) debugger with spawn-fcgi (or similar process launchers) -


i can (cross-) compile , (remote-) debug c applications eclipse. have bunch of fcgi-applications work when started spawn-fcgi (because need connected running nginx web server way), such as:

sudo -u www-data /usr/bin/spawn-fcgi -s/tmp/fcgiapp.socket -n /var/www/fcgiapp/fcgiapp.bin 

is there way instruct eclipse gdb copy latest binary server, launch application in special way outlined above, , attach spawned fcgi process?

note have put "cross" , "remote" in parentheses, because think actual problem (debugging spawned process) persists if run eclipse , webserver on same local machine.

i have found answer myself, more workaround specific problem fcgi:

it possible create required socket connection within application itself, in code snippet:

#if standalone     int sockfd = fcgx_opensocket("/tmp/fcgitest.socket", 1024);     char command[] = "chmod ag+rwx /tmp/fcgitest.socket";     system( command ); #endif     fcgx_request request;     fcgx_init();  #if standalone     fcgx_initrequest(&request, sockfd, 0); #else     fcgx_initrequest(&request, 0, 0); #endif 

so standalone application can used debugging (use #define standalone 1), socket created normal user, debugging purposes write access granted everyone, in particular www-data i.e web server.

for deployment, use #define standalone 0 , start process user www-data using spawn-fcgi usual.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -