From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /dbPN6Gm8GFECwAAWB0awg (envelope-from ) for ; Tue, 25 Jan 2022 20:40:49 -0500 Received: by simark.ca (Postfix, from userid 112) id D4AFC1F3B6; Tue, 25 Jan 2022 20:40:49 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 4FBCD1EA69 for ; Tue, 25 Jan 2022 20:40:49 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA1F6385EC59 for ; Wed, 26 Jan 2022 01:40:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA1F6385EC59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643161248; bh=CvjuB4VfyH7/pPW1uOtPj+zNA0ITaluFElYzpe1YlJE=; 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=r2mxPHG5Nk/WOkytYpyrAA3O1LDsUTFEEWPpOVp5Gc7mewssCofc7Q/fZYRu/Qb17 pYexo7TkKhl0x8ibFTIegfDgvgFSdGiPnWrDPYPiJJEKFSY2oewDcCBe91mFoBwfmQ uzl47YWO7JLaISdLuHXk97AeQBcwURXisBfR1Lb8= 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: 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 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" 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