From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 15RgLj5xlWFGPwAAWB0awg (envelope-from ) for ; Wed, 17 Nov 2021 16:16:46 -0500 Received: by simark.ca (Postfix, from userid 112) id A42D81F0C1; Wed, 17 Nov 2021 16:16:46 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2BC591ECEB for ; Wed, 17 Nov 2021 16:16:46 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 42CE5385800F for ; Wed, 17 Nov 2021 21:16:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42CE5385800F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637183805; bh=vmjRFeLwORW22Eqrl50V8qLGWNiJZELvuvFD5vPusPg=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=l6DPQmBFCwDfBpgp287rzoplEPLqV9Fy+AbXSvNdFoLF2lw7KWhv5c9mkjVBLqUFR 8kR9M4ehKWGaqEMseL9JdYh+BAY+05M6DFheEevtUslUdcC7+JYRt04a4KOIypHX2p E6jRNSRPfM/Lwv6dMy6GEL+vDp65k6wbGh5FD5NU= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTPS id ADCBC3858402 for ; Wed, 17 Nov 2021 21:16:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ADCBC3858402 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-b515OczrMQq_zQSitVAgsg-1; Wed, 17 Nov 2021 16:16:25 -0500 X-MC-Unique: b515OczrMQq_zQSitVAgsg-1 Received: by mail-qv1-f72.google.com with SMTP id q2-20020a05621419e200b003aeeeff5417so3879795qvc.9 for ; Wed, 17 Nov 2021 13:16:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vmjRFeLwORW22Eqrl50V8qLGWNiJZELvuvFD5vPusPg=; b=vV65EDZwFZSrJBbrfZ8h6HjiWLaGXnqTJvRibk7t0dVrMkw66GNy22OqwmYynpN7+k pVX18auUdd16oz1sAMtmWYvLT94QAiPmY5H8m/zRAjhkb7GqVYXJ8sAQcrdC7lQV69/p RwUqqKI8ggs5gxgNKxOw/Oqf3HkcQ22DbLyKwaQkmr54b3CEUt+nA7/AjWZnRM3n/SzK TiNGNCwyXeC0m8PHTWkJL2gciZmrk27ILHaVZZwikpSItYPKdd8cEoGC1JxO2WE7/dZz JMBo4G9ksJPmgtyJ2Wwt3RmppqeklBVlYSGNqJYLFCTOa6yQu9Csa7IZpepjcWJNdKI0 IS8w== X-Gm-Message-State: AOAM533SPr2DFJcHjzZfqKK8l0Z6hKAg+ToBipcfoSZfm5fsF7pVSlgH divJcWQNYh/3dTsJaDaVp5JrCIpgkDBjcG++QlOhyH8+lBCp2z1JUoWeBH4Yn3U7JZSFa5kziMr PjJ7xt2ZRujAfMeYQC9Lwug0hfXTx7NhAHfEB X-Received: by 2002:a05:622a:1190:: with SMTP id m16mr20019199qtk.287.1637183784785; Wed, 17 Nov 2021 13:16:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX2HRDnZ5C6HYrTlOatnHItOgLBGmbv6xgCYOiU435oxQwYsixtM2HIVx6+rjmFtpPr+IgZPfJVbnfJ1IrUSM= X-Received: by 2002:a05:622a:1190:: with SMTP id m16mr20019126qtk.287.1637183784253; Wed, 17 Nov 2021 13:16:24 -0800 (PST) MIME-Version: 1.0 References: <20211117032441.719270-1-amerey@redhat.com> <877dd6euil.fsf@tromey.com> In-Reply-To: <877dd6euil.fsf@tromey.com> Date: Wed, 17 Nov 2021 16:16:13 -0500 Message-ID: Subject: Re: [PATCH 2/3] gdb: Add soname to build-id mapping for corefiles To: Tom Tromey X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Aaron Merey via Gdb-patches Reply-To: Aaron Merey Cc: lsix@lancelotsix.com, Aaron Merey via Gdb-patches Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Tom, On Wed, Nov 17, 2021 at 9:29 AM Tom Tromey wrote: > If re-opening and then calling bfd_check_format sets the flags > correctly, then I suppose the question is just why the call in > build_file_mappings isn't doing that: > > if (bfd == nullptr || !bfd_check_format (bfd, bfd_object)) > > Possibly the answer is that corelow passes "binary" as the target, but > your code does: > > Aaron> + gdb_bfd_ref_ptr abfd = gdb_bfd_open (bfd->filename, gnutarget); > > But then I wonder why "binary" is appropriate in corelow. Yes it would be much better if "bfd" was simply initialised with the proper fields. Corelow treats bfds in a target-agnostic manner but this shouldn't preclude having accurate information in "bfd". We could force "bfd" to have a format of bfd_unknown and let bfd_check_format figure out the correct format and fields. This is basically what I do in gdb_bfd_read_elf_soname. But really there should be a way to just initialise "bfd" with completely accurate contents at the time of creation. If this doesn't exist maybe now is the time to add it. Aaron