mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
fix parseQEMUtoGDB.py to pass on interrupt messages correctly
This commit is contained in:
parent
241ec053e8
commit
95438fca0d
@ -29,10 +29,14 @@ def printPC(l):
|
|||||||
|
|
||||||
def printCSRs():
|
def printCSRs():
|
||||||
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
||||||
|
global interrupt_line
|
||||||
if not inPageFault:
|
if not inPageFault:
|
||||||
for (csr,val) in CSRs.items():
|
for (csr,val) in CSRs.items():
|
||||||
print('{}{}{:#x} {}'.format(csr, ' '*(15-len(csr)), val, val))
|
print('{}{}{:#x} {}'.format(csr, ' '*(15-len(csr)), val, val))
|
||||||
print('-----')
|
print('-----') # end of current instruction
|
||||||
|
if len(interrupt_line)>0: # squish interrupts in between instructions
|
||||||
|
print(interrupt_line)
|
||||||
|
interrupt_line=""
|
||||||
|
|
||||||
def parseCSRs(l):
|
def parseCSRs(l):
|
||||||
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
||||||
@ -119,15 +123,9 @@ for l in fileinput.input():
|
|||||||
break
|
break
|
||||||
elif l.startswith('IN:'):
|
elif l.startswith('IN:'):
|
||||||
# New disassembled instr
|
# New disassembled instr
|
||||||
if len(interrupt_line)>0:
|
|
||||||
print(interrupt_line)
|
|
||||||
interrupt_line=""
|
|
||||||
parseState = "instr"
|
parseState = "instr"
|
||||||
elif (parseState == "instr") and l.startswith('0x'):
|
elif (parseState == "instr") and l.startswith('0x'):
|
||||||
# New instruction
|
# New instruction
|
||||||
if len(interrupt_line)>0:
|
|
||||||
print(interrupt_line)
|
|
||||||
interrupt_line=""
|
|
||||||
if "out of bounds" in l:
|
if "out of bounds" in l:
|
||||||
sys.stderr.write("Detected QEMU page fault error\n")
|
sys.stderr.write("Detected QEMU page fault error\n")
|
||||||
beginPageFault = not inPageFault
|
beginPageFault = not inPageFault
|
||||||
|
Loading…
Reference in New Issue
Block a user