2000-04-29 00:23:06 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
2002-03-19 04:30:17 +00:00
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
2000-04-29 00:23:06 +00:00
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is the JavaScript 2 Prototype.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the
|
|
|
|
* terms of the GNU Public License (the "GPL"), in which case the
|
|
|
|
* provisions of the GPL are applicable instead of those above.
|
|
|
|
* If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of the GPL and not to allow others to use your
|
|
|
|
* version of this file under the NPL, indicate your decision by
|
|
|
|
* deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this
|
|
|
|
* file under either the NPL or the GPL.
|
|
|
|
*/
|
|
|
|
|
2001-02-09 19:10:18 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
// Turn off warnings about identifiers too long in browser information
|
|
|
|
#pragma warning(disable: 4786)
|
|
|
|
#endif
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
#include "world.h"
|
2001-02-08 21:13:16 +00:00
|
|
|
#include "utilities.h"
|
2000-04-29 00:23:06 +00:00
|
|
|
#include "debugger.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
namespace JavaScript {
|
|
|
|
namespace Debugger {
|
2000-05-05 04:44:51 +00:00
|
|
|
|
|
|
|
using namespace Interpreter;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
/* keep in sync with list in debugger.h */
|
2000-05-04 22:42:49 +00:00
|
|
|
static const char *shell_cmds[][3] = {
|
2000-06-24 02:53:29 +00:00
|
|
|
{"assemble", "", 0},
|
|
|
|
{"ambiguous", "", "Test command for ambiguous command detection"},
|
|
|
|
{"ambiguous2", "", "Test command for ambiguous command detection"},
|
|
|
|
{"continue", "", "Continue execution until complete."},
|
|
|
|
{"dissassemble", "[start_pc] [end_pc]", "Dissassemble entire module, or subset of module."},
|
|
|
|
{"exit", "", 0},
|
|
|
|
{"help", "", "Display this message."},
|
|
|
|
{"istep", "", "Execute the current opcode and stop."},
|
|
|
|
{"let", "", "Set a debugger environment variable."},
|
|
|
|
{"print", "", 0},
|
|
|
|
{"register", "", "(nyi) Show the value of a single register or all registers, or set the value of a single register."},
|
|
|
|
{"step", "", "Execute the current JS statement and stop."},
|
2000-05-04 22:42:49 +00:00
|
|
|
{0, 0} /* sentry */
|
|
|
|
};
|
2000-04-29 00:23:06 +00:00
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
enum ShellVariable {
|
2000-06-24 02:53:29 +00:00
|
|
|
TRACE_SOURCE,
|
|
|
|
TRACE_ICODE,
|
2000-05-04 22:42:49 +00:00
|
|
|
VARIABLE_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *shell_vars[][3] = {
|
2000-06-24 02:53:29 +00:00
|
|
|
{"tracesource", "", "(bool) Show JS source while executing."},
|
|
|
|
{"traceicode", " ", "(bool) Show opcodes while executing."},
|
2000-05-04 22:42:49 +00:00
|
|
|
{0, 0} /* sentry */
|
|
|
|
};
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
/* return true if str2 starts with/is str1
|
|
|
|
* XXX ignore case */
|
2000-04-30 14:56:31 +00:00
|
|
|
static bool
|
2000-04-29 00:23:06 +00:00
|
|
|
startsWith (const String &str1, const String &str2)
|
|
|
|
{
|
|
|
|
uint n;
|
|
|
|
size_t m = str1.size();
|
|
|
|
|
|
|
|
if (m > str2.size())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
for (n = 0; n < m; ++n)
|
|
|
|
if (str1[n] != str2[n])
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* locate the best match for |partial| in the command list |list|.
|
|
|
|
* if no matches are found, return |length|, if multiple matches are found,
|
|
|
|
* return |length| plus the number of ambiguous matches
|
|
|
|
*/
|
|
|
|
static uint32
|
|
|
|
matchElement (const String &partial, const char *list[][3], size_t length)
|
2000-04-29 00:23:06 +00:00
|
|
|
{
|
2000-04-29 00:29:56 +00:00
|
|
|
uint32 ambig_matches = 0;
|
2000-05-04 22:42:49 +00:00
|
|
|
uint32 match = length;
|
2000-04-29 00:23:06 +00:00
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
for (uint32 i = 0; i < length ; ++i)
|
2000-04-29 00:23:06 +00:00
|
|
|
{
|
2000-05-04 22:42:49 +00:00
|
|
|
String possibleMatch (widenCString(list[i][0]));
|
|
|
|
if (startsWith(partial, possibleMatch))
|
2000-04-29 00:23:06 +00:00
|
|
|
{
|
2000-05-04 22:42:49 +00:00
|
|
|
if (partial.size() == possibleMatch.size())
|
2000-04-29 00:23:06 +00:00
|
|
|
{
|
|
|
|
/* exact match */
|
|
|
|
ambig_matches = 0;
|
2000-05-04 22:42:49 +00:00
|
|
|
return i;
|
2000-04-29 00:23:06 +00:00
|
|
|
}
|
|
|
|
else if (match == COMMAND_COUNT) /* no match yet */
|
2000-05-04 22:42:49 +00:00
|
|
|
match = i;
|
2000-04-29 00:23:06 +00:00
|
|
|
else
|
|
|
|
++ambig_matches; /* something already matched,
|
|
|
|
* ambiguous command */
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ambig_matches == 0)
|
2000-05-04 22:42:49 +00:00
|
|
|
return match;
|
|
|
|
else
|
|
|
|
return length + ambig_matches;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
}
|
2000-05-04 22:42:49 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
showHelp(Formatter &out)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
out << "JavaScript 2.0 Debugger Help...\n\n";
|
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
for (i = 0; shell_cmds[i][0] != 0; i++)
|
2000-06-24 02:53:29 +00:00
|
|
|
{
|
|
|
|
out << "Command : " << shell_cmds[i][0] << " " <<
|
|
|
|
shell_cmds[i][1] << "\n";
|
|
|
|
|
|
|
|
if (shell_cmds[i][2])
|
|
|
|
out << "Help : " << shell_cmds[i][2] << "\n";
|
|
|
|
else
|
|
|
|
out << "Help : (probably) Not Implemented.\n";
|
|
|
|
}
|
2000-05-04 22:42:49 +00:00
|
|
|
}
|
2000-06-24 02:53:29 +00:00
|
|
|
|
|
|
|
static uint32
|
|
|
|
getClosestSourcePosForPC (Context *cx, InstructionIterator pc)
|
|
|
|
{
|
|
|
|
ICodeModule *iCode = cx->getICode();
|
|
|
|
|
|
|
|
if (iCode->mInstructionMap->begin() == iCode->mInstructionMap->end())
|
2000-07-11 23:08:03 +00:00
|
|
|
return NotABanana;
|
|
|
|
/*NOT_REACHED ("Instruction map is empty, waah.");*/
|
2000-06-24 02:53:29 +00:00
|
|
|
|
|
|
|
InstructionMap::iterator pos_iter =
|
2000-08-02 23:09:29 +00:00
|
|
|
iCode->mInstructionMap->upper_bound (static_cast<uint32>(pc - iCode->its_iCode->begin()));
|
2000-06-24 02:53:29 +00:00
|
|
|
if (pos_iter != iCode->mInstructionMap->begin())
|
|
|
|
--pos_iter;
|
2000-05-04 22:42:49 +00:00
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
return pos_iter->second;
|
|
|
|
}
|
|
|
|
|
2000-06-23 22:27:17 +00:00
|
|
|
void
|
|
|
|
Shell::showSourceAtPC (Context *cx, InstructionIterator pc)
|
|
|
|
{
|
|
|
|
if (!mResolveFileCallback)
|
|
|
|
{
|
2000-06-24 02:53:29 +00:00
|
|
|
mErr << "Source not available (Debugger was improperly initialized.)\n";
|
2000-06-23 22:27:17 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ICodeModule *iCode = cx->getICode();
|
|
|
|
|
|
|
|
String fn = iCode->getFileName();
|
|
|
|
const Reader *reader = mResolveFileCallback(fn);
|
|
|
|
if (!reader)
|
|
|
|
{
|
|
|
|
mErr << "Source not available.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
uint32 pos = getClosestSourcePosForPC(cx, pc);
|
2000-07-11 23:08:03 +00:00
|
|
|
if (pos == NotABanana)
|
|
|
|
{
|
|
|
|
mErr << "Map is empty, cannot display source.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
uint32 lineNum = reader->posToLineNum (pos);
|
2000-06-23 22:27:17 +00:00
|
|
|
const char16 *lineBegin, *lineEnd;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
uint32 lineStartPos = reader->getLine (lineNum, lineBegin, lineEnd);
|
2000-06-23 22:27:17 +00:00
|
|
|
String sourceLine (lineBegin, lineEnd);
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
mOut << fn << ":" << lineNum << " " << sourceLine << "\n";
|
|
|
|
|
|
|
|
uint padding = fn.length() + (uint32)(lineNum / 10) + 3;
|
|
|
|
uint i;
|
|
|
|
|
|
|
|
for (i = 0; i < padding; i++)
|
|
|
|
mOut << " ";
|
|
|
|
|
|
|
|
padding = (pos - lineStartPos);
|
|
|
|
for (i = 0; i < padding; i++)
|
|
|
|
mOut << ".";
|
|
|
|
|
|
|
|
mOut << "^\n";
|
2000-06-23 22:27:17 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Shell::showOpAtPC(Context* cx, InstructionIterator pc)
|
2000-05-04 22:42:49 +00:00
|
|
|
{
|
|
|
|
ICodeModule *iCode = cx->getICode();
|
2000-06-23 22:27:17 +00:00
|
|
|
|
|
|
|
if ((pc < iCode->its_iCode->begin()) ||
|
|
|
|
(pc >= iCode->its_iCode->end()))
|
|
|
|
{
|
|
|
|
mErr << "PC Out Of Range.";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
JSValues ®isters = cx->getRegisters();
|
|
|
|
|
2000-06-23 22:27:17 +00:00
|
|
|
printFormat(mOut, "trace [%02u:%04u]: ",
|
2000-05-04 22:42:49 +00:00
|
|
|
iCode->mID, (pc - iCode->its_iCode->begin()));
|
|
|
|
Instruction* i = *pc;
|
|
|
|
stdOut << *i;
|
|
|
|
if (i->op() != BRANCH && i->count() > 0) {
|
2000-06-23 22:27:17 +00:00
|
|
|
mOut << " [";
|
2000-05-04 22:42:49 +00:00
|
|
|
i->printOperands(stdOut, registers);
|
2000-06-23 22:27:17 +00:00
|
|
|
mOut << "]\n";
|
2000-05-04 22:42:49 +00:00
|
|
|
} else {
|
2000-06-23 22:27:17 +00:00
|
|
|
mOut << '\n';
|
2000-05-04 22:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-05-12 01:20:34 +00:00
|
|
|
Shell::listen(Context* cx, Context::Event event)
|
2000-05-04 22:42:49 +00:00
|
|
|
{
|
2000-06-24 02:53:29 +00:00
|
|
|
InstructionIterator pc = cx->getPC();
|
|
|
|
|
|
|
|
if (mTraceSource)
|
|
|
|
showSourceAtPC (cx, pc);
|
|
|
|
if (mTraceICode)
|
|
|
|
showOpAtPC (cx, pc);
|
2000-05-04 22:42:49 +00:00
|
|
|
|
2000-05-12 01:20:34 +00:00
|
|
|
if (!(mStopMask & event))
|
2000-05-04 22:42:49 +00:00
|
|
|
return;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
if ((mLastCommand == STEP) && (mLastICodeID == cx->getICode()->mID) &&
|
|
|
|
(mLastSourcePos == getClosestSourcePosForPC (cx, cx->getPC())))
|
|
|
|
/* we're in source-step mode, and the source position hasn't
|
|
|
|
* changed yet */
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!mTraceSource && !mTraceICode)
|
|
|
|
showSourceAtPC (cx, pc);
|
|
|
|
|
2000-05-05 05:25:00 +00:00
|
|
|
static String lastLine(widenCString("help\n"));
|
|
|
|
String line;
|
2000-05-05 04:44:51 +00:00
|
|
|
LineReader reader(mIn);
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
do {
|
|
|
|
stdOut << "jsd";
|
|
|
|
if (mLastCommand != COMMAND_COUNT)
|
|
|
|
stdOut << " (" << shell_cmds[mLastCommand][0] << ") ";
|
|
|
|
stdOut << "> ";
|
2000-05-04 22:42:49 +00:00
|
|
|
|
2000-05-05 04:44:51 +00:00
|
|
|
reader.readLine(line);
|
2000-05-05 04:19:20 +00:00
|
|
|
|
2000-05-05 05:25:00 +00:00
|
|
|
if (line[0] == uni::lf)
|
2000-05-04 22:42:49 +00:00
|
|
|
line = lastLine;
|
|
|
|
else
|
|
|
|
lastLine = line;
|
|
|
|
|
2000-05-05 05:25:00 +00:00
|
|
|
} while (doCommand(cx, line));
|
2000-05-04 22:42:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* lex and execute the debugger command in |source|, return true if the
|
|
|
|
* command does not require the script being debugged to continue (eg, ask
|
|
|
|
* for more debugger input.)
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
Shell::doCommand (Interpreter::Context *cx, const String &source)
|
|
|
|
{
|
|
|
|
Lexer lex (mWorld, source, widenCString("debugger console"), 0);
|
|
|
|
const String *cmd;
|
|
|
|
uint32 match;
|
|
|
|
bool rv = true;
|
|
|
|
|
|
|
|
const Token &t = lex.get(true);
|
|
|
|
|
|
|
|
if (t.hasKind(Token::identifier))
|
|
|
|
cmd = &(t.getIdentifier());
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mErr << "you idiot.\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
match = matchElement (*cmd, shell_cmds, (size_t)COMMAND_COUNT);
|
|
|
|
|
|
|
|
if (match <= (uint32)COMMAND_COUNT)
|
2000-06-24 02:53:29 +00:00
|
|
|
{
|
2000-05-04 22:42:49 +00:00
|
|
|
switch ((ShellCommand)match)
|
2000-04-29 00:23:06 +00:00
|
|
|
{
|
|
|
|
case COMMAND_COUNT:
|
|
|
|
mErr << "Unknown command '" << *cmd << "'.\n";
|
|
|
|
break;
|
2000-05-04 22:42:49 +00:00
|
|
|
|
|
|
|
case AMBIGUOUS:
|
|
|
|
case AMBIGUOUS2:
|
2000-05-12 01:20:34 +00:00
|
|
|
mErr << "I pity the foogoo.\n";
|
2000-05-04 22:42:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CONTINUE:
|
2000-05-12 01:20:34 +00:00
|
|
|
mStopMask &= (Context::EV_ALL ^ Context::EV_STEP);
|
2000-05-04 22:42:49 +00:00
|
|
|
rv = false;
|
|
|
|
break;
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
case DISSASSEMBLE:
|
2000-05-04 22:42:49 +00:00
|
|
|
mOut << *cx->getICode();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HELP:
|
|
|
|
showHelp (mOut);
|
|
|
|
break;
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
case PRINT:
|
2000-05-04 22:42:49 +00:00
|
|
|
doPrint (cx, lex);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case STEP:
|
2000-05-12 01:20:34 +00:00
|
|
|
mStopMask |= Context::EV_STEP;
|
2000-05-04 22:42:49 +00:00
|
|
|
rv = false;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LET:
|
|
|
|
doSetVariable (lex);
|
|
|
|
break;
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
default:
|
2000-05-04 22:42:49 +00:00
|
|
|
mErr << "Input '" << *cmd << "' matched unimplemented " <<
|
|
|
|
"command '" << shell_cmds[match][0] << "'.\n";
|
2000-04-29 00:23:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
2000-06-24 02:53:29 +00:00
|
|
|
|
|
|
|
mLastSourcePos = getClosestSourcePosForPC (cx, cx->getPC());
|
|
|
|
mLastICodeID = cx->getICode()->mID;
|
|
|
|
mLastCommand = (ShellCommand)match;
|
|
|
|
|
|
|
|
} else
|
2000-04-29 00:23:06 +00:00
|
|
|
mErr << "Ambiguous command '" << *cmd << "', " <<
|
2000-05-04 22:42:49 +00:00
|
|
|
(match - (uint32)COMMAND_COUNT + 1) << " similar commands.\n";
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
2000-04-29 00:23:06 +00:00
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
void
|
|
|
|
Shell::doSetVariable (Lexer &lex)
|
|
|
|
{
|
|
|
|
uint32 match;
|
|
|
|
const String *varname;
|
|
|
|
const Token *t = &(lex.get(true));
|
|
|
|
|
|
|
|
if (t->hasKind(Token::identifier))
|
|
|
|
varname = &(t->getIdentifier());
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mErr << "invalid variable name.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
match = matchElement (*varname, shell_vars, (size_t)VARIABLE_COUNT);
|
|
|
|
|
|
|
|
if (match <= (uint32)VARIABLE_COUNT)
|
|
|
|
switch ((ShellVariable)match)
|
|
|
|
{
|
|
|
|
case VARIABLE_COUNT:
|
|
|
|
mErr << "Unknown variable '" << *varname << "'.\n";
|
|
|
|
break;
|
|
|
|
|
2000-06-24 02:53:29 +00:00
|
|
|
case TRACE_SOURCE:
|
|
|
|
t = &(lex.get(true));
|
|
|
|
if (t->hasKind(Token::assignment))
|
|
|
|
t = &(lex.get(true)); /* optional = */
|
|
|
|
|
|
|
|
if (t->hasKind(Token::True))
|
|
|
|
mTraceSource = true;
|
|
|
|
else if (t->hasKind(Token::False))
|
|
|
|
mTraceSource = false;
|
|
|
|
else
|
|
|
|
goto badval;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TRACE_ICODE:
|
2000-05-04 22:42:49 +00:00
|
|
|
t = &(lex.get(true));
|
|
|
|
if (t->hasKind(Token::assignment))
|
|
|
|
t = &(lex.get(true)); /* optional = */
|
|
|
|
|
|
|
|
if (t->hasKind(Token::True))
|
2000-06-24 02:53:29 +00:00
|
|
|
mTraceICode = true;
|
2000-05-04 22:42:49 +00:00
|
|
|
else if (t->hasKind(Token::False))
|
2000-06-24 02:53:29 +00:00
|
|
|
mTraceICode = false;
|
2000-05-04 22:42:49 +00:00
|
|
|
else
|
|
|
|
goto badval;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
mErr << "Variable '" << *varname <<
|
|
|
|
"' matched unimplemented variable '" <<
|
|
|
|
shell_vars[match][0] << "'.\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mErr << "Ambiguous variable '" << *varname << "', " <<
|
|
|
|
(match - (uint32)COMMAND_COUNT + 1) << " similar variables.\n";
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
badval:
|
|
|
|
mErr << "Invalid value for variable '" <<
|
|
|
|
shell_vars[(ShellVariable)match][0] << "'\n";
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
}
|
2000-05-04 22:42:49 +00:00
|
|
|
|
|
|
|
void
|
2000-05-06 03:30:37 +00:00
|
|
|
Shell::doPrint (Context *, Lexer &lex)
|
2000-05-04 22:42:49 +00:00
|
|
|
{
|
|
|
|
const Token *t = &(lex.get(true));
|
2000-04-29 00:23:06 +00:00
|
|
|
|
2000-05-04 22:42:49 +00:00
|
|
|
if (!(t->hasKind(Token::identifier)))
|
|
|
|
{
|
|
|
|
mErr << "Invalid register name.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
const StringAtom *name = &(t->getIdentifier());
|
|
|
|
|
|
|
|
VariableMap::iterator i = ((cx->getICode())->itsVariables)->find(*name);
|
|
|
|
// if (i)
|
|
|
|
mOut << (*i).first << " = " << (*i).second << "\n";
|
|
|
|
// else
|
|
|
|
// mOut << "No " << *name << " defined.\n";
|
|
|
|
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-04-29 00:23:06 +00:00
|
|
|
} /* namespace Debugger */
|
|
|
|
} /* namespace JavaScript */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|