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

#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

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ---------------------------------------+---------------------------------- Changes (by tibbe): * cc: Tarrasch (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9894#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ---------------------------------------+---------------------------------- Comment (by tibbe): Peter tells me that I need to add {{{ GhcRtsHcOpts += -g GhcLibHcOpts += -g }}} at the bottom of mk/build.mk to get debug symbols working. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9894#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ---------------------------------------+---------------------------------- Comment (by Tarrasch): Indeed. I don't remember why, but I also found that I have {{{GhcStage2HcOpts += -g}}} in my mk/build.mk as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9894#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9894: Presence of DWARF debug symbols doesn't result in working backtraces in GDB ---------------------------------+-------------------------------------- Reporter: tibbe | Owner: scpmw Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10601 | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Changes (by thomie): * status: new => closed * resolution: => duplicate * related: => #10601 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9894#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9894: Presence of DWARF debug symbols doesn't result in working backtraces in GDB ---------------------------------+-------------------------------------- Reporter: tibbe | Owner: scpmw Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: duplicate | Keywords: DWARF Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10601 | Differential Rev(s): Wiki Page: | ---------------------------------+-------------------------------------- Changes (by bgamari): * keywords: => DWARF -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9894#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC