ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/mon/src/mon_disass.cpp
(Generate patch)

Comparing mon/src/mon_disass.cpp (file contents):
Revision 1.3 by cebix, 2000-10-06T00:04:22Z vs.
Revision 1.10 by gbeauche, 2004-06-14T14:23:59Z

# Line 1 | Line 1
1   /*
2   *  mon_disass.cpp - Disassemblers
3   *
4 < *  mon (C) 1997-2000 Christian Bauer, Marc Hellwig
4 > *  cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 40 | Line 40 | bool mon_macos_mode = false;
40   extern "C" {
41   #include "disass/dis-asm.h"
42  
43 < int buffer_read_memory(bfd_vma from, bfd_byte *to, int length, struct disassemble_info *info)
43 > int buffer_read_memory(bfd_vma from, bfd_byte *to, unsigned int length, struct disassemble_info *info)
44   {
45          while (length--)
46                  *to++ = mon_read_byte(from++);
# Line 84 | Line 84 | void generic_print_address(bfd_vma addr,
84                          }
85                  }
86          }
87 <        info->fprintf_func(info->stream, "$%08x", addr);
87 >        if (addr >= UVAL64(0x100000000))
88 >                info->fprintf_func(info->stream, "$%08x%08x", (uint32)(addr >> 32), (uint32)addr);
89 >        else
90 >                info->fprintf_func(info->stream, "$%08x", (uint32)addr);
91   }
92  
93   int generic_symbol_at_address(bfd_vma addr, struct disassemble_info *info)
# Line 166 | Line 169 | int disass_68k(FILE *f, uint32 adr)
169          return num;
170   }
171  
172 < int disass_x86(FILE *f, uint32 adr, bool i8086)
172 > int disass_x86(FILE *f, uint32 adr, uint32 bits)
173   {
174          // Initialize info for GDB disassembler
175          disassemble_info info;
# Line 175 | Line 178 | int disass_x86(FILE *f, uint32 adr, bool
178          sfile.buffer = buf;
179          sfile.current = buf;
180          INIT_DISASSEMBLE_INFO(info, (FILE *)&sfile, (fprintf_ftype)mon_sprintf);
181 <        if (i8086)
181 >        if (bits == 16)
182                  info.mach = bfd_mach_i386_i8086;
183 +        else if (bits == 64)
184 +                info.mach = bfd_mach_x86_64;
185  
186          // Disassemble instruction
187          lookup_lowmem = false;
188 <        int num = print_insn_i386(adr, &info);
188 >        int num = print_insn_i386_att(adr, &info);
189  
190          for (int i=0; i<6; i++) {
191                  if (num > i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines