Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to capture view hierarchy

Tags:

xcode9

Error: Unable to capture view hierarchy. Details: Log Title: Data source expression execution failure. Log Details: error evaluating expression “(id)[[(Class)objc_getClass("DBGTargetHub") sharedHub] performRequestWithRequestInBase64:@"YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QFwcIGxwdHh8gISIuLzAxMjM0Nz1BQkNEVSRudWxs0wkKCwwTGldOUy5rZXlzWk5TLm9iamVjdHNWJGNsYXNzpg0ODxAREoACgAOABIAFgAaAB6YUFRYXGBmACIAJgBOAD4AUgBWAFl8QG0RCR0hpZXJhcmNoeVJlcXVlc3RQcmlvcml0eV8QHERCR0hpZXJhcmNoeVJlcXVlc3RQcmVkaWNhdGVfEBdEQkdIaWVyYXJjaHlSZXF1ZXN0TmFtZV8QHkRCR0hpZXJhcmNoeVJlcXVlc3RTcGluUnVubG9vcF8QHURCR0hpZXJhcmNoeVJlcXVlc3RJZGVudGlmaWVyXxAXREJHSGllcmFyY2h5UmVxdWVzdFR5cGUQANMJCgsjKC2kJCUmJ4AKgAuADIANpCkXKyuADoAPgBCAEIASXxATc3RyaWN0ZXN0VmlzaWJpbGl0eV8QEWluY2x1ZGVMYXp5VmFsdWVzXxATZW51bVByb3ZpZGVyQ2xhc3Nlc18QFm9wdGlvbnNQcm92aWRlckNsYXNzZXMQAwjSCgs1NqCAEdI4OTo7WiRjbGFzc25hbWVYJGNsYXNzZXNXTlNBcnJheaI6PFhOU09iamVjdNI4OT4/XxATTlNNdXRhYmxlRGljdGlvbmFyeaM+QDxcTlNEaWN0aW9uYXJ5XxAPSW5pdGlhbCByZXF1ZXN0XxAkQ0U4OUY0RkItRkRGRS00RUNGLUIwNzctMUQyNDk1REMzMjRCEAHSODlARaJAPF8QD05TS2V5ZWRBcmNoaXZlctFISVRyb290gAEACAARABoAIwAtADIANwBRAFcAXgBmAHEAeAB/AIEAgwCFAIcAiQCLAJIAlACWAJgAmgCcAJ4AoAC+AN0A9wEYATgBUgFUAVsBYAFiAWQBZgFoAW0BbwFxAXMBdQF3AY0BoQG3AdAB0gHTAdgB2QHbAeAB6wH0AfwB/wIIAg0CIwInAjQCRgJtAm8CdAJ3AokCjAKRAAAAAAAAAgEAAAAAAAAASgAAAAAAAAAAAAAAAAAAApM="]”: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x0).

The process has been returned to the state before expression evaluation.

like image 334
MisterDeng Avatar asked Sep 29 '17 06:09

MisterDeng


1 Answers

You likely have a bug somewhere in the implementation of a framework override. At least it was the case for me: a forced unwrapping of an optional nil value. Since the debugger executes the above statement, I could not get a stack trace of where the problem had happened.

My idea was to emulate the debugger's statement in my code directly. Since you won't have access to DBGTargetHub's interface, I went with using the Objective-C runtime functions.

NSString *data = @"YnBsaXN0MDDUAQIDBA[...]";

Class DbgTargetHub = objc_getClass("DBGTargetHub");

SEL sel = sel_getUid("sharedHub");

id sharedHub = ((id(*)(id, SEL))objc_msgSend)(DbgTargetHub, sel);

sel = sel_getUid("performRequestWithRequestInBase64:");

id result = ((id(*)(id, SEL, NSString*))objc_msgSend)(sharedHub, sel, data);

I was able to generate a stack trace from this which I could use to locate my problem.

Would be interested to know if this helped anybody.

like image 160
bompf Avatar answered Sep 24 '22 01:09

bompf