mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +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,6 +87,8 @@ def print_vars (tag, vars, fname, line, file, frame, target, thread):
|
||||
bp_loc.SetEnabled(False);
|
||||
|
||||
for i in range(vars.GetSize()):
|
||||
v = vars.GetValueAtIndex(i)
|
||||
if v.GetName() is not None:
|
||||
file.write(tag)
|
||||
file.write(fname)
|
||||
file.write(':')
|
||||
@ -96,7 +98,6 @@ def print_vars (tag, vars, fname, line, file, frame, target, thread):
|
||||
file.write(':')
|
||||
file.write(str(bid))
|
||||
file.write(' ')
|
||||
v = vars.GetValueAtIndex(i)
|
||||
file.write(v.GetName())
|
||||
file.write(' ')
|
||||
AlreadyPrintedValues.clear()
|
||||
@ -104,13 +105,22 @@ def print_vars (tag, vars, fname, line, file, frame, target, thread):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user