mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
userland: show stdout again?
This commit is contained in:
4
baremetal/interactive/infinite_loop.c
Normal file
4
baremetal/interactive/infinite_loop.c
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
int main(void) {
|
||||||
|
while(1) {}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
7
run
7
run
@@ -203,13 +203,12 @@ Run QEMU with VNC instead of the default SDL. Connect to it with:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def timed_main(self):
|
def timed_main(self):
|
||||||
|
show_stdout = True
|
||||||
# Common qemu / gem5 logic.
|
# Common qemu / gem5 logic.
|
||||||
# nokaslr:
|
# nokaslr:
|
||||||
# * https://unix.stackexchange.com/questions/397939/turning-off-kaslr-to-debug-linux-kernel-using-qemu-and-gdb
|
# * 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
|
# * https://stackoverflow.com/questions/44612822/unable-to-debug-kernel-with-qemu-gdb/49840927#49840927
|
||||||
# Turned on by default since v4.12
|
# 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'
|
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:
|
if self.env['kernel_cli'] is not None:
|
||||||
kernel_cli += ' {}'.format(self.env['kernel_cli'])
|
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 +
|
qemu_user_and_system_options +
|
||||||
debug_args
|
debug_args
|
||||||
)
|
)
|
||||||
show_stdout = False
|
|
||||||
raise_on_failure = False
|
|
||||||
else:
|
else:
|
||||||
if not os.path.exists(self.env['image']):
|
if not os.path.exists(self.env['image']):
|
||||||
raise_image_not_found()
|
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'],
|
cmd_file=self.env['run_cmd_file'],
|
||||||
extra_env=extra_env,
|
extra_env=extra_env,
|
||||||
out_file=out_file,
|
out_file=out_file,
|
||||||
raise_on_failure=raise_on_failure,
|
raise_on_failure=False,
|
||||||
show_stdout=show_stdout,
|
show_stdout=show_stdout,
|
||||||
)
|
)
|
||||||
if exit_status == 0:
|
if exit_status == 0:
|
||||||
|
|||||||
3
test-gdb
3
test-gdb
@@ -43,7 +43,9 @@ found by searching for the Python test files.
|
|||||||
for test_script_noext in test_scripts_noext:
|
for test_script_noext in test_scripts_noext:
|
||||||
common_args = self.get_common_args()
|
common_args = self.get_common_args()
|
||||||
common_args['baremetal'] = test_script_noext
|
common_args['baremetal'] = test_script_noext
|
||||||
|
|
||||||
test_id_string = self.test_setup(common_args, test_script_noext)
|
test_id_string = self.test_setup(common_args, test_script_noext)
|
||||||
|
|
||||||
run_args = common_args.copy()
|
run_args = common_args.copy()
|
||||||
run_args['wait_gdb'] = True
|
run_args['wait_gdb'] = True
|
||||||
run_args['background'] = True
|
run_args['background'] = True
|
||||||
@@ -53,6 +55,7 @@ found by searching for the Python test files.
|
|||||||
gdb_args['test'] = True
|
gdb_args['test'] = True
|
||||||
run_gdb(**gdb_args)
|
run_gdb(**gdb_args)
|
||||||
run_thread.join()
|
run_thread.join()
|
||||||
|
|
||||||
self.test_teardown(run)
|
self.test_teardown(run)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -47,7 +47,11 @@ If given, run only the given tests. Otherwise, run all tests.
|
|||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
arch_sources = []
|
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)
|
sources.extend(arch_sources)
|
||||||
else:
|
else:
|
||||||
sources = self.env['tests']
|
sources = self.env['tests']
|
||||||
|
|||||||
Reference in New Issue
Block a user