Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,398
    • Issues 5,398
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 592
    • Merge requests 592
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20702
Closed
Open
Issue created Nov 17, 2021 by Richard Eisenberg@raeDeveloper

Describe how to use GHC.ExecutionStack

I was recently inspired to give DWARF-powered stack traces a try. But I don't know how to proceed.

The manual page is very helpful, describing how to use -g to get debugging information put into binaries. Good. It even tells me about the extra step to take on macOS.

But the section on stack traces using GHC.ExecutionStack tells me that we need to satisfy "libdw library from the elfutils package is available". I don't quite know what "is available" means here. But on the NixOS system I'm working on, I do see that there exists a libdw.a.

Looking further, I see this in the Haddocks for GHC.ExecutionStack:

Your GHC must have been built with libdw support for this to work.

user@host:~$ ghc --info | grep libdw
 ,("RTS expects libdw",YES)

Indeed, running ghc --info | grep libdw tells be NO, so I'm hosed.

Question 1: how can I make that into YES?

Question 2: The manual page suggests that there is hope for success on macOS. But elfutils is not available for macOS. I did find dwarfutils in Homebrew, which installs libdwarf.a. Poking around online suggests that libdwarf.a and libdw.a basically accomplish the same goal, and may even be somewhat easily exchanged. Would it make sense to switch GHC to use libdwarf instead of libdw to gain more platform compatibility? (Maybe not: my brief searching suggests that libdw is generally the better option when it is available.) In any case, I'll settle for an answer to Question 1 for now, waiting to push on Question 2 until after I can experience the glory of DWARF stack traces for myself.

Thanks!

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking