Debugging an ARM assembly (Neon extension)
I am developing an algorithm that uses ARM Neon instructions. I am writing code using an assembler file (
and not inline asm).
My question is what is the best way to debug a target i.e. to view registers, memory, etc. I am currently using
to compile and my android phone to run the algorithm.
source to share
Poor people debug solutions ...
You can use
to remotely control application execution on Android phone. I am not giving details here because they change all the time, but for example you can start with this answer or do a quick web search. Learning how to use GDB may seem like a very steep curve, but the material on the Internet is comprehensive. You can easily find something to your liking.
One-step ARM core using software tools is difficult, so the ARM architecture is full of expensive HW tools and additional hardware.
The trick I'm using is to manually insert instructions
into the assembly code. BRK is a self service breakpoint. When the kernel sees this instruction, it stops and informs the OS about the situation. The OS then notifies the debugger of the situation and transfers control to it. When the debugger gains control, you can inspect the contents of the registers and possibly even make changes to them. The last part of the operation is to continue the process. Since the
breakpoint is still in our instruction, you need to increase
, set it after the instruction
Since you mentioned using
files instead of files
, you can use
to do preprocessing / macro work. This way of turning it on and off
can become less problematic.
The big part of this way of working is the turnaround time. If there is a specific point that you want to investigate with gdb, you have to make sure there is an instruction
, and this will probably require another build / push / debug loop.
source to share