From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3315 invoked by alias); 15 Apr 2015 10:43:47 -0000 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 Received: (qmail 3296 invoked by uid 89); 15 Apr 2015 10:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 15 Apr 2015 10:43:45 +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 t3FAhiTn017600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 15 Apr 2015 06:43:44 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3FAhgWf020333; Wed, 15 Apr 2015 06:43:43 -0400 Message-ID: <552E40DE.7000209@redhat.com> Date: Wed, 15 Apr 2015 10:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org Subject: Re: [PATCH 3/7] Use gdb_sysroot for main executable on attach References: <1427887341-31819-1-git-send-email-gbenson@redhat.com> <1427887341-31819-4-git-send-email-gbenson@redhat.com> In-Reply-To: <1427887341-31819-4-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00553.txt.bz2 On 04/01/2015 12:22 PM, Gary Benson wrote: > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -17800,18 +17800,20 @@ may try to load the host's libraries. @value{GDBN} has two variables > to specify the search directories for target libraries. > > @table @code > -@cindex prefix for shared library file names > +@cindex prefix for executable and shared library file names > @cindex system root, alternate > @kindex set solib-absolute-prefix > @kindex set sysroot > @item set sysroot @var{path} > Use @var{path} as the system root for the program being debugged. Any > -absolute shared library paths will be prefixed with @var{path}; many > -runtime loaders store the absolute paths to the shared library in the > -target program's memory. If you use @code{set sysroot} to find shared > -libraries, they need to be laid out in the same way that they are on > -the target, with e.g.@: a @file{/lib} and @file{/usr/lib} hierarchy > -under @var{path}. > +shared library paths will be prefixed with @var{path}; many runtime > +loaders store the absolute paths to the shared library in the target > +program's memory. When attaching to already-running processes, their This "When attaching to already-running processes" part confuses me, as the sysroot is also prepended to paths in the "run" case. Otherwise looks good to me. > +paths will be prefixed with @var{path} if reported to @value{GDBN} as > +absolute by the operating system. If you use @code{set sysroot} to > +find executables and shared libraries, they need to be laid out in > +the same way that they are on the target, with e.g.@: a @file{/bin}, > +@file{/lib} and @file{/usr/lib} hierarchy under @var{path}. > > If @var{path} starts with the sequence @file{target:} and the target > system is remote then @value{GDBN} will retrieve the target binaries > @@ -17846,7 +17848,7 @@ system: > c:/foo/bar.dll @result{} /path/to/sysroot/c:/foo/bar.dll > @end smallexample Thanks, Pedro Alves