diff options
| -rw-r--r-- | tools/idevicedebug.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index 36a4fa7..24cc46d 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c | |||
| @@ -149,24 +149,26 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client | |||
| 149 | 149 | ||
| 150 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; | 150 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; |
| 151 | } else if (r[0] == 'E' || r[0] == 'W') { | 151 | } else if (r[0] == 'E' || r[0] == 'W') { |
| 152 | debugserver_decode_string(r + 1, strlen(r) - 1, &o); | 152 | /* dogben: 'W' + hex-encoded byte seems to mean "process exited with this status." */ |
| 153 | /* dogben: 'W' + byte seems to mean "process exited with this status." */ | 153 | if (r[0] == 'W' && strlen(r) == 3 && exit_status != NULL) { |
| 154 | if (r[0] == 'W' && strlen(o) == 1) { | 154 | debugserver_decode_string(r + 1, strlen(r) - 1, &o); |
| 155 | printf("Exit status: %u\n", o[0]); | 155 | if (o != NULL) { |
| 156 | if (exit_status != NULL) { | 156 | printf("Exit status: %u\n", o[0]); |
| 157 | *exit_status = o[0]; | 157 | *exit_status = o[0]; |
| 158 | free(o); | ||
| 159 | o = NULL; | ||
| 160 | free(*response); | ||
| 161 | *response = NULL; | ||
| 162 | return dres; | ||
| 158 | } | 163 | } |
| 159 | } else { | ||
| 160 | printf("%s: %s\n", (r[0] == 'E' ? "ERROR": "WARNING") , o); | ||
| 161 | } | ||
| 162 | if (o != NULL) { | ||
| 163 | free(o); | ||
| 164 | o = NULL; | ||
| 165 | } | 164 | } |
| 165 | |||
| 166 | printf("%s: %s\n", (r[0] == 'E' ? "ERROR": "WARNING") , r + 1); | ||
| 167 | |||
| 166 | free(*response); | 168 | free(*response); |
| 167 | *response = NULL; | 169 | *response = NULL; |
| 168 | 170 | ||
| 169 | if (!send_reply || (exit_status != NULL && *exit_status >= 0)) | 171 | if (!send_reply) |
| 170 | return dres; | 172 | return dres; |
| 171 | 173 | ||
| 172 | /* send reply */ | 174 | /* send reply */ |
