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.6 by gbeauche, 2002-09-07T12:48:15Z vs.
Revision 1.11 by gbeauche, 2007-06-07T09:51:56Z

# Line 1 | Line 1
1   /*
2   *  mon_disass.cpp - Disassemblers
3   *
4 < *  cxmon (C) 1997-2002 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 20 | Line 20
20  
21   #include "sysdeps.h"
22  
23 + #include <assert.h>
24   #include <stdarg.h>
25  
26   #include "mon.h"
# Line 84 | Line 85 | void generic_print_address(bfd_vma addr,
85                          }
86                  }
87          }
88 <        info->fprintf_func(info->stream, "$%08x", addr);
88 >        if (addr >= UVAL64(0x100000000))
89 >                info->fprintf_func(info->stream, "$%08x%08x", (uint32)(addr >> 32), (uint32)addr);
90 >        else
91 >                info->fprintf_func(info->stream, "$%08x", (uint32)addr);
92   }
93  
94   int generic_symbol_at_address(bfd_vma addr, struct disassemble_info *info)
# Line 166 | Line 170 | int disass_68k(FILE *f, uint32 adr)
170          return num;
171   }
172  
173 + int disass_mips(FILE *f, uint32 adr, int little_endian)
174 + {
175 +        // Initialize info for GDB disassembler
176 +        disassemble_info info;
177 +        char buf[1024];
178 +        SFILE sfile = {buf, buf};
179 +        sfile.buffer = buf;
180 +        sfile.current = buf;
181 +        INIT_DISASSEMBLE_INFO(info, (FILE *)&sfile, (fprintf_ftype)mon_sprintf);
182 +
183 +        // Disassemble instruction
184 +        lookup_lowmem = false;
185 +        int num = little_endian ? print_insn_little_mips(adr, &info) : print_insn_big_mips(adr, &info);
186 +
187 +        assert(num == 4);
188 +        for (int i=0; i<4; i++)
189 +                fprintf(f, " %02x", mon_read_byte(adr + i));
190 +
191 +        fprintf(f, "  %s\n", buf);
192 +
193 +        return num;
194 + }
195 +
196   int disass_x86(FILE *f, uint32 adr, uint32 bits)
197   {
198          // Initialize info for GDB disassembler
# Line 182 | Line 209 | int disass_x86(FILE *f, uint32 adr, uint
209  
210          // Disassemble instruction
211          lookup_lowmem = false;
212 <        int num = print_insn_i386(adr, &info);
212 >        int num = print_insn_i386_att(adr, &info);
213  
214          for (int i=0; i<6; i++) {
215                  if (num > i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines