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 ESMTP id EB11F3858C60 for ; Fri, 27 Aug 2021 16:11:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB11F3858C60 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-AX6IKyeaNJ2ASKkjdfYVCg-1; Fri, 27 Aug 2021 12:11:02 -0400 X-MC-Unique: AX6IKyeaNJ2ASKkjdfYVCg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2305A1083E81; Fri, 27 Aug 2021 16:11:01 +0000 (UTC) Received: from [10.3.114.222] (ovpn-114-222.phx2.redhat.com [10.3.114.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6F6510074E1; Fri, 27 Aug 2021 16:11:00 +0000 (UTC) Subject: Re: [PATCH][gdb/testsuite] Support .debug_aranges in dwarf assembly To: Simon Marchi , Tom Tromey , Tom de Vries via Gdb-patches References: <20210826115625.GA22715@delia> <87eeafovsa.fsf@tromey.com> <40b7d95e-cc02-38c7-5406-0fc83a2a1b28@polymtl.ca> From: Keith Seitz Message-ID: <6e2cdfcb-f667-a7ad-b314-0c100a7984ed@redhat.com> Date: Fri, 27 Aug 2021 09:11:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <40b7d95e-cc02-38c7-5406-0fc83a2a1b28@polymtl.ca> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 27 Aug 2021 16:11:05 -0000 On 8/27/21 8:09 AM, Simon Marchi via Gdb-patches wrote: > > > On 2021-08-27 9:35 a.m., Tom Tromey wrote: >>>>>>> "Tom" == Tom de Vries via Gdb-patches writes: >> >> Tom> + # arange [-c ] [] >> Tom> + # -- adds an address range. >> >> I wonder if there's a way to make this more tcl-ish, say by rearranging >> the order of arguments so that things can be defaulted. I think the >> "args"-parsing style should normally be a last resort. > > I personally don't like this style > > proc arange { arange_start arange_length {comment ""} {seg_sel ""} } > > ... because if you want to specify the last parameter, you need to give > all the other optional ones before. The test suite also contains the convenience proc parse_args which allows the use of optional arguments using flag-like syntax and default values. proc arange {start length args} { parse_args {{comment ""} {seg_sel ""}} # ... } arange $start $end -comment "a comment" See the definition in testsuite/lib/gdb.exp for usage examples. Keith