DynamoRIO / DynamoRIO/dynamorio

Support attach with a tool that uses its own launcher

Open
#5,480 1 comment 0 reactions 0 assignees View on GitHub
Component-Tools help wanted Hotlist-Release Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.