This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello. I'm developing a cgi c++ for apache, all tools(dbg, compile) are in a linux server and netbeans ide is in my windows 7 station. When i compile my project all perfect. Now I'm deploying my proyect but i need debug the project when apache receive data by post or get. Is possible that apache receive data by post or get and my program, stop in line debug in my windows 7 station?. I was read this post http://codebrane.com/blog/2010/04/29/debugging-an-apache-module-in-netbeans/ but apache server is not in my proccess list. Is there anybody can me help? Regards
NetBeans supports remote debugging. For doing this you should set up your remote host and attach to a remote process.
Created attachment 152370 [details] attach remote process
Created attachment 152371 [details] Error when attach apache process
Created attachment 152372 [details] Session of attach process and line stop debug
Sorry, but this doesn't work well. I attach my project to remote process (you see in file attach). The ide return an error (file doesn't exists). When I call to gci by url, doesn't stop in debug line of my code. I use apache in linux sistem and netbead in windows 7.
It looks like NB was unable to determine a path to a symbol file. Could you please attach a gdb log? http://wiki.netbeans.org/GdbLog
Created attachment 152374 [details] log file
Could you please provide me with "/bin/ls -l /proc/<apache's PID>/exe" output?
lrwxrwxrwx 1 root root 0 mar 3 13:18 /proc/12329/exe -> /usr/lib/apache2/mpm-worker/apache2
It looks like the process you're going to debug was started by root. Would you try starting the server process and debugging under the same account?
Hello I have three process of apache, I attach to id 12330 or 12329 root 12325 1 0 mar03 ? 00:00:00 /bin/sh /usr/sbin/apache2ctl -X www-data 12329 12325 0 mar03 ? 00:00:00 /usr/sbin/apache2 -X www-data 12330 12329 0 mar03 ? 00:00:00 /usr/sbin/apache2 -X
Hello, Do you know why does not stop in break line? Regards
(In reply to tgarijo from comment #12) > Hello, > > Do you know why does not stop in break line? > > Regards It occurs because sometimes procfs creates /proc/<PID> folders with inappropriate permissions (in your case superuser is owner instead of www-data).
Fixed in: http://hg.netbeans.org/cnd-main/rev/6ec8ff163ad7 Now you will be able to set a symbol file to debug using a remote project.
Integrated into 'main-silver', will be available in build *201503120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6ec8ff163ad7 User: Nikolay Koldunov <henk89@netbeans.org> Log: Fixed #250720 - Debug apache cgi c++ Fixed #
Sorry but the problem is not solved for me. I have the same problem with the version 201503120001.
What did you do to set a symbol file to debug?
I'm sorry, but I don't understand you the last post.
In order to get this work you have to set a symbol file. 1. Create a remote project on the target machine 2. In the debug properties set a symbol file (the server binary in your case) 3. In the Attach window select the target host, the process and the project created
Hi I do this, but when I send data to port 80 (apachectl -x) I cannot debug de program because the debug execution doesn't stop in line breakpoints. In other time I think to told you that the program is a CGI and I need when I send data to apache, and apache calls to my cgi program, the environment netbeand get the control and I can debug my program. I don`t know if this is possible.. Regards
It looks strange as there are many people who debug their binaries in such a way. Please provide me with the new gdb log. I'll try to solve your issue.
May be you should switch the follow fork mode to child in order to get this work. Please don't forget to specify a symbol file (the binary you're trying to debug)!
Created attachment 152782 [details] gdb log Thank's
As I can see your symbol file is /bin/dash. It's not correct. You should specify the correct symbol file (your binary) in the project properties. Could you please screenshot the Debug tab in the project properties?
Created attachment 152814 [details] symbol file
Now you should select this project while attaching to the server process.
Created attachment 152879 [details] attachProcces
Created attachment 152880 [details] debug.png Thank You very much for your work. I attach a file screen of my environment. If you see, i have a breakpoint on cout. The session is running and the project is attaching to the server process. If i send any data to port 80 (listen apache to cgi) the program doesn't stop on breakpoint and i can not debug it. I'm sorry but this is the true. Regards
Could you please screenshot the Debug tab in the xmlengine properties? Also I'd like to see a GDB log after the attempt to attach with the xmlengine project selected.
Created attachment 152924 [details] debug properties
Created attachment 152927 [details] log
During attach GDB replaces symbol file for some reason. I'll try to fix it. There is a workaround for you before I fix it: after attaching execute -file-symbol-file "/var/www/.netbeans/remote/192.168.3.32/tgarijow7-Windows-x86/P/xmlengine/dist/Debug/GNU-Linux-x86/xmlengine" in the Debugger console.
Also you can try upgrading your GDB