mirror of https://github.com/stella-emu/stella.git
Debugger::parseArgument() now takes an optional outputBase parameter,
which defaults to kBASE_DEFAULT (which means to use the DebuggerParser's current input base, set with the "base" command). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@532 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
7051819948
commit
f3fd39be4c
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: DebuggerParser.cxx,v 1.17 2005-06-19 16:53:57 urchlay Exp $
|
// $Id: DebuggerParser.cxx,v 1.18 2005-06-20 02:36:39 urchlay Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
@ -162,7 +162,7 @@ int DebuggerParser::decipher_arg(string &arg) {
|
||||||
|
|
||||||
// The GUI uses this:
|
// The GUI uses this:
|
||||||
bool DebuggerParser::parseArgument(
|
bool DebuggerParser::parseArgument(
|
||||||
string& arg, int *value, char *rendered)
|
string& arg, int *value, char *rendered, int outputBase=kBASE_DEFAULT)
|
||||||
{
|
{
|
||||||
*value = decipher_arg(arg);
|
*value = decipher_arg(arg);
|
||||||
|
|
||||||
|
@ -171,7 +171,10 @@ bool DebuggerParser::parseArgument(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(defaultBase) {
|
if(outputBase == kBASE_DEFAULT)
|
||||||
|
outputBase = defaultBase;
|
||||||
|
|
||||||
|
switch(outputBase) {
|
||||||
case kBASE_2:
|
case kBASE_2:
|
||||||
if(*value < 0x100)
|
if(*value < 0x100)
|
||||||
sprintf(rendered, Debugger::to_bin_8(*value));
|
sprintf(rendered, Debugger::to_bin_8(*value));
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: DebuggerParser.hxx,v 1.9 2005-06-19 08:29:40 urchlay Exp $
|
// $Id: DebuggerParser.hxx,v 1.10 2005-06-20 02:36:39 urchlay Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef DEBUGGER_PARSER_HXX
|
#ifndef DEBUGGER_PARSER_HXX
|
||||||
|
@ -29,7 +29,8 @@ class Debugger;
|
||||||
enum {
|
enum {
|
||||||
kBASE_16,
|
kBASE_16,
|
||||||
kBASE_10,
|
kBASE_10,
|
||||||
kBASE_2
|
kBASE_2,
|
||||||
|
kBASE_DEFAULT
|
||||||
};
|
};
|
||||||
|
|
||||||
class DebuggerParser
|
class DebuggerParser
|
||||||
|
@ -39,7 +40,7 @@ class DebuggerParser
|
||||||
~DebuggerParser();
|
~DebuggerParser();
|
||||||
|
|
||||||
string run(const string& command);
|
string run(const string& command);
|
||||||
bool parseArgument(string& arg, int *value, char *rendered);
|
bool parseArgument(string& arg, int *value, char *rendered, int outputBase);
|
||||||
void setBase(int base);
|
void setBase(int base);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue