From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6w2CA4xlBWeIQgYAWB0awg (envelope-from ) for ; Tue, 08 Oct 2024 13:02:04 -0400 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=aaAPcByN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E72361E355; Tue, 8 Oct 2024 13:02:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.0 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 3DEFA1E05C for ; Tue, 8 Oct 2024 13:02:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94D76386182B for ; Tue, 8 Oct 2024 17:02:02 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 1B14B3858CDB for ; Tue, 8 Oct 2024 17:01:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B14B3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none 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 1B14B3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728406904; cv=none; b=lPlYu12X5BDaqDQnDx0btXuFAs47QrOXElhqWgDTOo6yKDHoKeyk6SPnnHP2EwQBfA6nbnptfgC3gcwCHmtztEMidrF+kNsOG2js5+Dg/0122eCJMlaUQnb3f4tFzY/bN16/cHF/iRcrYjWaai+X/xuyFRS1CVwl+uBEQHvkCXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728406904; c=relaxed/simple; bh=ybF3NInFW0rjzSfXBR515/tGI5vbOnhSPmOxtexuRQc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=a9w1VBW97p53zy0SFTRKys0JEMmKH2mz5D/iaBBfvKUH3r5wviY+fuy+2vvk742h9A5frzake/Pi296ygGC08bZg188SHSnDZJyshW8p5vy6pBEqVX2PfC4aTBThjuKWDS+BbnLh8M2+CZ6cX0i/YjE/BPU4Po5UkH3mqLvE+ro= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728406901; 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=eOl/ybEgbI0HTndCAa73eSDFYuvdygek+hpLI7zWRf0=; b=aaAPcByNruh3Yp+Yg6RgCEgNwM5yLFogsY6G5e+fffeIO3hKI/eB3LS+6VBYuOoFVrxVcd vdrEgd3cY71I6FhIMHu7WOWj5/5urNVjqVWNxidCItGwDjZnTDOvfjp1U9kt3nuy+DgUb7 vVOOTfui0hpHn58Z9gZlQrQK0Ar25wY= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-171-ukWYLGQ1Osy8B94ZMR8Wcw-1; Tue, 08 Oct 2024 13:01:40 -0400 X-MC-Unique: ukWYLGQ1Osy8B94ZMR8Wcw-1 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-82cf28c74efso684780339f.1 for ; Tue, 08 Oct 2024 10:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406899; x=1729011699; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=eOl/ybEgbI0HTndCAa73eSDFYuvdygek+hpLI7zWRf0=; b=Fv6CZhbc5OKbb4mxLCnLaaLtmDQNvZUX6gZIxLwnO0jPCofEoi+7ny70eYGi/ujUoI 2vc/W1Udjn1vt5K4/aYpZeu1lJ95LbErtW+8zsGllIQwTRwsGlpIgcZDno256SrUlTEM j3/lmFgYIl2EJBducWrj9YvfIWk7hTs70Zvylcf25dCrm0vuoeE1wze/ycFRnVbJcMNf z3wKNdJ4KQ6YKtxsudmOFLwkBqiA5YVziMAs++56XRJxZXTV1EUmzbrtohaauPNMCrK3 o3sE1LOiCmI8p49UbyEy+EVpcYta/B9ffggvs1HXb8ocv9YldmmfBnm5Um29S+v/+W5T Bx5w== X-Gm-Message-State: AOJu0YzOkJBC52is9LsVnVzTvN2I+36cnRRvnUFqfKyRAgYoaOtzktrt JOCQvUQ43ZaeITc6wV9rrMXaKg3mEf2kUzsmZ9Ey6zzedt93SsUjl3ua1wLkRaT4vhEY7nKyawa 06bCHxZy6giKspdHIt44yzQmNlWGx+tAKsQYiYVbRVoWLYOw4PeoUF6+njIEQfIKeA0E= X-Received: by 2002:a05:6602:6c13:b0:82c:f30d:fc9b with SMTP id ca18e2360f4ac-834f7d67dfdmr1390802639f.13.1728406896150; Tue, 08 Oct 2024 10:01:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFI6g21k43s0K9eBHwBG3GeJ60k4bJUzrLC8SyEtm0EfO0Lx3yjQI7DFw3EZTZlyUi8oOxNcQ== X-Received: by 2002:a05:6602:6c13:b0:82c:f30d:fc9b with SMTP id ca18e2360f4ac-834f7d67dfdmr1390772539f.13.1728406893975; Tue, 08 Oct 2024 10:01:33 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1000? ([2804:14d:8084:92c5::1000]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4db96fa668bsm383018173.152.2024.10.08.10.01.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2024 10:01:33 -0700 (PDT) Message-ID: Date: Tue, 8 Oct 2024 14:01:31 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/5] gdb: make gdbarch store a vector of frame unwinders To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org References: <20241001184235.3710608-1-guinevere@redhat.com> <20241001184235.3710608-2-guinevere@redhat.com> <87zfnmb2fp.fsf@linaro.org> From: Guinevere Larsen In-Reply-To: <87zfnmb2fp.fsf@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------ad5aEkM9E0VmTpyUCALMf7lL" Content-Language: en-US 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 This is a multi-part message in MIME format. --------------ad5aEkM9E0VmTpyUCALMf7lL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the review! On 10/2/24 6:49 PM, Thiago Jung Bauermann wrote: >> @@ -355,11 +327,10 @@ maintenance_info_frame_unwinders (const char *args, int from_tty) >> uiout->table_header (25, ui_left, "type", "Type"); >> uiout->table_body (); >> >> - for (struct frame_unwind_table_entry *entry = table->list; entry != NULL; >> - entry = entry->next) >> + for (auto unwinder : table) >> { >> - const char *name = entry->unwinder->name; >> - const char *type = frame_type_str (entry->unwinder->type); >> + const char *name = unwinder->name; >> + const char *type = frame_type_str (unwinder->type); > Did you try getting rid of the local vars here, as Simon suggested? > I agree with him that seem unnecessary. I must have overlooked Simon's original suggestion. Considering he has approved with minor nits fixed, I'll send a follow up patch removing these, once this is merged. -- Cheers, Guinevere Larsen She/Her/Hers > >> ui_out_emit_list tuple_emitter (uiout, nullptr); >> uiout->field_string ("name", name); --------------ad5aEkM9E0VmTpyUCALMf7lL Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Thanks for the review!

On 10/2/24 6:49 PM, Thiago Jung Bauermann wrote:
@@ -355,11 +327,10 @@ maintenance_info_frame_unwinders (const char *args, int from_tty)
   uiout->table_header (25, ui_left, "type", "Type");
   uiout->table_body ();
 
-  for (struct frame_unwind_table_entry *entry = table->list; entry != NULL;
-       entry = entry->next)
+  for (auto unwinder : table)
     {
-      const char *name = entry->unwinder->name;
-      const char *type = frame_type_str (entry->unwinder->type);
+      const char *name = unwinder->name;
+      const char *type = frame_type_str (unwinder->type);
Did you try getting rid of the local vars here, as Simon suggested?
I agree with him that seem unnecessary.
I must have overlooked Simon's original suggestion. Considering he has approved with minor nits fixed, I'll send a follow up patch removing these, once this is merged.
-- 
Cheers,
Guinevere Larsen
She/Her/Hers

       ui_out_emit_list tuple_emitter (uiout, nullptr);
       uiout->field_string ("name", name);
--------------ad5aEkM9E0VmTpyUCALMf7lL--