-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instructions for debugging C++ tests in GDB when using colcon #3899
Conversation
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ryanf55 thanks for creating PR.
i think it will be helpful for user to add this documentation. in fact, i would like to hear from @SteveMacenski about this doc enhancement.
since Nav2 doc has good explanation about this https://navigation.ros.org/tutorials/docs/get_backtrace.html, how about the following approach?
- move the ROS 2 general explanation for backtrace from Nav2 to ROS 2 tutorial. (ROS 2 general part should be explained in ROS 2 documentation)
- Nav2 specific doc will be staying where it is now. and it can also has a link to ROS 2 backtrace tutorial if needed.
what do you think?
CC: @clalancette
I think its a simple additional example to show for debugging. I don't think this has anything in particular to do with Nav2, Ryan is just showing the example as a I'd just merge this without further discussion. Its a simple enough clarification / additional steps that can be helpful for those running and then fixing crashing tests. No need to overthink it |
This was my intent. While I agree @fujitatomoya on relocating some NAV2's (well-written) documentation on testing to here, it's out of the scope of this PR. This one just introduces the simple concept of using gdb to debug tests. It's not covered anywhere in the ecosystem, is pretty simple to do, and is likely not apparent to users as a potential way to fix failing tests. |
If Nav2 keeps that ROS 2 generic gdb explanation, which is totally fine for me. Lets forget about the relocation. I would use simpler example with ROS 2 tutorial but Nav2 example here. |
Thanks you Ryan for answering my question and for putting in the effort of documenting the solution! |
If I use the tutorials, it would look like this: Do you prefer that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I like the change. I've left a few suggestions for improvement.
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Thanks for all of the iterations! @fujitatomoya does this look good to you now? |
) Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit e3ff07e)
) Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit e3ff07e)
This stack overflow wasn't answered, and I ran into the same issue. Here is my approach to debugging failed C++ tests with gdb.
https://stackoverflow.com/questions/76589443/run-colcon-test-with-gdb-backtrack
Since
colcon
is lacking any references on using gdb, we can add information to the ROS 2 tutorials.