There is a golang application that loads the plugin at runtime. I am developing this plugin and I would like to ask if there is an opportunity to debug the code of my plugin?
I tried to run delve by compiling both the application and the plugin with --gcflags="all=-N -l", but running the application in the debugger I got an error the executable file does not contain debugging information for the plugin
Are there ways to debug golang plugin?
Solution: put breakpoint via runtime.Breakpoint(), then run application with delve. It will stop on breakpoint at the plugin code.
Don't forget to build plugin and application with flags: go build -trimpath -gcflags "all=-N -l"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With