summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/Dwarf.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-09-25 18:00:19 +0200
committerBen Gamari <ben@smart-cactus.org>2015-11-23 17:47:41 +0100
commit7aaeaf81ea95c36fe1dc4da449cf6092a792fd09 (patch)
tree79703e6d9db2f81507272d9efd1a5952b17c7924 /compiler/nativeGen/Dwarf.hs
parentbb249aa749c82590823855e970bcc1c4d4b23523 (diff)
downloadhaskell-7aaeaf81ea95c36fe1dc4da449cf6092a792fd09.tar.gz
Support multiple debug output levels
We now only strip block information from DebugBlocks when compiling with `-g1`, intended to be used when only minimal debug information is desired. `-g2` is assumed when `-g` is passed without any integer argument. Differential Revision: https://phabricator.haskell.org/D1281
Diffstat (limited to 'compiler/nativeGen/Dwarf.hs')
-rw-r--r--compiler/nativeGen/Dwarf.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/nativeGen/Dwarf.hs b/compiler/nativeGen/Dwarf.hs
index 6bf49f0e0d..3903dd9580 100644
--- a/compiler/nativeGen/Dwarf.hs
+++ b/compiler/nativeGen/Dwarf.hs
@@ -34,10 +34,11 @@ dwarfGen _ _ us [] = return (empty, us)
dwarfGen df modLoc us blocks = do
-- Convert debug data structures to DWARF info records
- -- We strip out block information, as it is not currently useful for
- -- anything. In future we might want to only do this for -g1.
+ -- We strip out block information when running with -g0 or -g1.
let procs = debugSplitProcs blocks
- stripBlocks dbg = dbg { dblBlocks = [] }
+ stripBlocks dbg
+ | debugLevel df < 2 = dbg { dblBlocks = [] }
+ | otherwise = dbg
compPath <- getCurrentDirectory
let lowLabel = dblCLabel $ head procs
highLabel = mkAsmTempEndLabel $ dblCLabel $ last procs