Actually, this is a 2 part question. Someone told me this has something to do with stackwalking but I am not entirely sure. Any help would be appreciated.
1. How do I get the line number for the operation that is currently executing.
Ex: presume getLine() returns the line number in the code where it sits, how exactly do I implement getLine()? (i.e. getLine in this case returns 22)
#20 main() {
#22 getLine()}
2. How do I get the lin number for the call site? (i.e. I want the getCallsite to return 14 not 10)
#10 A() { getCallsite(); }
#12 main() {
#14 A(); }
Hung-Hsun
1. How do I get the line number for the operation that is currently executing.
Ex: presume getLine() returns the line number in the code where it sits, how exactly do I implement getLine()? (i.e. getLine in this case returns 22)
#20 main() {
#22 getLine()}
2. How do I get the lin number for the call site? (i.e. I want the getCallsite to return 14 not 10)
#10 A() { getCallsite(); }
#12 main() {
#14 A(); }
Hung-Hsun