From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119927 invoked by alias); 12 Aug 2015 20:24:15 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 119907 invoked by uid 9674); 12 Aug 2015 20:24:15 -0000 Date: Wed, 12 Aug 2015 20:24:00 -0000 Message-ID: <20150812202415.119828.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: sticky X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid X-Git-Reftype: branch X-Git-Oldrev: 7511e878a507fd83b0954e35afc5b1954bbf4b70 X-Git-Newrev: ae009c1b5c62233bc52c92bb13829fbdf3f738d7 X-SW-Source: 2015-q3/txt/msg00027.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid has been updated discards 7511e878a507fd83b0954e35afc5b1954bbf4b70 (commit) discards 9a3e9406df37eb937420653ae950677f907688ab (commit) discards c035efd98527f99e03a0026bc780e70b25f976c4 (commit) discards e42869d96a302327ce96454c0d2145543c2dcd3c (commit) discards fc064e4f050405c777709428fba9753f76e0ad67 (commit) discards a3c14f98032a338154ad1bd6b72aa3353011913f (commit) discards 35a6c7e8a3a06d0d4312ca0ac61f775908404539 (commit) discards 88db88f0eaa679a6003a0d937740aabd8645b9a1 (commit) discards abde5b2f068ead085a2a1a3dee9dd0d38fa804ea (commit) discards cdb53cfdd51ece48623559c9438781206c542cf6 (commit) discards 131418d98260842d5c51faa491bd1f687b0cff1e (commit) discards 105855d3ed65660d3f6b757deb2715bf4c51f9fe (commit) discards a400763759a2134fb35b22fe16b905397d041df2 (commit) discards cecf494e5c91889b2e14f9de601f80a66f9f1f0c (commit) discards d3cfb809d3bf745a0ff88d8f859ec30d8c407a41 (commit) discards 9306fee563612fbf22cfdd1ceaed88af5c5f0f9f (commit) discards cc174ddeed447e0f7c5c352b3955c7444f27c9c5 (commit) discards cb971af740e27acf7c9bddbcf3cb6561eac6c212 (commit) discards 4e73026d7c026f25c550d587986b275964ce5af6 (commit) discards 72b8f9888a26b0c219d5b833fcedffdd008b38ce (commit) discards 7f8e7055a0c5a85ee69cd7e2afc5b94d04152b3e (commit) discards 8f52371e0efe7ed06a907649d640ef477999a1fc (commit) discards 60aea42fb6c8444c1dfb8fd418bbe89c05f3eed3 (commit) discards 49085cd8f6606199af381a7e71b90a0279ec9e34 (commit) discards 0eddadf0d2213ddafb0aa94da9fdef0c5c912d52 (commit) discards d7c3003426921da562b581d161bf3eb736c11780 (commit) via ae009c1b5c62233bc52c92bb13829fbdf3f738d7 (commit) via 4ed402d23c9bc7587d6ebeb98aac1c89f0e2996c (commit) via d6adbe2e2ea7cafa38a43192c558dc5fb986e9e2 (commit) via 62c380d107f284c732691bc1cf483c7001bf0575 (commit) via f2c851971ab84f0b66b2512e00116d0cec15abe7 (commit) via 63c8894843b98d28081a1a4ac9b22416ef139048 (commit) via 01a167f13792d059fa27d18054793c3ed3adb2b3 (commit) via f2e33a76348337f91f9be5a54f328e3c070a869b (commit) via 388cf8787adb0db1a5751311181c5ae6ff2fcab8 (commit) via 27854d1c85f0c689fec9e6c7617d09fb2c78be3a (commit) via f53fe5034f3b652e3bd4424eb9c3641cf057b37e (commit) via f3fb5a6526fe3ffdc2314290507a209acae2a5f1 (commit) via 1f28d772f900f8963ffaed2b7c37edfcd40efc92 (commit) via 486a40586c5f428a13048cef5c1575ebb9f18b61 (commit) via 18d4031ae35ae4a5dcb03f5eeba6cd43fa713700 (commit) via 0501d9df3ad566c9d66fb814584852dbd0930739 (commit) via b21b3a3f00a0dd80ee641d7aa12e950e977303c1 (commit) via 80432f849322811c259a05c8bd9a638a73e88cd5 (commit) via fef843202f56678b4089b285d14133969f56c7e6 (commit) via 1d63ae5cb294f9d8f0a059c49b1cf0c877b42cb5 (commit) via 7b46b23c4bb32e7d2171ef4c19c20bf51c06d6f4 (commit) via 524206e9a325be3684efd7af59676c307d3d150f (commit) via bef667c7aff50753dd43712be95afab66fa94767 (commit) via e20832687edce5b65e90fa338d42aa821207e5af (commit) via 7a867eeefa6d8a282a119afd5cc43697bb938266 (commit) via 4791222f9fc2a35a62078243a53409f26799f34a (commit) from 7511e878a507fd83b0954e35afc5b1954bbf4b70 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit ae009c1b5c62233bc52c92bb13829fbdf3f738d7 Author: Jan Kratochvil Date: Wed Aug 12 18:05:45 2015 +0200 sticky Message-Id: <1433754079-10395-1-git-send-email-gbenson@redhat.com> Philippe Waroquiers wrote: > On Fri, 2015-06-05 at 12:22 +0100, Gary Benson wrote: > > Built and regtested on RHEL6.6 x86_64. > I tested with the last SVN version of the Valgrind gdbserver (that > supports qXfer:exec-file:read+). > > The patch introduces a regression: > with the patch, GDB does not anymore automatically load the > exec-file. > > I bypassed this problem by ignoring fake_pid_p in remote.c: > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -1624,9 +1624,13 @@ remote_add_inferior (int fake_pid_p, int pid, int > attached, > inf->attach_flag = attached; > inf->fake_pid_p = fake_pid_p; > > - /* If no main executable is currently open then attempt to > - open the file that was executed to create this inferior. */ > - if (try_open_exec && get_exec_file (0) == NULL) > + /* Attempt to open the file that was executed to create this > + inferior. If the user has explicitly specified executable > + and/or symbol files then warn the user if their choices do > + not match. Otherwise, set exec_file and symfile_objfile to > + the new file. */ > + printf("fake_pid_p %d\n", fake_pid_p); > + if (try_open_exec)// && !fake_pid_p) > exec_file_locate_attach (pid, 1); > > Effectively, the printf shows that with Valgrind gdbsrv, > fake_pid_p value is 1. > > When ignoring fake_pid_p, GDB can properly attach > to different Valgrind gdbsrv, and changes of executable > as expected. Ah, it seems I mailed a bad patch, my apologies! I was working on two fixes that touched the same line, and it looks like I rebased them in the wrong order. This updated patch has been created against the latest gdb/master (80fb91378c91a8239817a5ab2b1c3e346109db25). Could you please try your tests again? Thanks, Gary --- On attach, GDB will only attempt to determine the main executable's filename if one is not already set. This causes problems if you attach to one process and then attach to another: GDB will not attempt to discover the main executable on the second attach. If the two processes have different main executable files then the symbols will now be wrong. This is PR gdb/17626. In GDB some filenames are supplied by the user (e.g. using the "file" or "symbol-file" commands) and some are determined by GDB (e.g. while processing an "attach" command). This commit updates GDB to track which filenames were supplied by the user. When GDB might attempt to determine an executable filename and one is already set, filenames determined by GDB may be overridden but user-supplied filenames will not. gdb/ChangeLog: PR gdb/17626 * progspace.h (struct program_space) : New field. : Likewise. (symfile_objfile_is_user_supplied): New macro. * exec.h (exec_file_is_user_supplied): Likewise. * exec.c (exec_close): Clear exec_file_is_user_supplied. (exec_file_locate_attach): Remove get_exec_file check. Do not replace user-supplied executable or symbol files. Warn if user-supplied executable or symbol files do not match discovered file. (exec_file_command): Set exec_file_is_user_supplied. * symfile.c (symbol_file_clear): Clear symfile_objfile_is_user_supplied. (symbol_file_command): Set symfile_objfile_is_user_supplied. * inferior.c (add_inferior_command): Set exec_file_is_user_supplied and symfile_objfile_is_user_supplied. * main.c (captured_main): Likewise. * infcmd.c (attach_command_post_wait): Always call exec_file_locate_attach. Only call reopen_exec_file and reread_symbols if exec_file_is_user_supplied. * remote.c (remote_add_inferior): Remove get_exec_file check around exec_file_locate_attach. commit 4ed402d23c9bc7587d6ebeb98aac1c89f0e2996c Author: Jan Kratochvil Date: Wed Aug 12 18:05:44 2015 +0200 mainbuildid commit d6adbe2e2ea7cafa38a43192c558dc5fb986e9e2 Author: Jan Kratochvil Date: Wed Aug 12 18:05:44 2015 +0200 hexallocate commit 62c380d107f284c732691bc1cf483c7001bf0575 Author: Jan Kratochvil Date: Wed Aug 12 18:05:44 2015 +0200 locatetest commit f2c851971ab84f0b66b2512e00116d0cec15abe7 Author: Jan Kratochvil Date: Sun Jul 12 20:59:03 2015 +0200 Tests for validate symbol file using build-id New testcase. gdb/testsuite/ChangeLog 2015-07-15 Aleksandar Ristovski Date: Wed Aug 12 18:05:43 2015 +0200 buildidwarn commit 01a167f13792d059fa27d18054793c3ed3adb2b3 Author: Jan Kratochvil Date: Wed Aug 12 18:05:43 2015 +0200 buildidsolibbfdopen commit f2e33a76348337f91f9be5a54f328e3c070a869b Author: Jan Kratochvil Date: Wed Aug 12 18:05:43 2015 +0200 buildidverify commit 388cf8787adb0db1a5751311181c5ae6ff2fcab8 Author: Jan Kratochvil Date: Wed Aug 12 18:05:43 2015 +0200 buildidsolibsearch commit 27854d1c85f0c689fec9e6c7617d09fb2c78be3a Author: Jan Kratochvil Date: Wed Aug 12 18:05:43 2015 +0200 buildidtofile commit f53fe5034f3b652e3bd4424eb9c3641cf057b37e Author: Jan Kratochvil Date: Wed Aug 12 18:05:42 2015 +0200 buildidproto commit f3fb5a6526fe3ffdc2314290507a209acae2a5f1 Author: Jan Kratochvil Date: Wed Aug 12 18:05:42 2015 +0200 buildidtobfd commit 1f28d772f900f8963ffaed2b7c37edfcd40efc92 Author: Jan Kratochvil Date: Wed Aug 12 18:05:42 2015 +0200 buildidforcemove commit 486a40586c5f428a13048cef5c1575ebb9f18b61 Author: Jan Kratochvil Date: Wed Aug 12 18:05:42 2015 +0200 buildidfreefix commit 18d4031ae35ae4a5dcb03f5eeba6cd43fa713700 Author: Jan Kratochvil Date: Wed Aug 12 18:05:41 2015 +0200 openpsymfile commit 0501d9df3ad566c9d66fb814584852dbd0930739 Author: Jan Kratochvil Date: Wed Aug 12 18:05:41 2015 +0200 openpsolib commit b21b3a3f00a0dd80ee641d7aa12e950e977303c1 Author: Jan Kratochvil Date: Wed Aug 12 18:05:41 2015 +0200 openp commit 80432f849322811c259a05c8bd9a638a73e88cd5 Author: Jan Kratochvil Date: Wed Aug 12 18:05:41 2015 +0200 filelib commit fef843202f56678b4089b285d14133969f56c7e6 Author: Jan Kratochvil Date: Wed Aug 12 18:05:40 2015 +0200 openfromtargetdoclose commit 1d63ae5cb294f9d8f0a059c49b1cf0c877b42cb5 Author: Jan Kratochvil Date: Wed Aug 12 18:05:40 2015 +0200 openfromtargetfd commit 7b46b23c4bb32e7d2171ef4c19c20bf51c06d6f4 Author: Jan Kratochvil Date: Wed Aug 12 18:05:40 2015 +0200 openfromtarget commit 524206e9a325be3684efd7af59676c307d3d150f Author: Jan Kratochvil Date: Wed Aug 12 18:05:40 2015 +0200 openpnullpathname commit bef667c7aff50753dd43712be95afab66fa94767 Author: Jan Kratochvil Date: Wed Aug 12 18:05:39 2015 +0200 openpmode commit e20832687edce5b65e90fa338d42aa821207e5af Author: Jan Kratochvil Date: Wed Aug 12 18:05:39 2015 +0200 openppath commit 7a867eeefa6d8a282a119afd5cc43697bb938266 Author: Jan Kratochvil Date: Wed Aug 12 18:05:39 2015 +0200 openpenum commit 4791222f9fc2a35a62078243a53409f26799f34a Author: Jan Kratochvil Date: Wed Aug 12 18:56:48 2015 +0200 sysrootdefault ----------------------------------------------------------------------- Summary of changes: gdb/solib.c | 20 ++++++++++++++++---- gdb/testsuite/gdb.base/break-probes.exp | 7 +++++-- 2 files changed, 21 insertions(+), 6 deletions(-) First 500 lines of diff: diff --git a/gdb/solib.c b/gdb/solib.c index 8f18b20..acb2eb1 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -346,7 +346,10 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot, { file = openp_file (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id); if (file_location_is_valid (&file)) - return file; + { + file.filename = gdb_realpath_and_xfree (file.filename); + return file; + } file_location_free (&file); } @@ -358,7 +361,10 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot, { file = openp_file (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), target_lbasename (fskind, in_pathname), build_idsz, build_id); if (file_location_is_valid (&file)) - return file; + { + file.filename = gdb_realpath_and_xfree (file.filename); + return file; + } file_location_free (&file); } @@ -377,7 +383,10 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot, { file = openp_file (get_in_environ (current_inferior ()->environment, "PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id); if (file_location_is_valid (&file)) - return file; + { + file.filename = gdb_realpath_and_xfree (file.filename); + return file; + } file_location_free (&file); } @@ -387,7 +396,10 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot, { file = openp_file (get_in_environ (current_inferior ()->environment, "LD_LIBRARY_PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id); if (file_location_is_valid (&file)) - return file; + { + file.filename = gdb_realpath_and_xfree (file.filename); + return file; + } file_location_free (&file); } diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp index 00ca458..0431aa3 100644 --- a/gdb/testsuite/gdb.base/break-probes.exp +++ b/gdb/testsuite/gdb.base/break-probes.exp @@ -67,8 +67,11 @@ if { $using_probes } { } # GDB strips "target:" from the start of filenames - # when operating on the local filesystem - regsub "^target:" "$sysroot" "(target:)?" sysroot + # when operating on the local filesystem. + # Also use only the first element of $sysroot which will hopefully + # successfully match the filename. + regsub "^target:(\[^:\]*):.*$" "$sysroot" "" sysroot + regsub "^(?!target:)(\[^:\]*):.*$" "$sysroot" "" sysroot # Run til it loads our library set test "run til our library loads" hooks/post-receive -- Repository for Project Archer.