[fpc-devel] A Compiled file size solution from the GBD mailing-list

Bogusław Brandys brandys at o2.pl
Thu Jan 17 11:11:23 CET 2008


Peter Vreman wrote:
>>> Support for a separate .dbg file is now available for windows in
>>> current svn trunk with the -Xg option. No need anymore for "objcopy
>>> --only-keep-debug && objcopy --add-debug-link && strip" under
>>> windows. The external linker (e.g. linux) still be updated to support
>>> objcopy and strip when -Xg is passed.
>> I have just try on Windows with objcopy (I have ownloaded it from the
>> mingw binutils binaries) and works like a charm.
>>
>> The -Xg flag do not works. GDB tell me: "not found symbols".
>>
>> PS: why do not add objcopy to the FPC bin folder?
> 
> Did you include the -g flag to generate debuginfo? The -Xg is a linker only option that does not
> influence generation of code or debuginfo. On an other system than the development system it is
> also working fine.
> 
> For windows we don't want to call external tools by default. The binutils are very slow under
> windows resulting in complains about slow compilation times which are infact linking times. That
> is also the reason why windows has already an internal linker.
> 
> 
> PVreman at NL-L3DA451 /fpc/compiler
> $ ppc386 p -Xg -g
> Free Pascal Compiler version 2.3.1-r9226 [2008/01/17] for i386
> Copyright (c) 1993-2007 by Florian Klaempfl
> Target OS: Win32 for i386
> Compiling p.pp
> Linking p.exe
> 3 lines compiled, 0.1 sec, 23408 bytes code, 1040 bytes data
> 
> PVreman at NL-L3DA451 /fpc/compiler
> $ ls -l p.dbg p.exe
> -rwx------+ 1 PVreman ???????? 20960 Jan 17 10:48 p.dbg
> -rwx------+ 1 PVreman ???????? 28191 Jan 17 10:48 p.exe
> 
> PVreman at NL-L3DA451 /fpc/compiler
> $ gdb p.exe
> GNU gdb 6.5.50.20060706-cvs (cygwin-special)
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-cygwin"...
> (gdb) l
> 1       begin
> 2         writeln('hello');
> 3       end.
> (gdb) q
> 
> 

Oops..what I did wrong ? Look below



D:\>fpc -Xg -g p.pas
Free Pascal Compiler version 2.3.1 [2008/01/10] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Win32 for i386
Compiling p.pas
Linking p.exe
4 lines compiled, 0.1 sec, 23536 bytes code, 1032 bytes data

D:\>gdb p.exe
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...(no debugging symbols found)

(gdb) l
No symbol table is loaded.  Use the "file" command.
(gdb) quit






More information about the fpc-devel mailing list