dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.

Message ID m3d26vpsq7.fsf@seba.sebabeach.org
State New, archived
Headers

Commit Message

Doug Evans Jan. 3, 2015, 7:30 p.m. UTC
  Hi.

I was grepping for where TYPE_FN_FIELD_PHYSNAME was set, but had to
resort to digging into the implementation.

This patch will simplify greps the next time.

Regression tested on amd64-linux.

2015-01-03  Doug Evans  <xdje42@gmail.com>

	* dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
  

Comments

Joel Brobecker Jan. 4, 2015, 3:24 a.m. UTC | #1
> 2015-01-03  Doug Evans  <xdje42@gmail.com>
> 
> 	* dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.

I was going to fix the line length, which is now too long, but it
looks like you haven't pushed the change, yet. So...

> 
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 86c3a73..15b3c9d 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -7704,7 +7704,7 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
>        struct fn_fieldlist *fn_flp
>  	= &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
>        physname = dwarf2_physname (mi->name, mi->die, cu);
> -      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
> +      TYPE_FN_FIELD_PHYSNAME (fn_flp->fn_fields, mi->index) = physname ? physname : "";

... this line is a little too long :).

>      }
>  }
>
  
Doug Evans Jan. 12, 2015, 12:41 a.m. UTC | #2
On Sat, Jan 3, 2015 at 7:24 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> 2015-01-03  Doug Evans  <xdje42@gmail.com>
>>
>>       * dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
>
> I was going to fix the line length, which is now too long, but it
> looks like you haven't pushed the change, yet. So...
>
>>
>> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
>> index 86c3a73..15b3c9d 100644
>> --- a/gdb/dwarf2read.c
>> +++ b/gdb/dwarf2read.c
>> @@ -7704,7 +7704,7 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
>>        struct fn_fieldlist *fn_flp
>>       = &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
>>        physname = dwarf2_physname (mi->name, mi->die, cu);
>> -      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
>> +      TYPE_FN_FIELD_PHYSNAME (fn_flp->fn_fields, mi->index) = physname ? physname : "";
>
> ... this line is a little too long :).
>
>>      }
>>  }
>>

Committed with the shorter lines.
  

Patch

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 86c3a73..15b3c9d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7704,7 +7704,7 @@  compute_delayed_physnames (struct dwarf2_cu *cu)
       struct fn_fieldlist *fn_flp
 	= &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
       physname = dwarf2_physname (mi->name, mi->die, cu);
-      fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
+      TYPE_FN_FIELD_PHYSNAME (fn_flp->fn_fields, mi->index) = physname ? physname : "";
     }
 }