From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30055 invoked by alias); 18 Oct 2011 13:32:22 -0000 Received: (qmail 30046 invoked by uid 22791); 18 Oct 2011 13:32:21 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Oct 2011 13:32:04 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9IDW3dH023005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Oct 2011 09:32:04 -0400 Received: from host1.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9IDW1If001214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 18 Oct 2011 09:32:03 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9IDW0ZA014305; Tue, 18 Oct 2011 15:32:00 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9IDVxH9014300; Tue, 18 Oct 2011 15:31:59 +0200 Date: Tue, 18 Oct 2011 13:41:00 -0000 From: Jan Kratochvil To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Relocate phdr in read_program_header Message-ID: <20111018133159.GA14219@host1.jankratochvil.net> References: <20111016192157.GA619@host1.jankratochvil.net> <4E9C5734.4000609@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E9C5734.4000609@qnx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00498.txt.bz2 On Mon, 17 Oct 2011 18:26:28 +0200, Aleksandar Ristovski wrote: > I was contemplating a testcase but I couldn't think of a trick to > "make" gdb not find the executable... Thanks for the test. The testcase of mine has a problem it will stop working in future. [patch] Attach to running but deleted executable http://sourceware.org/ml/gdb-patches/2010-03/msg00950.html The problem is the patch above is not so useful as it still does not work for deleted libraries, there was discussed some Linux kernel support like /proc/PID/mappedfileshandlesdirectory/ but it probably has not happened yet. Anyway one could also use gdbserver - which is probably the case your fix targets IIUC, the testcase will regress with a fix like above. > Aleksandar Ristovski > > * solib-svr4.c (read_program_header): New variable pt_phdr, > initialize > it from target PT_PHDR p_vaddr, relocate sect_addr by it. There should be now two new variables pt_phdr and pt_phdr_p. :-) OK with that ChangeLog change in a single commit with my testcase. Thanks, Jan