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.133.124]) by sourceware.org (Postfix) with ESMTPS id C8A023858D33 for ; Wed, 18 Oct 2023 17:25:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8A023858D33 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 C8A023858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697649944; cv=none; b=h1eBVbvY3iVB0Q2qDVoXh029E/cEhjdOi1Zxa70+P1949uR+uQAa1Bm6FkavSYVMrouxr9auwP33ACCa/wSvcugNNBRPREPp4uDiMFgZxOdMg5cdSStFbA1DiBP4ywu3LhNSs6K5FiTpcOLsJUdy2cTusmsbFxNYmeL52FKgZf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697649944; c=relaxed/simple; bh=5imN2g8AzKWyrBl8YnoiRM1AuriMhUu0sui/eT8P57o=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=E+WkqYX24JyQgTJ4dnKVKhOgLYJikIyZiCbfUgnKIcbRJTwWA5vE441bIJjn5xM/wf9kNlwVUpGM4JjUYua4RTFNPOSBEQR+0ye6AKZsVWdgwaLDDoGfPhJ1CVAxrJFxZJdhE5SZ+21H9AKzBreQkMHvQry8pIWrekrkv3N7NAU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697649943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eok/DNjpWXvb5fZOJ3iFpHNqTy/hqzEihi4Z5haC/jo=; b=dlEP4AjuL4Zpt/onV+A/RsUkf+iASU2PNiaVpavYgtHy5qNFkdxwZgqp3MyF4kQ78lvE0n OOrauJs5dsinMWOwe/ub+WRcLBSDJ37QcmTEwa397OCPPEXNW6jxTmvP3iorIdYV/Q7hvM cQROxgMMYEkyYHersQNLql7aHTAC0w4= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-QnLIAa1nN4SddIWRzo2lxA-1; Wed, 18 Oct 2023 13:25:42 -0400 X-MC-Unique: QnLIAa1nN4SddIWRzo2lxA-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3af97e47c02so11481505b6e.0 for ; Wed, 18 Oct 2023 10:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697649940; x=1698254740; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eok/DNjpWXvb5fZOJ3iFpHNqTy/hqzEihi4Z5haC/jo=; b=mYR3PdYxLVopAyWI7JBiG0Ux7d5BGJIIhcUTHqI4jD0CgV1hE0cIJubva/URQiR+Zl B10Exh/1Xa93wREMRirQQJnsMnOZXXi9RmlAimKaO6DYMDlhyWoT+/7yT0dMFD2g3DLN EetrwGn7ddbeoSmpq6E5fLa+3LaxXSnmpYZHDrxnRQdrGnjCRh2La9EE5P5DOGA2bI1+ NPCuRrSaBvGkcmJcZWgZfHwBodpa+3EhYC381PvqQaOlG/06djy8CHNgwq4TIm7RRGVe mfCLZFoH3193/wOLoxR4WnjUjHlJ7xMTb18uZTDJ2mkAxV20DkGGySwTwHdVnfPYvdiK 60ng== X-Gm-Message-State: AOJu0YwzFIqUYz0/19VbWurGb/aj0TiXijDYUrkDrlM1k0qxZ/LDxmUX 8M61WpXBPTXA5IMtdaZnxibuHeN5i/EQjAmzcxAbsYOfbgsGXhKHe77BaseBxltdEjBb8/TCBVN /XaVrnJdWJyAlBlAeoPE80i6ky+8XOg== X-Received: by 2002:a54:4014:0:b0:3ae:126b:8bfc with SMTP id x20-20020a544014000000b003ae126b8bfcmr6141967oie.4.1697649940514; Wed, 18 Oct 2023 10:25:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZd4sSX/LriFSw/i+1XIsFh0cHuRELoKiY13NoOntDcSfnQSaVhUuFkNxJQ/hvJmy97XrJMw== X-Received: by 2002:a54:4014:0:b0:3ae:126b:8bfc with SMTP id x20-20020a544014000000b003ae126b8bfcmr6141960oie.4.1697649940250; Wed, 18 Oct 2023 10:25:40 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id j21-20020a37ef15000000b007742c2ad7dfsm107444qkk.73.2023.10.18.10.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:25:39 -0700 (PDT) From: Andrew Burgess To: Jon Turney , gdb-patches@sourceware.org Subject: Re: [PATCH 2/5] gdb: merge debug symbol file lookup code from coffread & elfread paths In-Reply-To: <03de655e-5fab-46a6-b2ee-3ef3ddf185e1@dronecode.org.uk> References: <07d050dec424c75095135c8a4836f24e3d713a32.1697626088.git.aburgess@redhat.com> <03de655e-5fab-46a6-b2ee-3ef3ddf185e1@dronecode.org.uk> Date: Wed, 18 Oct 2023 18:25:37 +0100 Message-ID: <87bkcv4zce.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.9 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_H3,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: Jon Turney writes: > On 18/10/2023 11:53, Andrew Burgess wrote: >> This commit merges the code that looks for and loads the separate >> debug symbol files from coffread.c and elfread.c. The factored out >> code is moved into a new objfile::find_and_add_separate_symbol_file() >> method. >> >> For the elfread.c path there should be no user visible changes after >> this commit. >> >> For the coffread.c path GDB will now attempt to perform a debuginfod >> lookup for the missing debug information, assuming that GDB can find a >> build-id in the COFF file. >> >> I don't know if COFF files can include a build-id, but I the existing > > This is at least possible for PE/COFF. > > (I wrote the code to add support for this back in 2015, see commit > c74f7d1c6c5a968330208757f476c67a4bb66643) Thanks for the link. I figured they probably could based on the code, but I didn't dig too hard as I didn't think it really mattered for this change. Thanks, Andrew > >> coffread.c code already includes a call to >> find_separate_debug_file_by_build-id, so I know that it is at least OK >> for GDB to ask a COFF file for a build-id. If the COFF file doesn't >> include a build-id then the debuginfod lookup code will not trigger >> and the new code is harmless. >> >> If the COFF file does include a build-id, then we're going to end up >> asking debuginfod for the debug file. As build-ids should be unique, >> this should be harmless, even if debuginfod doesn't contain any >> suitable debug data, it just costs us one debuginfod lookup, so I'm >> not too worried about this for now. > > But yes, as you say, should be harmless. > >> I don't have access to a COFF target right now, so beyond compiling >> it, the coffread.c changes are completely untested.