From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42874 invoked by alias); 26 Nov 2019 12:49:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 42866 invoked by uid 89); 26 Nov 2019 12:49:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail4.protonmail.ch Received: from mail4.protonmail.ch (HELO mail4.protonmail.ch) (185.70.40.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2019 12:49:13 +0000 Date: Tue, 26 Nov 2019 12:49:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gdcproject.org; s=protonmail; t=1574772550; bh=H/Pk3Rv598eV2sGQGQjUOF97HJJ4onN3DeJsWRKIvLA=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=2zsWr9eLRqdhY0X8EYY5qgSBmoas4/ltIA08wX2RhviAqhQLS3WEJ0v7mxT+Kp/pV BTZYK/o1l9SktXvhPkcRTnJLFRX+fc9gbd9ojpCn1fZBwe94F8Ibx68ntiGAVeP7ig 5y4OkkkD/BVw+i6htfcG4ahsBzKRrBa5T64qHsAk= To: "gdb-patches@sourceware.org" From: Iain Buclaw Reply-To: Iain Buclaw Subject: [PATCH] gdb: Use puts_unfiltered instead of printf_unfiltered Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_326439c278bbaf7047fb51bae5793965" X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00859.txt.bz2 This is a multi-part message in MIME format. --b1_326439c278bbaf7047fb51bae5793965 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1806 Hi, This patch fixes a regression, possibly introduced by 2a3c1174c3c0db1140180= fb3fc56ac324d1c0a7c, in this part of the change: --- @@ -2064,13 +2096,13 @@ vfprintf_unfiltered (struct ui_file *stream, const = char *format, va_list args) fputs_unfiltered (timestamp.c_str (), stream); } else - fputs_unfiltered (linebuffer.c_str (), stream); + vfprintf_maybe_filtered (stream, format, args, false, true); } void vprintf_filtered (const char *format, va_list args) --- The significance of this is that printf_unfiltered writes messages to wrap_= buffer, whereas puts_unfiltered pushes them immediately to stdout, resultin= g in "post-" messages being printed out of order. Not sure about how to go about testing this, looking at the testsuite, such= as gdb.base/annota1.exp, everything appears to be in order. Perhaps this = is because the testsuite triggers one of these conditions in fputs_maybe_fi= ltered() though. --- if (stream !=3D gdb_stdout || !pagination_enabled || pagination_disabled_for_command || batch_flag || (lines_per_page =3D=3D UINT_MAX && chars_per_line =3D=3D UINT_MAX) || top_level_interpreter () =3D=3D NULL || top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ()) --- However, the actual observed behaviour in gdb is: --- Reading symbols from a.out... (gdb) set annotate 2 \032\032pre-prompt (gdb) \032\032prompt start prompt\032\032post- Temporary breakpoint 1 at 0x13716: file test.c, line 3. --- With this patch applied, instead "\032\032post-prompt" is printed. I think this can be applied as obvious, but wanted to have someone else hav= e a quick check, just in case it would be preferred to change fputs_maybe_f= iltered instead to flush the buffer on scope exit for unfiltered messages. -- Iain --- --b1_326439c278bbaf7047fb51bae5793965 Content-Type: text/x-patch; name="postprompt.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=postprompt.patch Content-length: 903 Z2RiL0NoYW5nZUxvZzoKCjIwMTktMTEtMjYgIElhaW4gQnVjbGF3ICA8aWJ1 Y2xhd0BnZGNwcm9qZWN0Lm9yZz4KCgkqIGdkYi9ldmVudC10b3AuYyAoaGFu ZGxlX2xpbmVfb2ZfaW5wdXQpOiBVc2UgcHV0c191bmZpbHRlcmVkIGluc3Rl YWQKCW9mIHByaW50Zl91bmZpbHRlcmVkLgoKZGlmZiAtLWdpdCBhL2dkYi9l dmVudC10b3AuYyBiL2dkYi9ldmVudC10b3AuYwppbmRleCAwMzk2ZGJjYzUy Li5kZjZhNDA5NWZiIDEwMDY0NAotLS0gYS9nZGIvZXZlbnQtdG9wLmMKKysr IGIvZ2RiL2V2ZW50LXRvcC5jCkBAIC02NjMsOSArNjYzLDkgQEAgaGFuZGxl X2xpbmVfb2ZfaW5wdXQgKHN0cnVjdCBidWZmZXIgKmNtZF9saW5lX2J1ZmZl ciwKIAogICBpZiAoZnJvbV90dHkgJiYgYW5ub3RhdGlvbl9sZXZlbCA+IDEp CiAgICAgewotICAgICAgcHJpbnRmX3VuZmlsdGVyZWQgKCgiXG5cMDMyXDAz MnBvc3QtIikpOworICAgICAgcHV0c191bmZpbHRlcmVkICgiXG5cMDMyXDAz MnBvc3QtIik7CiAgICAgICBwdXRzX3VuZmlsdGVyZWQgKGFubm90YXRpb25f c3VmZml4KTsKLSAgICAgIHByaW50Zl91bmZpbHRlcmVkICgoIlxuIikpOwor ICAgICAgcHV0c191bmZpbHRlcmVkICgiXG4iKTsKICAgICB9CiAKICNkZWZp bmUgU0VSVkVSX0NPTU1BTkRfUFJFRklYICJzZXJ2ZXIgIgo= --b1_326439c278bbaf7047fb51bae5793965--