Free5GC has many components and I'm not very familiar with Golang, so this is a quick reminder for myself how debugging works with Go.
I'm using vscode with the (golang.Go plugin)[https://marketplace.visualstudio.com/items?itemName=golang.Go]
- Start all Free5GC components with
./run.sh
- Kill the component you'd like to debug, like
killall amf
The main issue is that the Go module doesn't work well with submodules as of now,
so you cannot start debugging from the free5gc
folder.
- open the NF as separate workspace, e.g.
free5gc$ code NFs/amf
- open the main file, in this case
amf.go
. You spot it bypackage main
.
Hit "Run and Debug" in vscode, the plugin will deal with the rest.