From: Pedro Alves <palves@redhat.com>
To: Gary Benson <gbenson@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Move vgdb special case into remote_filesystem_is_local
Date: Fri, 15 May 2015 11:32:00 -0000 [thread overview]
Message-ID: <5555D94D.6020606@redhat.com> (raw)
In-Reply-To: <20150515090211.GA13085@blade.nx>
On 05/15/2015 10:02 AM, Gary Benson wrote:
> Pedro Alves wrote:
>> On 04/27/2015 03:51 PM, Gary Benson wrote:
>>> Valgrind GDB (vgdb) presents itself as a remote target but works
>>> on the local filesystem. gdb_bfd_open contained a special case
>>> to make vgdb work with "target:" sysroots, but the implementation
>>> meant that GDB would fall back to the local filesystem if *any*
>>> to_fileio_open method failed with ENOSYS for *any* reason.
>>
>> Can you give an example target where we'd want this to behave
>> differently?
>>
>> E.g,. what should happen with "target sim" ?
>
> I don't understand what you're asking. "target sim" doesn't use
> remote_filesystem_is_local, (to_filesystem_is_local for sim is
> the default, tdefault_filesystem_is_local, which returns 1 always).
When you say:
gdb_bfd_open contained a special case
to make vgdb work with "target:" sysroots, but the implementation
meant that GDB would fall back to the local filesystem if *any*
to_fileio_open method failed with ENOSYS for *any* reason.
I'd prefer to get an example target for one of those "if *any*
to_fileio_open ... *any* reason". I'd like to understand the
real motivation for the change. Because otherwise I get to
wonder why would we handle any other target that goes through
this path differently.
Say for example, that gdb learns to open files from
the remote target with "target mips" (remote-mips.c) as well,
for remote stubs that support it. Seems like we'd handle ENOSYS
the same way.
I may be misunderstanding what you meant.
In any case, I guess it does make more sense to move the checks
to target_filesystem_is_local, so the target_filesystem_is_local()
checks in core code get the right result before target_fileio_open
is called (or target_fileio_readlink, etc.). But then the patch
should be justified on those grounds.
(Note that it's not correct to say that Valgrind _always_ works on
the local filesystem. It's just more common to run Valgrind on
the local machine, but one can well connect to a Valgrind running
on a separate machine, even one of a different arch (e.g., an ARM
GNU/Linux dev board). The fallback is really for any remote
target that doesn't support file retrieval, and is needed because
assuming local is a better default. I'd guess that qemu needs
it too, for example.)
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-05-15 11:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-27 14:51 Gary Benson
2015-05-07 10:09 ` [PING][PATCH] " Gary Benson
2015-05-14 10:44 ` [PATCH] " Pedro Alves
2015-05-15 9:02 ` Gary Benson
2015-05-15 11:32 ` Pedro Alves [this message]
2015-05-15 13:19 ` Gary Benson
2015-05-19 11:10 ` Pedro Alves
2015-05-27 9:50 ` Gary Benson
2015-06-05 15:13 ` [pushed] " Gary Benson
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=5555D94D.6020606@redhat.com \
--to=palves@redhat.com \
--cc=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/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