From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2V0PAYwZmWrO9yIAWB0awg (envelope-from ) for ; Thu, 03 Sep 2026 02:54:04 -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=Ytw7mK4H; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B9C341E166; Thu, 03 Sep 2026 02:54:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 DA5531E09B for ; Thu, 03 Sep 2026 02:54:02 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA77A4BA900F for ; Thu, 3 Sep 2026 06:54:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA77A4BA900F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Ytw7mK4H Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by sourceware.org (Postfix) with ESMTPS id D5B074BA2E1B for ; Thu, 3 Sep 2026 06:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5B074BA2E1B 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 D5B074BA2E1B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::934 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788418416; cv=none; b=oS5TX2PV9esJGyOYynTOayNVLbpXv7gu+Ab3k12SLR3840eZoQxHDtKhjhF8VcNdM2v0iD+g/q/0yk+lZ7EAeVWPzoquT0FNoAokNbkevZpDHI2oIcBFzZ6euu1ENF/GjGS401cfFfcaFkfH5W8reTeOKemVJjYklQ2BhtWhlJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788418416; c=relaxed/simple; bh=MwokSUeFAzYQ66nFJ5ZewZaKu8tEiS9w3jHauBOXWsA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SpAjNq3nORk9Z2noHjBpQYBK66EENxQjX+IASBb8MB1bUobcjPMg5+EdWJIkDuHd36zSU1Fv9bwlP5besJbFTN/uKWXFWs1YWB+c3ocXqIwNu15mlbyvZO0YVa48fNpHhCFsMQBsZgoDgIB2ov6uGQ9Tceg6+QhRQH3JZrEbxno= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Ytw7mK4H DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5B074BA2E1B Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-97ca72f2cd9so1011736241.2 for ; Wed, 02 Sep 2026 23:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1788418416; x=1789023216; darn=sourceware.org; h=content-type:mime-version:message-id:date:user-agent:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=smVbP3JLkkldk74J7wHgnos2Vr2DYBDLMZOjvhGJzfw=; b=Ytw7mK4Hz9iiZr/k74jF46ueNjGVLTrPXP0cqf1d8aFn5/ogPUog0uqLdGLnUhEXoN MbYYBdVKRxvHUc2/oTiF31yL9MId2Wm6yVhJmI9QJ8M37O0QdQ19mfHl9yO7EPAo+QQM kFn/eU5QT+W7UhgMdPU+oBNypyKugmoe8JWhGb/aD6/oY1fwltEDpUkPvjG85PnvrYhP QWTWzv8LlGHYtABSzmtCOOnx3P+Xeo9YC4BNFjFJ0sL2Sk3goihSl/JesRXpxhAHlEtD WednZHeCrr1ehTq7eTU8CV7QCl5+UQEdagE/mglj1o63PkZ+OCWFE+d7Vf+E5iTdNe54 jv6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788418416; x=1789023216; h=content-type:mime-version:message-id:date:user-agent:references :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=smVbP3JLkkldk74J7wHgnos2Vr2DYBDLMZOjvhGJzfw=; b=YKT0uAwbr/mQymn9QUGPAlEQ7cvkgHkgjCIHuRfTSVM1CM89xQK8VVaJ6/KtZXtdMn PNFbxqwEfowMDfM8SvVlhfwdXQAgWvjEr/pJY/0+4PZLBV/09PuypGcCVquvNjyCJwBh r4p4PqYYNU6G6n5yEpgGOncA9HRhDjGGCCa1AZkE504COjc1tujRf45trM63ufpvM1Zj fwiw6fqyY96P7SaFwz2DjZSgup96GheMHpLCllQJ2xC+Gxu4do3+bOpwX56AXVZsVkfh hhOETTCFtrnXe1QAIHDRxbkT0Jj/74cv/uw2cNgF7GjCdS00I88v7fj7YhDeGQwOTvAh aGpg== X-Gm-Message-State: AFuF++lxaCWmK3xksufSXI9Wqdl/+8KBuKRPyVCxXInCiO+5u8s931LH JdECV/JsJ7GX/pRwcpECrti7uqx52+MApn9A3NboNFiGcvKLrYTUj5SdRm72yL/Rbo4= X-Gm-Gg: AYBFou0XNZdHS1WAocr/6LfwYoI6ttcydgjT//mbFnK6nPuYI3BeTzyLk1F20y5qIaM jTD3RvZwMRH5bManejTGW2hDyk3ULRhPhkJPORA+q1FpsxAJu9x5yzbbfxXSTQeEqV7WTdy5UZ/ TKZsZVcuZyVFjwSkfmcUzCk67XvRCCuB0vCMIj4yj1CEQwbeD7VsM5tlEuf8v70jBdhjZOsNaaZ 3Z4Y5PuSY7AQhu5IX+sYPSo4yEYbKwuHZR21DJ8xeAeRX4ZnRYe8NEvqJZWn29HdRBkBbpZMrkI ms4AaapkZX4tmE544PmeYQrMdtzbO785gTPmnYZFKNlz8ddyM8KFkElPdDeJyQ6dw6ZUc2yz13W FT4Hr+Owq0ghIUAklCNr8pdzC7SSVpSPp0FJeeqxXUMDrCSIS2QFcyfEq8hblNeKZTakDMuZbY5 hEO0fT8zBP13OTAlQ8xZbwEeYkgtfE8O6yjxs4joRScUXN5gvweCyc2PZJwbwPfeeo2ZcfZ+4= X-Received: by 2002:a05:6102:290a:b0:785:1d9c:633c with SMTP id ada2fe7eead31-78a1f2aeec4mr4203331137.7.1788418411105; Wed, 02 Sep 2026 23:53:31 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-9807764dec9sm1882529241.12.2026.09.02.23.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 23:53:30 -0700 (PDT) From: Thiago Jung Bauermann To: Christina Schimpe Cc: gdb-patches@sourceware.org, tom@tromey.com Subject: Re: [PATCH v4 03/13] gdb: Add get_main_func_start_pc to refactor frame.c:inside_main_func. In-Reply-To: <20260708143639.2214689-4-christina.schimpe@intel.com> (Christina Schimpe's message of "Wed, 8 Jul 2026 14:36:29 +0000") References: <20260708143639.2214689-1-christina.schimpe@intel.com> <20260708143639.2214689-4-christina.schimpe@intel.com> User-Agent: mu4e 1.14.3; emacs 30.2 Date: Thu, 03 Sep 2026 06:53:28 +0000 Message-ID: <87fqzqsu53.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 Christina Schimpe writes: > Refactor frame.c:inside_main_func to use the new function > get_main_func_start_pc, which will be called in a following commmit. > --- > gdb/frame.c | 37 +++++++++++++++++++++++++------------ > gdb/frame.h | 6 ++++++ > 2 files changed, 31 insertions(+), 12 deletions(-) > > diff --git a/gdb/frame.c b/gdb/frame.c > index cefdde5ed1e..a9f2675ce3a 100644 > --- a/gdb/frame.c > +++ b/gdb/frame.c > @@ -2641,27 +2641,26 @@ frame_debug_got_null_frame (const frame_info_ptr &this_frame, > } > } > > -/* Is this (non-sentinel) frame in the "main"() function? */ > +/* See frame.h. */ > > -static bool > -inside_main_func (const frame_info_ptr &this_frame) > +std::optional > +get_main_func_start_pc (gdbarch* gdbarch, const language lang) The nittest of nits: GDB style is to put the '*' with the variable, not the type. Reviewed-by: Thiago Jung Bauermann > { > if (current_program_space->symfile_object_file == nullptr) > - return false; > + return {}; > > - CORE_ADDR sym_addr = 0; > const char *name = main_name (); > bound_minimal_symbol msymbol > = lookup_minimal_symbol (current_program_space, name, > current_program_space->symfile_object_file); > > + CORE_ADDR sym_addr = 0; > if (msymbol.minsym != nullptr) > sym_addr = msymbol.value_address (); > > /* Favor a full symbol in Fortran, for the case where the Fortran main > is also called "main". */ > - if (msymbol.minsym == nullptr > - || get_frame_language (this_frame) == language_fortran) > + if (msymbol.minsym == nullptr || lang == language_fortran) > { > /* In some language (for example Fortran) there will be no minimal > symbol with the name of the main function. In this case we should -- Thiago (he/him)