问题
I am trying to find a way to display the values in arrays in my ojective-C based iphone program, as described in my other question here
I am able to get the contents of an array in my program into the python interpreter while the iphone program is stopped at a break point inside a function (to be specific, the function is the render callback function for audio)
However, when I tried to plot the contents of the array (availabe as SBValueList in the Python interpreter) using matplotlib, the debug session simply crashed without any error messages
To try a simple example, once the program stopped at the breakpoint, I tried issuing a very simple matplotlib command as follows:
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
but the debug session suddenly crashes and exits at plt.plot([1,2,3,4])
Is it possible to display contents of array in lldb using matplotlib? Is there any other way to display the contents of my array a graph while debugging my iphone program?
回答1:
I'd consider taking a step back. If you can render your objective-c
array as a plot on UIView
or UIImage
you could view it while standing on a breakpoint with chisel
:
https://github.com/facebook/chisel
来源:https://stackoverflow.com/questions/53367537/using-matplotlib-in-iphone-lldb-obj-c