mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-22 21:08:08 -04:00
fix parseQEMUtoGDB.py to pass on interrupt messages correctly
This commit is contained in:
parent
0f394ba18b
commit
0a0956fad0
1 changed files with 5 additions and 7 deletions
|
@ -29,10 +29,14 @@ def printPC(l):
|
|||
|
||||
def printCSRs():
|
||||
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
||||
global interrupt_line
|
||||
if not inPageFault:
|
||||
for (csr,val) in CSRs.items():
|
||||
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):
|
||||
global parseState, inPageFault, CSRs, pageFaultCSRs, regs, pageFaultCSRs, instrs
|
||||
|
@ -119,15 +123,9 @@ for l in fileinput.input():
|
|||
break
|
||||
elif l.startswith('IN:'):
|
||||
# New disassembled instr
|
||||
if len(interrupt_line)>0:
|
||||
print(interrupt_line)
|
||||
interrupt_line=""
|
||||
parseState = "instr"
|
||||
elif (parseState == "instr") and l.startswith('0x'):
|
||||
# New instruction
|
||||
if len(interrupt_line)>0:
|
||||
print(interrupt_line)
|
||||
interrupt_line=""
|
||||
if "out of bounds" in l:
|
||||
sys.stderr.write("Detected QEMU page fault error\n")
|
||||
beginPageFault = not inPageFault
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue