View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0020344FPCCompilerpublic2011-09-25 12:092013-04-24 04:41
ReporterLudo Brands 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
Platformi386OSWindowsOS VersionXP
Product Version2.7.1Product Build18901 
Target VersionFixed in Version 
Summary0020344: Internal linker corrupts object stab information when main program is compiled for dwarf.
DescriptionWhen compiling a program with -gw2, stab information in linked in .o objects is lacking the necessary information to build the full path of the source file. Debuggers or other tools using debug info aren't able to find the source file.
Using the external linker the problem does not occur.
Comparing stab information it appears that the linker removes N_SourceFile stab information and issues only N_IncludeFile stab info omitting the base directory.
Steps To ReproduceAttached a small testcase. Put project1.pas and project2.pas in the same dir. Unit1.pas and unit2.inc in a completely different location.

fpc.exe -B -gs -gl -FuPathToUnits project1.pas

With GDB check "info func TEST". Test and Test2 are found in sources

fpc.exe -gw2 -gl -FuPathToUnits project2.pas

With GDB check "info func TEST". Test and Test2 are found but no sources

fpc.exe -gw2 -gl -s -a -FuPathToUnits project2.pas
ppas.bat

With GDB check "info func TEST". Test and Test2 are found in sources


Additional InformationSince recent lazarus trunk defaults now to dwarf, the issue pops up frequently when using RTL or LCL with stab debug info or when linking with gcc compiled objects or libraries (stabs is also default for gcc on windows).
Tagsdwarf, linker, stab
FPCOldBugId
Fixed in Revision
Attached Fileszip file icon dwarfstabmix.zip [^] (774 bytes) 2011-09-25 12:10

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-09-25 12:09 Ludo Brands New Issue
2011-09-25 12:10 Ludo Brands File Added: dwarfstabmix.zip
2012-11-13 16:57 Reinier Olislagers Tag Attached: dwarf
2012-11-13 16:57 Reinier Olislagers Tag Attached: linker
2012-11-13 16:57 Reinier Olislagers Tag Attached: stab



MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker