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: Weimin Pan <weimin dot pan at oracle dot com>
- To: <palves at redhat dot com>
- Cc: <qiyaoltc at gmail dot com>, <gdb-patches at sourceware dot org>
- Date: Tue, 11 Jul 2017 17:36:34 -0700 (PDT)
- Subject: Re: [PING] [PATCH v3] gdb: ADI support
- Authentication-results: sourceware.org; auth=none
Simply using target_fileio_xxx routines to replace their
corresponding open/pread64/pwrite64/close calls, as you
suggested, does solve the cross-referencing problem.
The cross gdb build for all targets was then retried and
was successful.
Thanks much.
----- Original Message -----
From: palves@redhat.com
To: weimin.pan@oracle.com, qiyaoltc@gmail.com
Cc: gdb-patches@sourceware.org
Sent: Tuesday, July 11, 2017 5:21:26 AM GMT -08:00 US/Canada Pacific
Subject: Re: [PING] [PATCH v3] gdb: ADI support
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