public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com>
To: Michael Eager <eager@eagercon.com>,
	Pedro Alves <palves@redhat.com>,
	Joel Brobecker <brobecker@adacore.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Vinod Kathail	<vinodk@xilinx.com>,
	Vidhumouli Hunsigida <vidhum@xilinx.com>,
	"Nagaraju Mekala" <nmekala@xilinx.com>
Subject: RE: [Patch] Microblaze: Port of Linux gdbserver
Date: Tue, 14 Oct 2014 15:33:00 -0000	[thread overview]
Message-ID: <218e019237974e21aac94cd69251d98d@BN1AFFO11FD052.protection.gbl> (raw)
In-Reply-To: <543D3C18.4050609@eagercon.com>



-----Original Message-----
From: Michael Eager [mailto:eager@eagercon.com] 
Sent: Tuesday, October 14, 2014 8:37 PM
To: Ajit Kumar Agarwal; Pedro Alves; Joel Brobecker
Cc: gdb-patches@sourceware.org; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch] Microblaze: Port of Linux gdbserver

On 10/13/14 20:03, Ajit Kumar Agarwal wrote:
>
>

> On 10/13/14 09:00, Ajit Kumar Agarwal wrote:
>>
>
>>> +#define microblaze_breakpoint_len 4
>>>
>>>>> Use CAPS for macros.
>>>
>>> The MIPS and the ARM gdbserver code does not use the CAPS for the above macro defined.
>>
>>> Let's follow the GNU coding standard, even if some other targets haven't.
>>
>> https://gcc.gnu.org/ml/gcc-patches/2000-09/msg00901.html
>> https://gcc.gnu.org/ml/gcc-patches/2000-09/msg00912.html
>
>> To quote your first reference:
>
>> "I actually think it's a mistake to spell function-like macros in ALL_CAPS, precisely because that makes changing back-and-forth unduly disruptive."
>
>> To quote the second reference:
>
>> "ALL_CAPS in cases when it's important to be aware that it's a macro, but when we make "wrappers" for efficiency purposes where we basically want to >pretend it's a function,".
>
>> This is not a function-like macro.  In this case, it is important to be aware that this is a macro, not a variable.
>
> The macro microblaze_breakpoint_len is initialized in the struct linux_target_ops the_low_target.  This makes it as a wrapper and the above quote is valid.
> Still the CAPS is required for the above macro?

>>You clearly do not have any understanding of what a wrapper is.
>>A wrapper macro is one which looks like a function and calls another function or macro, passing it some arguments.

>>Please read a definition of "wrapper" or "function-like macro":
>>http://programmers.stackexchange.com/questions/142069/using-macro-as-an-abstraction-layer
>>https://gcc.gnu.org/onlinedocs/cpp/Function-like-Macros.html

>>microblaze_breakpoint_len is not initialized in any struct or anywhere else.  It is a preprocessor macro definition.  In C, only variables can be initialized, and >>that cannot happen in a struct.

>>microblaze_breakpoint_len is used in an initializer for an instance of struct linux_target_ops.

>>In general, macro definitions like this one should be at the top of a file, not buried in the middle of the file.

>>You appear to be unfamiliar with common terminology like wrapper, function- like macro, or initialize, or what can or cannot be done within a struct. I >>suggest you study C programming.  There are a number of books on advanced C programming available online.

I am well aware and adept with the above knowledge and I am afraid I won't be needing your guidance as far as this is concerned. 

> AGAIN, please follow the GNU Coding Standard.

Please make sure when replying to email that you do not confuse your responses with the text you are responding to.  I don't know how you are reading or submitting email, but just about every message is garbled.

USE CAPS FOR MACROS.  Is that clear enough?


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

  reply	other threads:[~2014-10-14 15:33 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 13:52 Ajit Kumar Agarwal
2014-10-09 16:29 ` Michael Eager
2014-10-09 18:54   ` Ajit Kumar Agarwal
2014-10-09 23:42     ` Michael Eager
2014-10-13 16:00       ` Ajit Kumar Agarwal
2014-10-13 17:49         ` Michael Eager
2014-10-14  3:03           ` Ajit Kumar Agarwal
2014-10-14 15:07             ` Michael Eager
2014-10-14 15:33               ` Ajit Kumar Agarwal [this message]
2014-10-14 15:42               ` Ajit Kumar Agarwal
2014-10-15 13:27     ` Pedro Alves
2014-10-17 19:22       ` Ajit Kumar Agarwal
2014-12-15 18:02         ` Pedro Alves
2014-12-15 18:13           ` Michael Eager
2014-12-18  8:58             ` Ajit Kumar Agarwal
2014-12-18 16:10               ` Michael Eager
2014-12-18  8:57           ` Ajit Kumar Agarwal
2014-12-18 11:28             ` Pedro Alves
2014-12-18 16:53               ` Ajit Kumar Agarwal
2014-12-18 17:40                 ` Pedro Alves
2014-12-19  8:27                   ` Ajit Kumar Agarwal
2014-12-19 10:56                     ` Pedro Alves
2014-12-19 10:26               ` Ajit Kumar Agarwal
2014-12-19 11:02                 ` Pedro Alves
2014-12-19 18:06                   ` Ajit Kumar Agarwal
2014-11-26 12:13       ` Ajit Kumar Agarwal
2014-12-15 16:08         ` Ajit Kumar Agarwal
  -- strict thread matches above, loose matches on Subject: below --
2014-10-08 14:59 Ajit Kumar Agarwal
2014-09-10 10:14 [Patch, microblaze]: " Ajit Kumar Agarwal
2014-09-10 13:31 ` Michael Eager
2014-09-10 13:46   ` Joel Brobecker
2014-09-10 14:23     ` Ajit Kumar Agarwal
2014-09-10 14:39       ` Michael Eager
2014-09-10 14:59         ` Ajit Kumar Agarwal
2014-09-10 15:12         ` Ajit Kumar Agarwal
2014-09-10 15:27           ` Michael Eager
2014-09-10 15:30             ` Ajit Kumar Agarwal
2014-09-10 15:35               ` Michael Eager
2014-09-10 15:51                 ` Ajit Kumar Agarwal
2014-09-10 14:43       ` Joel Brobecker
2014-09-10 15:04         ` Ajit Kumar Agarwal
2014-09-10 15:54           ` Joel Brobecker
2014-09-10 16:10             ` Ajit Kumar Agarwal
2014-09-12  8:01         ` Ajit Kumar Agarwal
2014-09-12  8:39         ` Ajit Kumar Agarwal
2014-09-12 15:38           ` Michael Eager
2014-09-16  6:42             ` Ajit Kumar Agarwal
2014-09-16 12:06               ` Michael Eager
2014-09-17  9:36                 ` Ajit Kumar Agarwal
2014-09-17 14:12                   ` Michael Eager
2014-09-16 17:04               ` Pedro Alves
2014-09-17  6:16                 ` Ajit Kumar Agarwal
2014-09-17  8:15                   ` Pedro Alves
2014-09-17  8:20                     ` Ajit Kumar Agarwal
2014-09-23 12:49                     ` Ajit Kumar Agarwal
2014-09-30 11:43                       ` Pedro Alves
2014-09-30 13:27                         ` Ajit Kumar Agarwal
2014-09-30 13:37                           ` Pedro Alves
2014-09-30 14:21                             ` Ajit Kumar Agarwal

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=218e019237974e21aac94cd69251d98d@BN1AFFO11FD052.protection.gbl \
    --to=ajit.kumar.agarwal@xilinx.com \
    --cc=brobecker@adacore.com \
    --cc=eager@eagercon.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nmekala@xilinx.com \
    --cc=palves@redhat.com \
    --cc=vidhum@xilinx.com \
    --cc=vinodk@xilinx.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).