|
21 | 21 | */
|
22 | 22 |
|
23 | 23 |
|
24 |
| -#if defined(__x86_64__) || defined(i386) |
| 24 | +#if defined(__x86_64__) || defined(i386) || defined(__aarch64__) |
25 | 25 |
|
26 | 26 | #define HAVE_GDB
|
27 | 27 |
|
|
93 | 93 | DW_REG_8, DW_REG_9, DW_REG_10, DW_REG_11,
|
94 | 94 | DW_REG_12, DW_REG_13, DW_REG_14, DW_REG_15,
|
95 | 95 | DW_REG_RA,
|
96 |
| - /* TODO: ARM supports? */ |
| 96 | +#elif defined(__aarch64__) |
| 97 | + DW_REG_SP = 31, |
| 98 | + DW_REG_RA = 30, |
97 | 99 | #else
|
98 | 100 | #error "Unsupported target architecture"
|
99 | 101 | #endif
|
@@ -161,6 +163,8 @@ static const zend_elf_header zend_elfhdr_template = {
|
161 | 163 | .machine = 3,
|
162 | 164 | #elif defined(__x86_64__)
|
163 | 165 | .machine = 62,
|
| 166 | +#elif defined(__aarch64__) |
| 167 | + .machine = 183, |
164 | 168 | #else
|
165 | 169 | # error "Unsupported target architecture"
|
166 | 170 | #endif
|
@@ -328,6 +332,9 @@ static void zend_gdbjit_ehframe(zend_gdbjit_ctx *ctx)
|
328 | 332 | #elif defined(__x86_64__)
|
329 | 333 | DB(DW_CFA_advance_loc|4); /* sub $0x8,%rsp */
|
330 | 334 | DB(DW_CFA_def_cfa_offset); DUV(16); /* Aligned stack frame size. */
|
| 335 | +#elif defined(__aarch64__) |
| 336 | + DB(DW_CFA_advance_loc|1); /* Only an approximation. */ |
| 337 | + DB(DW_CFA_def_cfa_offset); DUV(32); /* Aligned stack frame size. */ |
331 | 338 | #else
|
332 | 339 | # error "Unsupported target architecture"
|
333 | 340 | #endif
|
@@ -493,4 +500,4 @@ static void zend_jit_gdb_init(void)
|
493 | 500 | #endif
|
494 | 501 | }
|
495 | 502 |
|
496 |
| -#endif /* defined(__x86_64__) || defined(i386) */ |
| 503 | +#endif /* defined(__x86_64__) || defined(i386) || defined(__aarch64__) */ |
0 commit comments