Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !5154

i#2414 drcallstack: Add libunwind-based callstack walking

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i2414-libunwind into master Oct 11, 2021
  • Overview 43
  • Commits 17
  • Pipelines 0
  • Changes 27

Adds a new extension "drcallstack" which provides callstack walking facilities. This initial implementation adds a libunwind-based implementation and targets only Linux for now.

Adds an interface to walk one step at a time over callstack frames. The implementation converts the dr_mcontext_t into libunwind's context structure and invokes the libunwind step API.

Getting libunwind to work requires several steps:

  • Ignore libpthread exports when importing any symbol that does not start with "pthread". Otherwise libunwind crashes using __errno_location from libpthread instead of from libc. We add a warning when a private libpthread is loaded to help diagnose any other potential problems (xref #956).

  • Have dl_iterate_phdr operate on app libraries instead of private libraries. This is done with a new flag and logic in the redirection code, with the flag set for libraries named "libunwind*".

A statically-linked libunwind is not supported.

Updates drwrap to set the mcontext pc field to simplify usage.

Adds a test and documentation.

Adds a sample client showing how to use this library.

Issue: #2414, #956

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i2414-libunwind