DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.62k stars 554 forks source link

add .drrun native frontend support #1329

Open derekbruening opened 9 years ago

derekbruening commented 9 years ago

From bruen...@google.com on November 27, 2013 13:31:32

For embedding tools that have their own front-ends, like Dr. Memory and drstrace, into the DR package ( https://code.google.com/p/drmemory/issues/detail?id=1056 ), we'd like to have .drrun files that will launch the native frontend tool and pass options to it.

Do we need option mapping?

drmemory.drrun32: add NATIVE_OPS=-dr ../../ DRRUN_OPS_MAP=-debug => -dr_debug DR_OPS_PARAM=-dr_ops ""

We shouldn't if we just don't support things like: bin32/drrun -debug -t drmemory <...>

And we force the user to say: bin32/drrun -debug -t drmemory -dr_debub

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1329

derekbruening commented 9 years ago

From bruen...@google.com on August 07, 2014 15:38:06

I went with this:

**\ TODO testing

Dr. Memory tool config file

FRONTEND_ABS=/work/drmemory/git/build_x86_dbg/bin/drmemory TOOL_OP=-dr TOOL_OP_DR_PATH TOOL_OP_DR_BUNDLE=-dr_ops

bin32/drrun -v -debug -disasm_mask 4 -stderr_mask 0 -t drmemory -v -light -- /work/dr/test/hello

INFO: reading tool config file /work/dr/git/build_x86_dbg/bin32/../tools/drmemory.drrun32 INFO: client 0 path: /work/dr/git/build_x86_dbg/ INFO: targeting application: "/work/dr/test/hello" INFO: app cmdline: "/work/dr/test/hello" INFO: native tool cmdline: "/work/drmemory/git/build_x86_dbg/bin/drmemory" "-dr" "/work/dr/git/build_x86_dbg/bin32/.." "-dr_ops" "-disasm_mask 4 -stderr_mask 0" "-v" "-light" "--" "/work/dr/test/hello" INFO: will exec /work/drmemory/git/build_x86_dbg/bin/drmemory INFO: targeting application: "/work/dr/test/hello" INFO: app cmdline: "/work/dr/test/hello" WARNING: using debug DynamoRIO since release not found INFO: logdir is "/work/drmemory/git/build_x86_dbg/logs" INFO: symcache_dir is "/work/drmemory/git/build_x86_dbg/logs/symcache" INFO: configuring hello pid=25274 dr_ops="-disable_traces -bb_single_restore_prefix -max_bb_instrs 256 -vm_size 256M -no_enable_reset -no_early_inject -disasm_mask 4 -stderr_mask 0 -logdir /work/drmemory/git/build_x86_dbg/logs/dynamorio " INFO: configuring client "/work/drmemory/git/build_x86_dbg/bin/debug/libdrmemorylib.so" ops="-light -logdir /work/drmemory/git/build_x86_dbg/logs -symcache_dir /work/drmemory/git/build_x86_dbg/logs/symcache -resfile 25274 " Dr.M Dr. Memory version 1.6.2004 Hello world! Goodbye world! Dr.M Dr.M NO ERRORS FOUND: Dr.M 0 unique, 0 total unaddressable access(es) Dr.M 0 unique, 0 total invalid heap argument(s) Dr.M 0 unique, 0 total warning(s) Dr.M ERRORS IGNORED: Dr.M Details: /work/drmemory/git/build_x86_dbg/logs/DrMemory-hello.25274.000/results.txt

Windows:

Dr. Memory tool config file

FRONTEND_ABS=d:/derek/drmemory/git/build_x86_dbg/bin/drmemory.exe TOOL_OP=-dr TOOL_OP_DR_PATH TOOL_OP_DR_BUNDLE=-dr_ops

% bin32/drrun -v -debug -disasm_mask 4 -stderr_mask 0 -t drmemory -v -light -batch -- d:/derek/dr/test/hello.exe INFO: reading tool config file D:\derek\dr\git\build_x86_dbg/tools/drmemory.drrun32 INFO: client 0 path: INFO: targeting application: "d:\derek\dr\test\hello.exe" INFO: app cmdline: "d:/derek/dr/test/hello.exe" INFO: native tool cmdline: "d:/derek/drmemory/git/build_x86_dbg/bin/drmemory.exe" "-dr" "D:\derek\dr\git\build_x86_dbg" "-dr_ops" "-disasm_mask 4 -stderr_mask 0" "-v" "-light" "-batch" "--" "d:/derek/dr/test/hello.exe" INFO: created child with pid 11632 for d:/derek/drmemory/git/build_x86_dbg/bin/drmemory.exe INFO: waiting forever for app to exit... INFO: targeting application: "d:\derek\dr\test\hello.exe" INFO: app cmdline: "d:/derek/dr/test/hello.exe" WARNING: using debug DynamoRIO since release not found INFO: logdir is "d:\derek\drmemory\git\build_x86_dbg\logs" INFO: symcache_dir is "d:\derek\drmemory\git\build_x86_dbg\logs\symcache" INFO: using symbol path d:/derek/symbols as the local store INFO: using symbol path srvd:/derek/symbols http://msdl.microsoft.com/download/symbols to fetch symbols INFO: configuring hello.exe pid=20064 dr_ops="-disable_traces -bb_single_restore_prefix -max_bb_instrs 256 -vm_size 256M -no_enable_reset -no_early_inject -disasm_mask 4 -stderr_mask 0 -msgbox_mask 0 -logdir d:\derek\drmemory\git\build_x86_dbg\logs\dynamorio " INFO: configuring client "d:\derek\drmemory\git\build_x86_dbg\bin\debug\drmemorylib.dll" ops="-light -logdir d:\derek\drmemory\git\build_x86_dbg\logs -symcache_dir d:\derek\drmemory\git\build_x86_dbg\logs\symcache -lib_blacklist C:\Windows*.d?? -resfile 20064 " INFO: waiting for app to exit... Dr.M Dr. Memory version 1.6.2002 Dr.M Running "d:/derek/dr/test/hello.exe" Hello world! Goodbye world! Dr.M Dr.M NO ERRORS FOUND: Dr.M 0 unique, 0 total unaddressable access(es) Dr.M 0 unique, 0 total invalid heap argument(s) Dr.M 0 unique, 0 total GDI usage error(s) Dr.M 0 unique, 0 total warning(s) Dr.M ERRORS IGNORED: Dr.M Details: d:\derek\drmemory\git\build_x86_dbg\logs\DrMemory-hello.exe.20064.000\results.txt INFO: fetching symbols