Re: Pb when calling a nested function in the inferior

Kevin Buettner
2001-07-30T11:31:00Z

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