From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OJ6QOQXA/WZjIj8AWB0awg (envelope-from ) for ; Wed, 02 Oct 2024 17:49:57 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=v8uWgmWf; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E880E1E353; Wed, 2 Oct 2024 17:49:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS 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 2FF5E1E05C for ; Wed, 2 Oct 2024 17:49:57 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A8ACC3858C50 for ; Wed, 2 Oct 2024 21:49:56 +0000 (GMT) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 29D023858D34 for ; Wed, 2 Oct 2024 21:49:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29D023858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 29D023858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727905777; cv=none; b=NxiIOD6vcWkREJADfHNcq5iCYPPbH7t2393LxtiTmZ6hgeLHr501ZSIs/tYN6ekJXNNeRZPQxo0kwC2HSuyBedPYz15ZiI7GFlMDosPH1VJeqiVbQSF9hw6gWNRZc85g9Kyeg/6FxZQRZAGpL693ZPQ0BB2wAAnmhpyTDPWIjkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727905777; c=relaxed/simple; bh=7ezcaXIFrJmemgjcn8fN8e9cB6neiezecTjWgUYbqvM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FD2lfpHWjEfjmxmxBo36JaFj6C8uzQJryQwOssXbZVjWR4pcgBJGS/FIupMOBB+r7MXVS5vRpMCDLivfMv8LwI5qOa+S1JGfh+th4VhpQY14Ral2kbQZ4c759LFBeSPtv/yvbLrc7kziSmm7n42q988HCCnNZ8RGh/zR5xHAm7E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2e0afd945d4so257702a91.0 for ; Wed, 02 Oct 2024 14:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727905774; x=1728510574; darn=sourceware.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=WTDYbJ01R6WpFd/BreJrPRyCR4hyoecBIFdOhtBP1ME=; b=v8uWgmWfNfVIwarLz8J812neh0ApM3+2Lifw4RG+vUPT/e8btaQxFTYKCP6m8ImAW5 sll/6LFN8w9sjKIXPt3ycgHgsPboW7FzkubOHZo2BRPpTdWF55aJKKsUmrt6t/q6tZsb x/wFv4w+4u0txXHk2VLLmUUX0Br0Ygl595+/FAwSbSL8jfz83yAoVSlCIl2ON0WKdrCR yfDsCjKrDIJAU3J/wuVIrcJaVFJbNIV5AW7+NgXQkDBFYPzA4lu6nccmDGAaWFmUts/H j+f8J2QVSf9Gt/R+zEeJQSjjA4gDjWNchr+Dd63rnylVZBKLjKPb2A7GU+DxW6i4IYN5 3lfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727905774; x=1728510574; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WTDYbJ01R6WpFd/BreJrPRyCR4hyoecBIFdOhtBP1ME=; b=IiuB52IZ0fmvbNdjlp2c6ite6M77/nlsqGYNNFuaPa20hJjU3YGf8x5JAhYFEy2W65 xy/vxYuJ9yAhLT1/Bm6C+p838oEJZYTNYghRMbLGHf+AvM6PaPFTVpVOJRFtGltj5Wyr 2Pp9UAw/MHpZr4KoOX384MjM2fUJ8iC29WfpIlnr/1cUF86VJww8Ph1zHvOkycTA+iQn BqRI+YcKTgxCJtySgQXCYBW+wwTCR3tKyCH7qpISwr02botWJgyRruZ+JQYDf/HaupJ9 l0kuzMRV9T/inJoEYOafEH+zG+nmPMCkIscXhW7OVvM2P+IEj2Fb1nEIX162CdOW6ry0 1UwA== X-Gm-Message-State: AOJu0YxpoWTB6dwDgYtMvkJYi0d4Yl/2WFSiSd3hUROd/VdFOIThe/j8 ujvQal9wk5mstYYgsgsr3Gg9R00Ngz1O061AnxsLgmXorzIKIlkUaPKhvw+GirYc8sJOYZuXmlz 8 X-Google-Smtp-Source: AGHT+IGcmKMgRwta9CHutnxG5Wx+Zoyo95JrcHfRgbTdOJ4vnzUTC9ebmwRIee5VZwpZAN2Wtnr68A== X-Received: by 2002:a17:90b:e97:b0:2c9:9643:98f4 with SMTP id 98e67ed59e1d1-2e18452defcmr5535460a91.5.1727905773993; Wed, 02 Oct 2024 14:49:33 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:c692:4473:f1b3:494c]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e18f89e973sm2146424a91.29.2024.10.02.14.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 14:49:33 -0700 (PDT) From: Thiago Jung Bauermann To: Guinevere Larsen Cc: gdb-patches@sourceware.org, Guinevere Larsen Subject: Re: [PATCH v5 1/5] gdb: make gdbarch store a vector of frame unwinders In-Reply-To: <20241001184235.3710608-2-guinevere@redhat.com> (Guinevere Larsen's message of "Tue, 1 Oct 2024 15:42:31 -0300") References: <20241001184235.3710608-1-guinevere@redhat.com> <20241001184235.3710608-2-guinevere@redhat.com> Date: Wed, 02 Oct 2024 18:49:30 -0300 Message-ID: <87zfnmb2fp.fsf@linaro.org> MIME-Version: 1.0 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 Hello Guinevere, Just a couple of nits. Regardless: Reviewed-by: Thiago Jung Bauermann Guinevere Larsen writes: > diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c > index e5f108d3257..b69ae8596a2 100644 > --- a/gdb/frame-unwind.c > +++ b/gdb/frame-unwind.c > @@ -31,62 +31,46 @@ > #include "cli/cli-cmds.h" > #include "inferior.h" > > -struct frame_unwind_table_entry > +/* Default sniffers, that must always be the first in the unwinder list, > + no matter the architecture. */ > +static constexpr auto standard_unwinders = > { > - const struct frame_unwind *unwinder; > - struct frame_unwind_table_entry *next; > -}; > + &dummy_frame_unwind, > + /* The DWARF tailcall sniffer must come before the inline sniffer. > + Otherwise, we can end up in a situation where a DWARF frame finds > + tailcall information, but then the inline sniffer claims a frame > + before the tailcall sniffer, resulting in confusion. This is > + safe to do always because the tailcall sniffer can only ever be > + activated if the newer frame was created using the DWARF > + unwinder, and it also found tailcall information. */ > + &dwarf2_tailcall_frame_unwind, > + &inline_frame_unwind, > Nit: this empty line should be removed. > -struct frame_unwind_table > -{ > - struct frame_unwind_table_entry *list = nullptr; > - /* The head of the OSABI part of the search list. */ > - struct frame_unwind_table_entry **osabi_head = nullptr; > }; > @@ -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. > ui_out_emit_list tuple_emitter (uiout, nullptr); > uiout->field_string ("name", name); -- Thiago