Merge pull request #2957 from pkulchenko/debug-userdata-pretty-printing

Update pretty printing in debugging to generate valid Lua code for userdata-like types.
This commit is contained in:
Salvatore Sanfilippo 2015-12-22 08:59:48 +01:00
commit f054b4ac47

View File

@ -1915,11 +1915,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;