Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

Debug info for packages

14 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ludo Brands

Dear list,

Since lazarus has changed default debug info to dwarf, packages that are automatically compiled are systematically compiled with dwarf debug info. In a wince cross compiling environment this particularly annoying since the 2.4.4 wince cross compiler (actually the cross assembler provided with it) doesn't support the .secrel32 pseudo command issued by the compiler for debug info http://bugs.freepascal.org/view.php?id=20362. Configuring the lazarus build settings to stabs or no debug doesn't help. Project settings aren't changing anything either. How can I change the default compiler settings for packages? Am I missing something or is this a bug? Other than the dwarf problem, how to compile code without debug info in the packages?

To reproduce the problem: in a new lazarus wince cross environment drop a tmemdataset on a form. Set project options to create stabs. Compile. Aborts with
G:\lazarusce\components\memds\lib\arm-wince\wince\frmselectdataset.s:1521: Error: unknown pseudo-op: `.secrel32'

Makefile.compiled for memds package says:
<?xml version="1.0"?>
<CONFIG>
<Makefile Value="True"/>
<Params Value=" -MObjFPC -Scgi -O1 -gw2 -godwarfsets -gl -vewnhi -l -Fu../../ideintf/units/%(CPU_TARGET)-%(OS_TARGET);../../lcl/units/%(CPU_TARG ET)-%(OS_TARGET)/%(LCL_PLATFORM);../../lcl/units/%(CPU_TARGET)-%(OS_TARGET); ../../packager/units/%(CPU_TARGET)-%(OS_TARGET);. -dLCL -dLCL%(LCL_PLATFORM) memdslaz.pas"/>
</CONFIG>

Project options are:

-MObjFPC -Scghi -O3 -OoREGVAR -Twince -Parm -gs -gl -WG -vewnhi ....

Svn 32410

Thanks, Ludo

Reply by email

Ludo Brands
to Ludo Brands
Show quoted text 12 lines
> ah, there is already a report =) answered too fast > Felipe, If you refer to http://bugs.freepascal.org/view.php?id=20362 then I would suggest I create a new bugreport. The title "WinCE app with the sqlite3laz package wont compile " and the category "[Packages] Database" isn't appropriate at all to track the problem with package compiler settings. Ludo

I just tested this in a normal win32 environment and the same problem occurs: adding a new package compiles automatically with dwarf info when lazarus build config is set to no debug or to stabs. Project is configured for stabs (my default setting). So the problem is not even related to the cross compile environment.

Ludo

Reply by email

Martin
to Ludo Brands: Since lazarus has changed default debug info to dwarf, packages that are automatically…
Ludo Brands wrote
Dear list, Since lazarus has changed default debug info to dwarf, packages that are

It has not.
The change was reverted. the default is -g again (which means it may be dwarf, as -g is whatever fpc defaults to for the target)

However, the revert does not fix, any config that was already updated. So if you ever used any of the snapshots or svn versions that included the dwarf2 default, then you config may have been changed.

IMHO, I do not consider it a bug, that a config (which was only created by an experimental, and never released version) is not automatically reverted.

Show quoted text 5 lines
To reproduce the problem: in a new lazarus wince cross environment drop a tmemdataset on a form. Set project options to create stabs. Compile. Aborts with G:\lazarusce\components\memds\lib\arm-wince\wince\frmselectdataset.s:1521: Error: unknown pseudo-op: `.secrel32'

Does that happen, if you start with an empty primary config directory?

As for packages: If any package file has been committed with the dwarf setting, then those files need to be found individually.

Show quoted text 11 lines
Makefile.compiled for memds package says: <?xml version="1.0"?> <CONFIG> <Makefile Value="True"/> <Params Value=" -MObjFPC -Scgi -O1 -gw2 -godwarfsets -gl -vewnhi -l -Fu../../ideintf/units/%(CPU_TARGET)-%(OS_TARGET);../../lcl/units/%(CPU_TARG ET)-%(OS_TARGET)/%(LCL_PLATFORM);../../lcl/units/%(CPU_TARGET)-%(OS_TARGET); ../../packager/units/%(CPU_TARGET)-%(OS_TARGET);. -dLCL -dLCL%(LCL_PLATFORM) memdslaz.pas"/> </CONFIG>

It does not on my system.

Show quoted text 7 lines
Project options are: -MObjFPC -Scghi -O3 -OoREGVAR -Twince -Parm -gs -gl -WG -vewnhi .... Svn 32410

Maybe time to update again

Reply by email

cobines
to Ludo Brands: Since lazarus has changed default debug info to dwarf, packages that are automatically…

2011/10/7 Ludo Brands :
Configuring the

lazarus build settings to stabs or no debug doesn't help. Project settings aren't changing anything either. How can I change the default compiler settings for packages? Am I missing something or is this a bug? Other than the dwarf problem, how to compile code without debug info in the packages?

