Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Peter Wortmann <scpmw@leeds.ac.uk>
Cc: Johan Tibell <johan.tibell@gmail.com>, gdb <gdb@sourceware.org>
Subject: Re: Making GDB recognize the Haskell DWARF source language ID
Date: Wed, 05 Mar 2014 15:16:00 -0000	[thread overview]
Message-ID: <20140305151609.GP4860@adacore.com> (raw)
In-Reply-To: <1393610228.3893.49.camel@cslin101.csunix.comp.leeds.ac.uk>

> https://ghc.haskell.org/trac/ghc/ticket/3693#comment:44
> 
> Here's a (short) example session. There are actually two problems here:
> 
>   #2  0x00000000004047a0 in Main_zdwfibzuerr_info () at stack-trace.hs:7

Off the top of my head, you'll need to add a demangler as well.

> Wile we're at it, here's another issue we are struggling with:
> 
>   #1  0x0000000000694330 in ?? () at rts/Updates.cmm:57
> 
> What happens here is that 694330 gets derived correctly as the address
> to return to, but GDB actually seems to attempt to look up 69432f (= the
> address right in front) for display name and line number information.
> That might make sense for most compiled languages, but for GHC code, the
> space in front of return code pointers is an info table (= data). Hence
> GDB gets moderately confused when it can't find any information on it.
> 
> So far we essentially hack around this by applying a suitable "offset"
> to line data as well as unwind information. That's why we have a source
> code pointer, and the stack trace doesn't simply stop at that point. But
> that's a rather crude solution, so any ideas would be appreciated.

I'm not really sure in this case. The model seems odd - are you
returning outside of the function's code / block range, or do you
have data in the middle of your function code? Perhaps a language
hook to provide flexibility in the offset...

-- 
Joel


  reply	other threads:[~2014-03-05 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 15:47 Johan Tibell
2014-02-28 16:33 ` Joel Brobecker
2014-02-28 17:57   ` Peter Wortmann
2014-03-05 15:16     ` Joel Brobecker [this message]
2014-03-05 16:58       ` Johan Tibell
2014-03-05 18:06       ` Peter Wortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140305151609.GP4860@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=johan.tibell@gmail.com \
    --cc=scpmw@leeds.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox