2005-06-09 15:08:23 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
|
|
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
|
|
|
//
|
|
|
|
// See the file "license" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2005-06-19 08:29:40 +00:00
|
|
|
// $Id: DebuggerParser.hxx,v 1.9 2005-06-19 08:29:40 urchlay Exp $
|
2005-06-09 15:08:23 +00:00
|
|
|
//============================================================================
|
2005-06-09 04:31:45 +00:00
|
|
|
|
|
|
|
#ifndef DEBUGGER_PARSER_HXX
|
|
|
|
#define DEBUGGER_PARSER_HXX
|
|
|
|
|
2005-06-12 18:18:01 +00:00
|
|
|
class Debugger;
|
|
|
|
|
2005-06-09 04:31:45 +00:00
|
|
|
#include "bspf.hxx"
|
2005-06-14 03:11:03 +00:00
|
|
|
#include "EquateList.hxx"
|
2005-06-09 04:31:45 +00:00
|
|
|
|
2005-06-18 19:00:44 +00:00
|
|
|
#define kMAX_ARGS 100
|
|
|
|
|
2005-06-19 08:29:40 +00:00
|
|
|
enum {
|
|
|
|
kBASE_16,
|
|
|
|
kBASE_10,
|
|
|
|
kBASE_2
|
|
|
|
};
|
|
|
|
|
2005-06-09 04:31:45 +00:00
|
|
|
class DebuggerParser
|
|
|
|
{
|
|
|
|
public:
|
2005-06-12 18:18:01 +00:00
|
|
|
DebuggerParser(Debugger* debugger);
|
2005-06-09 15:08:23 +00:00
|
|
|
~DebuggerParser();
|
|
|
|
|
|
|
|
string run(const string& command);
|
2005-06-19 08:29:40 +00:00
|
|
|
bool parseArgument(string& arg, int *value, char *rendered);
|
|
|
|
void setBase(int base);
|
2005-06-09 04:31:45 +00:00
|
|
|
|
|
|
|
private:
|
2005-06-19 08:29:40 +00:00
|
|
|
bool getArgs(const string& command);
|
|
|
|
int conv_hex_digit(char d);
|
|
|
|
bool subStringMatch(const string& needle, const string& haystack);
|
|
|
|
int decipher_arg(string &arg);
|
2005-06-17 21:59:54 +00:00
|
|
|
string disasm();
|
|
|
|
string listBreaks();
|
Added register names to argument processing. This means you can set e.g.
location 80 to the contents of the X register by saying "ram 80 x". This
also means that there's a small conflict: if you're inputting the value
0x0a (decimal 10), you need to either say "0a" or "A". Otherwise the
parser thinks you're talking about the "a" register instead of the hex
number "a".
Added dereference operator to arg processing. This works the same way as
in C: you prefix a "*" to an argument. So "80" means a literal hex 80,
as before, but you can say "*80" to mean "the memory location pointed to
by location 80"... this also works with the registers. Example: if the X
register holds the value ff, you can say "*x" and it will be treated as
the value ff. Unlike C, multiple levels of dereference are not supported.
Also, the result of a dereference is always a byte for now.
Added "eval" command to debugger prompt. This evaluates one or more
arguments (which may hex values or a labels, and may have a * in front)
and prints the results in hex, binary, and decimal, along with the label
that has that value, if any.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@527 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-06-18 17:28:18 +00:00
|
|
|
string eval();
|
2005-06-12 18:18:01 +00:00
|
|
|
|
|
|
|
Debugger* debugger;
|
|
|
|
|
2005-06-09 04:31:45 +00:00
|
|
|
bool done;
|
2005-06-12 18:18:01 +00:00
|
|
|
|
2005-06-13 02:47:44 +00:00
|
|
|
string verb;
|
2005-06-18 19:00:44 +00:00
|
|
|
int args[kMAX_ARGS+1]; // FIXME: should be dynamic
|
2005-06-19 08:29:40 +00:00
|
|
|
string argStrings[kMAX_ARGS+1];
|
2005-06-11 20:02:25 +00:00
|
|
|
int argCount;
|
2005-06-19 08:29:40 +00:00
|
|
|
int defaultBase;
|
2005-06-09 04:31:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|