From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26385 invoked by alias); 5 Mar 2014 15:16:11 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 26369 invoked by uid 89); 5 Mar 2014 15:16:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 05 Mar 2014 15:16:08 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 02EB811662B; Wed, 5 Mar 2014 10:16:07 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0Rzl9Bd42BEI; Wed, 5 Mar 2014 10:16:06 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A41AE1165CB; Wed, 5 Mar 2014 10:16:06 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 19020E08BE; Wed, 5 Mar 2014 07:16:09 -0800 (PST) Date: Wed, 05 Mar 2014 15:16:00 -0000 From: Joel Brobecker To: Peter Wortmann Cc: Johan Tibell , gdb Subject: Re: Making GDB recognize the Haskell DWARF source language ID Message-ID: <20140305151609.GP4860@adacore.com> References: <20140228163339.GC4860@adacore.com> <1393610228.3893.49.camel@cslin101.csunix.comp.leeds.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1393610228.3893.49.camel@cslin101.csunix.comp.leeds.ac.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-03/txt/msg00005.txt.bz2 > 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