From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Michael Snyder , Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: Pb when calling a nested function in the inferior Date: Mon, 30 Jul 2001 11:31:00 -0000 Message-id: <1010730183050.ZM5116@ocotillo.lan> References: <20010730144818.A4726@act-europe.fr> <3B659961.26242FE@cygnus.com> X-SW-Source: 2001-07/msg00722.html On Jul 30, 10:29am, Michael Snyder wrote: > Joel Brobecker wrote: > > > > We have encountered a pb with gdb when one calls from gdb a nested > > function which accesses some "semi-global" variables. Here, > > "semi-global" means global to the nested function, but local to the > > englobing function. I would appreciate some advice on what can be done > > to correct the problem (if the problem can be solved, or helped, that > > is). Needless to say, if something can be done, I will make the > > necessary changes, and contribute them back. > > > > Here is an example to illustrate the problem: > > I've personally never used (or even seen) this > nested function syntax, so I don't know anything > useful about it. -- Michael It's a gcc extension. Apparently, on i386, a pointer to the static chain is passed in ecx. If Joel wants to fix this problem, it'd be a good idea to see if the relevant ABI addresses this issue and then make the appropriate changes. (The trick, I think, is to figure out the correct value to load into ecx.) Kevin