Ask Your Question
1

How can I run ROS2 nodes in a debugger (e.g. gdb)?

asked 2017-07-24 14:52:24 -0500

Is there something like the --prefix argument from rosrun in ros2 (see #q222530)?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2017-07-28 10:27:35 -0500

The --prefix argument is now working with ros2 run. So you can use it in the same way as known from rosrun, e.g.:

ros2 run --prefix 'gdb -ex run --args' package_name executable_name (see #q222530 for more examples).

At the moment this feature is only available on ROS2 installations, which were built from the development sources (master branch).

edit flag offensive delete link more

Comments

I don't want to create a new question for this but; how would that be written for lldb ? probably trivial but I couldn't get it to work.

klintan gravatar imageklintan ( 2019-09-11 20:04:45 -0500 )edit
1

answered 2017-07-24 15:30:32 -0500

William gravatar image

There is not an option like that. You can just run the binary directly from its location in gdb <install_prefix>/lib/<package_name>/<executable_name>. You can open an issue or pull request on ros2 run to make this case better:

https://github.com/ros2/ros2cli

edit flag offensive delete link more

Comments

Thanks for the quick answer!

Andre Volk gravatar imageAndre Volk ( 2017-07-24 15:34:41 -0500 )edit

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: 2017-07-24 14:52:24 -0500

Seen: 740 times

Last updated: Jul 28 '17