Snap run --gdb dont work

Hi,
i try to use the --gdb flag (snap run --gdb <snapname.appname>) to debug my snap but i always get: “sudo: gdb: command not found”.

What am i doing wrong?

Running on ubuntu core 18 (arm64 architecture). Snapd Version is 2.45.3.1

Thanks!

As it says, gdb is missing. Install it on the host.

sudo apt update
sudo apt install gdb

Edit: Oh wait, I didn’t realise you’re on core, that won’t work. Sorry.

In 2.46 there’s a snap run --experimental-gdbserver you can use. This will launch a gdb server to which you can attach to it from another host.

Edit: you may need to pass a listen address eg. snap run --experimental-gdbserver=0.0.0.0:1234

1 Like