From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section
Date: Mon, 13 Jan 2020 23:21:00 -0000 [thread overview]
Message-ID: <c8577019-de8a-4f6b-a445-b48396b69043@polymtl.ca> (raw)
In-Reply-To: <efef2737-7ddb-31af-2fa0-d628cdf11170@redhat.com>
On 2020-01-13 5:04 p.m., Pedro Alves wrote:
> On 1/13/20 8:02 PM, Simon Marchi wrote:
>> On 2020-01-13 2:40 p.m., Pedro Alves wrote:
>>> On 1/12/20 8:17 PM, Simon Marchi wrote:
>>>> - contents = (char *) alloca (size);
>>>> - if (! bfd_get_section_contents (core_bfd, section, contents,
>>>> + std::vector<char> contents (size);
>>>> + if (! bfd_get_section_contents (core_bfd, section, contents.data (),
>>>> (file_ptr) 0, size))
>>>> {
>>>
>>> gdb::byte_vector
>>
>> I used std::vector<char> because the original code also used char, and
>> m_core_vec->core_read_registers also accepts a char * (although I
>> could/should have used gdb::char_vector anyway). However, gdb_byte
>> probably makes more sense here. I would push the patch below as a fixup
>> if it looks good to you.
>
> It does LGTM, thanks!
>
> Pedro Alves
>
Thanks, it is now pushed.
Simon
prev parent reply other threads:[~2020-01-13 23:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-12 20:22 Simon Marchi
2020-01-13 3:30 ` Christian Biesinger via gdb-patches
2020-01-13 4:29 ` Simon Marchi
2020-01-13 10:45 ` Andreas Schwab
2020-01-13 17:03 ` Simon Marchi
2020-01-13 17:33 ` Tom Tromey
2020-01-13 19:36 ` Simon Marchi
2020-01-13 19:45 ` Pedro Alves
2020-01-13 20:20 ` Simon Marchi
2020-01-13 23:13 ` Pedro Alves
2020-01-13 23:21 ` Simon Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8577019-de8a-4f6b-a445-b48396b69043@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox