mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 20:44:26 +01:00
gem5: exit with error status on simulate() limit reached
This commit is contained in:
12
run
12
run
@@ -784,14 +784,18 @@ Extra options to append at the end of the emulator command line.
|
|||||||
gem5_panic_re = re.compile(b'--- BEGIN LIBC BACKTRACE ---$')
|
gem5_panic_re = re.compile(b'--- BEGIN LIBC BACKTRACE ---$')
|
||||||
line = None
|
line = None
|
||||||
for line in logfile:
|
for line in logfile:
|
||||||
|
line = line.rstrip()
|
||||||
if gem5_panic_re.search(line):
|
if gem5_panic_re.search(line):
|
||||||
exit_status = 1
|
exit_status = 1
|
||||||
if self.env['userland']:
|
last_line = line
|
||||||
if line is not None:
|
if last_line is not None:
|
||||||
last_line = line.rstrip()
|
if self.env['userland']:
|
||||||
match = re.search(b'Simulated exit code not 0! Exit code is (\d+)', last_line)
|
match = re.search(b'Simulated exit code not 0! Exit code is (\d+)', last_line)
|
||||||
if match:
|
if match is not None:
|
||||||
exit_status = int(match.group(1))
|
exit_status = int(match.group(1))
|
||||||
|
print(repr(last_line))
|
||||||
|
if re.search(b'Exiting @ tick \d+ because simulate\(\) limit reached', last_line) is not None:
|
||||||
|
exit_status = 1
|
||||||
if not self.env['userland']:
|
if not self.env['userland']:
|
||||||
if os.path.exists(self.env['guest_terminal_file']):
|
if os.path.exists(self.env['guest_terminal_file']):
|
||||||
with open(self.env['guest_terminal_file'], 'br') as logfile:
|
with open(self.env['guest_terminal_file'], 'br') as logfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user