Skip to content

Commit

Permalink
Merge pull request #316 from blitz/aarch64-hang
Browse files Browse the repository at this point in the history
Avoid hang on aarch64
  • Loading branch information
SimonKagstrom authored Jan 16, 2020
2 parents afa0ace + e2d7633 commit 2dca869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/engines/ptrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ static unsigned long arch_setupBreakpoint(unsigned long addr, unsigned long old_
#elif defined(__arm__)
val = 0xfedeffe7; // Undefined insn
#elif defined(__aarch64__)
val = 0xd4200000;
unsigned long aligned_addr = getAligned(addr);
unsigned long offs = addr - aligned_addr;
unsigned long shift = 8 * offs;

val = (old_data & ~(0xffffffffUL << shift)) | (0xd4200000UL << shift);
#else
# error Unsupported architecture
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/engines/ptrace_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

enum
{
i386_EIP = 12, x86_64_RIP = 16, ppc_NIP = 32, arm_PC = 15, aarch64_PC = 33, // See Linux arch/arm64/include/asm/ptrace.h
i386_EIP = 12, x86_64_RIP = 16, ppc_NIP = 32, arm_PC = 15, aarch64_PC = 32, // See Linux arch/arm64/include/asm/ptrace.h
};

static void arch_adjustPcAfterBreakpoint(unsigned long *regs);
Expand Down

0 comments on commit 2dca869

Please sign in to comment.