From 780e9ceeb473c68f75c17a28e9e0cb08a3f05c02 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] test-gdb: ok, it actually works now and exits a failure, OMG I hate threads --- run-gdb | 3 +-- test-gdb | 18 +++--------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/run-gdb b/run-gdb index 164b8cb..35d8e3a 100755 --- a/run-gdb +++ b/run-gdb @@ -152,8 +152,7 @@ See: https://github.com/cirosantilli/linux-kernel-module-cheat#gdb-builtin-cpu-s allowed_toolchains = ['buildroot', 'crosstool-ng', 'host'] cmd = ( [self.get_toolchain_tool('gdb', allowed_toolchains=allowed_toolchains), LF] + - before + - ['-q', LF] + before ) if linux_full_system: cmd.extend(['-ex', 'add-auto-load-safe-path {}'.format(self.env['linux_build_dir']), LF]) diff --git a/test-gdb b/test-gdb index b3c49db..3c94bf1 100755 --- a/test-gdb +++ b/test-gdb @@ -6,16 +6,6 @@ import os import common -def output_reader(proc, file): - while True: - byte = proc.stdout.read(1) - if byte: - sys.stdout.buffer.write(byte) - sys.stdout.flush() - file.buffer.write(byte) - else: - break - class Main(common.LkmcCliFunction): def timed_main(self): run = self.import_path('run').Main() @@ -43,13 +33,11 @@ class Main(common.LkmcCliFunction): emulator=emulator, wait_gdb=True )) - gdb_thread = threading.Thread(target=lambda: run_gdb( - arch=arch, baremetal=test_script_noext, print_time=False, emulator=emulator, test=True - )) run_thread.start() - gdb_thread.start() + run_gdb( + arch=arch, baremetal=test_script_noext, print_time=False, emulator=emulator, test=True + ) run_thread.join() - gdb_thread.join() if __name__ == '__main__': Main().cli()