Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Wei-min Pan <weimin.pan@oracle.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: ADI support
Date: Wed, 21 Jun 2017 16:22:00 -0000	[thread overview]
Message-ID: <594A9D45.1010604@oracle.com> (raw)
In-Reply-To: <86d19xhdv0.fsf@gmail.com>

Yao Qi wrote:
> 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.
>   

Thanks for bringing up and taking care of  this matter. I will create 
sparc64-tdep-adi.c for SPARC
ADI support.

>>> 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.
>   
I'm glad that I wasn't the only one who struggled to grasp the concept :) 
Thanks for the clarification (also Pedro's).


  parent reply	other threads:[~2017-06-21 16:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 23:37 Weimin Pan
2017-06-20 13:35 ` Yao Qi
2017-06-20 17:50   ` Wei-min Pan
2017-06-21  9:47     ` Yao Qi
2017-06-21 10:11       ` Pedro Alves
2017-06-21 16:22       ` Wei-min Pan [this message]
2017-06-21 16:42         ` Yao Qi
2017-06-27  0:44 Weimin Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=594A9D45.1010604@oracle.com \
    --to=weimin.pan@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox