This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 13 Jan 2020 14:34:22 -0500
- Subject: Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 00DJYMSH010471
- References: <20200112201729.489317-1-simon.marchi@polymtl.ca> <87y2ubp8l0.fsf@tromey.com>
On 2020-01-13 12:30 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> 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