From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 040E83858D28 for ; Tue, 31 Jan 2023 02:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 040E83858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675131016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mCDaph3Jd6pKaG4LiUeBxHz4QWfyMUcZyUec45+FGzs=; b=FokSY2199saQBOSIwRaIMZHSBNaf6NHQRMwreBbtb1YQjwuseP5qjJiI7MtemMwMXIX5lt 7PXSK4SAOFRFV3Jt6zEl8eF5mME9Y6uu5TZXms6LITIu152rS3347oQTHDpk2kdj10oo/5 LX3hQPqdGYt40OcipzgvWGdKTwyH0k8= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-473-c2MI5EAgPqO9PPMTCGTxxA-1; Mon, 30 Jan 2023 21:10:09 -0500 X-MC-Unique: c2MI5EAgPqO9PPMTCGTxxA-1 Received: by mail-pg1-f198.google.com with SMTP id f132-20020a636a8a000000b00473d0b600ebso6099238pgc.14 for ; Mon, 30 Jan 2023 18:10:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mCDaph3Jd6pKaG4LiUeBxHz4QWfyMUcZyUec45+FGzs=; b=u0kye1r+YBq2QW6eWXJWwvltkQct5MIyHSN2iZaZedLmxBr1hmgYkhfXmggGNwY559 QncgMvoM9uvcOa49gaNttZU2C4DvoYbV7SycmqjVWS2lcp+xiIJk7sz+cTlOuD70qFeV n325EQVDcFuVz8wMyYTeRQCE6KNWEGY7vGDCS7VC+hDrhKaFWtVxET11HKOF99SgP13+ U5SAU3SyD8mYskhy04yNls0ATCY7KCwzR0+vOtzWtBr/AXKHnaHPj0x3D5Gd2YgYaGPJ +6TpyupqN0LmRzOebF4Zu6aXlXZwpPNnSprFQAvV14mCmiA9bcIh9ZlvGEHI+LJNcpAW p2Pw== X-Gm-Message-State: AO0yUKWudoqXwYK8C/DlutWf29JOLzv9Lttzw6rdvKNdnANGpgznPeyS c498Mopw9gC0VI9vTwJBCVGu0qCjqYulZssby7AGJD4P1rLtvOxx7aM8vXd2puAKsSqfOEWO6gk YR6FV4oFzhjZWFhiOqXFdWQt+G0J20KreN4c4 X-Received: by 2002:a17:90a:e60a:b0:22c:77a9:e0d1 with SMTP id j10-20020a17090ae60a00b0022c77a9e0d1mr1362229pjy.193.1675131008532; Mon, 30 Jan 2023 18:10:08 -0800 (PST) X-Google-Smtp-Source: AK7set891DqYr2cQ4FLlVOlQhybpv3q8V7HNRcBrxW2xJaD0EII15lKzt5LtZNJbTnq7XARQfZwdBMJObqPTR7tYFOs= X-Received: by 2002:a17:90a:e60a:b0:22c:77a9:e0d1 with SMTP id j10-20020a17090ae60a00b0022c77a9e0d1mr1362225pjy.193.1675131008171; Mon, 30 Jan 2023 18:10:08 -0800 (PST) MIME-Version: 1.0 References: <20230128040601.2927632-1-amerey@redhat.com> <87a622itys.fsf@tromey.com> In-Reply-To: <87a622itys.fsf@tromey.com> From: Aaron Merey Date: Mon, 30 Jan 2023 21:09:57 -0500 Message-ID: Subject: Re: [PATCH] gdb/debuginfod: Prevent prompt for continue during downloading. To: Tom Tromey Cc: Aaron Merey via Gdb-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Jan 28, 2023 at 10:01 AM Tom Tromey wrote: > >>>>> "Aaron" == Aaron Merey via Gdb-patches writes: > > Aaron> In some cases the prompt "--Type for more, q to quit, c to > Aaron> continue without paging--" can appear during a large series of > Aaron> debuginfod downloads when lines_printed exceeds lines_allowed. > > Aaron> This is inconvenient plus ctrl-c during this prompt could leave some > Aaron> of gdb's internal structures in a broken state. > > Aaron> Fix this by adding a bool count_lines_printed to control whether > Aaron> lines_printed is incremented when a newline is printed. Set this > Aaron> value to false when performing a download. > > There's already pagination_disabled for this. Or you can print to a > stream other than gdb_stdout. > > However, my question is why pagination is even enabled at the likely > spots where debuginfod might be called. I thought infrun generally > disabled it. I was able to get a prompt to show up with the command gdb -ex 'set height 25' -ex 'start' qemu-kvm Setting pagination_enabled to false does stop the prompt in this case, however during testing of the on-demand downloading feature that I'm working on [1] I saw cases where this still didn't prevent the prompt. For example 'list main.c:50' might trigger a number of downloads where debuginfod-related output increases lines_printed past the lines_allowed limit. When the source lines actually print, the prompt immediately shows up since pagination has been re-enabled and lines_allowed was exceeded. Adding a count_lines_printed toggle takes care of this case too. However I didn't realise that printing to a stream besides gdb_stdout should avoid this. I'll try to implement this fix using another stream. Aaron [1] https://sourceware.org/pipermail/gdb-patches/2022-November/193416.html