From 080f4e9d4d322c65ccbc61426eb41911f4097e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 22 Jan 2019 00:00:00 +0000 Subject: [PATCH] userland: show stdout again? --- baremetal/interactive/infinite_loop.c | 4 ++++ run | 7 ++----- test-gdb | 3 +++ test-user-mode | 6 +++++- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 baremetal/interactive/infinite_loop.c diff --git a/baremetal/interactive/infinite_loop.c b/baremetal/interactive/infinite_loop.c new file mode 100644 index 0000000..6aaced0 --- /dev/null +++ b/baremetal/interactive/infinite_loop.c @@ -0,0 +1,4 @@ +int main(void) { + while(1) {} + return 0; +} diff --git a/run b/run index 8d12c0c..3a6ce44 100755 --- a/run +++ b/run @@ -203,13 +203,12 @@ Run QEMU with VNC instead of the default SDL. Connect to it with: ) def timed_main(self): + show_stdout = True # Common qemu / gem5 logic. # nokaslr: # * https://unix.stackexchange.com/questions/397939/turning-off-kaslr-to-debug-linux-kernel-using-qemu-and-gdb # * https://stackoverflow.com/questions/44612822/unable-to-debug-kernel-with-qemu-gdb/49840927#49840927 # Turned on by default since v4.12 - raise_on_failure = True - show_stdout = True kernel_cli = 'console_msg_format=syslog nokaslr norandmaps panic=-1 printk.devkmsg=on printk.time=y rw' if self.env['kernel_cli'] is not None: kernel_cli += ' {}'.format(self.env['kernel_cli']) @@ -427,8 +426,6 @@ Run QEMU with VNC instead of the default SDL. Connect to it with: qemu_user_and_system_options + debug_args ) - show_stdout = False - raise_on_failure = False else: if not os.path.exists(self.env['image']): raise_image_not_found() @@ -600,7 +597,7 @@ Run QEMU with VNC instead of the default SDL. Connect to it with: cmd_file=self.env['run_cmd_file'], extra_env=extra_env, out_file=out_file, - raise_on_failure=raise_on_failure, + raise_on_failure=False, show_stdout=show_stdout, ) if exit_status == 0: diff --git a/test-gdb b/test-gdb index 2b28b93..42d40f3 100755 --- a/test-gdb +++ b/test-gdb @@ -43,7 +43,9 @@ found by searching for the Python test files. for test_script_noext in test_scripts_noext: common_args = self.get_common_args() common_args['baremetal'] = test_script_noext + test_id_string = self.test_setup(common_args, test_script_noext) + run_args = common_args.copy() run_args['wait_gdb'] = True run_args['background'] = True @@ -53,6 +55,7 @@ found by searching for the Python test files. gdb_args['test'] = True run_gdb(**gdb_args) run_thread.join() + self.test_teardown(run) if __name__ == '__main__': diff --git a/test-user-mode b/test-user-mode index e4c5b97..6150035 100755 --- a/test-user-mode +++ b/test-user-mode @@ -47,7 +47,11 @@ If given, run only the given tests. Otherwise, run all tests. ] else: arch_sources = [] - arch_sources[:] = [os.path.join('arch', self.env['arch'], arch_source) for arch_source in arch_sources] + arch_sources[:] = [ + os.path.join('arch', self.env['arch'], arch_source) + for arch_source + in arch_sources + ] sources.extend(arch_sources) else: sources = self.env['tests']