From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A3F0E3858C2B for ; Tue, 24 Oct 2023 22:04:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3F0E3858C2B 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 A3F0E3858C2B 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=1698185073; cv=none; b=wDICBOscVziIfKpCwmFhzhV25uqc8CCpameBxiShzAARSoxVBMA8RIMaFtKnoICGEuF7Oc8Qf/JnVpt6K1TO4j7fnrpEuFRYwuU+gY4lxnhS0UjhyL9eRwDMTEMDo8zp03G29IZ3hiGSBDW6CTH3lz6z3TQQyNffaTh5tHRa0RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698185073; c=relaxed/simple; bh=Yxw35vIbSnV5VnAUG3MLwLemLuKB9IwxCFnJPzK0olY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=l8J2AR/adhRIIxPohmBDOOcN4jZ/kdA+oSYqrnfhRCwqTM7JBOK7FWU/hWwblehTzw9gGqoHnqOPrI/vrM6yYqCUR2ZforjZpr11tPMWkTnqo+a66Wiq4FI1yihwLx/lZuqfIJDKP9XZYb4Js9tnr/w+BZWq9IvJtEWCPHlZovE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698185072; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yczi6YfkGhCi1WYJY4TTO5V9VCQ1nh7OfL666ph1/DI=; b=LZIGHUoVtn898pQ4gfMQH7TsKVqZgjTTR5jCGsPcfXv7QxpNp17dmiyLirciB1oJRoTlsw u8avBn7WW7wyzO/LjsFtVvpyYg/ymIvK15gJ21ab2gpn7VO+Bs+whjeaA1KBwB3QdvjLVE mNSU2wqSdDiv612Y/0RpJ/9kbg0j5as= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-uw9cD5m5O_GRAoz9pj5-XQ-1; Tue, 24 Oct 2023 18:04:30 -0400 X-MC-Unique: uw9cD5m5O_GRAoz9pj5-XQ-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-27d1ceda666so141891a91.1 for ; Tue, 24 Oct 2023 15:04:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698185070; x=1698789870; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yczi6YfkGhCi1WYJY4TTO5V9VCQ1nh7OfL666ph1/DI=; b=QWhdSCrXBGp13wcKRmxIyv527me95Vrq7LJugpLW3heRlUOJV4esxQnq5EHDlPJh43 h8c3vxJGMnfaFEm017La2c9SFGGPg2zH5OYpBHVq+UiJIHHrYu19rAONupV7bLj1Nr+8 KYTBap7ZeJl+RrpAR0/sjjnX10O62AKobpJLxXxnHFhrBwYBlWEL78VKGq+H8mp+lbve 4Qoa5NYQtcl7CsVVaoj6N4Zn/5d2lljaGPm+v5w5q9bDe2oJ/Ja1cZqq6hBrFygm6YBO TWBwG0NJgFyZ2npUFf2vBXwCQHaPFBrapiZzXbTgWvniFZea2K/uCKgcqHS9rxnpQZ1u ky1Q== X-Gm-Message-State: AOJu0Yyr3RDwAjcC4edJmUDaxl8yLMeA1C/ZkCZATm+Kt/ia79Q0J5Mp OhZIJP5D7V6dhFLYdmLwLyAZlNfMfzcHUuP9G6giUt83P7EKt5AKgOaPqALrS0iQDvmmYWMGsqL ajlBFY9pomeiK7TBqQXQSNzy/uGgoAv8UCgDAQn3RQOdLjXs= X-Received: by 2002:a17:90a:1943:b0:27d:63f1:2d24 with SMTP id 3-20020a17090a194300b0027d63f12d24mr18886700pjh.0.1698185069720; Tue, 24 Oct 2023 15:04:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF45CGEK9hvjnG9DSyAOKPBjQrHdyUlMkQfw0qOTqzCmylofhicFa27ZHq5wDPPGMTdMHwhM425HQUfpRZCHC8= X-Received: by 2002:a17:90a:1943:b0:27d:63f1:2d24 with SMTP id 3-20020a17090a194300b0027d63f12d24mr18886676pjh.0.1698185069292; Tue, 24 Oct 2023 15:04:29 -0700 (PDT) MIME-Version: 1.0 References: <20231006183104.27689-1-tdevries@suse.de> <20231006183104.27689-2-tdevries@suse.de> <87cyxmuvy9.fsf@tromey.com> <3f08d572-0043-4d43-9ab8-b4f48865b6ab@suse.de> In-Reply-To: From: Aaron Merey Date: Tue, 24 Oct 2023 18:04:18 -0400 Message-ID: Subject: Re: [PATCH 1/2] [gdb/symtab] Add name_of_main and language_of_main to the DWARF index To: Tom de Vries Cc: gdb-patches@sourceware.org, Tom Tromey X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Tom, On Tue, Oct 24, 2023 at 3:43=E2=80=AFAM Tom de Vries wro= te: > > There are two paths to writing a .gdb_index: > - the save gdb-index command > - the index-cache. > > In the former case, it's probably fairly easy to infer the main name and > language from the current progspace, as you suggest, since > set_initial_language has been executed already. > > In the latter case, writing the index-cache is executed asap in the > background, and it only waits for the cooked-index to become available. > So it would have to wait for the result of set_initial_language as well. Given the possible speed up from having main info in the index, maybe we are better off waiting for set_initial_language. If we are still worried about this delay, we could introduce a gdb command to control this setting and note somewhere that if disabled the index may lack main name and language info. Another approach could be for gcc to emit DW_AT_main_subprogram for C/C++. I'm not too familiar with that gcc code so I'm not sure how feasible this is. > Also (for both cases) some thought will have to go into how to handle > the case that the initial language is set by the user. Is that the > language we want to write into the .gdb_index? Or do we skip writing it > in that case? Or do we try to get the auto-detected initial language by > running set_initial_language on the main thread at the point that we > need it? Or do we try to get the auto-detected initial language in the > background on a worker thread? Hmm I'm not sure here. I think we'd be justified in insisting that index contents should be determined only by the contents of the relevant binaries. Aaron