Re: [PATCH] gdb: use bfd_get_section_contents to read section contents in, is_linked_with_cygwin_dll

Simon Marchi
2020-04-02T14:57:56Z

On 2020-04-02 10:55 a.m., Simon Marchi via Gdb-patches wrote:
> diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
> index 9c5dfd183bfa..9b7dc1d12b26 100644
> --- a/gdb/windows-tdep.c
> +++ b/gdb/windows-tdep.c
> @@ -1005,18 +1005,17 @@ is_linked_with_cygwin_dll (bfd *abfd)
> bfd_vma idata_addr
> = pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress;
>
> - /* Map the section's data. */
> - bfd_size_type idata_size;
> - const gdb_byte *const idata_contents
> - = gdb_bfd_map_section (idata_section, &idata_size);
> - if (idata_contents == nullptr)
> + /* Get the section's data. */
> + gdb::byte_vector idata_contents;
> + if (!gdb_bfd_get_section_contents(abfd, idata_section, &idata_contents))

Missing space here, consider it fixed.

Simon