本文整理汇总了C++中MethodInfo::getLocalName方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodInfo::getLocalName方法的具体用法?C++ MethodInfo::getLocalName怎么用?C++ MethodInfo::getLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodInfo
的用法示例。
在下文中一共展示了MethodInfo::getLocalName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locals
void DebugCLI::locals()
{
Atom* ptr;
int count, line;
SourceInfo* src;
DebugFrame* frame = core->debugger->frameAt(0);
// source information
frame->sourceLocation(src, line);
// method
MethodInfo* info = functionFor(src, line);
if (info)
{
frame->arguments(ptr, count);
for(int i=0; i<count; i++)
{
// write out the name
if (info && (info->getLocalName(i) != core->kundefined) )
core->console << info->getLocalName(i) << " = ";
core->console << core->format(*ptr++);
//if (i<count-1)
core->console << "\n";
}
}
}
示例2: locals
void DebugCLI::locals()
{
Atom* ptr;
int count, line;
SourceInfo* src;
DebugFrame* frame = core->debugger()->frameAt(0);
// source information
frame->sourceLocation(src, line);
// method
MethodInfo* info = functionFor(src, line);
if (info)
{
frame->locals(ptr, count);
for(int i=0; i<count; i++)
{
// write out the name
Stringp nm = info->getLocalName(i);
if (nm != core->kundefined)
core->console << nm;
else
core->console << "<local_" << i << ">";
core->console << " = " << core->format(*ptr++) << "\n";
}
}
}
示例3: autoVarName
Stringp Debugger::autoVarName(DebugStackFrame* frame, int index, AutoVarKind kind) {
if (frame == NULL) return NULL;
int line;
SourceInfo* src = NULL;
// source information
frame->sourceLocation(src, line);
MethodInfo* info = functionFor(src, line, frame);
if (!info) return NULL;
switch (kind) {
case AUTO_LOCAL:
return info->getLocalName(index);
case AUTO_ARGUMENT:
return info->getArgName(index);
case AUTO_THIS:
return NULL;
default:
AvmAssert(false);
}
return NULL;
}
示例4: set
void DebugCLI::set()
{
const char* what = nextToken();
const char* equ = nextToken();
const char* to = nextToken();
if (!to || !equ || !what || *equ != '=')
{
core->console << " Bad format, should be: 'set {variable} = {value}' ";
}
else
{
// look for the varable in our locals or args.
Atom* ptr;
int count, line;
SourceInfo* src;
DebugFrame* frame = core->debugger->frameAt(0);
// source information
frame->sourceLocation(src, line);
if (!src)
{
core->console << "Unable to locate debug information for current source file, so no local or argument names known";
return;
}
// method
MethodInfo* info = functionFor(src, line);
if (!info)
{
core->console << "Unable to find method debug information, so no local or argument names known";
return;
}
frame->arguments(ptr, count);
for(int i=0; i<count; i++)
{
Stringp arg = info->getArgName(i);
if (arg->Equals(what))
{
// match!
Atom a = ease2Atom(to, ptr[i]);
if (a == undefinedAtom)
core->console << " Type mismatch : current value is " << core->format(ptr[i]);
else
frame->setArgument(i, a);
return;
}
}
frame->locals(ptr, count);
for(int i=0; i<count; i++)
{
Stringp local = info->getLocalName(i);
if ( local->Equals(what))
{
// match!
Atom a = ease2Atom(to, ptr[i]);
if (a == undefinedAtom)
core->console << " Type mismatch : current value is " << core->format(ptr[i]);
else
frame->setLocal(i, a);
return;
}
}
}
}