Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Support _Complex in hard-VFP abi
@ 2014-08-11 12:56 Yao Qi
  2014-08-11 13:12 ` Will Newton
  2014-08-19  0:55 ` Yao Qi
  0 siblings, 2 replies; 9+ messages in thread
From: Yao Qi @ 2014-08-11 12:56 UTC (permalink / raw)
  To: gdb-patches

Hi,
When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the
following fails,

FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4)
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex

The hard-VFP ABI was supported by GDB overal, done by this patch
https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
"vectors and complex types are not currently supported", mentioned in
the patch.  As a result, these tests fail.

This patch is to support _Complex types in hard-VFP abi.  As specified
in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
_Complex types is a struct, which is identical to the layout on amd64,
so I copy Mark's comments to amd64 support.

Regression tested on arm-none-eabi target.  OK to apply?

gdb:

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

	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
	types.
---
 gdb/arm-tdep.c | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b6ec456..10e74cf 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3557,8 +3557,8 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b)
    classified from *BASE_TYPE, or two types differently classified
    from each other, return -1, otherwise return the total number of
    base-type elements found (possibly 0 in an empty structure or
-   array).  Vectors and complex types are not currently supported,
-   matching the generic AAPCS support.  */
+   array).  Vectors types are not currently supported, matching the
+   generic AAPCS support.  */
 
 static int
 arm_vfp_cprc_sub_candidate (struct type *t,
@@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
 	}
       break;
 
