Re: [PATCH 6/7] gdb: select "Cygwin" OS ABI for Cygwin binaries

Simon Marchi
2020-04-02T14:01:31Z

On 2020-04-02 9:56 a.m., Pedro Alves wrote:
> On 4/1/20 10:53 PM, Simon Marchi via Gdb-patches wrote:
>> However, when BFD maps the file/section data in memory for GDB to read, is that mapping
>> guaranteed to be sufficiently aligned as well?
>
> I think so. If bfd heap allocates, then memory will be aligned to the word size at
> least. If bfd mmaps, then memory will be aligned to page size. And then if the
> data structures are aligned, we should be good.

Following this message from Tom [1], I'm going to change the code to use
bfd_get_full_section_contents and store the data into a pre-allocated gdb::byte_vector.
Does that change anything?

[1] https://marc.info/?l=gdb-patches&m=158583388704648&w=2

Simon