I am working on a complex project written in C for 8051 arhitecture with Keil C. And unfortunately no real debugger. There are many functions called from various c files. Some times hundereds of different c file. I want to implement a function which will give me the address of the calling function during runtime. Is there a way to read the call stack to exctract the callig function address? If a can get the adress a can check it from .m51 file and can understand which function call is active.
func1(void) { func_test(); };
func2(void) { func_test(); };
func3(void) { func_test(); };
func_test(void) { int get_call_func_address;
get_call_func_address = ???????; printf("Calling function adress is %d", get_call_func_address);
//Do other things...
}
main() { func1(); func2(); func3(); }
Best regards Saltuk Alakus
Per, Why "13Per Westermark" and not "Per Westermark" ?
Because I sometime start to write before the page has loaded fully, and guess which field that always have the focus on load?
All it takes is the phone to call or something and I will not notice this. All following posts will then use an incorrect name until I notice it and corrects it.
It is a bit funny actually: Most people posts multiple times, but this forum thinks the most prioritized field is the first name. A little bit of javascript to move the focus to the 'Message' in case the name and email can be auto-filled using a cookie would be practival. Or the MCU field in case the user is creating a new thread.
A little bit of javascript could also detect most unformatted source code and require the poster to correct.