I think you would need to open each .lpk and change the debugging info in it by hand.

I think the options you enter in Build Lazarus Options are applied to each package as well (the $(IDEBuildOptions) macro) and they are applied at the end of the FPC command line. So maybe if you used something like "-g-" in the Build Lazarus Options then it would disable debugging info for all packages? Or "-g-s" would overwrite it to Stabs. I haven't tried that however.

cobines

Reply by email

Ludo Brands
to Martin: It has not. The change was reverted. the default is -g again (which means it may be…
Show quoted text 6 lines
It has not. The change was reverted. the default is -g again (which means it may be dwarf, as -g is whatever fpc defaults to for the target)

Changelog says that it was reverted in 32468. The original reporter in http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=20362 used
32543. I can't tell if he used a "default dwarf" before.

Show quoted text 12 lines
However, the revert does not fix, any config that was already updated. So if you ever used any of the snapshots or svn versions that included the dwarf2 default, then you config may have been changed. IMHO, I do not consider it a bug, that a config (which was only created by an experimental, and never released version) is not automatically reverted.

Agreed. Only a pity that after the different messages on this list regarding the change to dwarf and its negative consequences, the revert wasn't signaled.

Show quoted text 10 lines
> To reproduce the problem: in a new lazarus wince cross environment > drop a tmemdataset on a form. Set project options to create stabs. > Compile. Aborts with > G:\lazarusce\components\memds\lib\arm-wince\wince\frmselectdataset.s:1 > 521: > Error: unknown pseudo-op: `.secrel32' Does that happen, if you start with an empty primary config directory?

Am the contents of primary config directory. Did a make clean all. Build lazarus from the ide with Debug IDE profile, after reseting dwarf to stabs;). Resulting packages are compiled with -g although I specified -gs. Then rebuild IDE with Optimized IDE. Surprise: packages are still build with -g.
Example: sqlite3laz.compiled:
<?xml version="1.0"?>
<CONFIG>
<Compiler Date="1060328717"
Value="C:\lazarus\fpc\svn\bin\i386-win32\fpc.exe"/> <Params Value=" -MObjFPC -Scgi -O1 -g -gl -vewnhi -l -FuC:\lazarus\ideintf\units\i386-win32
-FuC:\lazarus\lcl\units\i386-win32\win32 -FuC:\lazarus\lcl\units\i386-win32 -FuC:\lazarus\packager\units\i386-win32 -FuC:\lazarus\components\sqlite\ -FUC:\lazarus\components\sqlite\lib\i386-win32\win32\ -dLCL -dLCLwin32 sqlite3laz.pas"/>
</CONFIG>

Cleaned manually the sqlite\lib\i386-win32\win32 but same result.

Still same question for svn 32738: how can I change debug info for packages?

Ludo

Reply by email

Ludo Brands
to cobines: 2011/10/7 Ludo Brands : Configuring the I think you would need to open each .lpk and…
I think you would need to open each .lpk and change the debugging info in it by hand.

That is the workaround I suggested for the wince suggestion.

Show quoted text 8 lines
I think the options you enter in Build Lazarus Options are applied to each package as well (the $(IDEBuildOptions) macro) and they are applied at the end of the FPC command line. So maybe if you used something like "-g-" in the Build Lazarus Options then it would disable debugging info for all packages? Or "-g-s" would overwrite it to Stabs. I haven't tried that however.

While the Build Lazarus options are -O2 -g- -Xs , sqlite3laz( and all other packages) is compiled with:
sqlite3laz.compiled:
<?xml version="1.0"?>
<CONFIG>
<Compiler Date="1060328717"
Value="C:\lazarus\fpc\svn\bin\i386-win32\fpc.exe"/> <Params Value=" -MObjFPC -Scgi -O1 -g -gl -vewnhi -l -FuC:\lazarus\ideintf\units\i386-win32
-FuC:\lazarus\lcl\units\i386-win32\win32 -FuC:\lazarus\lcl\units\i386-win32 -FuC:\lazarus\packager\units\i386-win32 -FuC:\lazarus\components\sqlite\ -FUC:\lazarus\components\sqlite\lib\i386-win32\win32\ -dLCL -dLCLwin32 sqlite3laz.pas"/>
</CONFIG>

Ludo

Reply by email

cobines
to Ludo Brands

2011/10/7 Ludo Brands :

Show quoted text 14 lines
While the Build Lazarus options are -O2 -g- -Xs , sqlite3laz( and all other packages) is compiled with: sqlite3laz.compiled: <?xml version="1.0"?> <CONFIG> ?<Compiler Date="1060328717" Value="C:\lazarus\fpc\svn\bin\i386-win32\fpc.exe"/> ?<Params Value=" -MObjFPC -Scgi -O1 -g -gl -vewnhi -l -FuC:\lazarus\ideintf\units\i386-win32 -FuC:\lazarus\lcl\units\i386-win32\win32 -FuC:\lazarus\lcl\units\i386-win32 -FuC:\lazarus\packager\units\i386-win32 -FuC:\lazarus\components\sqlite\ -FUC:\lazarus\components\sqlite\lib\i386-win32\win32\ -dLCL -dLCLwin32 sqlite3laz.pas"/> </CONFIG>

I see it would only work for packages that use <CustomOptions Value="$(IDEBuildOptions)"/> but only some of them use it, like LCL, FCL.

cobines

Reply by email

Martin
to Ludo Brands: Changelog says that it was reverted in 32468. The original reporter in…
Ludo Brands wrote
Agreed. Only a pity that after the different messages on this list regarding the change to dwarf and its negative consequences, the revert wasn't signaled.

It was, on 23/09/2011 11:07 by me, under the subject "Re: [Lazarus] Spurious package rebuild", in reply to

Show quoted text 9 lines
On 22/09/2011 19:36, cobines wrote: > Ah, I see. It is not explicitly stated in lclbase.lpk because it is > the default value now. But I open lclbase.lpk in IDE, in Linking page > the debugging info is set to "Automatic (Dwarf with Sets(-gw > -godwarfsets))". So that must be it. > Problem should be solved. Automatic is now "-g", so options should match.

Reply by email

Ludo Brands
to Martin
Show quoted text 19 lines
> Agreed. Only a pity that after the different messages on this list > regarding the change to dwarf and its negative consequences, the > revert wasn't signaled. It was, on 23/09/2011 11:07 by me, under the subject "Re: [Lazarus] Spurious package rebuild", in reply to > On 22/09/2011 19:36, cobines wrote: >> Ah, I see. It is not explicitly stated in lclbase.lpk because it is >> the default value now. But I open lclbase.lpk in IDE, in Linking page >> the debugging info is set to "Automatic (Dwarf with Sets(-gw >> -godwarfsets))". So that must be it. >> > > Problem should be solved. > Automatic is now "-g", so options should match.

Clearly missed that one, sorry,

Ludo

Reply by email

Ludo Brands
to Martin: It was, on 23/09/2011 11:07 by me, under the subject "Re: [Lazarus] Spurious package…
Show quoted text 11 lines
> On 22/09/2011 19:36, cobines wrote: >> Ah, I see. It is not explicitly stated in lclbase.lpk because it is >> the default value now. But I open lclbase.lpk in IDE, in Linking page >> the debugging info is set to "Automatic (Dwarf with Sets(-gw >> -godwarfsets))". So that must be it. >> > > Problem should be solved. > Automatic is now "-g", so options should match.

Missed that one, sorry.

Ludo

Reply by email

Ludo Brands
to Martin: It was, on 23/09/2011 11:07 by me, under the subject "Re: [Lazarus] Spurious package…
Show quoted text 16 lines
It was, on 23/09/2011 11:07 by me, under the subject "Re: [Lazarus] Spurious package rebuild", in reply to > On 22/09/2011 19:36, cobines wrote: >> Ah, I see. It is not explicitly stated in lclbase.lpk because it is >> the default value now. But I open lclbase.lpk in IDE, in Linking page >> the debugging info is set to "Automatic (Dwarf with Sets(-gw >> -godwarfsets))". So that must be it. >> > > Problem should be solved. > Automatic is now "-g", so options should match.

Found the problem: Ide/compileroptions.pp line 1422

  GenerateDebugInfo :=
aXMLConfig.GetValue(p+'Debugging/GenerateDebugInfo/Value', false);
  UseLineInfoUnit :=
aXMLConfig.GetValue(p+'Debugging/UseLineInfoUnit/Value', true);
  UseHeaptrc := aXMLConfig.GetValue(p+'Debugging/UseHeaptrc/Value', false);
  UseValgrind := aXMLConfig.GetValue(p+'Debugging/UseValgrind/Value',
false);
  if aXMLConfig.GetValue(p+'Debugging/DebugInfoType/Value', '') = '' then
begin
    // upgrading old setting
    DebugInfoType := dsAuto;
    if GenerateDebugInfo then
      DebugInfoType := dsStabs;
    if UseLineInfoUnit or UseHeaptrc or UseValgrind then
      GenerateDebugInfo := True; // LineInfo implies debug info
    b := aXMLConfig.GetValue(p+'Debugging/GenerateDwarf/Value', false);
    if b then begin
      GenerateDebugInfo := True;    // The old setting implied this
      DebugInfoType := dsDwarf2Set; // explicit dwarf, upgrade to +set
    end;
UseLineInfoUnit is set to true if no xml data available and a few lines
further it says if UseLineInfoUnit or UseHeaptrc or UseValgrind then
GenerateDebugInfo := True;

So all packages that don't specify debug info are compiled with -g -gl. QED

Remains the question. How to change the package debug info without configuring individual packages? This is making debug/release project management a nightmare.

Ludo

Reply by email