[PATCH v2] Cache the Thread Local Base pointer type in the gdbarch

Hannes Domani via gdb-patches gdb-patches@sourceware.org
Wed Feb 12 16:06:00 GMT 2020


 Am Mittwoch, 12. Februar 2020, 05:06:33 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:

> On 2020-02-11 11:31 a.m., Hannes Domani via gdb-patches wrote:
> > @@ -196,10 +196,10 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
> >    struct type *word_type, *wchar_type, *wchar_ptr_type;
> >    struct type *uni_str_type, *rupp_type, *rupp_ptr_type;
> >
> > -  /* Do not rebuild type if same gdbarch as last time.  */
> > -  if (last_tlb_type && last_gdbarch == gdbarch)
> > -    return last_tlb_type;
> > -
> > +  windows_gdbarch_data = get_windows_gdbarch_data (gdbarch);
>
> You can declare the variable in place:
>
>   windows_gdbarch_data *windows_gdbarch_data
>     = get_windows_gdbarch_data (gdbarch);
>
>
> That code style rule changed when we switched to C++, this is why you can still see
> a lot of code declaring variables at the top of the functions.
>
> The patch LGTM with that fixed (if you want, it's really a detail).  Thanks for doing
> this, it's a nice cleanup.

Pushed with this change, thanks.



More information about the Gdb-patches mailing list