[Git][ghc/ghc][wip/local-symbols-2] Enable -fexpose-all-symbols when debug level is set

Ben Gamari gitlab at gitlab.haskell.org
Wed Mar 18 20:31:58 UTC 2020



Ben Gamari pushed to branch wip/local-symbols-2 at Glasgow Haskell Compiler / GHC


Commits:
bd94eb01 by Ben Gamari at 2020-03-18T20:31:47Z
Enable -fexpose-all-symbols when debug level is set

- - - - -


2 changed files:

- compiler/GHC/Driver/Session.hs
- docs/users_guide/debug-info.rst


Changes:

=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -3915,8 +3915,7 @@ defaultFlags settings
       Opt_RPath,
       Opt_SharedImplib,
       Opt_SimplPreInlining,
-      Opt_VersionMacros,
-      Opt_ExposeAllSymbols
+      Opt_VersionMacros
     ]
 
     ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
@@ -4502,7 +4501,13 @@ setVerbosity :: Maybe Int -> DynP ()
 setVerbosity mb_n = upd (\dfs -> dfs{ verbosity = mb_n `orElse` 3 })
 
 setDebugLevel :: Maybe Int -> DynP ()
-setDebugLevel mb_n = upd (\dfs -> dfs{ debugLevel = mb_n `orElse` 2 })
+setDebugLevel mb_n =
+  upd (\dfs -> exposeSyms $ dfs{ debugLevel = n })
+  where
+    n = mb_n `orElse` 2
+    exposeSyms
+      | n > 0     = setGeneralFlag' Opt_ExposeAllSymbols
+      | otherwise = id
 
 data PkgDbRef
   = GlobalPkgDb


=====================================
docs/users_guide/debug-info.rst
=====================================
@@ -14,6 +14,7 @@ useable by most UNIX debugging tools.
     :category: debugging
 
     :since: 7.10, numeric levels since 8.0
+    :implies: :ghc-flag:`-fexpose-all-symbols`
 
     Emit debug information in object code. Currently only DWARF debug
     information is supported on x86-64 and i386. Currently debug levels 0



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/bd94eb01d1d1b9b0cb04126e9a29c6e7454bea90

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/bd94eb01d1d1b9b0cb04126e9a29c6e7454bea90
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200318/90a4226e/attachment-0001.html>


More information about the ghc-commits mailing list