aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-04-01 20:01:13 +0200
committerMike Pall <mike>2012-04-01 20:01:13 +0200
commit5a836015895ea9a84a58b2d5fd04b84da89e9c6d (patch)
tree7fb2ded265184d89e5aad25253e8da38097edfbe /src
parent407cc5e9ec5b68ac3e0e81d846f755bdd25c117f (diff)
downloadluajit-5a836015895ea9a84a58b2d5fd04b84da89e9c6d.tar.gz
luajit-5a836015895ea9a84a58b2d5fd04b84da89e9c6d.tar.bz2
luajit-5a836015895ea9a84a58b2d5fd04b84da89e9c6d.zip
MIPS: Add support for GDB JIT API.
Diffstat (limited to 'src')
-rw-r--r--src/lj_gdbjit.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lj_gdbjit.c b/src/lj_gdbjit.c
index e4f96212..0cff11b0 100644
--- a/src/lj_gdbjit.c
+++ b/src/lj_gdbjit.c
@@ -298,6 +298,9 @@ enum {
298 DW_REG_SP = 1, 298 DW_REG_SP = 1,
299 DW_REG_RA = 65, 299 DW_REG_RA = 65,
300 DW_REG_CR = 70, 300 DW_REG_CR = 70,
301#elif LJ_TARGET_MIPS
302 DW_REG_SP = 29,
303 DW_REG_RA = 31,
301#else 304#else
302#error "Unsupported target architecture" 305#error "Unsupported target architecture"
303#endif 306#endif
@@ -369,6 +372,8 @@ static const ELFheader elfhdr_template = {
369 .machine = 40, 372 .machine = 40,
370#elif LJ_TARGET_PPC 373#elif LJ_TARGET_PPC
371 .machine = 20, 374 .machine = 20,
375#elif LJ_TARGET_MIPS
376 .machine = 8,
372#else 377#else
373#error "Unsupported target architecture" 378#error "Unsupported target architecture"
374#endif 379#endif
@@ -562,19 +567,24 @@ static void LJ_FASTCALL gdbjit_ehframe(GDBJITctx *ctx)
562#elif LJ_TARGET_ARM 567#elif LJ_TARGET_ARM
563 { 568 {
564 int i; 569 int i;
565 DB(DW_CFA_offset_extended); DB(DW_REG_CR); DUV(55); 570 for (i = 11; i >= 4; i--) { DB(DW_CFA_offset|i); DUV(2+(11-i)); }
566 for (i = 11; i >= 4; i--) { /* R4-R11. */
567 DB(DW_CFA_offset|i); DUV(2+(11-i));
568 }
569 } 571 }
570#elif LJ_TARGET_PPC 572#elif LJ_TARGET_PPC
571 { 573 {
572 int i; 574 int i;
575 DB(DW_CFA_offset_extended); DB(DW_REG_CR); DUV(55);
573 for (i = 14; i <= 31; i++) { 576 for (i = 14; i <= 31; i++) {
574 DB(DW_CFA_offset|i); DUV(37+(31-i)); 577 DB(DW_CFA_offset|i); DUV(37+(31-i));
575 DB(DW_CFA_offset|32|i); DUV(2+2*(31-i)); 578 DB(DW_CFA_offset|32|i); DUV(2+2*(31-i));
576 } 579 }
577 } 580 }
581#elif LJ_TARGET_MIPS
582 {
583 int i;
584 DB(DW_CFA_offset|30); DUV(2);
585 for (i = 23; i >= 16; i--) { DB(DW_CFA_offset|i); DUV(26-i); }
586 for (i = 30; i >= 20; i -= 2) { DB(DW_CFA_offset|32|i); DUV(42-i); }
587 }
578#else 588#else
579#error "Unsupported target architecture" 589#error "Unsupported target architecture"
580#endif 590#endif