From 24f13b88ea51277bc8ee606d8a7242fc3b99edb8 Mon Sep 17 00:00:00 2001 From: doupengda Date: Tue, 18 Jul 2023 16:41:05 +0800 Subject: [PATCH] Resolve compilation errors for loongarch64 --- 0001-add-loongarch64-support.patch | 10 +++++----- memleax.spec | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/0001-add-loongarch64-support.patch b/0001-add-loongarch64-support.patch index f5fdb78..980de1b 100644 --- a/0001-add-loongarch64-support.patch +++ b/0001-add-loongarch64-support.patch @@ -40,23 +40,23 @@ index cbbe69d..4472bd1 100644 +#elif defined(MLX_LOONGARCH64) +static inline uintptr_t call_return_address(pid_t pid, registers_info_t *regs) +{ -+ return ptrace_get_data(pid, regs->gpr[3]); ++ return ptrace_get_data(pid, regs->regs[3]); +} +static inline uintptr_t call_return_value(registers_info_t *regs) +{ -+ return regs->gpr[1]; ++ return regs->regs[1]; +} +static inline uintptr_t call_arg1(pid_t pid, registers_info_t *regs) +{ -+ return regs->gpr[6]; ++ return regs->regs[6]; +} +static inline uintptr_t call_arg2(pid_t pid, registers_info_t *regs) +{ -+ return regs->gpr[7]; ++ return regs->regs[7]; +} +static inline uintptr_t pc_unwind(pid_t pid, registers_info_t *regs) +{ -+ return regs->pc; ++ return regs->csr_era; +} +static inline void set_breakpoint(pid_t pid, uintptr_t address, uintptr_t code) +{ diff --git a/memleax.spec b/memleax.spec index d2aee0d..e4a7889 100644 --- a/memleax.spec +++ b/memleax.spec @@ -1,6 +1,6 @@ Name: memleax Version: 1.1.1 -Release: 6 +Release: 7 Summary: Memory lead detection tool License: GPLv2 URL: https://github.com/WuBingzheng/memleax @@ -48,6 +48,9 @@ make install DESTDIR="%{buildroot}" %{_mandir}/man1/%{name}.1* %changelog +* Tue Jul 18 2023 doupengda - 1.1.1-7 +- Resolve compilation errors for loongarch64 + * Wed Dec 14 2022 doupengda - 1.1.1-6 - add loongarch64 support -- Gitee