aboutsummaryrefslogtreecommitdiff
path: root/src/lj_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_debug.c')
-rw-r--r--src/lj_debug.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lj_debug.c b/src/lj_debug.c
index 3f502864..48364069 100644
--- a/src/lj_debug.c
+++ b/src/lj_debug.c
@@ -15,6 +15,7 @@
15#include "lj_state.h" 15#include "lj_state.h"
16#include "lj_frame.h" 16#include "lj_frame.h"
17#include "lj_bc.h" 17#include "lj_bc.h"
18#include "lj_strfmt.h"
18#if LJ_HASJIT 19#if LJ_HASJIT
19#include "lj_jit.h" 20#include "lj_jit.h"
20#endif 21#endif
@@ -350,12 +351,12 @@ void lj_debug_addloc(lua_State *L, const char *msg,
350 GCproto *pt = funcproto(fn); 351 GCproto *pt = funcproto(fn);
351 char buf[LUA_IDSIZE]; 352 char buf[LUA_IDSIZE];
352 lj_debug_shortname(buf, proto_chunkname(pt), pt->firstline); 353 lj_debug_shortname(buf, proto_chunkname(pt), pt->firstline);
353 lj_str_pushf(L, "%s:%d: %s", buf, line, msg); 354 lj_strfmt_pushf(L, "%s:%d: %s", buf, line, msg);
354 return; 355 return;
355 } 356 }
356 } 357 }
357 } 358 }
358 lj_str_pushf(L, "%s", msg); 359 lj_strfmt_pushf(L, "%s", msg);
359} 360}
360 361
361/* Push location string for a bytecode position to Lua stack. */ 362/* Push location string for a bytecode position to Lua stack. */
@@ -366,7 +367,7 @@ void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc)
366 MSize i, len = name->len; 367 MSize i, len = name->len;
367 BCLine line = lj_debug_line(pt, pc); 368 BCLine line = lj_debug_line(pt, pc);
368 if (pt->firstline == ~(BCLine)0) { 369 if (pt->firstline == ~(BCLine)0) {
369 lj_str_pushf(L, "builtin:%s", s); 370 lj_strfmt_pushf(L, "builtin:%s", s);
370 } else if (*s == '@') { 371 } else if (*s == '@') {
371 s++; len--; 372 s++; len--;
372 for (i = len; i > 0; i--) 373 for (i = len; i > 0; i--)
@@ -374,13 +375,13 @@ void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc)
374 s += i+1; 375 s += i+1;
375 break; 376 break;
376 } 377 }
377 lj_str_pushf(L, "%s:%d", s, line); 378 lj_strfmt_pushf(L, "%s:%d", s, line);
378 } else if (len > 40) { 379 } else if (len > 40) {
379 lj_str_pushf(L, "%p:%d", pt, line); 380 lj_strfmt_pushf(L, "%p:%d", pt, line);
380 } else if (*s == '=') { 381 } else if (*s == '=') {
381 lj_str_pushf(L, "%s:%d", s+1, line); 382 lj_strfmt_pushf(L, "%s:%d", s+1, line);
382 } else { 383 } else {
383 lj_str_pushf(L, "\"%s\":%d", s, line); 384 lj_strfmt_pushf(L, "\"%s\":%d", s, line);
384 } 385 }
385} 386}
386 387