dis-init.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Initialize "struct disassemble_info".
  2. Copyright (C) 2003-2015 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. {
  23. memset (info, 0, sizeof (*info));
  24. info->flavour = bfd_target_unknown_flavour;
  25. info->arch = bfd_arch_unknown;
  26. info->endian = BFD_ENDIAN_UNKNOWN;
  27. info->endian_code = info->endian;
  28. info->octets_per_byte = 1;
  29. info->fprintf_func = fprintf_func;
  30. info->stream = stream;
  31. info->read_memory_func = buffer_read_memory;
  32. info->memory_error_func = perror_memory;
  33. info->print_address_func = generic_print_address;
  34. info->symbol_at_address_func = generic_symbol_at_address;
  35. info->symbol_is_valid = generic_symbol_is_valid;
  36. info->display_endian = BFD_ENDIAN_UNKNOWN;
  37. }