Stern, Eli
2010-07-26 08:04:15 UTC
I am using uClibc (as opposed to glibc), so the backtrace() functions do not exist.
I am trying to write a backtrace function, but cannot determine the stack frame for Thumb code, since it seems inconsistent.
I have done several experiments:
1. Compiled using "-mtpcs-frame -mtpcs-leaf-frame". This creates a consistent stack frame, but is very expensive. It adds approximately 15 Thumb instructions per function.
2. Compiled using "-fno-omit-frame-pointer". There were 2 problems here.
2.1 When returning from main(), I did not reach a NULL fp.
2.2 The stack frame was different depending on the optimization. Tried without -O and with -O1. Got different structure of the stack frame.
Is there a way to backtrace interworked ARM/Thumb code, without using tpcs?
Thanx
Eli Stern
I am trying to write a backtrace function, but cannot determine the stack frame for Thumb code, since it seems inconsistent.
I have done several experiments:
1. Compiled using "-mtpcs-frame -mtpcs-leaf-frame". This creates a consistent stack frame, but is very expensive. It adds approximately 15 Thumb instructions per function.
2. Compiled using "-fno-omit-frame-pointer". There were 2 problems here.
2.1 When returning from main(), I did not reach a NULL fp.
2.2 The stack frame was different depending on the optimization. Tried without -O and with -O1. Got different structure of the stack frame.
Is there a way to backtrace interworked ARM/Thumb code, without using tpcs?
Thanx
Eli Stern