diff options
| author | Mike Pall <mike> | 2011-03-29 02:23:05 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2011-03-29 02:23:05 +0200 |
| commit | 3bcb48c6a13ad0c1d092f2ea682388dfba663942 (patch) | |
| tree | 4e8fcda3c7e359703be5d6356f441048d1d83e41 | |
| parent | 71f976b02e36e69731f85a1c2126af16b47b0395 (diff) | |
| download | luajit-3bcb48c6a13ad0c1d092f2ea682388dfba663942.tar.gz luajit-3bcb48c6a13ad0c1d092f2ea682388dfba663942.tar.bz2 luajit-3bcb48c6a13ad0c1d092f2ea682388dfba663942.zip | |
ARM: Add frame unwind info for assembler part.
| -rw-r--r-- | src/buildvm_arm.dasc | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/buildvm_arm.dasc b/src/buildvm_arm.dasc index 5d5ea37b..37fe7e3b 100644 --- a/src/buildvm_arm.dasc +++ b/src/buildvm_arm.dasc | |||
| @@ -1004,6 +1004,42 @@ static int build_backend(BuildCtx *ctx) | |||
| 1004 | /* Emit pseudo frame-info for all assembler functions. */ | 1004 | /* Emit pseudo frame-info for all assembler functions. */ |
| 1005 | static void emit_asm_debug(BuildCtx *ctx) | 1005 | static void emit_asm_debug(BuildCtx *ctx) |
| 1006 | { | 1006 | { |
| 1007 | UNUSED(ctx); /* NYI */ | 1007 | int i; |
| 1008 | switch (ctx->mode) { | ||
| 1009 | case BUILD_elfasm: | ||
| 1010 | fprintf(ctx->fp, "\t.section .debug_frame,\"\",%%progbits\n"); | ||
| 1011 | fprintf(ctx->fp, | ||
| 1012 | ".Lframe0:\n" | ||
| 1013 | "\t.long .LECIE0-.LSCIE0\n" | ||
| 1014 | ".LSCIE0:\n" | ||
| 1015 | "\t.long 0xffffffff\n" | ||
| 1016 | "\t.byte 0x1\n" | ||
| 1017 | "\t.string \"\"\n" | ||
| 1018 | "\t.uleb128 0x1\n" | ||
| 1019 | "\t.sleb128 -4\n" | ||
| 1020 | "\t.byte 0xe\n" /* Return address is in lr. */ | ||
| 1021 | "\t.byte 0xc\n\t.uleb128 0xd\n\t.uleb128 0\n" /* def_cfa sp */ | ||
| 1022 | "\t.align 2\n" | ||
| 1023 | ".LECIE0:\n\n"); | ||
| 1024 | fprintf(ctx->fp, | ||
| 1025 | ".LSFDE0:\n" | ||
| 1026 | "\t.long .LEFDE0-.LASFDE0\n" | ||
| 1027 | ".LASFDE0:\n" | ||
| 1028 | "\t.long .Lframe0\n" | ||
| 1029 | "\t.long .Lbegin\n" | ||
| 1030 | "\t.long %d\n" | ||
| 1031 | "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ | ||
| 1032 | "\t.byte 0x8e\n\t.uleb128 1\n", /* Restore lr. */ | ||
| 1033 | (int)ctx->codesz, CFRAME_SIZE); | ||
| 1034 | for (i = 11; i >= 4; i--) /* Restore r4-r11. */ | ||
| 1035 | fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 2+(11-i)); | ||
| 1036 | fprintf(ctx->fp, | ||
| 1037 | "\t.align 2\n" | ||
| 1038 | ".LEFDE0:\n\n"); | ||
| 1039 | /* NYI: emit ARM.exidx. */ | ||
| 1040 | break; | ||
| 1041 | default: | ||
| 1042 | break; | ||
| 1043 | } | ||
| 1008 | } | 1044 | } |
| 1009 | 1045 | ||
