dis-init.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Initialize "struct disassemble_info".
  2. Copyright 2003 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful, but
  8. WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  14. 02110-1301, USA. */
  15. #include "sysdep.h"
  16. #include "dis-asm.h"
  17. #include "bfd.h"
  18. void
  19. init_disassemble_info (struct disassemble_info *info, void *stream,
  20. fprintf_ftype fprintf_func)
  21. {
  22. memset (info, 0, sizeof (*info));
  23. info->flavour = bfd_target_unknown_flavour;
  24. info->arch = bfd_arch_unknown;
  25. info->endian = BFD_ENDIAN_UNKNOWN;
  26. info->octets_per_byte = 1;
  27. info->fprintf_func = fprintf_func;
  28. info->stream = stream;
  29. info->read_memory_func = buffer_read_memory;
  30. info->memory_error_func = perror_memory;
  31. info->print_address_func = generic_print_address;
  32. info->symbol_at_address_func = generic_symbol_at_address;
  33. info->symbol_is_valid = generic_symbol_is_valid;
  34. info->display_endian = BFD_ENDIAN_UNKNOWN;
  35. }