Forum Discussion
Altera_Forum
Honored Contributor
15 years agoGcc4 Frame Pointer Issue
I've been trying to write some code in an MPU exception handler to trap and dump the call stack when an intermittent exception occurs in our system and am pretty sure I've found a bug in the latest G...
Altera_Forum
Honored Contributor
12 years agoUpdate: Quartus 13.1 with GCC 4.7.3 has exactly the same issue.
It seems that the error occurs whenever the callee saved registers (r16-r23) get pushed onto the stack upon a function call. Then the frame pointer misses the correct position by <numOfCalleeRegs>*4 Bytes. Simple code example:class MyClass {
public:
MyClass() {};
virtual ~MyClass() {};
};
void FramePointerIssue( void ){
MyClass* foo = new MyClass();
delete foo;
}
int main(void){
FramePointerIssue();
return -1;
} Question: Is there an easy way to find out whether an address lies within the code space or not? I know that the information can be found in the *.objdump file, but is there also a programmatic way of accessing this info.