Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section

Tom Tromey-2
>>>>> "Simon" == Simon Marchi <[hidden email]> writes:

Simon> We are using alloca to hold the contents of a the core register
Simon> sections.  These sections are typically fairly small, but there is no
Simon> realy guarantee, so I think it would be more reasonable to just use
Simon> dynamic allocation here.

I would be fine with simply avoiding alloca in most, or all, cases.

Simon> gdb/ChangeLog:

Simon> * corelow.c (core_target::get_core_register_section): Use
Simon>  std::vector instead of alloca.

Looks reasonable to me.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section

Simon Marchi
On 2020-01-13 12:30 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <[hidden email]> writes:
>
> Simon> We are using alloca to hold the contents of a the core register
> Simon> sections.  These sections are typically fairly small, but there is no
> Simon> realy guarantee, so I think it would be more reasonable to just use
> Simon> dynamic allocation here.
>
> I would be fine with simply avoiding alloca in most, or all, cases.

Agreed.

> Simon> gdb/ChangeLog:
>
> Simon> * corelow.c (core_target::get_core_register_section): Use
> Simon>  std::vector instead of alloca.
>
> Looks reasonable to me.

Ok, thanks all, I've pushed this patch.

Simon