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 BDACB385BF99 for ; Wed, 26 Jan 2022 01:40:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BDACB385BF99 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-NBl7S6NoOayNtIbgL4-Qtw-1; Tue, 25 Jan 2022 20:40:24 -0500 X-MC-Unique: NBl7S6NoOayNtIbgL4-Qtw-1 Received: by mail-qv1-f69.google.com with SMTP id 6-20020a0562140d4600b004244d191fd4so5355843qvr.0 for ; Tue, 25 Jan 2022 17:40:23 -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=CvjuB4VfyH7/pPW1uOtPj+zNA0ITaluFElYzpe1YlJE=; b=21LQwQFI/cCQ4xMyd8F4xPAOsYBt+z8xg424bC1YEcYaDJ56XbA9DB6OlfODSO9atE 8Hi69ZvmpmYjNgYdLkBfyKckPokbLaYThl/rG/71WgNyzZvY/aZZOS0XkJegKsOTALxJ PrB7VNzj6+nJiMVBsF1HJfSOs6zXca9dmyfxQIAkw1OT5MJ7MpgpLwvOw87pPzV3P3X4 PnYDUbaPu2htApxCDAsraFqdkA6gHGcxmDnk0OYfazTH2q5oQ/Fk/cew9jONXoJIJwIX HjuRH+MLhWzvc8lF1fPwF7+PeF/I3+aKKV3RPBgD3lklXzuusiAdvnG8RRD0oLvu51Qz +FAA== X-Gm-Message-State: AOAM533U00uvOTxHrxXo+Vb019+JT5L9/8ZNLpnC1/QOpIVE+wIpLv/A wEQd3EbTcXRibh3cTWEs0uhJr2W7c/jsfzx4Nq8FjXyRTNXnnTuphmxn7Ea3qs/UaNUom4uaudC p69cxOcR6zeNAbzs/hf2jUNaaIAJ6BxLn1Yee X-Received: by 2002:a05:622a:1789:: with SMTP id s9mr12924274qtk.274.1643161223568; Tue, 25 Jan 2022 17:40:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqpttvWyh4zvJlHwd8NYIJ7ZbfgljeoJ4NNfSJa7EVbHJDIendkIalmyfUjmuE27uOp/yMCQVI1p1Kzot1ImE= X-Received: by 2002:a05:622a:1789:: with SMTP id s9mr12924269qtk.274.1643161223363; Tue, 25 Jan 2022 17:40:23 -0800 (PST) MIME-Version: 1.0 References: <20211117032441.719270-1-amerey@redhat.com> <877dd6euil.fsf@tromey.com> In-Reply-To: From: Aaron Merey Date: Tue, 25 Jan 2022 20:40:12 -0500 Message-ID: Subject: Re: [PATCH 2/3] gdb: Add soname to build-id mapping for corefiles To: Tom Tromey Cc: Aaron Merey via Gdb-patches , Simon Marchi , lsix@lancelotsix.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 26 Jan 2022 01:40:32 -0000 Ping Thanks, Aaron On Wed, Nov 17, 2021 at 4:16 PM Aaron Merey wrote: > > 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