@@ -717,7 +717,8 @@ _tmain(int argc, TCHAR *targv[])
717
717
#endif
718
718
719
719
drfront_status_t sc ;
720
- bool res ;
720
+ IF_NOT_X64 (bool res ;)
721
+ dr_config_status_t status ;
721
722
722
723
if (dr_standalone_init () == NULL ) {
723
724
/* We assume this is due to a new version of Windows */
@@ -1068,11 +1069,10 @@ _tmain(int argc, TCHAR *targv[])
1068
1069
if (i < argc )
1069
1070
usage ("%s" , "-nudge does not take an app to run" );
1070
1071
/* could also complain about other client or app specific ops */
1071
- res = dr_nudge_pid (nudge_pid , DRMEM_CLIENT_ID , NUDGE_LEAK_SCAN , INFINITE );
1072
- if (res != DR_SUCCESS ) {
1073
- fatal ("error nudging %d%s" , nudge_pid ,
1074
- (res == DR_NUDGE_PID_NOT_INJECTED ) ? ": no such Dr. Memory process"
1075
- : "" );
1072
+ status = dr_nudge_pid (nudge_pid , DRMEM_CLIENT_ID , NUDGE_LEAK_SCAN , INFINITE );
1073
+ if (status != DR_SUCCESS ) {
1074
+ const char * err_msg = dr_config_status_code_to_string (status );
1075
+ fatal ("error nudging %d, error code %d (%s)" , nudge_pid , status , err_msg );
1076
1076
assert (false); /* shouldn't get here */
1077
1077
}
1078
1078
exit (0 );
@@ -1301,17 +1301,27 @@ _tmain(int argc, TCHAR *targv[])
1301
1301
* this-pid config will override
1302
1302
*/
1303
1303
info ("configuring %s pid=%d dr_ops=\"%s\"" , process , pid , dr_ops );
1304
- if (dr_register_process (process , pid ,
1305
- false/*local*/ , dr_root , DR_MODE_CODE_MANIPULATION ,
1306
- use_dr_debug , DR_PLATFORM_DEFAULT , dr_ops ) != DR_SUCCESS ) {
1307
- fatal ("failed to register DynamoRIO configuration" );
1304
+ status = dr_register_process (process , pid ,
1305
+ false/*local*/ , dr_root , DR_MODE_CODE_MANIPULATION ,
1306
+ use_dr_debug , DR_PLATFORM_DEFAULT , dr_ops );
1307
+ if (status != DR_SUCCESS ) {
1308
+ const char * err_msg = dr_config_status_code_to_string (status );
1309
+ fatal ("failed to register DynamoRIO configuration for \"%s\"(%d) "
1310
+ "dr_ops=\"%s\".\n"
1311
+ "Error code %d (%s)" ,
1312
+ process , pid , dr_ops , status , err_msg );
1308
1313
goto error ; /* actually won't get here */
1309
1314
}
1310
1315
info ("configuring client \"%s\" ops=\"%s\"" , client_path , client_ops );
1311
- if (dr_register_client (process , pid ,
1312
- false/*local*/ , DR_PLATFORM_DEFAULT , DRMEM_CLIENT_ID ,
1313
- 0 , client_path , client_ops ) != DR_SUCCESS ) {
1314
- fatal ("failed to register DynamoRIO client configuration" );
1316
+ status = dr_register_client (process , pid ,
1317
+ false/*local*/ , DR_PLATFORM_DEFAULT , DRMEM_CLIENT_ID ,
1318
+ 0 , client_path , client_ops );
1319
+ if (status != DR_SUCCESS ) {
1320
+ const char * err_msg = dr_config_status_code_to_string (status );
1321
+ fatal ("failed to register DynamoRIO client configuration for \"%s\","
1322
+ " ops=\"%s\"\n"
1323
+ "Error code %d (%s)" ,
1324
+ client_path , client_ops , status , err_msg );
1315
1325
goto error ; /* actually won't get here */
1316
1326
}
1317
1327
0 commit comments