This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc, ping] Remote "info proc" and core file generation
- From: Pedro Alves <alves dot ped at gmail dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com, sergiodj at redhat dot com
- Date: Thu, 05 Jan 2012 16:38:35 +0000
- Subject: Re: [rfc, ping] Remote "info proc" and core file generation
- References: <201201051517.q05FH0IE012035@d06av02.portsmouth.uk.ibm.com>
On 01/05/2012 03:17 PM, Ulrich Weigand wrote:
Hello,
given the problems with my latest attempt to access /proc remotely via
generic file access routines documented here:
http://sourceware.org/ml/gdb-patches/2011-12/msg00782.html
I would like to go back to my earlier approach using TARGET_INFO_PROC:
http://sourceware.org/ml/gdb-patches/2011-12/msg00007.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00008.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00009.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00010.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00011.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00014.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00015.html
http://sourceware.org/ml/gdb-patches/2011-12/msg00016.html
In the meantime, I've got approval for the doc and bfd parts, and
Joel has regression-tested the patches on a procfs target (Irix).
So the only thing that stops this patch series from going in as-is
is consensus that TARGET_INFO_PROC is the right abstraction level.
Given the experiments I did in the meantime (see above), I'd now
argue that this *is* the proper level of abstraction:
- TARGET_INFO_PROC allows the *contents* of Linux /proc files to
be passed through unchanged, so we don't have to define our own
formats (and keep updating them) -- the one drawback is that the
contents are obviously Linux-specific, but that's OK as long as
the target objects are only used in linux-tdep code.
- At the same time, *access* to those contents is abstracted. This
means we do *not* have to know exactly where on the target the
/proc files are found: e.g. in the classic remote target, the GDB
host side does not even know the PID of the inferior process on
the target. (Another possibility might be a Linux kernel remote
target that operates via hardware debugging or in-kernel debugging
and still provides access to Linux processes: such remote stubs
could also implement TARGET_INFO_PROC, even if they may not
provide general access to the file system.)
Pedro, you had been raising concerns about this initially. Did you
have a chance to look at the discussion refered to at the top of
this mail?
I've replied now. Sorry for the delay...
Do you still feel that TARGET_INFO_PROC is inappropiate?
I still do. :-(
- there's the issue I raised about needing to cache the object across
the whole transfer, lest the file disappears
of changes behind your feet. Easy to fix, though.
- I don't see the advantage over separate target objects for each
proc/... subtype. We already have a mechanism to report back
some object is not supports (simply don't support
the qXfer:object:read packet). Why use the annex instead?
An e.g., getting at the current process'es executable is something
that would be useful for target_pid_to_exec_file, for attach.
If we're having a specific packet for that, shouldn't it be a "top-level"
packet, rather than buried in TARGET_INFO_PROC?
- if GDB already needs to know what target it is talking to (for the
gdbarch methods), then I don't see what gain do we have from half
an abstraction -- this is what leads me to consider instead reading
from the target filesystem.