Bug 337051 - fpc misuses DW_AT_comp_dir and .debug_line directory and file name formats
fpc misuses DW_AT_comp_dir and .debug_line directory and file name formats
Product: Fedora
Classification: Fedora
Component: fpc (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Joost van der Sluis
Fedora Extras Quality Assurance
: Reopened
: 434195 (view as bug list)
Depends On:
Blocks: gcc43rebuildfail
  Show dependency treegraph
Reported: 2007-10-18 00:04 EDT by Roland McGrath
Modified: 2013-01-09 23:27 EST (History)
2 users (show)

See Also:
Fixed In Version: F9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-18 04:07:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Roland McGrath 2007-10-18 00:04:55 EDT
The DWARF information that fpc generates (.debug_line) does not encode the file
and directory names correctly as defined by the DWARF spec.  This confuses
consumers like a debugger, and confuses the debugedit program that is used in
rpm builds.

The DW_AT_comp_dir attribute is being used entirely incorrectly.
It's sometimes "" and otherwise a relative directory name in fpc's output.
The spec says that this must be the current directory that the compiler runs in,
i.e. what it gets for getcwd().  Relative names in the directory and file table
refer to this to produce the complete name.

The directory table as produced has a few problems.
DWARF specifies that the table lists exactly all the directories that are
searched for included source files, i.e. for the analog of #include "file". 
This includes the directories specified with the equivalent of cc's -Idir, as
well as system-default directories analogous to C's /usr/include et al.  If a
directory name is relative it's resolved relative to DW_AT_comp_dir.
I can't tell, but it looks like maybe the first of these is going into
DW_AT_comp_dir in some cases.  Anyway, it's not clear the right list is here.
Secondly, the directory names in the table have a trailing slash; this is not a
violation of the DWARF spec, but it's not the way it's usually done, and
debugedit canonicalizes the names to remove it anyway.  You really should avoid
putting a trailing / or a leading ./ on directory names, unless the user really
specified it that way.
Comment 1 Joost van der Sluis 2007-10-18 06:40:07 EDT
Reported upstream: http://www.freepascal.org/mantis/view.php?id=9965
Comment 2 Bug Zapper 2008-04-04 10:09:36 EDT
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 3 Jason Tibbitts 2008-04-17 17:49:16 EDT
Upstream says this is fixed now in fpc 2.2.1.
Comment 4 Joost van der Sluis 2008-04-18 04:07:57 EDT
I hoped that the new fpc release would be in time for F9, but it isn't. So I
decided to backport the DWARF-fix to fpc-2.2.0 for F9, since fpc doesn't build
without this patch on F9.

Comment 5 Joost van der Sluis 2008-04-18 04:10:21 EDT
(fpc 2.2.1 is a snapshot/svn/unstable version which changes every day. We would
say that it's in 'rawhide'. Next release would be 2.2.2, which is delayed)
Comment 6 Joost van der Sluis 2008-04-18 04:14:03 EDT
*** Bug 434195 has been marked as a duplicate of this bug. ***
Comment 7 Fedora Update System 2008-05-10 07:49:23 EDT
fpc-2.2.0-12.fc9 has been submitted as an update for Fedora 9
Comment 8 Fedora Update System 2008-05-13 11:27:49 EDT
fpc-2.2.0-12.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2008-07-26 02:02:54 EDT
fpc-2.2.0-12.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.