diff options
author | 2020-02-11 15:38:21 -0500 | |
---|---|---|
committer | 2022-03-29 12:13:38 +0200 | |
commit | abba1e82679a58a32a943cded58204d14a231ef6 (patch) | |
tree | 8d4f216631966c173b85f63f2d98d996f2518be4 | |
parent | 468de4021cff4005211bb0a440f8caeecbc723e7 (diff) | |
download | libimobiledevice-abba1e82679a58a32a943cded58204d14a231ef6.tar.gz libimobiledevice-abba1e82679a58a32a943cded58204d14a231ef6.tar.bz2 |
More fixes
-rw-r--r-- | tools/idevicedebug.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index c596213..ae6dd02 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c | |||
@@ -61,7 +61,7 @@ static void on_signal(int sig) | |||
61 | quit_flag++; | 61 | quit_flag++; |
62 | } | 62 | } |
63 | 63 | ||
64 | static void cancel_receive() | 64 | static int cancel_receive() |
65 | { | 65 | { |
66 | return quit_flag; | 66 | return quit_flag; |
67 | } | 67 | } |
@@ -130,9 +130,11 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client | |||
130 | } else if (r[0] == 'T') { | 130 | } else if (r[0] == 'T') { |
131 | /* thread stopped information */ | 131 | /* thread stopped information */ |
132 | log_debug("Thread stopped. Details:\n%s", r + 1); | 132 | log_debug("Thread stopped. Details:\n%s", r + 1); |
133 | /* "Thread stopped" seems to happen when assert() fails. Use bash convention where signals cause an exit status of 128 + signal */ | 133 | if (exit_status != NULL) { |
134 | *exit_status = 128 + SIGABRT; | 134 | /* "Thread stopped" seems to happen when assert() fails. Use bash convention where signals cause an exit status of 128 + signal */ |
135 | /* Break out of the loop. */ | 135 | *exit_status = 128 + SIGABRT; |
136 | } | ||
137 | /* Break out of the loop. */ | ||
136 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; | 138 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; |
137 | } else if (r[0] == 'E') { | 139 | } else if (r[0] == 'E') { |
138 | printf("ERROR: %s\n", r + 1); | 140 | printf("ERROR: %s\n", r + 1); |
@@ -141,8 +143,10 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client | |||
141 | debugserver_decode_string(r + 1, strlen(r) - 1, &o); | 143 | debugserver_decode_string(r + 1, strlen(r) - 1, &o); |
142 | if (o != NULL) { | 144 | if (o != NULL) { |
143 | printf("Exit %s: %u\n", (r[0] == 'W' ? "status" : "due to signal"), o[0]); | 145 | printf("Exit %s: %u\n", (r[0] == 'W' ? "status" : "due to signal"), o[0]); |
146 | if (exit_status != NULL) { | ||
144 | /* Use bash convention where signals cause an exit status of 128 + signal */ | 147 | /* Use bash convention where signals cause an exit status of 128 + signal */ |
145 | *exit_status = o[0] + (r[0] == 'W' ? 0 : 128); | 148 | *exit_status = o[0] + (r[0] == 'W' ? 0 : 128); |
149 | } | ||
146 | } else { | 150 | } else { |
147 | debug_info("Unable to decode exit status from %s", r); | 151 | debug_info("Unable to decode exit status from %s", r); |
148 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; | 152 | dres = DEBUGSERVER_E_UNKNOWN_ERROR; |