From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YbQqOVSjHWnn0xIAWB0awg (envelope-from ) for ; Wed, 19 Nov 2025 06:00:36 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y4V6uwNp; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E62BE1E08D; Wed, 19 Nov 2025 06:00:36 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7F7AC1E08D for ; Wed, 19 Nov 2025 06:00:36 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28D78384CBA1 for ; Wed, 19 Nov 2025 11:00:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28D78384CBA1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y4V6uwNp 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 932F2385275F for ; Wed, 19 Nov 2025 10:59:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 932F2385275F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 932F2385275F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763549950; cv=none; b=I66Se9TES/5gyl/vJQQXAixL+108woM60OiXJqxwcf+LChiuacI/s+mdqlaqqbY19SMv4J1ywDduTz8Dv8fmi1oJ8jwZI244NPx5paGh3j5e2pqQMmS9IFAD3Hw5NUJsDOOBn22459pEUIQlpxqRrulTPHTtqOU/rULJXa658wQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763549950; c=relaxed/simple; bh=mEGb1msvJr64lsJCmeMU5XURkLEvBe1cn3ueQ6rEw7k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TH7lrtQJuRZt9Ic6OJRk6I64j/6dmCpLbL9vbex+8f1M0aOuhsB3fiR5M5Y3zRoYWtWT2OBsbXJ19ZEG5g87PFDuthgy+j8pEgJCyfL0lE0sZHSxNBp55AcTd4ydpef5tIHy3zuyKZqROLUlkXYo4K2Nyg4JTgGZSA/0rEXSYSw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 932F2385275F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763549950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bA1n69OxyUcIUPbvp3+P9jmD1vjc63SvciEIIl/dsZg=; b=Y4V6uwNpGXokp0Ba/fowds0DDMGl7MjWnFwPhEg0xaa8QWqEAMQpsoaFWZLzTssCMBMzEd bEkt5GkuVW96wr0E5PDDadniy/OekujiWV4rA7QcFETVXqqE0YBsYJqUS4/TFCbu5XvNGY mqJlzxEzZPX84RVxT1y9W2x8LqZNT3M= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-414-FEvbyXW7PUyPwYK1ntO9lw-1; Wed, 19 Nov 2025 05:59:07 -0500 X-MC-Unique: FEvbyXW7PUyPwYK1ntO9lw-1 X-Mimecast-MFC-AGG-ID: FEvbyXW7PUyPwYK1ntO9lw_1763549946 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-429c5f1e9faso5198564f8f.3 for ; Wed, 19 Nov 2025 02:59:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763549945; x=1764154745; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bA1n69OxyUcIUPbvp3+P9jmD1vjc63SvciEIIl/dsZg=; b=eiQgODtA3uBw4HLFGCwd8DlURuKRJSTjEzvw0qg7BbMUA8jAfH7AzulEJs003RjrG0 r/2p0TZKqWGlY1BUZ7imYkpFRMXSSU/Eu3kq0ildEQ3H534CSVJpmlEBV/iK0QmuwKAQ jtXEd8FyqGrqRPr13iPUgmKRofQfH9SFKE5L5LW/nWehyUdwLaO1P6cXFlQPziiz0Ar6 4sbJlGeWG2+yfKJFUay9A4gEt+jJJ85/RgX1DxSanNjq8iyPpvrwLQLgJXiXgYxW+25K rkegzf/Z3up0778UO7ZBVBRVKbKB7yxyxXCZ3xpyvmQHufTQSineFHKAYJU5r9qyet4I 9LJQ== X-Forwarded-Encrypted: i=1; AJvYcCW1OnoXy+IZJkpcxKRi6ISwIU/cMbrJnVabvPa3adfw0tAxrt7TfAf5RVKieT2II/cLiu61dAGxz3KkPA==@sourceware.org X-Gm-Message-State: AOJu0Yy9uTiI3gKACdPBKQypDxuc+HqQZY1U2uS8mVCMkAAuTaFIoA57 t5mQ56Mvz2+7YOYTSl8a/g5dv8CrW1RN0vCLSwDlWoLMNdAJYEk376CcJ8wToq7sVfXvcIATnbl hKZDnm+A7gnRFO3APckN2x6GtkK/kJnLGIfrnxWh+IAL4+hdqiYZQZETVbpEc/Ztp5sW7880= X-Gm-Gg: ASbGnctUNeeQXapMPosbkSzNe7PE5I1AWFkh0UdO6NVK6/ywkkvF70zsC0F1ZPgGHcu 0ziOoq7bo9j8cSjHVr7X3oJE+fsuNrn6FRTx2Vt00KeSPGYHv+HLR/CxyrCpZz458CCuts2HkTp hmHhoVRCQ2+AaF+joK/9u4TzB0/67E9IbOpdfwzvUWYA4kNVDWmTCya9vtIIpCNJk4Ymrj68bGl PiymODVvaq2JxUuWG1UXq41+YNst3/OlexvIO6k6OuuUT7s2vV3ATd/uNSvIkZd+/QZ4YovOKYS X5UkbH8uw/psJWaCDPPOovxYvJzEwcOBrY82sEu/UsvAZZL41hTkOX8JIFjndSYXTSrLwoluBQw nyQz6 X-Received: by 2002:a05:6000:40cc:b0:42b:2c53:3abc with SMTP id ffacd0b85a97d-42b593414d2mr19388509f8f.19.1763549945620; Wed, 19 Nov 2025 02:59:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVwjywxdxHlNFL40KCREFKadWStg1PDruLprT1CGYvcBuys5l1CpEGSQmhk1kdSg04DaXvUw== X-Received: by 2002:a05:6000:40cc:b0:42b:2c53:3abc with SMTP id ffacd0b85a97d-42b593414d2mr19388457f8f.19.1763549944777; Wed, 19 Nov 2025 02:59:04 -0800 (PST) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e85cc0sm38418287f8f.17.2025.11.19.02.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 02:59:04 -0800 (PST) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 2/6] gdb/testsuite/dwarf: convert _section proc to use parse_options In-Reply-To: <20251107211041.520697-3-simon.marchi@efficios.com> References: <20251107211041.520697-1-simon.marchi@efficios.com> <20251107211041.520697-3-simon.marchi@efficios.com> Date: Wed, 19 Nov 2025 10:59:03 +0000 Message-ID: <87pl9ethjc.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: x_VgjES3MkHk_xQuVHxiWVVPqDkSAclW9oqXNSI0yAc_1763549946 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Simon Marchi writes: > From: Simon Marchi > > The following patch will add more options to the _section proc, so > convert it to use options, to be more user-friendly. LGTM. Approved-By: Andrew Burgess Thanks, Andrew > > Change-Id: I971e4e10e55d63af2a5e29dc5e1d00f368b3ecaa > --- > gdb/testsuite/lib/dwarf.exp | 45 +++++++++++++++++++++++++++---------- > 1 file changed, 33 insertions(+), 12 deletions(-) > > diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp > index 919e2e05687f..5536b7656b8c 100644 > --- a/gdb/testsuite/lib/dwarf.exp > +++ b/gdb/testsuite/lib/dwarf.exp > @@ -1071,17 +1071,33 @@ namespace eval Dwarf { > } > } > > - proc _section {name {flags ""} {type ""}} { > - if {$name == ".debug_str"} { > - # Hard-code this because it's always desirable. > - _emit " .section $name, \"MS\", %progbits, 1" > - } elseif {$flags == "" && $type == ""} { > - _emit " .section $name" > - } elseif {$type == ""} { > - _emit " .section $name, \"$flags\"" > - } else { > - _emit " .section $name, \"$flags\", %$type" > + proc _section {name {options {}}} { > + parse_options { > + { flags "" } > + { type "" } > } > + > + set directive ".section $name" > + > + if { $name == ".debug_str" } { > + # Hard-code this because it's always desirable. > + append directive ", \"MS\", %progbits, 1" > + } > + > + if { $flags != "" } { > + append directive ",\"$flags\"" > + } > + > + if { $type != "" } { > + # Can't specify a type without flags. > + if { $flags == "" } { > + append directive ", \"\"" > + } > + > + append directive ", %$type" > + } > + > + _emit " $directive" > } > > # SECTION_SPEC is a list of arguments to _section. > @@ -3173,7 +3189,10 @@ namespace eval Dwarf { > > # Emit a note section holding the given build-id. > proc build_id {buildid} { > - _defer_output {.note.gnu.build-id a note} { > + _defer_output {.note.gnu.build-id { > + flags a > + type note > + }} { > # From elf/common.h. > set NT_GNU_BUILD_ID 3 > > @@ -3607,7 +3626,9 @@ namespace eval Dwarf { > > _write_deferred_output > > - _section .note.GNU-stack "" progbits > + _section .note.GNU-stack { > + type progbits > + } > > if { $file_id == "" } { > catch {close $_output_file} > -- > 2.51.2