Skip to content

Debugging plugin using vscode

Docker and ptrace

GDB

don't forget to install gdb

devcontainer.json
1
2
3
4
5
6
{
  "runArgs": [
    "--cap-add=SYS_PTRACE",
    "--security-opt=seccomp=unconfined"
  ]
}

OR

docker-compose
1
2
3
4
5
6
7
8
9
services:
  gazebo:
    build: 
      dockerfile: .devcontainer/Dockerfile
      context: .
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp=unconfined

VScode

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) Launch",
      "type": "cppdbg",
      "request": "attach",
      "program": "/usr/bin/ruby3.0",
      "processId": "${command:pickProcess}",
      "MIMode": "gdb",
      "miDebuggerPath": "/usr/bin/gdb",
    }
  ]
}

TODO: explain how i get /usr/bin/ruby3.0


Reference