Ask Your Question
0

ros debug to runtime

asked 2013-01-28 02:09:54 -0500

Hunk gravatar image

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

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
2

answered 2013-01-28 13:11:41 -0500

I am not sure I understand your question, if you want to debug it with gdb, open a new terminal, type cd ~/<enter-your-package-path>/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!

edit flag offensive delete link more
1

answered 2013-01-31 21:04:26 -0500

Hunk gravatar image

updated 2013-02-03 22:11:32 -0500

Hello, thank you for your answer.

it is working now

I forgot

-DCMAKE_BUILD_TYPE=Debug

thank you for your help

edit flag offensive delete link more

Comments

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

Juan gravatar imageJuan ( 2013-03-05 11:59:23 -0500 )edit

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.

Hunk gravatar imageHunk ( 2013-03-07 02:47:18 -0500 )edit

i am not using rosrun

Hunk gravatar imageHunk ( 2013-03-07 02:47:19 -0500 )edit

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

Sentinal_Bias gravatar imageSentinal_Bias ( 2013-12-04 17:36:59 -0500 )edit
0

answered 2014-02-11 04:35:05 -0500

See my answer here. In my experience, debugging with QtCreator works very well.

edit flag offensive delete link more
0

answered 2014-02-11 04:17:24 -0500

shangl gravatar image

hi, i still dont get it. i uese eclipse, but i cannot configure the "run configuration". the online tutorial says, i should see a list of executables when i click on "search project", but there is nothing. if i type in there rosrun ..., i can execute but not debug it says "Program is not a recognized executable.". however, i can build the whole package without problems, but indexer is not working for me as well. all in all, it is a huge mess

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-01-28 02:09:54 -0500

Seen: 2,694 times

Last updated: Feb 11 '14