Is there a way to find out the address of main() in C or C++ ? Since it is itself a function ,would there be an address of it own ?
If for any system you can't find the address of main.. put an invocation to a function foo() as the only statement in main, have main return whatever it returns and use the address of foo rather than main.
Note that calling main won't necessarily restart your code, even if there are no static/global variables. The compiler generates start up code before actually calling main.
If you want to breakpoint before this call to main write something like:
static int i=foo();
and foo will be called during the earlier data initialisation step.