MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / traceback

Function traceback

lua/lua.c:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74static int traceback (lua_State *L) {
75 if (!lua_isstring(L, 1)) /* 'message' not a string? */
76 return 1; /* keep it intact */
77 lua_getfield(L, LUA_GLOBALSINDEX, "debug");
78 if (!lua_istable(L, -1)) {
79 lua_pop(L, 1);
80 return 1;
81 }
82 lua_getfield(L, -1, "traceback");
83 if (!lua_isfunction(L, -1)) {
84 lua_pop(L, 2);
85 return 1;
86 }
87 lua_pushvalue(L, 1); /* pass error message */
88 lua_pushinteger(L, 2); /* skip this function and traceback */
89 lua_call(L, 2, 1); /* call debug.traceback */
90 return 1;
91}
92
93
94static int docall (lua_State *L, int narg, int clear) {

Callers

nothing calls this directly

Calls 5

lua_isstringFunction · 0.85
lua_getfieldFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushintegerFunction · 0.85
lua_callFunction · 0.85

Tested by

no test coverage detected