diff options
author | Mike Pall <mike> | 2010-03-01 06:33:48 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-03-01 06:33:48 +0100 |
commit | 69ea553024155638c89bc12dca648c87a625ab5f (patch) | |
tree | ed8edd7e7939b33c671be161222da621826568b9 /src | |
parent | 7e696124ec94c0312b4a23d07ba2fb15cc1014b9 (diff) | |
download | luajit-69ea553024155638c89bc12dca648c87a625ab5f.tar.gz luajit-69ea553024155638c89bc12dca648c87a625ab5f.tar.bz2 luajit-69ea553024155638c89bc12dca648c87a625ab5f.zip |
Fix pc to line number translation for GDB JIT API.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_gdbjit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lj_gdbjit.c b/src/lj_gdbjit.c index c6e34807..951d52ec 100644 --- a/src/lj_gdbjit.c +++ b/src/lj_gdbjit.c | |||
@@ -711,7 +711,10 @@ void lj_gdbjit_addtrace(jit_State *J, Trace *T, TraceNo traceno) | |||
711 | ctx.szmcode = T->szmcode; | 711 | ctx.szmcode = T->szmcode; |
712 | ctx.spadjp = CFRAME_SIZE_JIT + (MSize)(parent?J->trace[parent]->spadjust:0); | 712 | ctx.spadjp = CFRAME_SIZE_JIT + (MSize)(parent?J->trace[parent]->spadjust:0); |
713 | ctx.spadj = CFRAME_SIZE_JIT + T->spadjust; | 713 | ctx.spadj = CFRAME_SIZE_JIT + T->spadjust; |
714 | ctx.lineno = proto_line(pt, proto_bcpos(pt, startpc)); | 714 | if (startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc) |
715 | ctx.lineno = proto_line(pt, proto_bcpos(pt, startpc)); | ||
716 | else | ||
717 | ctx.lineno = proto_line(pt, 0); /* Wrong, but better than nothing. */ | ||
715 | ctx.filename = strdata(proto_chunkname(pt)); | 718 | ctx.filename = strdata(proto_chunkname(pt)); |
716 | if (*ctx.filename == '@' || *ctx.filename == '=') | 719 | if (*ctx.filename == '@' || *ctx.filename == '=') |
717 | ctx.filename++; | 720 | ctx.filename++; |