This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
varargs for decoding stack frames ?
- To: gcc list <gcc at gcc dot gnu dot org>
- Subject: varargs for decoding stack frames ?
- From: Helge Hess <helge at mdlink dot de>
- Date: Mon, 29 Nov 1999 00:27:30 +0100
- Organization: MDlink online service center GmbH
Hi,
I'm search for a solution for decoding of calls stacks. I just wonder
whether varargs are suitable for this kind of task.
eg, would this be somewhat correct:
void a(void *this, int a, float b) {
printf("a is %i, b is %g", a, b);
}
void genericStoreMethod(void *this) {
va_list va;
va_start(va, this);
if (this->signature = VOID__INT_FLOAT) {
this->arg1 = va_arg(int);
this->arg2 = va_arg(float);
}
va_end(va);
}
this->a = a;
this->delayedA = (void (*)(void*))storeMethod;
this->delayedA(this, 100, 200.0);
// later call a by constructing stackframe via libffi
or do varargs only work with '...' style 'real' varargs ?
If not, does anyone know a package for doing this (like libffi but the
reverse way) ?
Thanks,
Helge