We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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