Re: What does the DWARF information generated by your GHC branch look like?

On Fri, Feb 28, 2014 at 3:15 PM, Peter Wortmann
Johan Tibell wrote:> Lets try to get our name standardized and pushed into GDB. It's
hopefully as simple as sending an email to the GDB devs.
Strictly speaking standardization is the job of the DWARF format committee, which seem to currently be in the process of specifying DWARF5[1]. Not quite sure we have a strong enough case, but if we wanted our own language ID these would probably be the right people to ask.
I just emailed the DWARF discussion mailing list to sort this out. -- Johan

Yes another question while I have you on the line. :) Do we follow the best practices here: http://wiki.dwarfstd.org/index.php?title=Best_Practices -- Johan

(Passive note - this conversation looks like Johan talking to himself,
as I suspect Peter is not 'reply all'-ing to the developers list. So
other people may be a tad lost.)
On Fri, Feb 28, 2014 at 9:36 AM, Johan Tibell
Yes another question while I have you on the line. :)
Do we follow the best practices here: http://wiki.dwarfstd.org/index.php?title=Best_Practices
-- Johan
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
-- Regards, Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/

On Fri, Feb 28, 2014 at 4:53 PM, Austin Seipp
(Passive note - this conversation looks like Johan talking to himself, as I suspect Peter is not 'reply all'-ing to the developers list. So other people may be a tad lost.)
Nope, this is just me having a stream of consciousness discussion. If you see 2 replies from Peter and 5 emails from me (including this one), that's it. :)

Or he's not subscribed to this list and his messages do not come through
* Austin Seipp
(Passive note - this conversation looks like Johan talking to himself, as I suspect Peter is not 'reply all'-ing to the developers list. So other people may be a tad lost.)
On Fri, Feb 28, 2014 at 9:36 AM, Johan Tibell
wrote: Yes another question while I have you on the line. :)
Do we follow the best practices here: http://wiki.dwarfstd.org/index.php?title=Best_Practices
-- Johan
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
-- Regards,
Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On Fri, Feb 28, 2014 at 4:57 PM, Roman Cheplyaka
Or he's not subscribed to this list and his messages do not come through
Ah yes. From my end I can see that he tried to CC the mailing list, but I missed that the messages didn't get through.

Roman Cheplyaka wrote:
Or he's not subscribed to this list and his messages do not come through
Ah thanks, that's probably it. I accumulated lots of error mails from the mailing list, which however didn't mention subscribing. Sorry about the confusion... Greetings, Peter Wortmann

Johan Tibell wrote:
Do we follow the best practices here: http://wiki.dwarfstd.org/index.php?title=Best_Practices
Not quite sure what exactly you are referring to, here's the current state:
For DW_TAG_compilation_unit and DW_TAG_partial_unit DIEs, the name attribute should contain the path name of the primary source file from which the compilation unit was derived (see Section 3.1.1).
Yes, we do that.
If the compiler was invoked with a full path name, it is recommended to use the path name as given to the compiler, although it is considered acceptable to convert the path name to an equivalent path where none of the components is a symbolic link.
I am simply using ModLocation for this. The results make sense, even though I haven't tried crazy symbolic link combinations yet. If we find something to improve we should probably do it for GHC as a whole.
combining the compilation directory (see DW_AT_comp_dir) with the relative path name.
We set this attribute, albeit simply using getCurrentDirectory. This might be an oversight, but I couldn't see a location where GHC stores the "compilation directory" path.
For modules, subroutines, variables, parameters, constants, types, and labels, the DW_AT_name attribute should contain the name of the corresponding program object as it appears in the source code
We make a "best effort" to provide a suitable name for every single procedure. Note that a single function in Haskell might become multiple subroutines in DWARF - or not appear at all due to in-lining.
In general, the value of DW_AT_name should be such that a fully-qualified name constructed from the DW_AT_name attributes of the object and its containing objects will uniquely represent that object in a form natural to the source language.
This would probably require us to have a DIE for modules. Not quite sure how we would approach that.
The producer may also generate a DW_AT_linkage_name attribute for program objects
We do that.
In many cases, however, it is expensive for a consumer to parse the hierarchy, and the presence of the mangled name may be beneficial to performance.
This might be the underlying reason why it shows mangled names for languages with unknown IDs (such as Haskell). We'll see whether Johan's query to the GDB team brings some light into that. Greetings, Peter Wortmann

I did get a language ID assigned a couple years ago, it should be in DWARF
5.
Accepted: DW_LANG_Haskell assigned value 0x18. -- April 18.2012
http://dwarfstd.org/ShowIssue.php?issue=120218.1
On Fri, Feb 28, 2014 at 7:34 AM, Johan Tibell
On Fri, Feb 28, 2014 at 3:15 PM, Peter Wortmann
wrote: Johan Tibell wrote:> Lets try to get our name standardized and pushed into GDB. It's
hopefully as simple as sending an email to the GDB devs.
Strictly speaking standardization is the job of the DWARF format committee, which seem to currently be in the process of specifying DWARF5[1]. Not quite sure we have a strong enough case, but if we wanted our own language ID these would probably be the right people to ask.
I just emailed the DWARF discussion mailing list to sort this out.
-- Johan
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Nathan Howell wrote:
I did get a language ID assigned a couple years ago, it should be in DWARF 5.
Accepted: DW_LANG_Haskell assigned value 0x18. -- April 18.2012
Nice work. We'll start using that one then :) Greetings, Peter Wortmann

On Mon, Mar 3, 2014 at 2:54 PM, Peter Wortmann
Nathan Howell wrote:
I did get a language ID assigned a couple years ago, it should be in DWARF 5.
Accepted: DW_LANG_Haskell assigned value 0x18. -- April 18.2012
Nice work. We'll start using that one then :)
Great! -- Johan
participants (5)
-
Austin Seipp
-
Johan Tibell
-
Nathan Howell
-
Peter Wortmann
-
Roman Cheplyaka