This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING] [PATCH v3] gdb: ADI support
- From: Pedro Alves <palves at redhat dot com>
- To: Wei-min Pan <weimin dot pan at oracle dot com>, Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 11 Jul 2017 13:21:20 +0100
- Subject: Re: [PING] [PATCH v3] gdb: ADI support
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 89FA515561
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89FA515561
- References: <1499365761-83719-1-git-send-email-weimin.pan@oracle.com> <86d1988tmp.fsf@gmail.com> <34218edb-9c6b-4989-62f3-dd7afb0e3511@oracle.com>
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