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 AC4B83858D37 for ; Mon, 23 Oct 2023 16:26:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC4B83858D37 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 AC4B83858D37 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=1698078393; cv=none; b=sSHD+OZExvQTFfeHUjsrPmHtjhI9E5Ko6Ad1Np4nNNADJqP8dclZEcMQhQe04D0NF+/WTsQmnZ7SdqwMsBT04/Mt+1zDzvc32K3/spM4Uo+6Db55EDIojkReqEdpdAl7pFDNd/mlFrgSRbJQB0wtBPCguCfI5RBF9W5PudA2Ct0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698078393; c=relaxed/simple; bh=ercZfZxsM6yk88cngwwxSTsLzeb4rXNE2XDVlSwslCA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=QuRFSwnr6QU6b7uETiBd5aI3Ic7zANxlLv5TZ2NleBc+uGUVVukvdauqDmk2RUwRnHZNcTszcwnKrrLwDBFP5q9GX/9O8kgylcD1yi+/6WWNB7uXMBeReIyo5DshL6XkwKHiYTFO9CLEkEQlVborx6V/IURKPXG2Om5FLM5h6T0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698078391; 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=HPGpSycPSIVVemf4PRqj0P8r46CezPqLaTC7L+6I3gg=; b=RiKZLpWnWQ17hQw9961gwxGIq+7tKOn1ATO5WnWY/8+WEUyoYuJb3PXeRb3YE5qkgB/3qT bju510z4UJQ9aFH7QfUJrL0vv9r+EIaSojv1qGrgbNTj8l5T4L8RMObGfIi6hjbYe13/5s K/jSrBYPqtvJvkowN01sqlavY3Gl5oA= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-489-nqj03Vr2MgCw5_1dN0MgIQ-1; Mon, 23 Oct 2023 12:26:29 -0400 X-MC-Unique: nqj03Vr2MgCw5_1dN0MgIQ-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1c9d42aedc6so23118315ad.0 for ; Mon, 23 Oct 2023 09:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698078388; x=1698683188; h=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=HPGpSycPSIVVemf4PRqj0P8r46CezPqLaTC7L+6I3gg=; b=wLDWjmnE0TOn4WQoEBFlYiFcRPl9qQP4urIKlthpFUQXV6jnHcJ7hBhQ73YbFoPSDW rUt+32RDZpxRBHM29B8/vBeBWetQHAZN9dvSPIL8DfNVw8E05ppGjlTtdo5lYgPYdsgE T70ozeHosApqmQCiftIFz2ZKWe1231Yb/k1Ka+XVJ6v2h+fcVnBh/thTvhf9cBeU8TEx NilgFYeqoQ3teU1PDaRJDsUm0pS+9iBamclhALiqpgmPIUXvWbG+aKOzDQdq3QXAaslr eM9ZqJHOLO3zkOlRSNa+fQFKZQYZKOAxJCC+4ZxT77nHeQN6a+FZsqLNU7suNtfUk8HN ab5A== X-Gm-Message-State: AOJu0YxPlkadTdA4UVnj5d77HxKZc0cwHd6Ab9tPRUXLqkWqVzf9Fe3A bCRJ5sNZIMUqrj9v+gQynm1WMcKmU4r6TDH1QM5IZb+i+OkGALidwAq/r0oK6hgRAVG1v50g+2x GWAN8J70fp9PzOkZCBJ1kdF/WZHvs81+wvMOMNT7UXgUV X-Received: by 2002:a17:902:cf4f:b0:1ca:64f:35ff with SMTP id e15-20020a170902cf4f00b001ca064f35ffmr7128322plg.48.1698078388423; Mon, 23 Oct 2023 09:26:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvP3gmEzza0MuGzQlol/qxoD3b6FFmdD8DTAfyjIK+yEIgyxZ27AHDeMYQrR901BUBGZJNlIUdziqpZc7JZmU= X-Received: by 2002:a17:902:cf4f:b0:1ca:64f:35ff with SMTP id e15-20020a170902cf4f00b001ca064f35ffmr7128306plg.48.1698078388096; Mon, 23 Oct 2023 09:26:28 -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: <3f08d572-0043-4d43-9ab8-b4f48865b6ab@suse.de> From: Aaron Merey Date: Mon, 23 Oct 2023 12:26:17 -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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.2 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,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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, I tried to generate a v9 .gdb_index for a hello world C program and for my local gdb build. In both cases the name and language of the main function are missing. I looked into this and it seems that main information is set in the index only when DW_AT_main_subprogram is found or DW_AT_calling_convention == DW_CC_program. >From gcc/dwarf2out.cc:add_calling_convention_attribute it looks like DW_AT_main_subprogram is only set for Fortran programs. And as far as I can tell DW_AT_calling_convention is not set for C/C++ programs. Am I missing something or is the range of cases where a v9 index actually contains the name and laguage of main quite limited? When writing an index maybe gdb should try to infer the main name and language from the current progspace if this information isn't available in the debuginfo. Aaron