]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/dap] Flush after printing in log_stack
authorTom de Vries <tdevries@suse.de>
Wed, 21 Feb 2024 09:46:08 +0000 (10:46 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 21 Feb 2024 09:46:08 +0000 (10:46 +0100)
I noticed that function log flushes the dap log file after printing, but
that function log_stack doesn't.

Fix this by also flushing the dap log file in log_stack.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/lib/gdb/dap/startup.py

index daaeb28e997960df66d82040536b100031210e10..f20c54194c591e67fa7087259453647a8445f524 100644 (file)
@@ -178,6 +178,7 @@ def log_stack(level=LogLevel.DEFAULT):
     """Log a stack trace to the log file, if logging is enabled."""
     if dap_log.log_file is not None and level <= _log_level.value:
         traceback.print_exc(file=dap_log.log_file)
+        dap_log.log_file.flush()
 
 
 @in_gdb_thread