I'm having some trouble getting
cdb to start a program under DynamoRIO. My command line in msys looks like this (line breaks added to make it readable):
/wkits/8.0/Debuggers/x64/cdb.exe
-cf /dev/crowd-safe-dynamo-rio/build/break-on-entry.cdb
/dev/crowd-safe-dynamo-rio/build/bin64/drinject.exe
/dev/crowd-safe-dynamo-rio/build/lib64/debug/dynamorio.dll
"/bin/ls.exe"
The script break-on-entry.cdb contains:
.reload dynamorio.dll=15000000
$></dev/crowd-safe-dynamo-rio/tools/windbg-scripts/load_syms64
There are two problems:
1. Somehow my dynamorio.dll is not acceptable to cdb. The error message is strange because it mentions "Win32", even though it is the x64 build of cdb. The response to the first "g" command is:
ERROR: Failed to create process for "C:\dev\crowd-safe-dynamo-rio\build\lib64\debug\dynamorio.dll": %1 is not a valid Win32 application.
ntdll!ZwTerminateProcess+0xa:
2. The $DYNAMORIO_HOME/tools/load_syms64 script is causing an error:
0:000> $></dev/crowd-safe-dynamo-rio/tools/windbg-scripts/load_syms64
Memory access error at ') & 0xfffff000);;$$ Check magic values to avoid executing random command w/o DynamoRIO;.if (dwo(@$t1) = b1d2ae58) {; .if (dwo(@$t1 +
4) = ca50c356) {; .if (dwo(@$t1 + 8) = 63000089) {; .if (dwo(@$t1 + c) = 3fa898f0) {; aS /c ${/v:loadpriv} .printf "%ma", @$t1
+ 40; .block { ${loadpriv} }; ad ${/v:loadpriv}; } .else {; .echo "DynamoRIO not detected"; }; } .else {; .echo "DynamoRIO not detected"; }; } .else {; .echo "DynamoRIO not detected"; };} .else {; .echo "DynamoRIO not detected";};'
The environment here is Windows 7 64-bit on a 64-bit Intel processor, with all commands executed from msys on the x64 cdb. It looks like cdb is handling the msys paths ok, since it will complain about file not found if I give an incorrect path in the same format.
So far I've tried several variations of these commands, but I keep getting the exact same errors. Please let me know if anyone is familiar with windows debugging and can see what might be wrong here. Thanks.
Byron