From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19221 invoked by alias); 23 Nov 2012 16:23:00 -0000 Received: (qmail 19211 invoked by uid 22791); 23 Nov 2012 16:22:58 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Fri, 23 Nov 2012 16:22:50 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qANGMoPc000465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Nov 2012 11:22:50 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qANGMmhQ015520; Fri, 23 Nov 2012 11:22:49 -0500 Message-ID: <50AFA2D7.2010207@redhat.com> Date: Fri, 23 Nov 2012 16:23:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Mark Kettenis CC: jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [patch+7.5.1] Work around PR libc/13097 "linux-vdso.so.1" #3 References: <20121122201737.GA32172@host2.jankratochvil.net> <50AF65E1.1090308@redhat.com> <20121123123952.GA15371@host2.jankratochvil.net> <50AF9DBF.1090406@redhat.com> <201211231612.qANGCXUC004949@glazunov.sibelius.xs4all.nl> In-Reply-To: <201211231612.qANGCXUC004949@glazunov.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit 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: 2012-11/txt/msg00621.txt.bz2 On 11/23/2012 04:12 PM, Mark Kettenis wrote: >> Date: Fri, 23 Nov 2012 16:01:03 +0000 >> From: Pedro Alves >> >> This means that looking for relative path DSOs in the file system is >> currently depending on GDB's current directory. > > Yup, you lose. > >> My favorite is opening a DSO symlink like we /proc/PID/exe. > > That doesn't really help. If you replace the DSO the symlink will > point at the new one, not the one loaded by the executable. No, no, no. /proc/PID/exe is special. It's kind of a hard link. Opening it opens the old, before-replacement file. E.g., try running a program, and deleting its executable. You can still open /proc/PID/exe, and it will open the running program. >cp /usr/bin/sleep sleep2 >./sleep2 1000& [1] 26504 >bg [1]+ ./sleep2 1000 & >readlink -f /proc/26504/exe /home/pedro/sleep2 >rm sleep2 >readlink -f /proc/26504/exe /home/pedro/sleep2 (deleted) >ls -l /proc/26504/exe lrwxrwxrwx. 1 pedro pedro 0 Nov 23 16:20 /proc/26504/exe -> /home/pedro/sleep2 (deleted) >size /proc/26504/exe text data bss dec hex filename 21645 1200 384 23229 5abd /proc/26504/exe Let's try replacing it, even: >echo "hahaha" > sleep2 >size /proc/26504/exe text data bss dec hex filename 21645 1200 384 23229 5abd /proc/26504/exe -- Pedro Alves