This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++: __builtin_frame_address(0) behaviour
- From: "Stefan Schuerger" <stefan dot schuerger at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 17 May 2004 12:49:40 +0200 (MEST)
- Subject: g++: __builtin_frame_address(0) behaviour
Hi,
For a lightweight argument tracing I've tried
template <ptrdiff_t x>
class diff_const{
public:
static void p(){
cout << x << endl;
}
};
void* f5_2(char* arg1,string& arg2,int arg3){
diff_const<(char*)&arg1-(char*)__builtin_frame_address(0)> xj;
}
...but even though (&arg1-__builtin_frame_address(0)) should be a constant
expression on most platforms, gcc does not recognize it as such.
I need to store this as a stack/frame offset information for walking down
the call tree with full argument display in case of a function/method
failure. This would have zero overhead in the normal (successful) case.
Ideas, anyone?
--
---
Regards,
Stefan Schuerger
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/dsl