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

[feature] Print pretty when c++ ros program is launched thru attach or launch #240

Closed
lusu8892 opened this issue Jun 18, 2020 · 6 comments
Closed
Assignees
Labels
feature request Suggested features

Comments

@lusu8892
Copy link

what is needed
May I ask how to setup pretty-printing when a c++ ros node is launched thru

type: ros
request: attach

or

type: ros
request: launch

The pretty-printing setting for gdb can be easily setup thru setupCommands when launch a C++ program of type: cppdbg. But this setupCommands seems not supported by any type: ros program.

@lusu8892 lusu8892 added the feature request Suggested features label Jun 18, 2020
@seanyen
Copy link

seanyen commented Jun 18, 2020

@lusu8892 Thanks for the feedback. And sorry I am not familiar with the pretty-printing thing, can you link some documents, maybe write down steps (or screenshots) to help the team understand the scenario better?

@lusu8892
Copy link
Author

image

So, as shown in the pc, there are two programs defined in launch.json, only the first could turn on pretty-printing for the underlying gdb debugger. But for the second case, the setupCommands can not be mentioned, so pretty-printing can not be turned on. Pretty-printing is a feature from GDB debugger. Here is link

@danneboom
Copy link

danneboom commented Jun 21, 2021

I'd really appreciate this feature. It enables you to debug std library containers like strings, vectors, maps etc. Without this line, the variables view is simply not usable.

Just check this example:

 std::vector<double> test = {1, 2, 3, 4, 5};

Without pretty printing:
image

With pretty printing enabled:
image

Please enable pretty printing - its a must have.

Btw: It can be enabled manually while debugging in the debug console (requires a step/F5 to activate):
-exec -enable-pretty-printing

@fmros
Copy link

fmros commented Jan 31, 2022

You can still use the "standard" gdb-attach approach which works for me and makes pretty printing work from attach:

{
            "name": "(gdb) Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "${workspaceFolder}/devel/lib/ros_package/ros_package_executeable",
            "processId": "${command:pickProcess}",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },

@ooeygui
Copy link
Member

ooeygui commented Oct 13, 2022

We have added pretty printing to the default launch.

@ooeygui ooeygui closed this as completed Oct 13, 2022
@zhh2005757
Copy link

Hi!
I found it fixed only in ros launch(debug) mode while ros attach mode still remain unfixed. I created a PR for fixing that. #815
Hope it will be helpful!

Hickey

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

No branches or pull requests

6 participants