summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/Dwarf.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nativeGen/Dwarf.hs')
-rw-r--r--compiler/nativeGen/Dwarf.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/nativeGen/Dwarf.hs b/compiler/nativeGen/Dwarf.hs
index 35ee9c90ab..116fc6e976 100644
--- a/compiler/nativeGen/Dwarf.hs
+++ b/compiler/nativeGen/Dwarf.hs
@@ -84,10 +84,20 @@ dwarfGen df modLoc us blocks = do
-- .aranges section: Information about the bounds of compilation units
let aranges = dwarfARangesSection $$
- pprDwarfARange (DwarfARange lowLabel highLabel unitU)
+ pprDwarfARanges (map mkDwarfARange procs) unitU
return (infoSct $$ abbrevSct $$ lineSct $$ frameSct $$ aranges, us'')
+-- | Build an address range entry for one proc.
+-- With split sections, each proc needs its own entry, since they may get
+-- scattered in the final binary. Without split sections, we could make a
+-- single arange based on the first/last proc.
+mkDwarfARange :: DebugBlock -> DwarfARange
+mkDwarfARange proc = DwarfARange start end
+ where
+ start = dblCLabel proc
+ end = mkAsmTempEndLabel start
+
-- | Header for a compilation unit, establishing global format
-- parameters
compileUnitHeader :: Unique -> SDoc