I'm developing on an ARM9E processor running Linux. Sometimes my application crashes with the following message :
[ 142.410000] Alignment trap: rtspserverd (996) PC=0x4034f61c Instr=0xe591300c Address=0x0000000d FSR 0x001
How can I translate the PC address to actual source code? In other words, how can I make sense out of this message?
You can turn on listings in the compiler and tell the linker to produce a map file. The map file will give you the meaning of the absolute addresses up to the function where the problem occurs, while the listing will help you pinpoint the exact location of the exception within the function.
For example in
gcc you can do
gcc -Wa,-a,-ad -c foo.c > foo.lst
to produce a listing in the file
-Wa, sends the following options to the assembler (
gas to produce a listing on standard output.
gas to omit debug directives, which would otherwise add a lot of clutter.
The option for the GNU linker to produce a map file is
--print-map. If you link with
gcc you need to pass the option to the linker with an option starting with
-Wl,, for example
Alternatively you could also run your application in the debugger (e.g.
gdb) and look at the stack dump after the crash with the
User contributions licensed under CC BY-SA 3.0