Tune upvalue and table item reporting
This commit is contained in:
@@ -173,8 +173,8 @@ public class DebugLuaState extends LuaState implements DebugRequestListener {
|
|||||||
protected DebugNetSupportBase debugSupport;
|
protected DebugNetSupportBase debugSupport;
|
||||||
protected LuaErrorException lastError;
|
protected LuaErrorException lastError;
|
||||||
|
|
||||||
final String uparrow = "^";
|
final String openUpVal = "+";
|
||||||
final String rtarrow = "~";
|
final String closedUpVal = "-";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of DebugLuaState.
|
* Creates an instance of DebugLuaState.
|
||||||
@@ -641,7 +641,7 @@ public class DebugLuaState extends LuaState implements DebugRequestListener {
|
|||||||
for ( int i=0; i<prototype.nups; i++ ) {
|
for ( int i=0; i<prototype.nups; i++ ) {
|
||||||
if ( closure.upVals[i] != null ) {
|
if ( closure.upVals[i] != null ) {
|
||||||
LString[] ups = prototype.upvalues;
|
LString[] ups = prototype.upvalues;
|
||||||
String upstate = (closure.upVals[i].isClosed()? rtarrow: uparrow);
|
String upstate = (closure.upVals[i].isClosed()? closedUpVal: openUpVal);
|
||||||
String name = (ups!=null && ups.length>i? String.valueOf(ups[i]): "?");
|
String name = (ups!=null && ups.length>i? String.valueOf(ups[i]): "?");
|
||||||
LValue value = closure.upVals[i].getValue();
|
LValue value = closure.upVals[i].getValue();
|
||||||
addVariable( variables, upstate+name, value );
|
addVariable( variables, upstate+name, value );
|
||||||
@@ -767,12 +767,10 @@ public class DebugLuaState extends LuaState implements DebugRequestListener {
|
|||||||
System.out.print("\tType: " + value.luaGetTypeName());
|
System.out.print("\tType: " + value.luaGetTypeName());
|
||||||
if (type == Lua.LUA_TTABLE) {
|
if (type == Lua.LUA_TTABLE) {
|
||||||
variables.addElement(new TableVariable( selectedVariableCount, varName, type, (LTable) value));
|
variables.addElement(new TableVariable( selectedVariableCount, varName, type, (LTable) value));
|
||||||
} else if (type == LUA_TNUMBER || type == LUA_TBOOLEAN || type == LUA_TNIL) {
|
|
||||||
variables.addElement(new Variable(selectedVariableCount, varName, type, value.toString()));
|
|
||||||
} else if (type == LUA_TSTRING) {
|
} else if (type == LUA_TSTRING) {
|
||||||
variables.addElement(new Variable(selectedVariableCount, varName, type, "'"+value.toString()+"'"));
|
variables.addElement(new Variable(selectedVariableCount, varName, type, "'"+value.toString()+"'"));
|
||||||
} else { // thread, userdata, function
|
} else {
|
||||||
variables.addElement(new Variable(selectedVariableCount, varName, type, "<"+value.luaGetTypeName().toJavaString()+">"));
|
variables.addElement(new Variable(selectedVariableCount, varName, type, value.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class TableVariable extends Variable {
|
|||||||
|
|
||||||
keyList.addElement(keyValues[i].toString());
|
keyList.addElement(keyValues[i].toString());
|
||||||
if (value instanceof LTable) {
|
if (value instanceof LTable) {
|
||||||
valueList.addElement(new TableVariable(i, "element[" + keyValues[i].toString() + "]", Lua.LUA_TTABLE, (LTable)value));
|
valueList.addElement(new TableVariable(i, "[" + keyValues[i].toString() + "]", Lua.LUA_TTABLE, (LTable)value));
|
||||||
} else {
|
} else {
|
||||||
valueList.addElement(value.toString());
|
valueList.addElement(value.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user