This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: calling functions in gdb sometimes doesn't work
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: Klaus Zeitler <kzeitler at lucent dot com>, gdb at sources dot redhat dot com
- Date: Thu, 22 May 2003 11:38:35 -0400
- Subject: Re: calling functions in gdb sometimes doesn't work
- References: <q5gfzn76tmp.fsf@lucent.com> <3ECCD616.3040108@redhat.com>
On Thu, May 22, 2003 at 09:52:22AM -0400, Andrew Cagney wrote:
> >Hi,
> >
> >with gdb 5.2 (Solaris 5.8) sometimes calling a function,
> >e.g. hello(){printf("hello\n");}, results in the following message:
> >
> >(gdb) p hello()
> >
> >The program being debugged stopped while in a function called from GDB.
> >When the function (hello) is done executing, GDB will silently
> >stop (instead of continuing to evaluate the expression containing
> >the function call).
> >
> >When I try to continue my program it appears as if this function didn't get
> >call at all.
> >Unfortunately this doesn't happen with simple example programs.
> >The program I'm debugging is threaded (maybe this has something
> >to do with it).
>
> Check which thread has stopped.
>
> I'm not sure that GDB's behavior, when trying to do an inferior function
> call on a threaded program is, er, very well defined :-(
In fact, it really doesn't work right. Jim discovered a few months ago
that other threads will be resumed.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer