dis-init.c 1.7 KB

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