0
$\begingroup$

Rosanswers logo

Hello,

i am looking for a good way to debug my program. At the moment i only use screen output because eclipse debug mode is not working.

My problem is that i am using a ros node and this is calling my c++ library. Not i want to debug my library when ros is running.

How i can do this? When i am using eclipse he and i say debug my node he give me an error : No source available for "main() at 0x4277e8"

then i tested the gdb launch-prefix="gdb -ex --args"

but then i cant type anything inside the shell, because i have a few rosoutputs.

Can anyone please help me and explain me what is the best way for debuging this?

thank you for your help


Originally posted by Hunk on ROS Answers with karma: 222 on 2013-01-28

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I am not sure I understand your question, if you want to debug it with gdb, open a new terminal, type cd ~//bin (or wherever the executable is) and then run the command: $ gdb node-name. gdb will launch and then you could type: run to run it or you could set breakpoints in your code by typing : break line-number , and whenever it stops at a break point you could type : continue to go to the next breakpoint. I am not sure if this answers your question but I hope it helps!


Originally posted by K_Yousif with karma: 735 on 2013-01-28

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hello, thank you for your answer.

it is working now

I forgot

-DCMAKE_BUILD_TYPE=Debug

thank you for your help


Originally posted by Hunk with karma: 222 on 2013-01-31

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Juan on 2013-03-05:
I still have a question about this. How do you call "rosrun" if you are using gdb. When I just try to run gdb on my executable, I get some boost errors and a SIGABRT flag.

Could you give a representative example? Thanks

Comment by Hunk on 2013-03-07:
i am not using rosrun. U can use roslaunch with the prefix or u can use eclipse. I am using eclipse at the moment and it works fine.

Comment by Hunk on 2013-03-07:
i am not using rosrun

Comment by Sentinal_Bias on 2013-12-04:
Qtcreator allows you to open a project by opening the cmake.list file, using this parameter makes the build a debug build therefore breakpoints can be set

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.