From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24318 invoked by alias); 12 Aug 2015 15:39:28 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 24300 invoked by uid 9674); 12 Aug 2015 15:39:27 -0000 Date: Wed, 12 Aug 2015 15:39:00 -0000 Message-ID: <20150812153927.24271.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid-locate: sticky X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid-locate X-Git-Reftype: branch X-Git-Oldrev: 418401189cb3400e44e5fa27114025e8b539f4b3 X-Git-Newrev: 1f37397f1b638f717f2bd0bc6e71fd6fc8e75d39 X-SW-Source: 2015-q3/txt/msg00023.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid-locate has been updated discards 418401189cb3400e44e5fa27114025e8b539f4b3 (commit) via 1f37397f1b638f717f2bd0bc6e71fd6fc8e75d39 (commit) via cb87cc5840129399855923ab381d6a11ba502593 (commit) from 418401189cb3400e44e5fa27114025e8b539f4b3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 1f37397f1b638f717f2bd0bc6e71fd6fc8e75d39 Author: Jan Kratochvil Date: Wed Aug 5 21:41:00 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 cb87cc5840129399855923ab381d6a11ba502593 Author: Jan Kratochvil Date: Wed Aug 12 17:06:00 2015 +0200 openptarget ----------------------------------------------------------------------- Summary of changes: gdb/source.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) First 500 lines of diff: diff --git a/gdb/source.c b/gdb/source.c index 3c35075..99706a2 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1031,11 +1031,12 @@ openp_file (const char *path, enum openp_flags opts, const char *string, size_t if (!path) path = "."; - if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string)) + if ((opts & OPF_TRY_CWD_FIRST) || is_target_filename (string) + || IS_ABSOLUTE_PATH (string)) { int i; - if (is_regular_file (string)) + if (is_target_filename (string) || is_regular_file (string)) { filename = alloca (strlen (string) + 1); strcpy (filename, string); hooks/post-receive -- Repository for Project Archer.