1 |
|
/* |
2 |
|
* mon.cpp - mon main program |
3 |
|
* |
4 |
< |
* mon (C) 1997-1999 Christian Bauer, Marc Hellwig |
4 |
> |
* mon (C) 1997-2000 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 |
25 |
|
#include <signal.h> |
26 |
|
#include <ctype.h> |
27 |
|
|
28 |
< |
#ifdef HAVE_READLINE_READLINE_H |
28 |
> |
#if defined(HAVE_READLINE_H) |
29 |
> |
extern "C" { |
30 |
> |
#include <readline.h> |
31 |
> |
} |
32 |
> |
#elif defined(HAVE_READLINE_READLINE_H) |
33 |
|
extern "C" { |
34 |
|
#include <readline/readline.h> |
35 |
|
} |
36 |
|
#endif |
37 |
|
|
38 |
< |
#ifdef HAVE_READLINE_HISTORY_H |
38 |
> |
#if defined(HAVE_HISTORY_H) |
39 |
> |
extern "C" { |
40 |
> |
#include <history.h> |
41 |
> |
} |
42 |
> |
#elif defined(HAVE_READLINE_HISTORY_H) |
43 |
|
extern "C" { |
44 |
|
#include <readline/history.h> |
45 |
|
} |
48 |
|
#include "mon.h" |
49 |
|
#include "mon_cmd.h" |
50 |
|
|
51 |
+ |
#ifndef VERSION |
52 |
+ |
#define VERSION "2" |
53 |
+ |
#endif |
54 |
+ |
|
55 |
|
|
56 |
|
// Buffer we're operating on |
57 |
|
bool mon_use_real_mem = false; |
1074 |
|
mon_add_command("@", reallocate, "@ [size] Reallocate buffer\n"); |
1075 |
|
mon_add_command("i", ascii_dump, "i [start [end]] ASCII memory dump\n"); |
1076 |
|
mon_add_command("m", memory_dump, "m [start [end]] Hex/ASCII memory dump\n"); |
1077 |
+ |
mon_add_command("b", binary_dump, "b [start [end]] Binary memory dump\n"); |
1078 |
|
mon_add_command("d", disassemble_ppc, "d [start [end]] Disassemble PowerPC code\n"); |
1079 |
|
mon_add_command("d65", disassemble_6502, "d65 [start [end]] Disassemble 6502 code\n"); |
1080 |
|
mon_add_command("d68", disassemble_680x0, "d68 [start [end]] Disassemble 680x0 code\n"); |
1169 |
|
|
1170 |
|
// Print banner |
1171 |
|
if (interactive) |
1172 |
< |
fprintf(monerr, "\n *** mon V%d.%d by Christian Bauer and Marc Hellwig ***\n" |
1173 |
< |
" *** Press 'h' for help ***\n\n", MON_VERSION_MAJOR, MON_VERSION_MINOR); |
1172 |
> |
fprintf(monerr, "\n *** mon V" VERSION " by Christian Bauer and Marc Hellwig ***\n" |
1173 |
> |
" *** Press 'h' for help ***\n\n"); |
1174 |
|
} |
1175 |
|
|
1176 |
|
init_abort(); |