Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, Will Newton <will.newton@linaro.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Support _Complex in hard-VFP abi
Date: Wed, 20 Aug 2014 03:46:00 -0000	[thread overview]
Message-ID: <53F41920.8040800@codesourcery.com> (raw)
In-Reply-To: <53F3D349.9080904@redhat.com>

On 08/20/2014 06:44 AM, Pedro Alves wrote:
> This is borderline pedantry, but this looks ugly enough to me that
> I'll speak up in case this ends up being the norm.  :-)  FWIW, I agree
> with Will here -- I think we should make an exception to the rule
> in the cases where the comment is actually a paste of output,
> multiline code or similar cases.  It's kind of like a @smallexample
> region in texinfo, that begs to be rendered on its own block/lines,
> separate from the text around it.

I am fine with this exception here, but we'd better document it.

The rule is documented here
https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards

Block comments must appear in the following form, with no /*- or */-only lines, and no leading *:

/* Wait for control to return from inferior to debugger.  If inferior
   gets a signal, we may decide to start it up again instead of
   returning.  That is why there is a loop in this function.  When
   this function actually returns it means the inferior should be left
   stopped and GDB should read more commands.  */

I propose to add the following words after this paragraph above,

"Exceptionally, */ can be put at a separate line if the comment is ended
with an example, an output or a code snippet:

/* Arguments of complex T where T is one of the types float or
   double get treated as if they are implemented as:

struct complexT
{
  T real;
  T imag;
};

*/"

The patch below updates the comments I've seen in current code base.

-- 
Yao (齐尧)

Subject: [PATCH] Adjust comments with example in it

We would like to wrap examples, output or code snippet in comments with
blank lines, and move */ to a new line if the comment is ended with the
example.

gdb:

2014-08-20  Yao Qi  <yao@codesourcery.com>

	* amd64-tdep.c (amd64_classify): Add a blank line after the
	example.  Move "*/" to a new line.
	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Likewise.
	* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Likewise.
	* dwarf2read.c (psymtab_include_file_name): Likewise.
---
 gdb/amd64-tdep.c     | 4 +++-
 gdb/arm-tdep.c       | 4 +++-
 gdb/arm-wince-tdep.c | 5 ++++-
 gdb/dwarf2read.c     | 4 +++-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 173451f..abd9c48 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -670,7 +670,9 @@ amd64_classify (struct type *type, enum amd64_reg_class class[2])
      struct complexT {
        T real;
        T imag;
-     };  */
+     };
+
+  */
   else if (code == TYPE_CODE_COMPLEX && len == 8)
     class[0] = AMD64_SSE;
   else if (code == TYPE_CODE_COMPLEX && len == 16)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 2e2d6fd..69ffecb 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3597,7 +3597,9 @@ arm_vfp_cprc_sub_candidate (struct type *t,
 	 {
 	   T real;
 	   T imag;
-	 };  */
+	 };
+
+      */
       switch (TYPE_LENGTH (t))
 	{
 	case 8:
diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c
index 24f0e5b..aff8d20 100644
--- a/gdb/arm-wince-tdep.c
+++ b/gdb/arm-wince-tdep.c
@@ -45,9 +45,12 @@ arm_pe_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
   CORE_ADDR next_pc;
 
   /* The format of an ARM DLL trampoline is:
+
        ldr  ip, [pc]
        ldr  pc, [ip]
-       .dw __imp_<func>  */
+       .dw __imp_<func>
+
+  */
 
   if (pc == 0
       || read_memory_unsigned_integer (pc + 0, 4, byte_order) != 0xe59fc000
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index f5e3418..f5b6341 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17132,7 +17132,9 @@ psymtab_include_file_name (const struct line_header *lh, int file_index,
 	 include_name = "hello.c"
 	 dir_name = "."
 	 DW_AT_comp_dir = comp_dir = "/tmp"
-	 DW_AT_name = "./hello.c"  */
+	 DW_AT_name = "./hello.c"
+
+      */
 
       if (dir_name != NULL)
 	{
-- 
1.9.3


  reply	other threads:[~2014-08-20  3:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 12:56 Yao Qi
2014-08-11 13:12 ` Will Newton
2014-08-19 13:16   ` Yao Qi
2014-08-19 22:44     ` Pedro Alves
2014-08-20  3:46       ` Yao Qi [this message]
2014-08-20  8:21         ` Pedro Alves
2014-08-20 10:26           ` Yao Qi
2014-08-19  0:55 ` Yao Qi
2014-08-19  7:00   ` Joel Brobecker

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=53F41920.8040800@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=will.newton@linaro.org \
    /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