I'm trying to remote debug a c++ app from a VM ubuntu 16.04 amd64 host to a debian armbian target of cubietruck board (ARM® Cortex™-A7 Dual-Core) via vs code.
I have follwed this guide https://medium.com/@spe_/debugging-c-c-programs-remotely-using-visual-studio-code-and-gdbserver-559d3434fb78 with the only addition of the field
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
so the whole launch.json has become
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "/home/user/ARM/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"program": "/home/user/myproject/bin/app",
"miDebuggerServerAddress": "localhost:9091",
"args": [],
"stopAtEntry": false,
"cwd": "/home/user/myproject",
"environment": [],
"externalConsole": true,
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "gdb"
},
"windows": {
"MIMode": "gdb"
}
}
]
}
in launch.json file so as to support pretty printer.
In the host I'm using the linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf gdb while the gdb in arm board has the native 8.0.1 gdb.
Everything works fine except from the pretty printer since the strings are not shown correctly. Whenever I hover over a string the fields npos and _M_dataplus pop up and one should open the _M_dataplus filed to see the actual string.
In host the linaro gdb supports pretty-printer since the command info pretty-printer
gives the output :
builtin
mpx_bound128
However when I give the same command in target gdb 8.0.1, I get:
Undefined info command: "pretty-printer". Try "help info".
I also created a .gdbinit file in my host home folder that contains the enable pretty-printer
command. I saw in the debug console that it was executed successfully but the result was erroneous as well.
Since I am pretty novice in remote debugging, what should I do to get the pretty-printer working. Should I install pretty-printer in the remote board as well or am I doing something else wrong?