Dwarf: Generics cause wrong unit-path in line-info-map
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
When specializing generics, such as
unit MyUnit;
type
TMyFoo = spcecialize generics.collecitons.TFoo<xxx>;
TMyFoo resides in MyUnit.
The line info for that code (any method of TMyFoo that results from specialization) will be in the line-info for (the compilation unit) TMyUnit. (which is correct).
I.e. the line info map for TMyUnit (there is just one compilation unit) will have entries for several files (just as it would for include files).
- For include files (if in other directories) fpc correctly create entries in the line-infos "include_directories".
- But for "generic.collections" no entry in include_directories is created.
From objdump:
The Directory Table is empty.
The File Name Table (offset 0xb857):
Entry Dir Time Size Name
1 0 0 0 unit1.pas
2 0 0 0 generics.collections.pas
3 0 0 0 generics.defaults.pas
generics.collections point to the implicit dir "0", which the dwarf specs state: "The
current directory of the compilation is understood to be the first entry and is not explicitly
represented."
Therefore a debugger should read this, as "generics.collections.pas" is in the same directory as "unit1.pas"
Steps to reproduce:
The include_directories should contain both:
- user specified path
- none explicit mentioned path that were searched
From DWARF
10. include_directories (sequence of path names)
The sequence contains an entry for each path that was searched for included source files in
this compilation. (The paths include those directories specified explicitly by the user for the
compiler to search and those the compiler searches without explicit direction). Each path
entry is either a full path name or is relative to the current directory of the compilation. The
current directory of the compilation is understood to be the first entry and is not explicitly
represented. Each entry is a null-terminated string containing a full path name. The last entry
is followed by a single null byte.
Mantis conversion info:
- Mantis ID: 37658
- OS: win 10
- OS Build: 10
- Platform: 64bit Intel
- Version: 3.2.0