MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / kname

Function kname

third-party/lua-5.2.4/src/ldebug.c:327–344  ·  view source on GitHub ↗

** find a "name" for the RK value 'c' */

Source from the content-addressed store, hash-verified

325** find a "name" for the RK value 'c'
326*/
327static void kname (Proto *p, int pc, int c, const char **name) {
328 if (ISK(c)) { /* is 'c' a constant? */
329 TValue *kvalue = &p->k[INDEXK(c)];
330 if (ttisstring(kvalue)) { /* literal constant? */
331 *name = svalue(kvalue); /* it is its own name */
332 return;
333 }
334 /* else no reasonable name found */
335 }
336 else { /* 'c' is a register */
337 const char *what = getobjname(p, pc, c, name); /* search for 'c' */
338 if (what && *what == 'c') { /* found a constant name? */
339 return; /* 'name' already filled */
340 }
341 /* else no reasonable name found */
342 }
343 *name = "?"; /* no reasonable name found */
344}
345
346
347static int filterpc (int pc, int jmptarget) {

Callers 1

getobjnameFunction · 0.70

Calls 1

getobjnameFunction · 0.70

Tested by

no test coverage detected