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

Function kname

third-party/lua-5.3.5/src/ldebug.c:355–372  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

353** find a "name" for the RK value 'c'
354*/
355static void kname (Proto *p, int pc, int c, const char **name) {
356 if (ISK(c)) { /* is 'c' a constant? */
357 TValue *kvalue = &p->k[INDEXK(c)];
358 if (ttisstring(kvalue)) { /* literal constant? */
359 *name = svalue(kvalue); /* it is its own name */
360 return;
361 }
362 /* else no reasonable name found */
363 }
364 else { /* 'c' is a register */
365 const char *what = getobjname(p, pc, c, name); /* search for 'c' */
366 if (what && *what == 'c') { /* found a constant name? */
367 return; /* 'name' already filled */
368 }
369 /* else no reasonable name found */
370 }
371 *name = "?"; /* no reasonable name found */
372}
373
374
375static int filterpc (int pc, int jmptarget) {

Callers 1

getobjnameFunction · 0.70

Calls 1

getobjnameFunction · 0.70

Tested by

no test coverage detected