+    case TYPE_CODE_COMPLEX:
+      /* 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;
+	 };*/
+      switch (TYPE_LENGTH (t))
+	{
+	case 8:
+	  if (*base_type == VFP_CPRC_UNKNOWN)
+	    *base_type = VFP_CPRC_SINGLE;
+	  else if (*base_type != VFP_CPRC_SINGLE)
+	    return -1;
+	  return 2;
+
+	case 16:
+	  if (*base_type == VFP_CPRC_UNKNOWN)
+	    *base_type = VFP_CPRC_DOUBLE;
+	  else if (*base_type != VFP_CPRC_DOUBLE)
+	    return -1;
+	  return 2;
+
+	default:
+	  return -1;
+	}
+      break;
+
     case TYPE_CODE_ARRAY:
       {
 	int count;
-- 
1.9.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-11 12:56 [PATCH] Support _Complex in hard-VFP abi Yao Qi
@ 2014-08-11 13:12 ` Will Newton
  2014-08-19 13:16   ` Yao Qi
  2014-08-19  0:55 ` Yao Qi
  1 sibling, 1 reply; 9+ messages in thread
From: Will Newton @ 2014-08-11 13:12 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 11 August 2014 13:51, Yao Qi <yao@codesourcery.com> wrote:
> Hi,
> When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the
> following fails,
>
> FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
> FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
> FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2)
> FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4)
> FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2)
> FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4)
> FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex
> FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex
>
> The hard-VFP ABI was supported by GDB overal, done by this patch
> https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
> "vectors and complex types are not currently supported", mentioned in
> the patch.  As a result, these tests fail.
>
> This patch is to support _Complex types in hard-VFP abi.  As specified
> in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
> _Complex types is a struct, which is identical to the layout on amd64,
> so I copy Mark's comments to amd64 support.
>
> Regression tested on arm-none-eabi target.  OK to apply?
>
> gdb:
>
> 2014-08-11  Yao Qi  <yao@codesourcery.com>
>
>         * arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
>         types.
> ---
>  gdb/arm-tdep.c | 34 ++++++++++++++++++++++++++++++++--
>  1 file changed, 32 insertions(+), 2 deletions(-)

Apart from a couple of minor nits below this looks ok to me.

> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index b6ec456..10e74cf 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -3557,8 +3557,8 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b)
>     classified from *BASE_TYPE, or two types differently classified
>     from each other, return -1, otherwise return the total number of
>     base-type elements found (possibly 0 in an empty structure or
> -   array).  Vectors and complex types are not currently supported,
> -   matching the generic AAPCS support.  */
> +   array).  Vectors types are not currently supported, matching the

This should be "Vector types".

> +   generic AAPCS support.  */
>
>  static int
>  arm_vfp_cprc_sub_candidate (struct type *t,
> @@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
>         }
>        break;
>
> +    case TYPE_CODE_COMPLEX:
> +      /* 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;
> +        };*/

A line break before closing the comment might look nicer here.

> +      switch (TYPE_LENGTH (t))
> +       {
> +       case 8:
> +         if (*base_type == VFP_CPRC_UNKNOWN)
> +           *base_type = VFP_CPRC_SINGLE;
> +         else if (*base_type != VFP_CPRC_SINGLE)
> +           return -1;
> +         return 2;
> +
> +       case 16:
> +         if (*base_type == VFP_CPRC_UNKNOWN)
> +           *base_type = VFP_CPRC_DOUBLE;
> +         else if (*base_type != VFP_CPRC_DOUBLE)
> +           return -1;
> +         return 2;
> +
> +       default:
> +         return -1;
> +       }
> +      break;
> +
>      case TYPE_CODE_ARRAY:
>        {
>         int count;
> --
> 1.9.0
>



-- 
Will Newton
Toolchain Working Group, Linaro


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-11 12:56 [PATCH] Support _Complex in hard-VFP abi Yao Qi
  2014-08-11 13:12 ` Will Newton
@ 2014-08-19  0:55 ` Yao Qi
  2014-08-19  7:00   ` Joel Brobecker
  1 sibling, 1 reply; 9+ messages in thread
From: Yao Qi @ 2014-08-19  0:55 UTC (permalink / raw)
  To: gdb-patches

On 08/11/2014 08:51 PM, Yao Qi wrote:
> The hard-VFP ABI was supported by GDB overal, done by this patch
> https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
> "vectors and complex types are not currently supported", mentioned in
> the patch.  As a result, these tests fail.
> 
> This patch is to support _Complex types in hard-VFP abi.  As specified
> in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
> _Complex types is a struct, which is identical to the layout on amd64,
> so I copy Mark's comments to amd64 support.
> 
> Regression tested on arm-none-eabi target.  OK to apply?
> 
> gdb:
> 
> 2014-08-11  Yao Qi  <yao@codesourcery.com>
> 
> 	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
> 	types.

Beside Will's review on code comments, any other review?
https://sourceware.org/ml/gdb-patches/2014-08/msg00182.html

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-19  0:55 ` Yao Qi
@ 2014-08-19  7:00   ` Joel Brobecker
  0 siblings, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2014-08-19  7:00 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

> > 2014-08-11  Yao Qi  <yao@codesourcery.com>
> > 
> > 	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
> > 	types.
> 
> Beside Will's review on code comments, any other review?
> https://sourceware.org/ml/gdb-patches/2014-08/msg00182.html

No other comments. Go ahead and push after having made the recommended
adjustements.

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-11 13:12 ` Will Newton
@ 2014-08-19 13:16   ` Yao Qi
  2014-08-19 22:44     ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Qi @ 2014-08-19 13:16 UTC (permalink / raw)
  To: Will Newton; +Cc: gdb-patches

On 08/11/2014 09:12 PM, Will Newton wrote:
>> -   array).  Vectors and complex types are not currently supported,
>> > -   matching the generic AAPCS support.  */
>> > +   array).  Vectors types are not currently supported, matching the
> This should be "Vector types".
> 

Fixed.

>> > +   generic AAPCS support.  */
>> >
>> >  static int
>> >  arm_vfp_cprc_sub_candidate (struct type *t,
>> > @@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
>> >         }
>> >        break;
>> >
>> > +    case TYPE_CODE_COMPLEX:
>> > +      /* 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;
>> > +        };*/
> A line break before closing the comment might look nicer here.
> 

I add two spaces before closing the comment, because we don't move
"*/" to a separated line.  Patch was approved by Joel, and is pushed
in.

-- 
Yao (齐尧)

Subject: [PATCH] Support _Complex in hard-VFP abi

Hi,
When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the
following fails,

FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4)
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex

The hard-VFP ABI was supported by GDB overal, done by this patch
https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
"vectors and complex types are not currently supported", mentioned in
the patch.  As a result, these tests fail.

This patch is to support _Complex types in hard-VFP abi.  As specified
in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
_Complex types is a struct, which is identical to the layout on amd64,
so I copy Mark's comments to amd64 support.

