Re: main(), registers and gdb

2007-01-10 Thread Daniel Jacobowitz
On Wed, Jan 10, 2007 at 04:50:59PM -0700, Greg Watson wrote: > That would be nice. Although this seems like a trivial issue, it can > potentially effect debugging all MPI programs since they always start > with 'MPI_Init(&argc, &argv)'. See my reply to the bug. This is specific to i686 32-bit

Re: main(), registers and gdb

2007-01-10 Thread Greg Watson
On Jan 10, 2007, at 4:38 PM, Daniel Jacobowitz wrote: On Wed, Jan 10, 2007 at 04:32:48PM -0700, Greg Watson wrote: If the following code is compiled with 'gcc -g -O0 -o test test.c', the address of argc is passed into func() in the ecx register. Since ecx is not preserved after the call to prin

Re: main(), registers and gdb

2007-01-10 Thread Daniel Jacobowitz
On Wed, Jan 10, 2007 at 04:32:48PM -0700, Greg Watson wrote: > If the following code is compiled with 'gcc -g -O0 -o test test.c', > the address of argc is passed into func() in the ecx register. Since > ecx is not preserved after the call to printf(), the address of argc > is corrupted on re

main(), registers and gdb

2007-01-10 Thread Greg Watson
I have an issue (I hesitate to say a problem) related to register saving and debugging on the linux/x86 platform using gdb 4.1.0. If the following code is compiled with 'gcc -g -O0 -o test test.c', the address of argc is passed into func() in the ecx register. Since ecx is not preserved aft