[PATCH v2] gdb: ADI support
Yao Qi
qiyaoltc@gmail.com
Wed Jun 21 09:47:00 GMT 2017
Wei-min Pan <weimin.pan@oracle.com> writes:
>> The new file sparc64-adi-tdep.c should be merged into the existing
>> sparc64-tdep.c. The file name schema in GDB is ARCH-OSABI-tdep.c.
>> Since adi is a new hardware feature rather than an OSABI, it should be
>> put in sparc64-tdep.c
>>
>
> Originally it was part of sparc64-tdep.c. But our engineer thought
> it's cleaner to make it a
> separate source file. Being new to the gnu world, I believe following
> the file name schema
> is the way to go. Thanks.
>
That is the current file name convention we have to follow, however, I
personally prefer putting them into separated files. Let me post a mail
to ask this.
>>
>> 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.
--
Yao (齐尧)
More information about the Gdb-patches
mailing list