Skip to content

Commit

Permalink
Merge pull request #244 from facebook/fix-visualize
Browse files Browse the repository at this point in the history
Fix issue with visualize
  • Loading branch information
kastiglione authored Jun 5, 2018
2 parents d0b4d2d + cf46d7a commit 365e758
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion commands/FBVisualizationCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]')

Expand Down
6 changes: 3 additions & 3 deletions fblldbbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 365e758

Please sign in to comment.