Search
lxdream.org :: lxdream/src/x86dasm/dis-init.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/x86dasm/dis-init.c
changeset 362:dc40e2064dc4
next755:ab873907b00e
author nkeynes
date Tue Aug 28 08:46:54 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Add the i386 disassembler from binutils (why write your own if you don't
have to) to use for translator validation
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/x86dasm/dis-init.c Tue Aug 28 08:46:54 2007 +0000
1.3 @@ -0,0 +1,43 @@
1.4 +/* Initialize "struct disassemble_info".
1.5 +
1.6 + Copyright 2003 Free Software Foundation, Inc.
1.7 +
1.8 + This program is free software; you can redistribute it and/or
1.9 + modify it under the terms of the GNU General Public License as
1.10 + published by the Free Software Foundation; either version 2 of the
1.11 + License, or (at your option) any later version.
1.12 +
1.13 + This program is distributed in the hope that it will be useful, but
1.14 + WITHOUT ANY WARRANTY; without even the implied warranty of
1.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.16 + General Public License for more details.
1.17 +
1.18 + You should have received a copy of the GNU General Public License
1.19 + along with this program; if not, write to the Free Software
1.20 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1.21 + 02111-1307, USA. */
1.22 +
1.23 +#include "sysdep.h"
1.24 +#include "dis-asm.h"
1.25 +#include "bfd.h"
1.26 +
1.27 +void
1.28 +init_disassemble_info (struct disassemble_info *info, void *stream,
1.29 + fprintf_ftype fprintf_func)
1.30 +{
1.31 + memset (info, 0, sizeof (*info));
1.32 +
1.33 + info->flavour = bfd_target_unknown_flavour;
1.34 + info->arch = bfd_arch_unknown;
1.35 + info->endian = BFD_ENDIAN_UNKNOWN;
1.36 + info->octets_per_byte = 1;
1.37 + info->fprintf_func = fprintf_func;
1.38 + info->stream = stream;
1.39 + info->read_memory_func = buffer_read_memory;
1.40 + info->memory_error_func = perror_memory;
1.41 + info->print_address_func = generic_print_address;
1.42 + info->symbol_at_address_func = generic_symbol_at_address;
1.43 + info->symbol_is_valid = generic_symbol_is_valid;
1.44 + info->display_endian = BFD_ENDIAN_UNKNOWN;
1.45 +}
1.46 +
.