Skip to content
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

VSCode debug instructions #291

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

guilyx
Copy link

@guilyx guilyx commented Mar 19, 2022

PS but there's no Scriptum: Would be nice to have a .gitignore for _build

tutorials/docs/get_backtrace.rst Outdated Show resolved Hide resolved
"type": "cppdbg",
"miDebuggerServerAddress": "localhost:3000",
"cwd": "/",
"program": "$path_to_build_executable"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with /path/to/build/executable to make clear this should be replaced. As well below anywhere you use the $ syntax, I don't want people confused that it literally means that string.

]
}

The path to the build executable will be printed out when running gdbserver. You can also find it using ``ros2 pkg prefix $package_name``. This gives you the prefix. Add ``/lib/$package_name/$node_name`` to the prefix path to have the absolute path of the build executable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand the /lib bit, where did that come from?


The path to the build executable will be printed out when running gdbserver. You can also find it using ``ros2 pkg prefix $package_name``. This gives you the prefix. Add ``/lib/$package_name/$node_name`` to the prefix path to have the absolute path of the build executable.

You should be all set to debug with VSCode: run the GDB server, then use the ``Run and Debug`` panel to attach and start debugging your application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do what? how? what does it look like? how do you interact with it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this talk to breakpoints in the editor, what can you do? Does the server need to be restarted adding traces?

There are alot of unanswered questions about how to use this or what you can do with this (and how)


.. code-block:: bash

ros2 run --prefix 'gdbserver localhost:3000' <pkg> <node> --all-other-launch arguments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove --all-other-launch arguments, that is implied

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
@SteveMacenski
Copy link
Member

Any update @guilyx ? I had a few problems that look acknowledged but not updated

@guilyx
Copy link
Author

guilyx commented Apr 26, 2022

Hey, it's in my backlog, seen your feedback and will update when time allows me to 😬😬

@SteveMacenski
Copy link
Member

OK! Just a friendly reminder :-)

@SteveMacenski
Copy link
Member

Just a quick ping again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants