summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 16:17:09 +0200
committerGravatar Nikias Bassen2012-07-17 16:17:09 +0200
commitbc4e8ec23a60e6936497826f29cbed39da4f964b (patch)
treeb425a209a4c3c410e096a62cf6947aae494a3c94
parent94743be00fb0b66bb093210d091f17c5ac51d678 (diff)
downloadidevicerestore-bc4e8ec23a60e6936497826f29cbed39da4f964b.tar.gz
idevicerestore-bc4e8ec23a60e6936497826f29cbed39da4f964b.tar.bz2
restore: Query and output saved debug information in restore mode
This includes USB and panic logs if available and last restore exit status.
-rw-r--r--src/restore.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c
index 367e73e..77b658e 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1389,6 +1389,34 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
plist_free(info);
}
+ restore_error = restored_query_value(restore, "SavedDebugInfo", &info);
+ if (restore_error == RESTORE_E_SUCCESS) {
+ char* sval = NULL;
+
+ node = plist_dict_get_item(info, "PreviousExitStatus");
+ if (node && plist_get_node_type(node) == PLIST_STRING) {
+ plist_get_string_val(node, &sval);
+ info("Previous restore exit status: %s\n", sval);
+ free(sval);
+ sval = NULL;
+ }
+
+ node = plist_dict_get_item(info, "USBLog");
+ if (node && plist_get_node_type(node) == PLIST_STRING) {
+ plist_get_string_val(node, &sval);
+ info("USB log is available:\n%s\n", sval);
+ sval = NULL;
+ }
+
+ node = plist_dict_get_item(info, "PanicLog");
+ if (node && plist_get_node_type(node) == PLIST_STRING) {
+ plist_get_string_val(node, &sval);
+ info("Panic log is available:\n%s\n", sval);
+ sval = NULL;
+ }
+ plist_free(info);
+ }
+
plist_t opts = plist_new_dict();
// FIXME: required?
//plist_dict_insert_item(opts, "AuthInstallRestoreBehavior", plist_new_string("Erase"));