aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-28 17:52:11 +0100
committerMike Pall <mike>2010-02-28 17:52:11 +0100
commit956065fd047de66aab31cd4336f3e663e87db3e3 (patch)
tree5cafa74eb68e8c53ff0def921ec5cefa37026fd0 /src
parent2144d55eb83f8b92732c3e5aa51ece61071a7b8f (diff)
downloadluajit-956065fd047de66aab31cd4336f3e663e87db3e3.tar.gz
luajit-956065fd047de66aab31cd4336f3e663e87db3e3.tar.bz2
luajit-956065fd047de66aab31cd4336f3e663e87db3e3.zip
Add frame info for x64 GDB JIT API.
Diffstat (limited to 'src')
-rw-r--r--src/lj_frame.h3
-rw-r--r--src/lj_gdbjit.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lj_frame.h b/src/lj_frame.h
index 089b24f6..549784c6 100644
--- a/src/lj_frame.h
+++ b/src/lj_frame.h
@@ -66,6 +66,7 @@ enum {
66#define CFRAME_OFS_PC (6*4) 66#define CFRAME_OFS_PC (6*4)
67#define CFRAME_OFS_MULTRES (5*4) 67#define CFRAME_OFS_MULTRES (5*4)
68#define CFRAME_SIZE (12*4) 68#define CFRAME_SIZE (12*4)
69#define CFRAME_SIZE_JIT CFRAME_SIZE
69#elif LJ_TARGET_X64 70#elif LJ_TARGET_X64
70#if _WIN64 71#if _WIN64
71#define CFRAME_OFS_PREV (13*8) 72#define CFRAME_OFS_PREV (13*8)
@@ -75,6 +76,7 @@ enum {
75#define CFRAME_OFS_NRES (22*4) 76#define CFRAME_OFS_NRES (22*4)
76#define CFRAME_OFS_MULTRES (21*4) 77#define CFRAME_OFS_MULTRES (21*4)
77#define CFRAME_SIZE (10*8) 78#define CFRAME_SIZE (10*8)
79#define CFRAME_SIZE_JIT (CFRAME_SIZE + 9*16 + 4*8)
78#else 80#else
79#define CFRAME_OFS_PREV (4*8) 81#define CFRAME_OFS_PREV (4*8)
80#define CFRAME_OFS_PC (7*4) 82#define CFRAME_OFS_PC (7*4)
@@ -83,6 +85,7 @@ enum {
83#define CFRAME_OFS_NRES (4*4) 85#define CFRAME_OFS_NRES (4*4)
84#define CFRAME_OFS_MULTRES (1*4) 86#define CFRAME_OFS_MULTRES (1*4)
85#define CFRAME_SIZE (10*8) 87#define CFRAME_SIZE (10*8)
88#define CFRAME_SIZE_JIT (CFRAME_SIZE + 16)
86#endif 89#endif
87#else 90#else
88#error "Missing CFRAME_* definitions for this architecture" 91#error "Missing CFRAME_* definitions for this architecture"
diff --git a/src/lj_gdbjit.c b/src/lj_gdbjit.c
index f71b3081..c6e34807 100644
--- a/src/lj_gdbjit.c
+++ b/src/lj_gdbjit.c
@@ -528,7 +528,13 @@ static void LJ_FASTCALL gdbjit_ehframe(GDBJITctx *ctx)
528 DB(DW_CFA_offset|DW_REG_SI); DUV(4); 528 DB(DW_CFA_offset|DW_REG_SI); DUV(4);
529 DB(DW_CFA_offset|DW_REG_BX); DUV(5); 529 DB(DW_CFA_offset|DW_REG_BX); DUV(5);
530#elif LJ_TARGET_X64 530#elif LJ_TARGET_X64
531 /* Add saved registers for x64 CFRAME. */ 531 DB(DW_CFA_offset|DW_REG_BP); DUV(2);
532 DB(DW_CFA_offset|DW_REG_BX); DUV(3);
533 DB(DW_CFA_offset|DW_REG_15); DUV(4);
534 DB(DW_CFA_offset|DW_REG_14); DUV(5);
535 /* Extra registers saved for JIT-compiled code. */
536 DB(DW_CFA_offset|DW_REG_13); DUV(9);
537 DB(DW_CFA_offset|DW_REG_12); DUV(10);
532#else 538#else
533#error "Unsupported target architecture" 539#error "Unsupported target architecture"
534#endif 540#endif
@@ -703,8 +709,8 @@ void lj_gdbjit_addtrace(jit_State *J, Trace *T, TraceNo traceno)
703 ctx.T = T; 709 ctx.T = T;
704 ctx.mcaddr = (uintptr_t)T->mcode; 710 ctx.mcaddr = (uintptr_t)T->mcode;
705 ctx.szmcode = T->szmcode; 711 ctx.szmcode = T->szmcode;
706 ctx.spadjp = CFRAME_SIZE + (MSize)(parent ? J->trace[parent]->spadjust : 0); 712 ctx.spadjp = CFRAME_SIZE_JIT + (MSize)(parent?J->trace[parent]->spadjust:0);
707 ctx.spadj = CFRAME_SIZE + T->spadjust; 713 ctx.spadj = CFRAME_SIZE_JIT + T->spadjust;
708 ctx.lineno = proto_line(pt, proto_bcpos(pt, startpc)); 714 ctx.lineno = proto_line(pt, proto_bcpos(pt, startpc));
709 ctx.filename = strdata(proto_chunkname(pt)); 715 ctx.filename = strdata(proto_chunkname(pt));
710 if (*ctx.filename == '@' || *ctx.filename == '=') 716 if (*ctx.filename == '@' || *ctx.filename == '=')