| Hi Michael, I have tried to reproduce your issue (BTW, which version of LLDB are you using? - I have tried with a revision of the code from yesterday). I have defined your script as a Python command using "command script add". In my case, there is no lockup, but the SBThread::StepOver() function appears to "over-step" and the test program terminates prematurely at the end of the stepping. The issue, which effectively does not occur when sleeping between the several calls, seems to be related to the StepOver() method itself. I have also tried changing the lldb.thread.StepOver() call with debugger.HandleCommand("thread step-over -m this-thread"), but doing so, the test program terminates and the thread gets deselected. If thread.StepOver() is replaced with some other operation that does not involve threading (I have used debugger.HandleCommand("frame variable") in my example), everything works as it should. I would bet the issue lies in stepping over itself, but I have never worked on ThreadPlans, so I leave it to someone who knows more about them. As per your second question, you may want to try the solution described here: http://stackoverflow.com/questions/230751/how-to-flush-output-of-python-print I have attached the Python script and test program used. |
#########################
import lldb
import sys
import os
import time
def StepOver(debugger, args, result, dict):
arg_split = args.split(" ")
print type(arg_split)
count = int(arg_split[0])
for i in range(0,count):
#lldb.thread.StepOver(lldb.eOnlyThisThread)
debugger.HandleCommand("fr var")
print "step<%d>"%i
time.sleep(.75)
def __lldb_init_module(debugger, session_dict):
debugger.HandleCommand("command script add -f script.StepOver mysto")
return None
##########################
programma.cpp
Description: Binary data
Sincerely, - Enrico Granata
On Nov 4, 2011, at 7:58 AM, michael wrote:
|
_______________________________________________ lldb-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
