Hadrian build with DWARF information doesn't contain as much debug information as I would expect

Matthew Pickering matthewtpickering at gmail.com
Sat May 2 22:08:18 UTC 2020


I followed the instructions on the wiki to enable debug symbols in my
build of GHC. (https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian#enabling-dwarf-debug-symbols)

So I added these flags to may hadrian.settings file

stage1.*.ghc.hs.opts += -g3
stage1.*.cabal.configure.opts += --disable-library-stripping
--disable-executable-stripping
stage1.ghc-bin.ghc.link.opts += -eventlog

The resulting executable has debug information in it for the
executable component but not for any of the libraries in including the
compiler library.

("../sysdeps/x86_64/start.S",Just 4414944,Just 4414987,139633489318136)
("init.c",Nothing,Nothing,139633489318136)
("../sysdeps/x86_64/crti.S",Nothing,Nothing,139633489318136)
("ghc/Main.hs",Just 4415312,Just 4615455,139633489318136)
("ghc/GHCi/Leak.hs",Just 4615480,Just 4623414,139633489318136)
("ghc/GHCi/UI.hs",Just 4623440,Just 5461990,139633489318136)
("ghc/GHCi/UI/Info.hs",Just 5461992,Just 5571230,139633489318136)
("ghc/GHCi/UI/Monad.hs",Just 5571232,Just 5679695,139633489318136)
("ghc/GHCi/UI/Tags.hs",Just 5679696,Just 5704775,139633489318136)
("ghc/GHCi/Util.hs",Just 24,Just 173,139633489318136)
("../sysdeps/x86_64/crtn.S",Nothing,Nothing,139633489318136)

I tried building a project with cabal and the resulting executable had
debug information for every file in the dependencies as well as the
main project.

So how do I convince hadrian to include the correct information? Is it
a bug in hadrian?

I checked the command line when building the library and `-g3` is passed.

Cheers,

Matt


More information about the ghc-devs mailing list