From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37327 invoked by alias); 19 Mar 2019 15:42:02 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 37134 invoked by uid 89); 19 Mar 2019 15:42:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=H*i:sk:jff2wg@, H*f:sk:jff2wg@ X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Mar 2019 15:42:01 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6GsG-0005qo-12 for gdb@sourceware.org; Tue, 19 Mar 2019 11:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34621) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h6GsF-0002ZZ-LW for gdb@gnu.org; Tue, 19 Mar 2019 11:41:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6GsD-0005o7-Lv for gdb@gnu.org; Tue, 19 Mar 2019 11:41:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52032) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6GsB-0005jf-Rz for gdb@gnu.org; Tue, 19 Mar 2019 11:41:52 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA1B8C04B926; Tue, 19 Mar 2019 15:41:49 +0000 (UTC) Received: from host1.jankratochvil.net (unknown [10.36.118.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDC5419C6A; Tue, 19 Mar 2019 15:41:48 +0000 (UTC) Date: Tue, 19 Mar 2019 15:42:00 -0000 From: Jan Kratochvil To: Jirka =?utf-8?Q?Koutn=C3=BD?= Cc: gdb@gnu.org Subject: Re: question about why gdb needs executable's binary Message-ID: <20190319154144.GA3509809@host1.jankratochvil.net> References: <20190314214555.GA2221061@host1.jankratochvil.net> <20190319143542.GA3498328@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-SW-Source: 2019-03/txt/msg00056.txt.bz2 On Tue, 19 Mar 2019 16:25:30 +0100, Jirka Koutn=C3=BD wrote: > I see, just to make sure - DT_DEBUG gets dumped into the corefile, is that > correct? The PT_DYNAMIC segment containing the DT_DEBUG pointer (pointing to r_debug/_r_debug) normally gets dumped into the core file. The problem is t= hat without having the main executable one cannot much find where is the DT_DEB= UG pointer located in the core file. Core file has for example NT_AUXV where is AT_PHDR and from program headers one could find PT_DYNAMIC where is DT_DEBU= G. But core file does not have to contain the program headers as those may be = in a read-only page of the main executable. Nowadays with dumping of the first page of any ELF (even if it is read-only, for its NT_GNU_BUILD_ID) one can probably find the program headers there. But then one can also just read NT_FILE nowadays. Jan