diff --git a/run b/run index 26e5eb8..8b33987 100755 --- a/run +++ b/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 ---$') line = None for line in logfile: + line = line.rstrip() if gem5_panic_re.search(line): exit_status = 1 - if self.env['userland']: - if line is not None: - last_line = line.rstrip() + last_line = line + if last_line is not None: + if self.env['userland']: 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)) + 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 os.path.exists(self.env['guest_terminal_file']): with open(self.env['guest_terminal_file'], 'br') as logfile: