From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 6CEA23851C32 for ; Tue, 28 Apr 2020 15:17:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CEA23851C32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 2B1041F068; Tue, 28 Apr 2020 11:17:27 -0400 (EDT) Subject: Re: [PATCH v2][PR gdb/17320] Fix array pretty formatter To: Hannes Domani , gdb-patches@sourceware.org References: <20200427125900.5587-1-ssbssa.ref@yahoo.de> <20200427125900.5587-1-ssbssa@yahoo.de> From: Simon Marchi Message-ID: <86e4c9c8-77bc-00c0-526c-b2974e15d7b9@simark.ca> Date: Tue, 28 Apr 2020 11:17:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200427125900.5587-1-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 28 Apr 2020 15:17:29 -0000 On 2020-04-27 8:59 a.m., Hannes Domani via Gdb-patches wrote: > Currently, printing with array pretty formatting makes the output actually > less readable than without: > > (gdb) p -array on -- {{1,2,3},{4,5,6}} > $1 = { {1, > 2, > 3}, > {4, > 5, > 6}} > (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}} > $2 = {[0] = {[0] = 1, > [1] = 2, > [2] = 3}, > [1] = {[0] = 4, > [1] = 5, > [2] = 6}} > > These changes now also put the first element and the array end bracket on a new > line, similar to the structure pretty formatter: > > (gdb) p -array on -- {{1,2,3},{4,5,6}} > $1 = { > { > 1, > 2, > 3 > }, > { > 4, > 5, > 6 > } > } > (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}} > $2 = { > [0] = { > [0] = 1, > [1] = 2, > [2] = 3 > }, > [1] = { > [0] = 4, > [1] = 5, > [2] = 6 > } > } Thanks for providing a test case, this is ok. Simon