- Do not try to print nameless variable's info.

- Print a summary of breakpoints in the beginning.

llvm-svn: 124308
This commit is contained in:
Devang Patel 2011-01-26 19:14:14 +00:00
parent bab5e6ed0e
commit 1c7bd7f481
1 changed files with 28 additions and 22 deletions

View File

@ -87,30 +87,40 @@ def print_vars (tag, vars, fname, line, file, frame, target, thread):
bp_loc.SetEnabled(False);
for i in range(vars.GetSize()):
file.write(tag)
file.write(fname)
file.write(':')
file.write(str(line))
file.write(' ')
file.write(str(tid))
file.write(':')
file.write(str(bid))
file.write(' ')
v = vars.GetValueAtIndex(i)
file.write(v.GetName())
file.write(' ')
AlreadyPrintedValues.clear()
print_var_value (v, file, frame)
file.write('\n')
v = vars.GetValueAtIndex(i)
if v.GetName() is not None:
file.write(tag)
file.write(fname)
file.write(':')
file.write(str(line))
file.write(' ')
file.write(str(tid))
file.write(':')
file.write(str(bid))
file.write(' ')
file.write(v.GetName())
file.write(' ')
AlreadyPrintedValues.clear()
print_var_value (v, file, frame)
file.write('\n')
# set_breakpoints - set breakpoints as listed in input file.
def set_breakpoints (target, breakpoint_filename):
def set_breakpoints (target, breakpoint_filename, file):
f = open(breakpoint_filename, "r")
lines = f.readlines()
for l in range(len(lines)):
c = lines[l].split()
# print "setting break point - ", c
bp = target.BreakpointCreateByLocation (str(c[0]), int(c[1]))
file.write("#Breakpoint ")
file.write(str(c[0]))
file.write(':')
file.write(str(c[1]))
file.write(' ')
file.write(str(bp.GetThreadID()))
file.write(':')
file.write(str(bp.GetID()))
file.write('\n')
f.close()
# stopeed_at_breakpoint - Return True if process is stopeed at a
@ -139,16 +149,12 @@ target = debugger.CreateTargetWithFileAndArch (sys.argv[1], lldb.LLDB_ARCH_DEFAU
if target.IsValid():
#print "target is valid"
set_breakpoints (target, sys.argv[2])
#main_bp = target.BreakpointCreateByLocation ("byval-alignment.c", 11)
#main_bp2 = target.BreakpointCreateByLocation ("byval-alignment.c", 20)
##print main_bp
file=open(str(sys.argv[3]), 'w')
set_breakpoints (target, sys.argv[2], file)
# Launch the process. Since we specified synchronous mode, we won't return
# from this function until we hit the breakpoint at main
process = target.LaunchProcess ([''], [''], "/dev/stdout", 0, False)
file=open(str(sys.argv[3]), 'w')
# Make sure the launch went ok
while stopped_at_breakpoint(process):
thread = process.GetThreadAtIndex (0)