From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12038 invoked by alias); 20 Mar 2014 13:13:13 -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 12029 invoked by uid 89); 20 Mar 2014 13:13:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: MXA.qnx.com Received: from mxa.qnx.com (HELO MXA.qnx.com) (72.1.200.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 20 Mar 2014 13:13:10 +0000 X-ASG-Debug-ID: 1395321851-072188127043680001-fS2M51 Received: from exhts.ott.qnx.com (exch1.ott.qnx.com [10.222.2.137]) by MXA.qnx.com with ESMTP id f0OjBhbD4HnheyHR; Thu, 20 Mar 2014 09:24:11 -0400 (EDT) X-Barracuda-Envelope-From: ARistovski@qnx.com Received: from [10.222.130.188] (10.222.2.5) by EXCH1.ott.qnx.com (10.222.2.137) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 20 Mar 2014 09:13:07 -0400 Message-ID: <532AE962.9030604@qnx.com> Date: Thu, 20 Mar 2014 13:13:00 -0000 From: Aleksandar Ristovski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Jan Kratochvil , Subject: Re: [PATCH v5 7/8] Validate symbol file using build-id References: <20140319223004.14668.20989.stgit@host1.jankratochvil.net> <20140319223123.14668.95821.stgit@host1.jankratochvil.net> X-ASG-Orig-Subj: Re: [PATCH v5 7/8] Validate symbol file using build-id In-Reply-To: <20140319223123.14668.95821.stgit@host1.jankratochvil.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: exch1.ott.qnx.com[10.222.2.137] X-Barracuda-Start-Time: 1395321851 X-Barracuda-URL: http://qnx-spam.ott.qnx.com:80/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.4092 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-SW-Source: 2014-03/txt/msg00491.txt.bz2 On 14-03-19 06:31 PM, Jan Kratochvil wrote: > Hi, > > consumer part of the "build-id" attribute. > > > Jan > > > gdb/ > 2014-02-26 Aleksandar Ristovski Jan Kratochvil > > Validate symbol file using build-id. > * NEWS (Changes since GDB 7.7): Add 'set solib-build-id-force' > and 'show solib-build-id-force'. Add build-id attribute. > * solib-darwin.c (_initialize_darwin_solib): Assign validate value. > * solib-dsbt.c (_initialize_dsbt_solib): Ditto. > * solib-frv.c (_initialize_frv_solib): Ditto. > * solib-ia64-hpux.c (ia64_hpux_target_so_ops): Ditto. > * solib-irix.c (_initialize_irix_solib): Ditto. > * solib-osf.c (_initialize_osf_solib): Ditto. > * solib-pa64.c (_initialize_pa64_solib): Ditto. > * solib-som.c (_initialize_som_solib): Ditto. > * solib-spu.c (set_spu_solib_ops): Ditto. > * solib-svr4.c: Include rsp-low.h. > (NOTE_GNU_BUILD_ID_NAME): New define. > (svr4_validate): New function. > (library_list_start_library): Parse 'build-id' attribute. > (svr4_library_attributes): Add 'build-id' attribute. > (_initialize_svr4_solib): Assign validate value. > * solib-target.c (solib.h): Include. > (_initialize_solib_target): Assign validate value. > * solib.c (solib_build_id_force, show_solib_build_id_force): New. > (solib_map_sections): Use ops->validate. > (clear_so): Free build_id. > (default_solib_validate): New function. > (_initialize_solib): Add "solib-build-id-force". > * solib.h (default_solib_validate): New declaration. > * solist.h (struct so_list): New fields 'build_idsz' and 'build_id'. > (target_so_ops): New field 'validate'. > > gdb/doc/ > 2014-03-02 Jan Kratochvil > > * gdb.texinfo (Files): Add 'set solib-build-id-force' > and 'show solib-build-id-force'. > --- > gdb/NEWS | 10 ++++++ > gdb/doc/gdb.texinfo | 38 ++++++++++++++++++++++ > gdb/solib-darwin.c | 1 + > gdb/solib-dsbt.c | 1 + > gdb/solib-frv.c | 1 + > gdb/solib-ia64-hpux.c | 1 + > gdb/solib-irix.c | 1 + > gdb/solib-osf.c | 1 + > gdb/solib-pa64.c | 1 + > gdb/solib-som.c | 1 + > gdb/solib-spu.c | 1 + > gdb/solib-svr4.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ > gdb/solib-target.c | 2 + > gdb/solib.c | 62 +++++++++++++++++++++++++++++++++++- > gdb/solib.h | 4 ++ > gdb/solist.h | 21 ++++++++++++ > 16 files changed, 230 insertions(+), 1 deletion(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index 2a384ba..629cc13 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -43,6 +43,12 @@ maint ada show ignore-descriptive-types > the user manual for more details on descriptive types and the intended > usage of this option. > > +set solib-build-id-force (on|off) > +show solib-build-id-force > + Inferior shared library and symbol file may contain unique build-id. > + If both build-ids are present but they do not match then this setting > + enables (on) or disables (off) loading of such symbol file. > + > * New features in the GDB remote stub, GDBserver > > ** New option --debug-format=option1[,option2,...] allows one to add > @@ -51,6 +57,10 @@ maint ada show ignore-descriptive-types > Timestamps can also be turned on with the > "monitor set debug-format timestamps" command from GDB. > > + ** library-list-svr4 contains also optional attribute 'build-id' for > + each library. GDB does not load library with build-id that > + does not match such attribute. > + > * The 'record instruction-history' command now starts counting instructions > at one. This also affects the instruction ranges reported by the > 'record function-call-history' command when given the /i modifier. > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index b1b29bd..a4af3ec 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -17114,6 +17114,44 @@ libraries that were loaded by explicit user requests are not > discarded. > @end table > > +@table @code > +@kindex set solib-build-id-force > +@cindex override @value{GDBN} build-id check > +@item set solib-build-id-force @var{mode} > +Setting to override @value{GDBN} build-id check. > + > +Inferior shared libraries and symbol files may contain unique build-id. > +By default @value{GDBN} will ignore symbol files with non-matching build-id > +while printing: > + > +@smallexample > + warning: Shared object "libfoo.so.1" could not be validated (remote > + build ID 2bc1745e does not match local build ID a08f8767) and will be I am not sure 'remote' adds any clarity here, on-contrary, I think it will confuse. This could all be happening in local scenario as well. The gist should be: inferior so build-id (i.e. build-id of the shared object loaded in the inferior memory) does not match build-id of the so gdb loaded to get symbols. > + ignored; or use 'set solib-build-id-force'. > +@end smallexample > + > +Turning on this setting would load such symbol file while still printing: > + > +@smallexample > + warning: Shared object "libfoo.so.1" could not be validated (remote > + build ID 2bc1745e does not match local build ID a08f8767) but it is > + being loaded due to 'set solib-build-id-force'. > +@end smallexample The same here > + > +If remote build-id is present but it does not match local build-id (or local > +build-id is not present) then this setting enables (@var{mode} is @code{on}) or > +disables (@var{mode} is @code{off}) loading of such symbol file. On systems > +where build-id is not present in the remote system this setting has no effect. > +The default value is @code{off}. and here. I think 'inferior' would be a lot more suitable reference than "remote system". --- Aleksandar Ristovski QNX Software Systems