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.133.124]) by sourceware.org (Postfix) with ESMTPS id 7A5513858D32 for ; Sat, 11 Feb 2023 02:02:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A5513858D32 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=1676080954; 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=Cg28MhTkybIX2nfJJNriF6lxxBjeXL+GrVciEHPPb8M=; b=J1UD9s+4k4zOOBAKgN4MK+j3O6x3mk/LQunRHXit7mTzzWPi3zF3HtIhCU8LzQqYhSTCcr Hqht+spka8TdxNw/pDj9pp2/MJk3N25s128TcsX5DB0GzT/PZrHrvmM78XCzlewzRgm1Id GOCh6zTS/7ALcBieE0b7KE0uRcweBxc= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-640-nSEs8wNCOjWQohIk9hMx-Q-1; Fri, 10 Feb 2023 21:02:33 -0500 X-MC-Unique: nSEs8wNCOjWQohIk9hMx-Q-1 Received: by mail-pf1-f197.google.com with SMTP id z30-20020a056a001d9e00b005a6f861fa20so3474608pfw.3 for ; Fri, 10 Feb 2023 18:02:32 -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=Cg28MhTkybIX2nfJJNriF6lxxBjeXL+GrVciEHPPb8M=; b=1pfV/nUDjx8v105asb6Zt6boi0d+oDs9mxOawVdHJRbBww46BuM7nxB/yObs1pTf9H TGuOhtsRQMspMJK4lPiaD7XvLhpIaTMPFwkvkhlKFnv8CAPlbzQLA4CvyfH08LCC2cJV aFZIcdvgKGaWVMcACMug4ABNX1WTXZIJWowMo3nETXWLXBUT7QESic9zpkEXjP//dYct YbJ7b8FvUM2NghHm7A6FOy5nJurUKju6kd3Uv9Euaix4XSRCZa9oj/VLeE9JEH7/E725 hXYW0i18f3EH572w7zw9Aat+6oEj4fjp3EaiZ/sZRztvXi2I7b8F5vroPQn7FNAETlM1 js0A== X-Gm-Message-State: AO0yUKUQ4Whotwr7nDR2XA0u4rp7RN0lR8z9+q6XX9enmxfKE6n45TsN Z96DR4VurgyFR3SKeMwwrAJDT838F0LpXqrSlKXbcNZj0x9YzIJN0iNu6P4pHCHUz30U4CKFt1/ HnuTF0J/4BaiosiEgJHy+v4uL8Bw6/wdqmVMQJhAxGmYruXI= X-Received: by 2002:a17:90a:3b07:b0:233:23b9:dd5c with SMTP id d7-20020a17090a3b0700b0023323b9dd5cmr1350475pjc.48.1676080951500; Fri, 10 Feb 2023 18:02:31 -0800 (PST) X-Google-Smtp-Source: AK7set+3DnrAOp+FFtZB6CWTWQewBGWdK/gVLo8rVIXBkb0nb0nVbmoGsMWf8RqCdasEgXS4rzlxTZJfaba7+8BWdkw= X-Received: by 2002:a17:90a:3b07:b0:233:23b9:dd5c with SMTP id d7-20020a17090a3b0700b0023323b9dd5cmr1350473pjc.48.1676080951142; Fri, 10 Feb 2023 18:02:31 -0800 (PST) MIME-Version: 1.0 References: <20230128040601.2927632-1-amerey@redhat.com> <87a622itys.fsf@tromey.com> <87edran5qf.fsf@tromey.com> <87a61omd35.fsf@tromey.com> In-Reply-To: <87a61omd35.fsf@tromey.com> From: Aaron Merey Date: Fri, 10 Feb 2023 21:02:19 -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.0 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 Wed, Feb 8, 2023 at 9:44 AM Tom Tromey wrote: > It occurred to me last night that this could be a subtle change > introduced by the pager rewrite. > > Before, disabling pagination also disabled line splitting, and took an > earlier exit. > > But now, if pagination is disabled for some output, those lines still > "count" towards the total. So then when pagination is no longer > disabled, a print might cause the pager to intervene. > > Is this what's happening in your case? If so, I'm not totally sure it > is a bug. Normally disabling paging should be done because using the > pager isn't safe or appropriate at some point in time. But having those > lines still "count" seems alright, maybe even useful. Yes pagination_enabled=false prevents prompt_for_continue but lines_printed still increments for each newline printed. Like you said, this prompt shouldn't show up around debuginfod progress output since most downloads happen under fetch_inferior_event which disables pagination until it returns. The reproducer I previously mentioned On Mon, Jan 30, 2023 at 9:09 PM Aaron Merey wrote: > gdb -ex 'set height 25' -ex 'start' qemu-kvm triggers the prompt during a download occurring right before 'start' begins running the inferior and pagination isn't disabled by fetch_inferior_event. I don't think this particular case is too much of a problem because there are only a few downloads that can happen before the rest occur under fetch_inferior_event. So the prompt will only show up at the start if gdb's height is unusually small, in which case you can expect regular prompts anyways. However the on-demand downloading work creates new situations where a large series of downloads might happen outside fetch_inferior_event. For example, "break client.c:50" could download the .debug_line and .debug_line_str of each shared library to search for the filename "client.c". Then it downloads debuginfo for each match, all of which happens outside of fetch_inferior_event. Setting pagination_enabled=false in debuginfod_*_query prevents the prompt durings the downloads but lines_printed keeps increasing. If lines_allowed is exceeded then after the download you get an (IMO) annoying prompt: (gdb) break client.c:50 [...] Downloading separate debug info for /lib64/libabc.so Downloading separate debug info for /lib64/libxyz.so --Type for more, q to quit, c to continue without paging-- Breakpoint 1 at 0xcf525d: client.c:50. (2 locations) (gdb) Adding a count_lines_printed flag gives us another way to fine-tune when the prompt shows up. It keeps prompt behavior around debuginfod output consistent whether or not the inferior is running. Aaron