Debugging an ARM assembly (Neon extension) -
i developing algorithm uses arm neon instructions. writing code using assembler file (.s
, no inline asm).
my question best way debugging purpose i.e. viewing registers, memory, etc. currently, using android ndk
compile , android phone run algorithm.
poor man's debug solutions...
you can use gdb
/ gdbserver
remotely control execution of applications on android phone. i'm not giving full details here because change time example can start answer or make quick search on internet. learning use gdb might seem have high steep curve material on web exhaustive. can find taste.
single-stepping arm core via software tools hard that's why arm ecosystem full of expensive tools , hw equipment.
trick use insert brk
instructions manually in assembly code. brk self-hosted debug breakpoint. when core sees instruction stops , informs os situation. os notifies debugger situation , passes control it. when debugger gets control can check contents of registers , make changes them. last part of operation make process continue. since pc
still @ our break point instruction must increase pc
, set instruction after brk
.
since mentioned use .s
files instead of .s
files can utilize gcc
preprocessing / macro work. way enabling, disabling brk
might become less of issue.
big down side of way of working turnaround time. if there point want investigate gdb must make sure there brk
instruction there , require build/push/debug cycle.
Comments
Post a Comment