Move dump_machine_register
definitions
This commit is contained in:
parent
e9e4e1cb46
commit
da0e6b99c7
Notes:
git
2023-02-23 02:26:18 +00:00
29
vm_dump.c
29
vm_dump.c
@ -808,16 +808,20 @@ rb_print_backtrace(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __linux__
|
#if defined __linux__
|
||||||
# if defined __x86_64__ || defined __i386__ || defined __aarch64__ || defined __arm__ || defined __riscv || defined __loongarch64
|
# if defined(__x86_64__) || defined(__i386__)
|
||||||
# define HAVE_PRINT_MACHINE_REGISTERS 1
|
# define dump_machine_register(reg) (col_count = print_machine_register(mctx->gregs[REG_##reg], #reg, col_count, 80))
|
||||||
|
# elif defined(__aarch64__) || defined(__arm__) || defined(__riscv) || defined(__loongarch64)
|
||||||
|
# define dump_machine_register(reg, regstr) (col_count = print_machine_register(reg, regstr, col_count, 80))
|
||||||
# endif
|
# endif
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
# if defined __x86_64__ || defined __i386__ || defined __aarch64__
|
# if defined(__aarch64__)
|
||||||
# define HAVE_PRINT_MACHINE_REGISTERS 1
|
# define dump_machine_register(reg, regstr) (col_count = print_machine_register(mctx->MCTX_SS_REG(reg), regstr, col_count, 80))
|
||||||
|
# else
|
||||||
|
# define dump_machine_register(reg) (col_count = print_machine_register(mctx->MCTX_SS_REG(reg), #reg, col_count, 80))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PRINT_MACHINE_REGISTERS
|
#ifdef dump_machine_register
|
||||||
static int
|
static int
|
||||||
print_machine_register(size_t reg, const char *reg_name, int col_count, int max_col)
|
print_machine_register(size_t reg, const char *reg_name, int col_count, int max_col)
|
||||||
{
|
{
|
||||||
@ -834,19 +838,6 @@ print_machine_register(size_t reg, const char *reg_name, int col_count, int max_
|
|||||||
fputs(buf, stderr);
|
fputs(buf, stderr);
|
||||||
return col_count;
|
return col_count;
|
||||||
}
|
}
|
||||||
# ifdef __linux__
|
|
||||||
# if defined(__x86_64__) || defined(__i386__)
|
|
||||||
# define dump_machine_register(reg) (col_count = print_machine_register(mctx->gregs[REG_##reg], #reg, col_count, 80))
|
|
||||||
# elif defined(__aarch64__) || defined(__arm__) || defined(__riscv) || defined(__loongarch64)
|
|
||||||
# define dump_machine_register(reg, regstr) (col_count = print_machine_register(reg, regstr, col_count, 80))
|
|
||||||
# endif
|
|
||||||
# elif defined __APPLE__
|
|
||||||
# if defined(__aarch64__)
|
|
||||||
# define dump_machine_register(reg, regstr) (col_count = print_machine_register(mctx->MCTX_SS_REG(reg), regstr, col_count, 80))
|
|
||||||
# else
|
|
||||||
# define dump_machine_register(reg) (col_count = print_machine_register(mctx->MCTX_SS_REG(reg), #reg, col_count, 80))
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rb_dump_machine_register(const ucontext_t *ctx)
|
rb_dump_machine_register(const ucontext_t *ctx)
|
||||||
@ -1051,7 +1042,7 @@ rb_dump_machine_register(const ucontext_t *ctx)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define rb_dump_machine_register(ctx) ((void)0)
|
# define rb_dump_machine_register(ctx) ((void)0)
|
||||||
#endif /* HAVE_PRINT_MACHINE_REGISTERS */
|
#endif /* dump_machine_register */
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_vm_bugreport(const void *ctx)
|
rb_vm_bugreport(const void *ctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user