From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>,
Sandra Loosemore <sandra@codesourcery.com>,
Paul_Koning@Dell.com,
Jan Kratochvil <jan.kratochvil@redhat.com>,
Joel Brobecker <brobecker@adacore.com>
Subject: [PATCH 5/5] Update exec_file_find callers
Date: Tue, 28 Jul 2015 15:45:00 -0000 [thread overview]
Message-ID: <1438097772-31480-6-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1438097772-31480-1-git-send-email-gbenson@redhat.com>
This commit updates the two callers of exec_file_find to make the call
regardless of what gdb_sysroot is set to.
Also, one of the callers used exec_file_find for absolute filenames
only, but the other used it in all cases. The latter is probably
wrong, and has been updated to only use exec_file_find for absolute
filenames.
gdb/ChangeLog:
* exec.c (exec_file_locate_attach): Use exec_file_find
regardless of what gdb_sysroot is set to.
* infrun.c (follow_exec): Likewise, but only if the new
filename is absolute.
---
gdb/ChangeLog | 7 +++++++
gdb/exec.c | 6 +++---
gdb/infrun.c | 5 ++++-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/gdb/exec.c b/gdb/exec.c
index bbb7798..dcfa971 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -152,9 +152,9 @@ exec_file_locate_attach (int pid, int from_tty)
if (exec_file == NULL)
return;
- /* If gdb_sysroot is not empty and the discovered filename
- is absolute then prefix the filename with gdb_sysroot. */
- if (*gdb_sysroot != '\0' && IS_ABSOLUTE_PATH (exec_file))
+ /* If the discovered filename is absolute then prefix the filename
+ with the target prefix (if necessary) and gdb_sysroot. */
+ if (IS_ABSOLUTE_PATH (exec_file))
full_exec_path = exec_file_find (exec_file, NULL);
if (full_exec_path == NULL)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 445a612..0b4f867 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -61,6 +61,7 @@
#include "target-dcache.h"
#include "terminal.h"
#include "solist.h"
+#include "filenames.h"
/* Prototypes for local functions */
@@ -1133,7 +1134,9 @@ follow_exec (ptid_t ptid, char *execd_pathname)
breakpoint_init_inferior (inf_execd);
- if (*gdb_sysroot != '\0')
+ /* If the discovered filename is absolute then prefix the filename
+ with the target prefix (if necessary) and gdb_sysroot. */
+ if (IS_ABSOLUTE_PATH (execd_pathname))
{
char *name = exec_file_find (execd_pathname, NULL);
--
1.7.1
next prev parent reply other threads:[~2015-07-28 15:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 15:36 [PATCH 0/5] Change how "target:" gets into filenames Gary Benson
2015-07-28 15:36 ` [PATCH 4/5] Use TARGET_FILENAME_PREFIX as the system root in some cases Gary Benson
2015-07-28 15:40 ` Eli Zaretskii
2015-07-28 15:36 ` [PATCH 2/5] Update Valgrind GDB special case Gary Benson
2015-07-28 15:36 ` [PATCH 3/5] Rename TARGET_SYSROOT_PREFIX as TARGET_FILENAME_PREFIX Gary Benson
2015-07-28 15:45 ` [PATCH 1/5] Revert default system root back to "" Gary Benson
2015-07-28 15:58 ` Eli Zaretskii
2015-07-28 15:45 ` Gary Benson [this message]
2015-07-29 17:04 ` [PATCH 0/5] Change how "target:" gets into filenames Jan Kratochvil
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=1438097772-31480-6-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=Paul_Koning@Dell.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=palves@redhat.com \
--cc=sandra@codesourcery.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