[GHC] #9894: Presence of DWARF debug symbols doesn't result in working backtraces in GDB

GHC ghc-devs at haskell.org
Wed Dec 17 13:11:40 UTC 2014


#9894: Presence of DWARF debug symbols doesn't result in working backtraces in GDB
----------------------------------+---------------------------------------
       Reporter:  tibbe           |                   Owner:  scpmw
           Type:  bug             |                  Status:  new
       Priority:  normal          |               Milestone:
      Component:  Compiler        |                 Version:  7.9
       Keywords:                  |        Operating System:  Linux
   Architecture:  x86_64 (amd64)  |         Type of failure:  None/Unknown
     Difficulty:  Unknown         |               Test Case:
     Blocked By:                  |                Blocking:
Related Tickets:                  |  Differential Revisions:
----------------------------------+---------------------------------------
 Now when GHC can output DWARF debug symbols we need to take the remaining
 steps needed to get downstream tool like GDB to do something useful with
 it. As of today GDB cannot produce a valid stack trace for this code:

 {{{#!hs
 module Main where

 import System.IO

 f name = print $ "Hello, " ++ name
 {-# NOINLINE f #-}

 g name = f name
 {-# NOINLINE g #-}

 main = do
     name <- getLine
     g name
 }}}

 when a breakpoint is set on the line that defines `f` before the program
 is run. The resulting backtrace looks like:

 {{{
 (gdb) bt
 #0  Main_f_info () at /tmp/Test.hs:5
 #1  0x0000000000481a00 in ?? ()
 Backtrace stopped: frame did not save the PC
 }}}

 This bug tracks the remaining work that needs to be done before this will
 work.

 Peter, what is the remaining work here?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9894>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list