Update pretty printing in debugging to generate valid Lua code for userdata-like types.

This commit is contained in:
Paul Kulchenko 2015-12-15 20:24:41 -08:00
parent 9f63e75a07
commit b754c8e18b

View File

@ -1911,11 +1911,11 @@ sds ldbCatStackValue(sds s, lua_State *lua, int idx) {
else if (t == LUA_TUSERDATA) typename = "userdata";
else if (t == LUA_TTHREAD) typename = "thread";
else if (t == LUA_TLIGHTUSERDATA) typename = "light-userdata";
s = sdscatprintf(s,"%s@%p",typename,p);
s = sdscatprintf(s,"\"%s@%p\"",typename,p);
}
break;
default:
s = sdscat(s,"<unknown-lua-type>");
s = sdscat(s,"\"<unknown-lua-type>\"");
break;
}
return s;