1818
1919#include "jit.h"
2020
21- IdeviceFfiError * debug_proxy_send_command2 (struct DebugProxyHandle * handle , struct DebugserverCommandHandle * command , char * * response ) {
22- IdeviceFfiError * err = debug_proxy_send_command (handle , command , response );
23- if (err ) {
24- return err ;
25- }
26- for (int i = 0 ; i < 10 ; ++ i ) {
27- if (* response ) {
28- return err ;
29- }
30- debug_proxy_read_response (handle , response );
31- }
32- return err ;
33- }
34-
3521void runDebugServerCommand (int pid , DebugProxyHandle * debug_proxy , LogFuncC logger , DebugAppCallback callback ) {
3622 // enable QStartNoAckMode
3723 char * disableResponse = NULL ;
@@ -61,7 +47,7 @@ void runDebugServerCommand(int pid, DebugProxyHandle* debug_proxy, LogFuncC logg
6147 }
6248
6349 char * attach_response = NULL ;
64- err = debug_proxy_send_command2 (debug_proxy , attach_cmd , & attach_response );
50+ err = debug_proxy_send_command (debug_proxy , attach_cmd , & attach_response );
6551 debugserver_command_free (attach_cmd );
6652
6753 if (err ) {
@@ -79,11 +65,12 @@ void runDebugServerCommand(int pid, DebugProxyHandle* debug_proxy, LogFuncC logg
7965 logger ("Failed to create detach command" );
8066 } else {
8167 char * detach_response = NULL ;
82- err = debug_proxy_send_command2 (debug_proxy , detach_cmd , & detach_response );
68+ err = debug_proxy_send_command (debug_proxy , detach_cmd , & detach_response );
8369 debugserver_command_free (detach_cmd );
8470
8571 if (err ) {
86- logger ("Failed to detach from process: %d" , err );
72+ logger ("Failed to detach from process: %d" , err -> code );
73+ idevice_error_free (err );
8774 } else if (detach_response != NULL ) {
8875 logger ("Detach response: %s" , detach_response );
8976 idevice_string_free (detach_response );
0 commit comments