User forums > Using Code::Blocks
debugging a shared library with host application
ote:
Hi,
I've been trying all day to find a way for debugging my code which is a plugin to 3D soft Houdini in the form of a shared library (.so)
I'm able to do that with eclipse, but I would like to use again Code::Blocks for that project, and I haven't succeeded alone...
I've installed one of the latest nightly build of the debugger branch (SVN 7845), use Project > set Project's argument to supply the path to the application (Houdini), and try different settings, but it doesn't work. I can do whatever I want in my 3D soft, my breakpoints never stops anything.
Here's the debugger log :
--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug11
Adding source dir: /home/ote/reconstruction/dev/LmTriangulate2D/
Adding source dir: /home/ote/reconstruction/dev/LmTriangulate2D/
Adding file: /shared/apps/houdini/hfs11.1.118_64/bin/houdini-bin
Changing directory to: /home/ote/reconstruction/dev/LmTriangulate2D/.
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -args /shared/apps/houdini/hfs11.1.118_64/bin/houdini-bin
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.1-ubuntu
Program exited normally.
--- End code ---
Any clue on something I'm missing ?
oBFusCATed:
Enable the full log (Settings->Debugger->Common->Full log) and post again.
Another option is to start houdini from a console and then use Debug->Attach. This will work for 99.9% of the cases.
ote:
Thanks for the reply oBFusCATed. Debug -> Attach to process works when I type the PID of the instance of Houdini running ! \o/
I've not been exact in my previous post : houdini is kind of starting when Debug -> Start, but with a lot of errors that cause it to crash. When I try the same command in a console, it gives the same result. Normally, I start Houdini from a console typing : /shared/apps/houdini/hfs11.1.118_64/bin/houdini which is a script bash calling another one setting some environment variables, and then calling /shared/apps/houdini/hfs11.1.118_64/bin/houdini-bin. When I change the host application to the first command, it fails : Starting the debuggee failed: No executable file specified. But anyway, if I manage to make this way work, it will start houdini, not attach it to an instance already running, right ? It's the latter that I want. And the way you told me is working the way I want, except it would be perfect if I could type the name of the process, rather than the PID that I have to get every time I'm starting a debugging session. Is there's a way to do that, cause I already tried with attach : houdini-bin, and I've got the same errors and crash of Houdini.
ote:
Now that it works, one question : can the debuggging view start automatically when Debug -> Attach to process ?
oBFusCATed:
You can make it work with Debug->Start, by using the envvar plugin and you must set the correct values for all vars houdini-bin is expecting.
I use C::B to run/debug Maya2011 which uses the same mechanism and looking at the scripts of Houdini, I see no problem to do the same with it.
About the attach problem: It should switch the perspective, it does it for me. Can you reproduce this problem with some simple hello world program?
Also what is the setting of Settings->Debugger->Common->Perspective?
p.s. the improvement to the attach dialog is in my todo list, but it is very low priority.
Navigation
[0] Message Index
[#] Next page
Go to full version