This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdb: ADI support
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, Wei-min Pan <weimin dot pan at oracle dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 21 Jun 2017 11:10:52 +0100
- Subject: Re: [PATCH v2] gdb: ADI support
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.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 F40E23D956
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F40E23D956
- References: <1497655802-111684-1-git-send-email-weimin.pan@oracle.com> <86o9ti4wa1.fsf@gmail.com> <59496067.5040008@oracle.com> <86d19xhdv0.fsf@gmail.com>
On 06/21/2017 10:46 AM, Yao Qi wrote:
> Wei-min Pan <weimin.pan@oracle.com> writes:
>
>
>>>
>>> You can't access /proc in *-tdep.c file, because it is also compiled for
>>> cross-debugger. The rule in general is to move it to sparc64-linux-nat.c.
>>>
>> It's nice to know. Will look into it. BTW is there any document that
>> specifies/defines these rules for
>> *-tdep.c and *-nat.c files?
>
> I was puzzled by this for several years when I started on GDB :) The
> most relevant one is
> https://sourceware.org/gdb/wiki/Internals%20Native-Debugging In short,
> anything required in native debugging (gdb and program are running on
> the same machine) should be put in *-nat.c. The rest of things related
> to this arch should be put into *-tdep.c. Note some ports have
> *-linux-nat.c and *-linux-tdep.c, the former is about anything required
> in Linux native debugging (gdb and the program is running on the same Linux
> machine), while the latter is about debugging a program running on Linux
> of that arch.
>
There's also:
https://sourceware.org/gdb/wiki/Internals/Source%20Tree%20Structure
I've extended the tdep section a bit now, and added something about
unit tests too, while at it:
https://sourceware.org/gdb/wiki/Internals/Source%20Tree%20Structure?action=diff&rev1=7&rev2=8
Thanks,
Pedro Alves