This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING] [PATCH v3] gdb: ADI support


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]