Regression tested on arm-none-eabi target.  OK to apply?

gdb:

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

	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
	types.
---
 gdb/ChangeLog  |  5 +++++
 gdb/arm-tdep.c | 34 ++++++++++++++++++++++++++++++++--
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7c3c582..8789fe8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-19  Yao Qi  <yao@codesourcery.com>
+
+	* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
+	types.
+
 2014-08-19  Alan Modra  <amodra@gmail.com>
 
 	* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b6ec456..2e2d6fd 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3557,8 +3557,8 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b)
    classified from *BASE_TYPE, or two types differently classified
    from each other, return -1, otherwise return the total number of
    base-type elements found (possibly 0 in an empty structure or
-   array).  Vectors and complex types are not currently supported,
-   matching the generic AAPCS support.  */
+   array).  Vector types are not currently supported, matching the
+   generic AAPCS support.  */
 
 static int
 arm_vfp_cprc_sub_candidate (struct type *t,
@@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
 	}
       break;
 
+    case TYPE_CODE_COMPLEX:
+      /* 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;
+	 };  */
+      switch (TYPE_LENGTH (t))
+	{
+	case 8:
+	  if (*base_type == VFP_CPRC_UNKNOWN)
+	    *base_type = VFP_CPRC_SINGLE;
+	  else if (*base_type != VFP_CPRC_SINGLE)
+	    return -1;
+	  return 2;
+
+	case 16:
+	  if (*base_type == VFP_CPRC_UNKNOWN)
+	    *base_type = VFP_CPRC_DOUBLE;
+	  else if (*base_type != VFP_CPRC_DOUBLE)
+	    return -1;
+	  return 2;
+
+	default:
+	  return -1;
+	}
+      break;
+
     case TYPE_CODE_ARRAY:
       {
 	int count;
-- 
1.9.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-19 13:16   ` Yao Qi
@ 2014-08-19 22:44     ` Pedro Alves
  2014-08-20  3:46       ` Yao Qi
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2014-08-19 22:44 UTC (permalink / raw)
  To: Yao Qi, Will Newton; +Cc: gdb-patches

On 08/19/2014 02:12 PM, Yao Qi wrote:
> On 08/11/2014 09:12 PM, Will Newton wrote:
>>>> +    case TYPE_CODE_COMPLEX:
>>>> +      /* 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;
>>>> +        };*/
>> A line break before closing the comment might look nicer here.
>>
>
> I add two spaces before closing the comment, because we don't move
> "*/" to a separated line.

...

> +    case TYPE_CODE_COMPLEX:
> +      /* 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;
> +	 };  */
> +      switch (TYPE_LENGTH (t))

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.

'grep -n "^[ |\t]\+\*/" *.h -B 3' finds several (many?) similar
examples (and a bunch of wrong-format comments too, though..)

<nit mode/>

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-19 22:44     ` Pedro Alves
@ 2014-08-20  3:46       ` Yao Qi
  2014-08-20  8:21         ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Qi @ 2014-08-20  3:46 UTC (permalink / raw)
  To: Pedro Alves, Will Newton; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-20  3:46       ` Yao Qi
@ 2014-08-20  8:21         ` Pedro Alves
  2014-08-20 10:26           ` Yao Qi
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2014-08-20  8:21 UTC (permalink / raw)
  To: Yao Qi, Will Newton; +Cc: gdb-patches

On 08/20/2014 04:42 AM, Yao Qi wrote:
> 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;
> };
> 
> */"
> 

That's excellent, IMO.

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

Looks great to me.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Support _Complex in hard-VFP abi
  2014-08-20  8:21         ` Pedro Alves
@ 2014-08-20 10:26           ` Yao Qi
  0 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-08-20 10:26 UTC (permalink / raw)
  To: Pedro Alves, Will Newton; +Cc: gdb-patches

On 08/20/2014 04:20 PM, Pedro Alves wrote:
> That's excellent, IMO.
> 
>> > The patch below updates the comments I've seen in current code base.
>> > 
> Looks great to me.

Patch is pushed in and wiki page is updated.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-20 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-11 12:56 [PATCH] Support _Complex in hard-VFP abi 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox