public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/dap] Flush after printing in log_stack
Date: Wed, 21 Feb 2024 09:46:25 +0000 (GMT)	[thread overview]
Message-ID: <20240221094626.884A43858CDA@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=84a227694d7b97bb4d09786dcfcc3d7c0ca16d4f

commit 84a227694d7b97bb4d09786dcfcc3d7c0ca16d4f
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Feb 21 10:46:08 2024 +0100

    [gdb/dap] Flush after printing in log_stack
    
    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>

Diff:
---
 gdb/python/lib/gdb/dap/startup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/python/lib/gdb/dap/startup.py b/gdb/python/lib/gdb/dap/startup.py
index daaeb28e997..f20c54194c5 100644
--- a/gdb/python/lib/gdb/dap/startup.py
+++ b/gdb/python/lib/gdb/dap/startup.py
@@ -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

                 reply	other threads:[~2024-02-21  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240221094626.884A43858CDA@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).