From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gO+IAiOlh2Purx4AWB0awg (envelope-from ) for ; Wed, 30 Nov 2022 13:46:59 -0500 Received: by simark.ca (Postfix, from userid 112) id ECC701E11E; Wed, 30 Nov 2022 13:46:58 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=asHFDwyc; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 6E8411E0CB for ; Wed, 30 Nov 2022 13:46:58 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C28BD385B53E for ; Wed, 30 Nov 2022 18:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C28BD385B53E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669834017; bh=o1DWcuuEhxCNJOvmOQFVZZYAFzEuX1cQ1EG4odLMRx0=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=asHFDwyc5+PXAj2XUB3D4CgYw44BFpfRa+JPHUmoqAmlAfXDfvhuOY1RBomCOORa4 dtGxoCpiGExAnVmtazkoiszOxQbavWDlOIUwJicZ4j4BfFEJLRVMYyIXaOHzhFmgxF 9eaUIlLon6pjKRJxjuxmr2Ha1DymkOVsvWhePBfA= 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 39F193858D37 for ; Wed, 30 Nov 2022 18:46:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 39F193858D37 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-111-oHWeCRB3OvOmbIlpCue13w-1; Wed, 30 Nov 2022 13:46:18 -0500 X-MC-Unique: oHWeCRB3OvOmbIlpCue13w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E57E858F13; Wed, 30 Nov 2022 18:46:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 821551121314; Wed, 30 Nov 2022 18:46:17 +0000 (UTC) To: Mark Wielaard Cc: Avi Kivity , gdb@sourceware.org Subject: Re: debuginfod vs libthread_db.so References: <6cf1a5ef8636a1603181f0b177909a1e7869ece9.camel@klomp.org> Date: Wed, 30 Nov 2022 19:46:14 +0100 In-Reply-To: <6cf1a5ef8636a1603181f0b177909a1e7869ece9.camel@klomp.org> (Mark Wielaard's message of "Thu, 24 Nov 2022 13:24:00 +0100") Message-ID: <87bkoo46x5.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Gdb Reply-To: Florian Weimer Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" * Mark Wielaard: > Hi Avi, > > On Thu, 2022-11-24 at 14:02 +0200, Avi Kivity via Gdb wrote: >> (tangent: is it possible to express libthread_db.so code as DWARF >> expressions? if so it will be possible to get rid of libthread_db.so, >> by having libc encode accessors to thread information as some DWARF >> expressions, and teaching gdb to use those expressions instead of >> calling libthread_db.so) > > There used to be an effort to define a kind of extended DWARF > expressions, infinity notes, to describe things like the > libthread_db.so code. Although the website can only be found in > archive.org now, the code is still out there: > https://web.archive.org/web/20190126111943/https://infinitynotes.org/wiki= /Infinity > > Mailing list: infinity@sourceware.org,=20 > https://sourceware.org/ml/infinity/ > Source code: https://gitlab.com/gbenson/i8c/,=20 > https://gitlab.com/gbenson/libi8x/ These days, I would recommend to teach GDB to poke at the internal ld.so data structures to glean the necessary data. The offsets vary a lot and would have to come from DWARF, but the structures themselves are fairly stable (relative to other changes in GDB that glibc updates impose=E2=80=94= sorry about that). To enable experimentation with this approach, we have stopped removing debuginfo from ld.so in our distributions. I kind of want to ship a header-only library in glibc which provides this capability across multiple glibc versions, while outsourcing the DWARF parsing etc. to GDB. libthread_db also had code to compensate for limitations in the original Linux ptrace interface, but that isn't needed anymore. Thanks, Florian