This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH v5 09/15] vla: resolve dynamic bounds if value contents is a constant byte-sequence


Thanks for your review.

The inlined diff below wraps the single statement + comment within curly braces.

diff --git a/gdb/findvar.c b/gdb/findvar.c
index a543dc4..11ce3c6 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -469,8 +469,10 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)

     case LOC_CONST_BYTES:
       if (is_dynamic_type (type))
-       /* Value is a constant byte-sequence and needs no memory access.  */
-       type = resolve_dynamic_type (type, /* Unused address.  */ 0);
+       {
+         /* Value is a constant byte-sequence and needs no memory access.  */
+         type = resolve_dynamic_type (type, /* Unused address.  */ 0);
+       }
       v = allocate_value (type);
       memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var),
              TYPE_LENGTH (type));

 -Sanimir

> -----Original Message-----
> From: Joel Brobecker [mailto:brobecker@adacore.com]
> Sent: Friday, February 07, 2014 11:27 AM
> To: Agovic, Sanimir
> Cc: tromey@redhat.com; Boell, Keven; gdb-patches@sourceware.org
> Subject: Re: [PATCH v5 09/15] vla: resolve dynamic bounds if value contents is a constant
> byte-sequence
> 
> Hello!
> 
> > 2013-11-26  Sanimir Agovic  <sanimir.agovic@intel.com>
> >             Keven Boell  <keven.boell@intel.com>
> >
> > 	* findvar.c (default_read_var_value): Resolve dynamic bounds if location
> > 	points to a constant blob.
> 
> Small trivial comment....
> 
> >      case LOC_CONST_BYTES:
> > +      if (is_dynamic_type (type))
> > +	/* Value is a constant byte-sequence and needs no memory access.  */
> > +	type = resolve_dynamic_type (type, /* Unused address.  */ 0);
> 
> Although not required by C, we prefer in the GDB project to still
> use curly braces around the if block. The reason is that the comment
> visually looks like a statement, so it looks like the if block as
> more than one statement, hence the use of curly braces...
> 
> Thank you!
> 
> --
> Joel
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]