#define STASH_INFO_HASH_OFF 0
#define STASH_INFO_HASH_ON 1
#define STASH_INFO_HASH_DISABLED 2
+
+ /* True if we opened bfd_ptr. */
+ bfd_boolean close_on_cleanup;
};
struct arange
if (! stash)
return FALSE;
stash->debug_sections = debug_sections;
+ stash->syms = symbols;
*pinfo = stash;
free (debug_filename);
return FALSE;
}
+ stash->close_on_cleanup = TRUE;
}
+ stash->bfd_ptr = debug_bfd;
/* There can be more than one DWARF2 info section in a BFD these
days. First handle the easy case when there's only one. If
stash->info_ptr_end = stash->info_ptr + total_size;
stash->sec = find_debug_info (debug_bfd, debug_sections, NULL);
stash->sec_info_ptr = stash->info_ptr;
- stash->syms = symbols;
- stash->bfd_ptr = debug_bfd;
-
return TRUE;
}
if (functionname_ptr != NULL)
*functionname_ptr = NULL;
*linenumber_ptr = 0;
+ if (discriminator_ptr)
+ *discriminator_ptr = 0;
if (! _bfd_dwarf2_slurp_debug_info (abfd, NULL,
debug_sections, symbols, pinfo))
void
_bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
{
- struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;;
+ struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo;
struct comp_unit *each;
if (abfd == NULL || stash == NULL)
free (stash->dwarf_ranges_buffer);
if (stash->info_ptr_memory)
free (stash->info_ptr_memory);
+ if (stash->close_on_cleanup)
+ bfd_close (stash->bfd_ptr);
}