I am setting up the op-tee in ARM-64. and I'm wondering if it is possible to debug it using visual studio code running under ubuntu 18.04.
So far I was able to compile and run the op-tee in QEMU. and also being able to connect the gdb-server using the command line gdb (following this link: ).
Now I would like to use some GUI instead of gdb. Since I was working wih visual studio code, so I was wondering if it is possible to configure vsCode to do so?
I have tried installing the cortex-debug extension (I'm not sure if that it the right one) and also tried c/c++ debug attach as well. But I cannot make them work!
Here is my launch.json file:
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: "version": "0.2.0", "configurations": [ { "name": "(gdb) Attach", "type": "cppdbg", "request": "attach", "program": "${workspaceFolder}/optee_os/out/arm/core/tee.elf", "miDebuggerServerAddress": "localhost:1234", "processId": "${command:pickProcess}", "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "text": "optee" } ] }, { "cwd": "${workspaceRoot}", "executable": "${workspaceFolder}/optee_os/out/arm/core/tee.elf", "name": "Debug Microcontroller", "request": "attach", "type": "cortex-debug", "servertype": "openocd" } ] }
I expect to be able to debug the arm application by remotely connecting to the gdb-server which is running under QEMU using the Microsoft visual code.
Any suggestion of using extensions is appreciated.
1 Answer
I found the solution which works for me:
First it is needed to install the Native Debug extension for VS Code.
Then Add the following configuration into the launch.json file:
{ "type": "gdb", "request": "attach", "name": "Attach to QEMU", "executable": "${workspaceFolder}/optee_os/out/arm/core/tee.elf", "target": "localhost:1234", "remote": true, "cwd": "${workspaceRoot}", "gdbpath": "~/devel/optee/toolchains/aarch64/bin/aarch64-linux-gnu-gdb" } Notes:
- You can connect to QEMU only if the app is not running:
- It should either be at initial state before typing c in QEMU
- or it is stopped in a breakpoint
- There should be no other clients connected to it.
Reference:
0