which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

General FreeBASIC programming questions.
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by D.J.Peters »

I get "Dwarf Error: wrong version in compilation unit header (is 5, should be 2, 3, or 4)"

which version of gdb.exe is the right one ?

Joshy

Code: Select all

d:\FreeBASIC\fbc32.exe -version
FreeBASIC Compiler - Version 1.20.0 (2025-03-16), built for win32 (32bit)
Copyright (C) 2004-2025 The FreeBASIC development team.
standalone
d:\FreeBASIC\fbc32.exe -g test03.bas

Code: Select all

d:\FreeBASIC\bin\win32\gdb test03.exe
GNU gdb (GDB) 7.6.1 This GDB was configured as "mingw32".
Reading symbols from test03.exe...Dwarf Error: wrong version in compilation unit header (is 5, should be 2, 3, or 4)
[in module test03.exe]
SARG
Posts: 1888
Joined: May 27, 2005 7:15
Location: FRANCE

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by SARG »

I guess you should use a more recent version of GDB.
Or use fbdebugger ;-) (see in projects)
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by D.J.Peters »

SARG wrote: Apr 22, 2025 19:46I guess you should use a more recent version of GDB.
I guess you don't share the a link to the right download of 'gdb.exe' :-)

Joshy
SARG
Posts: 1888
Joined: May 27, 2005 7:15
Location: FRANCE

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by SARG »

I thought that you were enough skilled to find it by your self. :lol:

Here a link but no warranty GDB (version 10.1) works with your exes : https://www.equation.com/ftpdir/gdb/32/gdb.exe

https://github.com/brechtsanders/winlib ... r3-sjlj.7z
from downloading page of FBC. in mingw32/bin. And some dll to be also extracted.
VANYA
Posts: 1889
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

SARG wrote: Apr 23, 2025 7:09 I thought that you were enough skilled to find it by your self. :lol:

Here a link but no warranty GDB (version 10.1) works with your exes : https://www.equation.com/ftpdir/gdb/32/gdb.exe
Does anyone know how it was possible to collect GDB of such a small size (7 MB)?
I collected the latest version 16.3 using Msys2, and the GDB size: 280MB (not counting DLLs).
SARG
Posts: 1888
Joined: May 27, 2005 7:15
Location: FRANCE

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by SARG »

@VANYA
HI,

It's rather 14MB (not 280MB) : https://packages.msys2.org/packages/mingw-w64-i686-gdb

And maybe all dlls are embedded as static libs.
VANYA
Posts: 1889
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

SARG wrote: Apr 24, 2025 8:06 @VANYA
HI,

It's rather 14MB (not 280MB) : https://packages.msys2.org/packages/mingw-w64-i686-gdb

And maybe all dlls are embedded as static libs.
Hi SARG!

I've tried this build, but it's very inconvenient.:

There are 2 EXE files in it (one runs the other). If you run the second EXE directly, you will have problems configuring Python. In general, it's bad because it's tied to Python, you need to install Python on another system and configure global variables, otherwise GDB will send you constant diagnostic errors. And the system when one EXE launches another is bad because there will be problems with PIPE (such a system is not suitable for IDEs that use GDB as a debugger)

I don't understand UNIX-like builds, but it looks like a Portable GDB build is created by default, although the size is of course monstrous.
I looked at the builds from Brecht Sanders, the GDB size is small there, but it's very difficult to pull GDB out of there, and in the end the size will be about the same as mine.

I am interested in how GDB was built with a size of 7mb and without dependencies (the link that you gave above for gdb 10).
SARG
Posts: 1888
Joined: May 27, 2005 7:15
Location: FRANCE

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by SARG »

I'm not a specialist of gdb and even less of buiding it so I can help more :-(
srvaldez
Posts: 3649
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

hello VANYA
it's my experience that gdb grows exponentially in complexity as the versions go up, I built gdb 9.1 https://www.freebasic.net/forum/viewtop ... 63#p271763 about 5 years ago
the 32-bit version is 6,472,252 bytes in size
the 64-bit version is 7,157,505 bytes in size
they only depend on Windows System dlls like KERNEL32.dll, msvcrt.dll, USER32.dll and WS_32.dll

today I built version 16.3 but it was impossible to build it without a dozen or so dependent gnu dlls
the 64-bit gdb size after stripping unneeded symbols is 9,012,254 bytes
the size of gdbserver after stripping is 1,894,945 bytes
it may be possible to build version 10 without a ton of gnu dependencies, have not tried

<edit> I remember that I had trouble building gdb without gnu dependencies when using the latest(at the time) gcc toolchain, so using an older toolchain might help
VANYA
Posts: 1889
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

SARG wrote: Apr 24, 2025 19:58 I'm not a specialist of gdb and even less of buiding it so I can help more :-(
It's okay, I'll try to find the answer. Thank you for your participation!

----------

Hi srvaldez!

It's cool that you got such small EXE sizes.

I don't understand why I always get such huge EXEs. For example, GDB 8 is ~90 MB. I seem to install MSYS2 as indicated on their page, install GCC and other necessary libraries and utilities. Then ./configure and make. Can you tell me what might be wrong with my build?
Lost Zergling
Posts: 637
Joined: Dec 02, 2011 22:51
Location: France

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by Lost Zergling »

From experience with debuggers—and I'm probably wrong because it's old—we can't be absolutely certain of transparent operation; undocumented operation or degraded mode of the processor or system, automatic dynamic optimization, an impromptu load, or whatever else would suffice. Who needs a powerful debugger today, except to reverse engineer sometimes poorly documented code, or to test processors to their limits? But I can also easily imagine the idea of ​​trying to pair it with an LLM.
What tech has done to music, audiovisual production, and the press—namely, arguing that the fact that it's done by an AI could allow one to argue that there is no copyright—could probably be usefully repeated for technology: processor patents? An AI, Telecom? An AI, OS? An AI, software publishing? AI too.
Beyond plagiarism, it's not unthinkable to say that this idea of ​​seeing ever more precise and efficient automated ontologies emerge in the field of cutting-edge technology is already being implemented.
This question about usage is a bit off-topic, but perhaps it will have the merit of highlighting the fact that there may still be cutting-edge uses for debuggers, something we don't necessarily think of at first glance.
VANYA
Posts: 1889
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

It looks like by default when entering the commands:
./configure
make

The EXE file is built with debug information. I found out when I looked at the EXE file section. That's why the size is huge! Why did they make it this way by default...

Me just need to change the build parameters. In general, my issue is resolved.
srvaldez
Posts: 3649
Joined: Sep 25, 2005 21:54

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by srvaldez »

VANYA
you need to strip the produced exe, dll or lib
I do strip --strip-unneeded myfile.exe ( or myfile.dll or myfile.a )
VANYA
Posts: 1889
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: which version of gdb.exe for FreeBASIC Version 1.20.0 windows 32-bit (standalone) ?

Post by VANYA »

srvaldez wrote: Apr 25, 2025 11:19 VANYA
you need to strip the produced exe, dll or lib
I do strip --strip-unneeded myfile.exe ( or myfile.dll or myfile.a )
Thanks for the advice!

How to assemble GDB without dependencies for past versions (for example 10.2)?

I try like this: ./configure --disable-shared --enable-static "CFLAGS= -O2 " "CXXFLAGS= -O2 "

But problems arise during assembly. He cannot find the Libbcrypt library, although it is in the default LIB folder.
undefined reference to `BCryptGenRandom'
Post Reply