Here are some notes how I am using using remote (Linux) development and debugging with VS Code. These guides get you started.
Since the server I am using is headless, I needed to use Xvfb.
Xvfb
MapLibre Native could not connect to the X server when I ran Xvfb manually and set the DISPLAY variable.
DISPLAY
So instead I ran gdbserver with
gdbserver
xvfb-run -a gdbserver localhost:9999 build/mbgl-benchmark-runner
and added the following launch.json configuration to VS Code:
launch.json
{ "type": "gdb", "request": "attach", "name": "Attach to gdbserver", "executable": "build/mbgl-benchmark-runner", "target": "localhost:9999", "remote": true, "cwd": "${workspaceRoot}", "gdbpath": "/usr/bin/gdb", }
There was an error while loading. Please reload this page.