[PING] [PATCH v3] gdb: ADI support
Pedro Alves
palves@redhat.com
Tue Jul 11 12:21:00 GMT 2017
On 07/11/2017 03:56 AM, Wei-min Pan wrote:
> With your comments like:
> * You can't access /proc in *-tdep.c file, because it is also compiled for
> cross-debugger (from previous review);
> * We can't include "nat.h" in "tdep.c";
> * Calling pread64 in -tdep.c makes few sense to me. If you only want to
> support native debugging, move them to -nat.c file.
>
> I now believe that the ADI support should be in sparc6 4-linux-nat.c,
> not sparc64-tdep.c. Doing so also makes cross gdb build a non-issue.
Please don't leave remote debugging out of the design.
I.e., remote debugging against gdbserver.
You were reading some /proc files with target_fileio, like:
snprintf (filename, sizeof filename, "/proc/%d/adi/maps", pid);
char *data = target_fileio_read_stralloc (NULL, filename);
and that should work against gdbserver. (It'll read the remote
target file when remote debugging.) So one way would be to
replace open/pread64/close etc calls with calls to corresponding
target_fileio_xxx routines.
Alternatively (or in addition) defining new "enum target_object"
objects, and then using the target_xfer_partial interface may
make sense. (I really haven't studied the code in any detail
to tell, but it should be a useful pointer, regardless.)
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list