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
  • Issues
  • #5480
Closed
Open
Issue created May 03, 2022 by Derek Bruening@derekbrueningContributor

Support attach with a tool that uses its own launcher

Attach with a tool config file that simply points at a client lib works:

$ bin64/drrun -v -attach $(pgrep bc) -t drcov

However, a tool config file that provides its own launcher does not work and is misleading as it will do nothing:

$ bin64/drrun -v -attach $(pgrep bc) -t drcachesim -offline -verbose 1
INFO: reading tool config file /home/bruening/dr/git/build_x64_dbg_tests/bin64/../tools/drcachesim.drrun64
INFO: client 0 path: /home/bruening/dr/git/build_x64_dbg_tests/bin64/../clients/lib64/debug/libdrmemtrace.so
INFO: client 1 path: /home/bruening/dr/git/build_x64_dbg_tests/bin64/../clients/lib32/debug/libdrmemtrace.so
INFO: app cmdline: /home/bruening/dr/git/build_x64_dbg_tests/bin64/..
INFO: native tool cmdline:  "/home/bruening/dr/git/build_x64_dbg_tests/bin64/../clients/bin64/drcachesim" "-dr" "/home/bruening/dr/git/build_x64_dbg_tests/bin64/.." "-dr_ops" "" "-tracer" "/home/bruening/dr/git/build_x64_dbg_tests/bin64/../clients/lib64/debug/libdrmemtrace.so" "-tracer_alt" "/home/bruening/dr/git/build_x64_dbg_tests/bin64/../clients/lib32/debug/libdrmemtrace.so" "-dr_debug" "-offline" "-verbose" "1" "--"
INFO: debug build directory detected: switching to debug build
INFO: configuration directory is "/home/bruening/.dynamorio"
INFO: using ptrace to inject
INFO: waiting forever for app to exit...

For offline the drcachesim launcher is not needed so this is a workaround for offline drmemtrace:

$ bin64/drrun -v -attach $(pgrep bc) -c clients/lib64/debug/libdrmemtrace.so -offline -verbose 1

But for online drcachesim, or for Dr. Memory, or other cases where the launcher is required: how to support attach? Each launcher has to include code to use dr_inject_prepare_to_ptrace, dr_inject_prepare_to_attach, dr_inject_process_attach, or whatnot, duplicating whatever drrun is doing?

Assignee
Assign to
Time tracking