[llvm-commits] [llvm] r124308 - /llvm/trunk/utils/CollectDebugInfoUsingLLDB.py
Devang Patel
dpatel at apple.com
Wed Jan 26 11:14:14 PST 2011
Author: dpatel
Date: Wed Jan 26 13:14:14 2011
New Revision: 124308
URL: http://llvm.org/viewvc/llvm-project?rev=124308&view=rev
Log:
- Do not try to print nameless variable's info.
- Print a summary of breakpoints in the beginning.
Modified:
llvm/trunk/utils/CollectDebugInfoUsingLLDB.py
Modified: llvm/trunk/utils/CollectDebugInfoUsingLLDB.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/CollectDebugInfoUsingLLDB.py?rev=124308&r1=124307&r2=124308&view=diff
==============================================================================
--- llvm/trunk/utils/CollectDebugInfoUsingLLDB.py (original)
+++ llvm/trunk/utils/CollectDebugInfoUsingLLDB.py Wed Jan 26 13:14:14 2011
@@ -87,30 +87,40 @@
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 @@
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)
More information about the llvm-commits
mailing list