Move debugging/introspection functionality to lj_debug.c.

This commit is contained in:
Mike Pall
2011-06-07 21:37:24 +02:00
parent b44ccd4263
commit 585cf05dbd
13 changed files with 521 additions and 457 deletions

View File

@@ -12,6 +12,7 @@
#include "lj_gc.h"
#include "lj_err.h"
#include "lj_debug.h"
#include "lj_str.h"
#include "lj_frame.h"
#include "lj_state.h"
@@ -103,10 +104,8 @@ static void perftools_addtrace(GCtrace *T)
name++;
else
name = "(string)";
if (startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc)
lineno = proto_line(pt, proto_bcpos(pt, startpc));
else
lineno = proto_line(pt, 0); /* Wrong, but better than nothing. */
lua_assert(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc);
lineno = lj_debug_line(pt, proto_bcpos(pt, startpc));
if (!fp) {
char fname[40];
sprintf(fname, "/tmp/perf-%d.map", getpid());