Exemplo n.º 1
0
bfd *
find_separate_debug_file_in_section (struct objfile *objfile)
{
    asection *section;
    bfd *abfd;

    if (objfile->obfd == NULL)
        return NULL;

    section = bfd_get_section_by_name (objfile->obfd, ".gnu_debugdata");
    if (section == NULL)
        return NULL;

#ifdef HAVE_LIBLZMA
    abfd = gdb_bfd_openr_iovec (objfile_name (objfile), gnutarget, lzma_open,
                                section, lzma_pread, lzma_close, lzma_stat);
    if (abfd == NULL)
        return NULL;

    if (!bfd_check_format (abfd, bfd_object))
    {
        warning (_("Cannot parse .gnu_debugdata section; not a BFD object"));
        gdb_bfd_unref (abfd);
        return NULL;
    }
#else
    warning (_("Cannot parse .gnu_debugdata section; LZMA support was "
               "disabled at compile time"));
    abfd = NULL;
#endif /* !HAVE_LIBLZMA */

    return abfd;
}
Exemplo n.º 2
0
Arquivo: jit.c Projeto: uarka/binutils
static struct bfd *
bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, char *target)
{
  struct target_buffer *buffer = xmalloc (sizeof (struct target_buffer));

  buffer->base = addr;
  buffer->size = size;
  return gdb_bfd_openr_iovec ("<in-memory>", target,
			      mem_bfd_iovec_open,
			      buffer,
			      mem_bfd_iovec_pread,
			      mem_bfd_iovec_close,
			      mem_bfd_iovec_stat);
}
Exemplo n.º 3
0
static bfd *
spu_bfd_fopen (char *name, CORE_ADDR addr)
{
  bfd *nbfd;
  CORE_ADDR *open_closure = XNEW (CORE_ADDR);

  *open_closure = addr;

  nbfd = gdb_bfd_openr_iovec (name, "elf32-spu",
			      spu_bfd_iovec_open, open_closure,
			      spu_bfd_iovec_pread, spu_bfd_iovec_close,
			      spu_bfd_iovec_stat);
  if (!nbfd)
    return NULL;

  if (!bfd_check_format (nbfd, bfd_object))
    {
      gdb_bfd_unref (nbfd);
      return NULL;
    }

  return nbfd;
}