From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uAweNrIOKWHGXQAAWB0awg (envelope-from ) for ; Fri, 27 Aug 2021 12:11:30 -0400 Received: by simark.ca (Postfix, from userid 112) id DB7D81EE1B; Fri, 27 Aug 2021 12:11:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 66F5B1ECEB for ; Fri, 27 Aug 2021 12:11:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B9613858415 for ; Fri, 27 Aug 2021 16:11:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B9613858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630080684; bh=QGCRCHKkVMo1NBPmnOt7hQyAaDXNG19Y7Fd4oOluizw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eYSZnX5Tk1bPPmEywOcWa8SGjs/2csxnzh97cU8MjVoYIXZ8SuqYgtQTP+vyZZWAB dB3pIH0p4wYc64DWB2CsCKD1g0ueWgQq8y0rNX5g11ht1pbn0b0MIcMBFbLa6BKBzg Fxqy9zlYAt7LYD3RxM3ehcU5VuKqMdM7qecQ09Sk= 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> 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-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: , From: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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