From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id D328D3858C33 for ; Tue, 9 May 2023 18:18:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D328D3858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 016DF21C1B; Tue, 9 May 2023 18:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683656328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNG7M7cc2gkeMNhIaNU54rDQNh04BKB13fytN7/0TUc=; b=D3g3PBdda62708hVyETABzzSwtKGBGQiSSrtcxFXNfy6ZXXDmOM0ETq5belKfHZt6TnRsF qFxCqAascj5WyW/ng0BdZaXgVJEfmsX8hq1IuE6Hp/6GcZDF/wxcaGZw3/6IB8z8Sq4/1v srM6cZPc3L5LZBif0XdojdCInTPcpvQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683656328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNG7M7cc2gkeMNhIaNU54rDQNh04BKB13fytN7/0TUc=; b=bE+maWor9z5ritqvU3O0hf6bLJcguLWLFaWl3Xb8tL+pOqRUZPE0RAnBwUdb0Vfx4T0Aek uwpxtZoFVkgtNuBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BF298139B3; Tue, 9 May 2023 18:18:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TigIK4eOWmS1BwAAMHmgww (envelope-from ); Tue, 09 May 2023 18:18:47 +0000 Message-ID: Date: Tue, 9 May 2023 20:18:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] [gdb/tui] Fix tui compact-source To: gdb-patches@sourceware.org Cc: Tom Tromey References: <20230509174422.13362-1-tdevries@suse.de> Content-Language: en-US From: Tom de Vries In-Reply-To: <20230509174422.13362-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 5/9/23 19:44, Tom de Vries via Gdb-patches wrote: > The abbreviation is due to allocating space for , which is > 8 for this example, and takes a single digit. The line numbers though > continue past the end of the file, so fix this by allocating space for > max (, ), which is 21 in this example, and > takes 2 digits. Right after sending this, I found a bug in this fix. It's not the that matters, it's the . So, at the point that the we go from: ... |___09_ | |___10_ | +---------------------------+ ... to: ... |___8_} | |___9_ | +---------------------------+ ... the number of digits needed should drop from 2 to 1, and that was not the case. I've fixed this, updated the test-case and submitted a v2 ( https://sourceware.org/pipermail/gdb-patches/2023-May/199447.html ). Thanks, - Tom