From 5e64a5998dda2cf477265d9f7af6e6515d4cff86 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Tue, 5 Jun 2018 12:13:35 -0700 Subject: [PATCH 1/2] Make "try all threads" configurable --- fblldbbase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fblldbbase.py b/fblldbbase.py index 3a8f5b1..dae6897 100755 --- a/fblldbbase.py +++ b/fblldbbase.py @@ -56,7 +56,7 @@ def importModule(frame, module): # evaluates expression in Objective-C++ context, so it will work even for # Swift projects -def evaluateExpressionValue(expression, printErrors=True, language=lldb.eLanguageTypeObjC_plus_plus): +def evaluateExpressionValue(expression, printErrors=True, language=lldb.eLanguageTypeObjC_plus_plus, tryAllThreads=False): frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() options = lldb.SBExpressionOptions() options.SetLanguage(language) @@ -70,8 +70,8 @@ def evaluateExpressionValue(expression, printErrors=True, language=lldb.eLanguag # Give evaluation more time. options.SetTimeoutInMicroSeconds(5000000) # 5s - # Chisel commands are not multithreaded. - options.SetTryAllThreads(False) + # Most Chisel commands are not multithreaded. + options.SetTryAllThreads(tryAllThreads) value = frame.EvaluateExpression(expression, options) error = value.GetError() From cf46d7ab37a88764fd71f9eb6a124942f96a4eb5 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Tue, 5 Jun 2018 12:14:08 -0700 Subject: [PATCH 2/2] Try all threads when calling UIImagePNGRepresentation --- commands/FBVisualizationCommands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/FBVisualizationCommands.py b/commands/FBVisualizationCommands.py index 3948a31..542076f 100755 --- a/commands/FBVisualizationCommands.py +++ b/commands/FBVisualizationCommands.py @@ -34,7 +34,8 @@ def _showImage(commandForImage): else: raise - imageDataAddress = fb.evaluateObjectExpression('UIImagePNGRepresentation((id)' + commandForImage + ')') + toPNG = '(id)UIImagePNGRepresentation((id){})'.format(commandForImage) + imageDataAddress = fb.evaluateExpressionValue(toPNG, tryAllThreads=True).GetValue() imageBytesStartAddress = fb.evaluateExpression('(void *)[(id)' + imageDataAddress + ' bytes]') imageBytesLength = fb.evaluateExpression('(NSUInteger)[(id)' + imageDataAddress + ' length]')