Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH v5 7/8] Validate symbol file using build-id
Date: Thu, 20 Mar 2014 13:13:00 -0000	[thread overview]
Message-ID: <532AE962.9030604@qnx.com> (raw)
In-Reply-To: <20140319223123.14668.95821.stgit@host1.jankratochvil.net>

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  <aristovski@qnx.com
> 	    Jan Kratochvil  <jan.kratochvil@redhat.com>
>
> 	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  <jan.kratochvil@redhat.com>
>
> 	* 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


  parent reply	other threads:[~2014-03-20 13:13 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 23:12 [PATCH v5 0/8] Validate binary before use Jan Kratochvil
2014-03-19 22:30 ` [PATCH v5 1/8] Move utility functions to common/ Jan Kratochvil
2014-03-24 20:00   ` Sergio Durigan Junior
2014-05-18 19:05     ` Jan Kratochvil
2014-05-19 18:22       ` Tom Tromey
2014-05-19 22:48         ` Doug Evans
2014-05-19 22:46       ` Doug Evans
2014-05-19 18:21   ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 3/8] Create empty common/linux-maps.[ch] and common/target-utils.[ch] Jan Kratochvil
2014-05-19 18:29   ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 8/8] Tests for validate symbol file using build-id Jan Kratochvil
2014-05-20 14:57   ` Tom Tromey
2014-05-20 15:29     ` Jan Kratochvil
2014-03-19 22:31 ` [PATCH v5 2/8] Merge multiple hex conversions Jan Kratochvil
2014-05-19 18:24   ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 6/8] gdbserver build-id attribute generator Jan Kratochvil
2014-05-20 14:40   ` Tom Tromey
2014-05-21 12:24     ` Jan Kratochvil
2014-05-21 16:48       ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 5/8] Move linux_find_memory_regions_full & co Jan Kratochvil
2014-05-19 19:19   ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 4/8] Prepare linux_find_memory_regions_full & co. for move Jan Kratochvil
2014-05-19 19:15   ` Tom Tromey
2014-03-19 22:31 ` [PATCH v5 7/8] Validate symbol file using build-id Jan Kratochvil
2014-03-20  3:51   ` Eli Zaretskii
2014-03-20 13:07     ` Jan Kratochvil
2014-03-20 17:28       ` Eli Zaretskii
2014-03-21 16:58         ` Jan Kratochvil
2014-03-20 13:13   ` Aleksandar Ristovski [this message]
2014-03-21 16:58     ` Jan Kratochvil
2014-03-21 17:08       ` Aleksandar Ristovski
2014-03-21 16:34   ` [PATCH v5 7/8] Validate symbol file using build-id [updated] Jan Kratochvil
2014-03-21 16:52     ` Eli Zaretskii
2014-05-20 14:51   ` [PATCH v5 7/8] Validate symbol file using build-id Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=532AE962.9030604@qnx.com \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox