mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
- Do not try to print nameless variable's info.
- Print a summary of breakpoints in the beginning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfe33c46aa
commit
a3722e67d9
@ -87,30 +87,40 @@ def print_vars (tag, vars, fname, line, file, frame, target, thread):
|
|||||||
bp_loc.SetEnabled(False);
|
bp_loc.SetEnabled(False);
|
||||||
|
|
||||||
for i in range(vars.GetSize()):
|
for i in range(vars.GetSize()):
|
||||||
file.write(tag)
|
v = vars.GetValueAtIndex(i)
|
||||||
file.write(fname)
|
if v.GetName() is not None:
|
||||||
file.write(':')
|
file.write(tag)
|
||||||
file.write(str(line))
|
file.write(fname)
|
||||||
file.write(' ')
|
file.write(':')
|
||||||
file.write(str(tid))
|
file.write(str(line))
|
||||||
file.write(':')
|
file.write(' ')
|
||||||
file.write(str(bid))
|
file.write(str(tid))
|
||||||
file.write(' ')
|
file.write(':')
|
||||||
v = vars.GetValueAtIndex(i)
|
file.write(str(bid))
|
||||||
file.write(v.GetName())
|
file.write(' ')
|
||||||
file.write(' ')
|
file.write(v.GetName())
|
||||||
AlreadyPrintedValues.clear()
|
file.write(' ')
|
||||||
print_var_value (v, file, frame)
|
AlreadyPrintedValues.clear()
|
||||||
file.write('\n')
|
print_var_value (v, file, frame)
|
||||||
|
file.write('\n')
|
||||||
|
|
||||||
# set_breakpoints - set breakpoints as listed in input file.
|
# 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")
|
f = open(breakpoint_filename, "r")
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for l in range(len(lines)):
|
for l in range(len(lines)):
|
||||||
c = lines[l].split()
|
c = lines[l].split()
|
||||||
# print "setting break point - ", c
|
# print "setting break point - ", c
|
||||||
bp = target.BreakpointCreateByLocation (str(c[0]), int(c[1]))
|
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()
|
f.close()
|
||||||
|
|
||||||
# stopeed_at_breakpoint - Return True if process is stopeed at a
|
# 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():
|
if target.IsValid():
|
||||||
#print "target is valid"
|
#print "target is valid"
|
||||||
set_breakpoints (target, sys.argv[2])
|
file=open(str(sys.argv[3]), 'w')
|
||||||
#main_bp = target.BreakpointCreateByLocation ("byval-alignment.c", 11)
|
set_breakpoints (target, sys.argv[2], file)
|
||||||
#main_bp2 = target.BreakpointCreateByLocation ("byval-alignment.c", 20)
|
|
||||||
|
|
||||||
##print main_bp
|
|
||||||
|
|
||||||
# Launch the process. Since we specified synchronous mode, we won't return
|
# Launch the process. Since we specified synchronous mode, we won't return
|
||||||
# from this function until we hit the breakpoint at main
|
# from this function until we hit the breakpoint at main
|
||||||
process = target.LaunchProcess ([''], [''], "/dev/stdout", 0, False)
|
process = target.LaunchProcess ([''], [''], "/dev/stdout", 0, False)
|
||||||
file=open(str(sys.argv[3]), 'w')
|
|
||||||
# Make sure the launch went ok
|
# Make sure the launch went ok
|
||||||
while stopped_at_breakpoint(process):
|
while stopped_at_breakpoint(process):
|
||||||
thread = process.GetThreadAtIndex (0)
|
thread = process.GetThreadAtIndex (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user