Debug Go DLL

144 views
Skip to first unread message

Gladiators Squad

unread,
Sep 30, 2022, 1:58:18 AM9/30/22
to golang-nuts
Hi everyone,

Is there any way to debug DLL files once it is loaded?

Jason E. Aten

unread,
Oct 3, 2022, 11:39:48 PM10/3/22
to golang-nuts
Insert fmt.Printf() calls into your code.  If you aren't familiar with how to get timestamped, filename:line-number prints
to create a log of your run, I demonstrate that here: https://github.com/glycerine/vprint

In my experience, prints are how 99% of debugging should be done.

If you don't have a console (stdout), write them to a file instead.

On linux, the gdb debugger can give you alot of information.  On windows, visual studio's debugger will do the same.
However debuggers are very slow to use compared to generating and analyzing a log file.  The only real thing
that the debugger can do that logging cannot is to set watchpoints on memory locations (using special
purpose CPU facilities), and then to stop the program when that address is written.

On linux, strace is also quite helpful. 

Reply all
Reply to author
Forward
0 new messages