From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OGp2IzMJ0l/LOAAAWB0awg (envelope-from ) for ; Thu, 10 Dec 2020 06:40:35 -0500 Received: by simark.ca (Postfix, from userid 112) id 8EB691F0A9; Thu, 10 Dec 2020 06:40:35 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=DATE_IN_PAST_03_06, MAILING_LIST_MULTI,RDNS_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 10B6F1E99A for ; Thu, 10 Dec 2020 06:40:35 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9FEA383F876; Thu, 10 Dec 2020 11:40:34 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id CA1F63840C3D for ; Thu, 10 Dec 2020 11:40:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CA1F63840C3D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 14822AE47; Thu, 10 Dec 2020 11:40:30 +0000 (UTC) Subject: Re: [PATCH] gdb: print size of downloaded debuginfod binary To: Tom de Vries , Simon Marchi , gdb-patches@sourceware.org References: <6ad82f30-0ca3-8b19-2907-d71f0dfecafe@suse.cz> <2c28a403-a169-0dc3-9b64-58484237c8c2@suse.cz> <72061fbb-b480-04ce-ef4a-fe13a7266885@suse.de> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <03eafeba-e512-9b99-1b5e-62ecf490ea44@suse.cz> Date: Thu, 10 Dec 2020 09:26:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <72061fbb-b480-04ce-ef4a-fe13a7266885@suse.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 12/10/20 12:26 AM, Tom de Vries wrote: > On 12/9/20 11:51 AM, Martin Liška wrote: >> On 12/8/20 3:28 PM, Simon Marchi wrote: >>> On 2020-12-08 5:16 a.m., Martin Liška wrote: >>> Temporary breakpoint 1 at 0x406150: file >>>> /home/marxin/Programming/gcc/gcc/gcc-main.c, line 44. >>>> Starting program: /home/marxin/bin/gcc/bin/gcc >>>> Downloading 1.00 MB separate debug info for >>>> /lib64/ld-linux-x86-64.so.2...10%..20%..30%..40%..50%..60%..70%..80%..90%..100% >>>> >>>> Downloading 4.20 MB separate debug info for >>>> /lib64/libm.so.6...10%..20%..30%..40%..50%..60%..70%..80%..90%..100% >>>> Downloading 10.72 MB separate debug info for >>>> /lib64/libc.so.6...10%..20%..30%..40%..50% >>>> >>>> Thoughts? >>> >>> Could you make it so the percentage always gets written at the same >>> place, overwriting the  previous percentage written? >> >> Sure, implemented in the attached patch. >> > > Hi, > > I played around with this patch on openSUSE Tumbleweed and found two > problems: > - '\r' is not handled in fputs_maybe_filtered, so we run into > the pagination prompt after having printed just one downloading line > - when printing a downloading line longer than chars_per_line, > it will wrap, so the '\r' does not reset back to the actual start of > the line. The effect you see is that the download line is printed > over and over again, flooding the screen. > > This updated patch fixes both problems, the latter by printing the % > progress on its own line (which is cleared by a final '\r' after > reaching 100%, in order not to waste lines on this). Hi Tom. Thank you for the improvement, I like it. Martin > > Thanks, > - Tom >