Wednesday, July 27, 2011

"Data TLB access error" exception when XMD(GDB) resumes execution from breakpoint


After breakpoint is set up in Xilinx XMD(GDB) debugger and the program is run to the breakpoint, when trying to continue/resume the execution or step through the code, "Data TLB access error" exception occurs.

This problem indicates stack corruption or uninitialized initial stack frame. When program execution reaches a breakpoint, execution pauses and gdb begins to reconstruct the backtrace. That means, using the contents of stack, the debugger trace through the previous stack frames and lists the calling functions corresponding to each stack-frame.

Actually, each stack-frame contains the (back chain pointer, which is) pointer to the previously allocated stack-frame and the pointer to the calling function.

GDB(XMD) continues to trace until the backchain pointer for a stack-frame is 0x00000000 which is the initial stack frame corresponding to the start of the program.

Therefore, either if the back-chain pointer of the initial stack frame is not initialized to NULL(0x00000000) by the program or if stack is corrupted, invalid addresses might be referred during the back-trace and "Data TLB access error" exception occurs when resuming the execution.

For more details about GDB backtrace, please refer to the following:
http://devpit.org/wiki/GDB

Have a nice debug!

No comments: