How to work with GDB in a network of nodes in docker containers

You need to install git, docker, docker compose plugin (https://docs.docker.com/engine/install/). Also you need to select in https://internal-pub.cellframe.net a node distribution built with gdb support, for example - https://internal-pub.cellframe.net/linux/cellframe-node/master/cellframe-node-5.2-399-dbg-amd64.deb.

Clone the project and go to the ‘tests-in-docker’ directory:

git clone https://gitlab.demlabs.net/cellframe/tests-in-docker.git
cd tests-in-docker

Run the network creation:

./testnet.sh https://internal-pub.cellframe.net/linux/cellframe-node/master/cellframe-node-5.2-399-dbg-amd64.deb

When the network is created and you need to run one of the nodes under gdb, modify the foobar.yaml file by changing the

command: /opt/cellframe-node/bin/cellframe-node

line of the node you want to run under gdb to:

command: gdb

Then apply the changes:

docker compose --file foobar.yml up -d

You can see that on one of the nodes (1-master-foobar) the running process has changed to gdb

You can now connect to this node in docker interactive mode and use gdb:

docker exec -it 1-master-foobar gdb /opt/cellframe-node/bin/cellframe-node

After you finish

./clean.sh

will remove all containers, images, and volumes.