From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4317 invoked by alias); 19 Mar 2014 22:17:24 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 4299 invoked by uid 9674); 19 Mar 2014 22:17:24 -0000 Date: Wed, 19 Mar 2014 22:17:00 -0000 Message-ID: <20140319221724.4257.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: Tests for validate symbol file using build-id X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid X-Git-Reftype: branch X-Git-Oldrev: 15a8a61a24feec0d72fb9b2ac595a692a7b319ae X-Git-Newrev: 4e3ec3ff77577a847700893cf308ba1bc6b32b8a X-SW-Source: 2014-q1/txt/msg00021.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid has been updated discards 15a8a61a24feec0d72fb9b2ac595a692a7b319ae (commit) discards 4a392695fafb09376ba4af36a063ca5f1e073ac0 (commit) discards d20ab6c71dbc82c0054cefe7172221f4f988b130 (commit) discards 7118d91db83eea8936692946870089f62214b24c (commit) discards 77f6badca315bafdccdc669b77c72c82eb4dcea0 (commit) discards a4f0f78dea4bc7c217f37eeb96d152c94d17144f (commit) via 4e3ec3ff77577a847700893cf308ba1bc6b32b8a (commit) via 9914a76a05357603ccdc3a41a399ee125053e66d (commit) via 55ec4dcef3e4b3a36d010dff32127ffacea743b9 (commit) via 9ebd029d44030aee8b537108beba069788d68839 (commit) via 6e94d1ef1cde4ba4e38606c4d0f9a20f90fc8fb5 (commit) via b007f850d5490d5947663932482cd682f3fea6cd (commit) from 15a8a61a24feec0d72fb9b2ac595a692a7b319ae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 4e3ec3ff77577a847700893cf308ba1bc6b32b8a Author: Jan Kratochvil Date: Sun Mar 9 19:51:37 2014 +0100 Tests for validate symbol file using build-id Hi, new testcase. Jan gdb/testsuite/ 2014-02-26 Aleksandar Ristovski Date: Wed Mar 19 21:39:22 2014 +0100 Validate symbol file using build-id Hi, consumer part of the "build-id" attribute. Jan gdb/ 2014-02-26 Aleksandar Ristovski 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'. commit 55ec4dcef3e4b3a36d010dff32127ffacea743b9 Author: Jan Kratochvil Date: Wed Mar 19 21:39:21 2014 +0100 gdbserver build-id attribute generator Hi, producer part of the new "build-id" XML attribute. Jan gdb/ 2014-02-26 Aleksandar Ristovski Date: Wed Mar 19 21:39:21 2014 +0100 Move linux_find_memory_regions_full & co. Hi, this should be just a move with no changes. Jan gdb/ 2014-02-26 Aleksandar Ristovski Date: Wed Mar 19 21:39:21 2014 +0100 Prepare linux_find_memory_regions_full & co. for move Hi, prepare code for move into gdb/common/. Jan gdb/ 2014-02-26 Aleksandar Ristovski Date: Wed Mar 19 21:39:20 2014 +0100 Create empty common/linux-maps.[ch] and common/target-utils.[ch] Hi, prepare new files for later move. Jan gdb/ 2014-02-26 Aleksandar Ristovski target-utils.c} | 2 +- gdb/common/{common-target.h => target-utils.h} | 6 +++--- gdb/doc/gdb.texinfo | 19 +++++++++++-------- gdb/gdbserver/Makefile.in | 4 ++-- gdb/target.c | 2 +- .../{gdb.base => gdb.server}/solib-mismatch-lib.c | 0 .../solib-mismatch-libmod.c | 0 .../{gdb.base => gdb.server}/solib-mismatch.c | 4 ++-- .../{gdb.base => gdb.server}/solib-mismatch.exp | 19 ++++++++----------- 11 files changed, 33 insertions(+), 33 deletions(-) rename gdb/common/{common-target.c => target-utils.c} (99%) rename gdb/common/{common-target.h => target-utils.h} (93%) rename gdb/testsuite/{gdb.base => gdb.server}/solib-mismatch-lib.c (100%) rename gdb/testsuite/{gdb.base => gdb.server}/solib-mismatch-libmod.c (100%) rename gdb/testsuite/{gdb.base => gdb.server}/solib-mismatch.c (91%) rename gdb/testsuite/{gdb.base => gdb.server}/solib-mismatch.exp (89%) First 500 lines of diff: diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 1e2c5f6..2dc5c47 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -924,7 +924,7 @@ common/linux-osdata.h gdb-dlfcn.h auto-load.h probe.h stap-probe.h \ gdb_bfd.h sparc-ravenscar-thread.h ppc-ravenscar-thread.h common/linux-btrace.h \ ctf.h common/i386-cpuid.h common/i386-gcc-cpuid.h target/resume.h \ target/wait.h target/waitstatus.h nat/linux-nat.h nat/linux-waitpid.h \ -common/print-utils.h common/rsp-low.h common/common-target.h +common/print-utils.h common/rsp-low.h common/target-utils.h # Header files that already have srcdir in them, or which are in objdir. @@ -1023,7 +1023,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ gdb_vecs.o jit.o progspace.o skip.o probe.o \ common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.o \ format.o registry.o btrace.o record-btrace.o waitstatus.o \ - print-utils.o rsp-low.o common-target.o + print-utils.o rsp-low.o target-utils.o TSOBS = inflow.o @@ -2137,8 +2137,8 @@ common-agent.o: $(srcdir)/common/agent.c $(COMPILE) $(srcdir)/common/agent.c $(POSTCOMPILE) -common-target.o: ${srcdir}/common/common-target.c - $(COMPILE) $(srcdir)/common/common-target.c +target-utils.o: ${srcdir}/common/target-utils.c + $(COMPILE) $(srcdir)/common/target-utils.c $(POSTCOMPILE) vec.o: ${srcdir}/common/vec.c diff --git a/gdb/common/linux-maps.c b/gdb/common/linux-maps.c index bb587df..4d0b973 100644 --- a/gdb/common/linux-maps.c +++ b/gdb/common/linux-maps.c @@ -29,7 +29,7 @@ #include "gdb_assert.h" #include #include -#include "common-target.h" +#include "target-utils.h" /* Service function for corefiles and info proc. */ diff --git a/gdb/common/common-target.c b/gdb/common/target-utils.c similarity index 99% rename from gdb/common/common-target.c rename to gdb/common/target-utils.c index d6e5d60..84d1bca 100644 --- a/gdb/common/common-target.c +++ b/gdb/common/target-utils.c @@ -24,7 +24,7 @@ #endif #include -#include "common-target.h" +#include "target-utils.h" #include "gdb_assert.h" LONGEST diff --git a/gdb/common/common-target.h b/gdb/common/target-utils.h similarity index 93% rename from gdb/common/common-target.h rename to gdb/common/target-utils.h index 9aedc12..f8ca972 100644 --- a/gdb/common/common-target.h +++ b/gdb/common/target-utils.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef COMMON_COMMON_TARGET_H -#define COMMON_COMMON_TARGET_H +#ifndef COMMON_TARGET_UTILS_H +#define COMMON_TARGET_UTILS_H typedef int (read_alloc_pread_ftype) (int handle, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno); @@ -31,4 +31,4 @@ typedef LONGEST (read_stralloc_func_ftype) (const char *filename, extern char *read_stralloc (const char *filename, read_stralloc_func_ftype *func); -#endif /* COMMON_COMMON_TARGET_H */ +#endif /* COMMON_TARGET_UTILS_H */ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index ebdc9ea..a4af3ec 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -17125,21 +17125,24 @@ By default @value{GDBN} will ignore symbol files with non-matching build-id while printing: @smallexample - Shared object "libfoo.so.1" could not be validated and will be ignored; - or use 'set solib-build-id-force'. + warning: Shared object "libfoo.so.1" could not be validated (remote + build ID 2bc1745e does not match local build ID a08f8767) and will be + ignored; or use 'set solib-build-id-force'. @end smallexample Turning on this setting would load such symbol file while still printing: @smallexample - Shared object "libfoo.so.1" could not be validated but it is being loaded - due to 'set solib-build-id-force'. + 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 -If both build-ids are present but they do not match 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 files this setting has no effect. The default value is @code{off}. +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}. Loading non-matching symbol file may confuse debugging including breakage of backtrace output. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 4ae4702..7d267f7 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -177,7 +177,7 @@ OBS = agent.o ax.o inferiors.o regcache.o remote-utils.o server.o signals.o \ target.o waitstatus.o utils.o debug.o version.o vec.o gdb_vecs.o \ mem-break.o hostio.o event-loop.o tracepoint.o xml-utils.o \ common-utils.o ptid.o buffer.o format.o filestuff.o dll.o notif.o \ - tdesc.o print-utils.o rsp-low.o common-target.o \ + tdesc.o print-utils.o rsp-low.o target-utils.o \ $(XML_BUILTIN) $(DEPFILES) $(LIBOBJS) GDBREPLAY_OBS = gdbreplay.o version.o GDBSERVER_LIBS = @GDBSERVER_LIBS@ @@ -502,7 +502,7 @@ linux-procfs.o: ../common/linux-procfs.c linux-ptrace.o: ../common/linux-ptrace.c $(COMPILE) $< $(POSTCOMPILE) -common-target.o: ../common/common-target.c +target-utils.o: ../common/target-utils.c $(COMPILE) $< $(POSTCOMPILE) common-utils.o: ../common/common-utils.c diff --git a/gdb/target.c b/gdb/target.c index fa51952..0e5ea33 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -45,7 +45,7 @@ #include "gdb/fileio.h" #include "agent.h" #include "auxv.h" -#include "common-target.h" +#include "target-utils.h" static void target_info (char *, int); diff --git a/gdb/testsuite/gdb.base/solib-mismatch-lib.c b/gdb/testsuite/gdb.server/solib-mismatch-lib.c similarity index 100% rename from gdb/testsuite/gdb.base/solib-mismatch-lib.c rename to gdb/testsuite/gdb.server/solib-mismatch-lib.c diff --git a/gdb/testsuite/gdb.base/solib-mismatch-libmod.c b/gdb/testsuite/gdb.server/solib-mismatch-libmod.c similarity index 100% rename from gdb/testsuite/gdb.base/solib-mismatch-libmod.c rename to gdb/testsuite/gdb.server/solib-mismatch-libmod.c diff --git a/gdb/testsuite/gdb.base/solib-mismatch.c b/gdb/testsuite/gdb.server/solib-mismatch.c similarity index 91% rename from gdb/testsuite/gdb.base/solib-mismatch.c rename to gdb/testsuite/gdb.server/solib-mismatch.c index 7bf425d..c8be18a 100644 --- a/gdb/testsuite/gdb.base/solib-mismatch.c +++ b/gdb/testsuite/gdb.server/solib-mismatch.c @@ -22,9 +22,9 @@ #include #include -/* The following defines must correspond to solib-mismatch.exp */ +/* The following defines must correspond to solib-mismatch.exp . */ -/* DIRNAME must be defined at compile time. */ +/* DIRNAME and LIB must be defined at compile time. */ #ifndef DIRNAME #error DIRNAME not defined #endif diff --git a/gdb/testsuite/gdb.base/solib-mismatch.exp b/gdb/testsuite/gdb.server/solib-mismatch.exp similarity index 89% rename from gdb/testsuite/gdb.base/solib-mismatch.exp rename to gdb/testsuite/gdb.server/solib-mismatch.exp index 0048213..9dbce7f 100644 --- a/gdb/testsuite/gdb.base/solib-mismatch.exp +++ b/gdb/testsuite/gdb.server/solib-mismatch.exp @@ -82,7 +82,7 @@ if { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfilerun}" "${binlibfilerun} return -1 } -proc solib_matching_test { solibfile symsloaded msg } { +proc solib_matching_test { solibfile symsloaded } { global gdb_prompt global testfile global executable @@ -116,7 +116,7 @@ proc solib_matching_test { solibfile symsloaded msg } { gdb_test "info sharedlibrary ${solibfile}" \ "${expected_header}\r\n.*${expected_line}.*" \ - "${msg} - Symbols for ${solibfile} loaded: expected '${symsloaded}'" + "Symbols for ${solibfile} loaded: expected '${symsloaded}'" return 0 } @@ -127,9 +127,8 @@ file copy -force "${binlibfiledirgdb}/${executable}" \ "${binlibfiledirrun}/${executable}" # Test unstripped, .dynamic matching -if { [solib_matching_test "${binlibfilebase}" "No" \ - "test unstripped, .dynamic matching"] != 0 } { - untested "test unstripped, .dynamic matching" +with_test_prefix "test unstripped, .dynamic matching" { + solib_matching_test "${binlibfilebase}" "No" } # Keep original so for debugging purposes @@ -141,9 +140,8 @@ if {$result != 0} { } # Test --only-keep-debug, .dynamic matching so -if { [solib_matching_test "${binlibfilebase}" "No" \ - "test --only-keep-debug"] != 0 } { - untested "test --only-keep-debug" +with_test_prefix "test --only-keep-debug" { + solib_matching_test "${binlibfilebase}" "No" } # Keep previous so for debugging puroses @@ -153,7 +151,6 @@ file copy -force "${binlibfilegdb}" "${binlibfilegdb}-orig1" file copy -force "${binlibfilerun}" "${binlibfilegdb}" # Now test it does not mis-invalidate matching libraries -if { [solib_matching_test "${binlibfilebase}" "Yes" \ - "test matching libraries"] } { - untested "test matching libraries" +with_test_prefix "test matching libraries" { + solib_matching_test "${binlibfilebase}" "Yes" } hooks/post-receive -- Repository for Project Archer.