Building and debugging 32-bit program on 64-bit system

Dear all,

I’m currently working on a program that is designed to run on both 32-bit and 64-bit systems. During the process of compiling it with the 386 mode, I came across some bugs that need to be resolved. Therefore, I decided to use Goland on my 64-bit system to debug the program.

I have already set up the run/debug configurations, as shown in the attached image.


However, when I try to debug the program, I’m encountering an error that’s preventing me from proceeding.

API server listening at: 127.0.0.1:60327
unsupported architecture of windows/i386 - only windows/amd64  windows/arm64 are supported

As a developer, I’m always eager to learn and improve my skills, so any assistance or guidance in resolving this issue would be greatly appreciated.

Thank you in advance for your help!

Unfortunately, you cannot debug 32-bit Go programs with Delve, the de facto standard Go debugger. You can try to use gdb instead, but based on the Go documentation, it is my understanding that it can be challenging or even wrong:

GDB does not understand Go programs well. The stack management, threading, and runtime contain aspects that differ enough from the execution model GDB expects that they can confuse the debugger and cause incorrect results even when the program is compiled with gccgo. As a consequence, although GDB can be useful in some situations (e.g., debugging Cgo code, or debugging the runtime itself), it is not a reliable debugger for Go programs, particularly heavily concurrent ones. Moreover, it is not a priority for the Go project to address these issues, which are difficult.

I still use 32-bit systems and the way I “debug” them is with logging all over the place, which is far from ideal. Maybe someone else will have better information.

1 Like

thanks for taking the time to help me.
I think that logging all over the places is a not ideal but always useful method.
I will try it tommrow

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.