Let me know EIP address

From: Lethalman
Date: Tue Jan 04 2005 - 10:36:00 EST


I'm trying to get the EIP value from a simple program in C but i don't how to do it. I need it to know the current address position on the code segment.

main() {
long *eip;
asm("mov %%eip,%0" : "=g"(eip));
printf("%p\n", eip);
}

Unfortunately EIP is not that kind of register :P
Does anyone know how to get EIP?

--
www.iosn.it * Amministratore Italian Open Source Network
www.fyrebird.net * Fyrebird Hosting Provider - Technical Department
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/