Skip to content

Instantly share code, notes, and snippets.

@mrlnc
Created February 27, 2021 16:14
Show Gist options
  • Save mrlnc/1d667335f294cee61f2f2ccd0abce7d6 to your computer and use it in GitHub Desktop.
Save mrlnc/1d667335f294cee61f2f2ccd0abce7d6 to your computer and use it in GitHub Desktop.
Debugging free5gc

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]

  1. Start all Free5GC components with ./run.sh
  2. 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 by package main.

Hit "Run and Debug" in vscode, the plugin will deal with the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment