This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Pb when calling a nested function in the inferior
- To: Michael Snyder <msnyder at cygnus dot com>, Joel Brobecker <brobecker at act-europe dot fr>
- Subject: Re: Pb when calling a nested function in the inferior
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Mon, 30 Jul 2001 11:30:50 -0700
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010730144818.A4726@act-europe.fr> <3B659961.26242FE@cygnus.com>
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