This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 0/1] Don't rewind PC for GHC generated frames
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Bartosz Nitka <niteria at gmail dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 12 Feb 2018 14:42:44 +0000
- Subject: Re: [PATCH v3 0/1] Don't rewind PC for GHC generated frames
- Authentication-results: sourceware.org; auth=none
- References: <20180204000647.19188-1-niteria@gmail.com> <CAH=s-PPFSafb123n2shgwQciRXO8rgUqoOszXyvMNYfP9R4aVA@mail.gmail.com> <CAOSxnRg+vkSvWw2gDzumpA5nrWSQgppQ1=kOvVeU_yYDpQWHwQ@mail.gmail.com>
On Mon, Feb 12, 2018 at 2:14 PM, Bartosz Nitka <niteria@gmail.com> wrote:
> 2018-02-12 13:50 GMT+00:00 Yao Qi <qiyaoltc@gmail.com>:
>
>> If what you meant is DW_LNS_set_column, then, other compilers
>> also generates it, and GDB doesn't use it.
>
> I'm not familiar with DW_LNS_set_column, perhaps GHC can be made to use it.
> The current encoding is described in [1]. Based on my experimentation [2] lldb
> seems to understand it. Note
> LineEntry: [0x00000000004056f7-0x0000000000405720):
> /data/users/bnitka/tmp/fib.hs:3:9
> there. The second number (9) is the column number.
GHC is completely new to me, so I don't understand the reason
DW_TAG_ghc_src_note was added to describe line/column. To me,
it is .debug_line's responsibility.
>
>> What do you want to add to GDB?
>
> Using the example from the summary. Currently gdb shows:
>
> (gdb) bt
> #0 Main_zdwfib_info () at fib.hs:3
> #1 Main_zdwfib_info () at fib.hs:4
> #2 Main_zdwfib_info () at fib.hs:4
> #3 Main_zdwfib_info () at fib.hs:4
>
> I'd like it to show something like:
>
> (gdb) bt
> #0 Main_zdwfib_info () at fib.hs:3:9
> #1 Main_zdwfib_info () at fib.hs:4:20
> #2 Main_zdwfib_info () at fib.hs:4:20
> #3 Main_zdwfib_info () at fib.hs:4:20
>
> Similarly, currently when you do:
>
> (gdb) info line *f1_info
> Line 4 of "fib.hs" starts at address...
>
> I'd like to get:
>
> Line 4, column 20 of "fib.hs" starts at address...
>
Yes, they are good improvements to GDB, IMO.
FAOD, it is good to me that we can show and use column
information in GDB. If the column information is from
DW_LNS_set_column, that is absolutely fine to me, because
DW_LNS_set_column is in standard dwarf spec. However,
if column information is from DW_TAG_ghc_src_note, we want
to support it, it should be discussed as "Haskell/GHC support in
GDB". It is great if you can describe the reason that
DW_TAG_ghc_src_note was invented rather than using existing
dwarf line program to describe line/column information.
--
Yao (齐尧)