Skip to content

Presence of DWARF debug symbols doesn't result in working backtraces in GDB

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:

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?

Trac metadata
Trac field Value
Version 7.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information