public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: calling functions in gdb sometimes doesn't work
@ 2003-05-23 13:13 Klaus Zeitler
  0 siblings, 0 replies; 5+ messages in thread
From: Klaus Zeitler @ 2003-05-23 13:13 UTC (permalink / raw)
  To: gdb


>>>>> "Andrew" == Andrew Cagney <ac131313@redhat.com> writes:
    Andrew>
    >> Hi,
    >> with gdb 5.2 (Solaris 5.8) sometimes calling a function,
    Andrew>
    >> e.g. hello(){printf("hello\n");}, results in the following message:
    >> (gdb) p hello()
    Andrew>
    >> 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.
    Andrew>
    Andrew> Check which thread has stopped.

The one where I'm just at when I call a function.

Actually the message from above appears only when I've some breakpoint
defined, in which gdb would eventually run into, when I continue.
If there's no breakpoint, gdb will ignore my function call and continue the
program, but it'll show this message when I interrupt the program again.


Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Idiot, n.:  A member of a large and powerful tribe whose
influence in human affairs has always been dominant and
controlling.  -- Ambrose Bierce, "The Devil's Dictionary"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: calling functions in gdb sometimes doesn't work
  2003-05-22 15:46   ` Daniel Jacobowitz
@ 2003-05-23 14:03     ` Klaus Zeitler
  0 siblings, 0 replies; 5+ messages in thread
From: Klaus Zeitler @ 2003-05-23 14:03 UTC (permalink / raw)
  To: gdb

>>>>> "Daniel" == Daniel Jacobowitz <drow@mvista.com> writes:
    Daniel> 
    Daniel> 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).
    >> >
    Daniel> In fact, it really doesn't work right.  Jim discovered a few
    Daniel> months ago that other threads will be resumed.

so do you wanna say that this is a known bug? Is it already fixed in 5.3
or in CVS? How stable is the CVS version in general?

Klaus


-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Left to themselves, things tend to go from bad to worse.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: calling functions in gdb sometimes doesn't work
  2003-05-22 13:52 ` Andrew Cagney
@ 2003-05-22 15:46   ` Daniel Jacobowitz
  2003-05-23 14:03     ` Klaus Zeitler
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-05-22 15:46 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Klaus Zeitler, gdb

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: calling functions in gdb sometimes doesn't work
  2003-05-22 12:41 Klaus Zeitler
@ 2003-05-22 13:52 ` Andrew Cagney
  2003-05-22 15:46   ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-05-22 13:52 UTC (permalink / raw)
  To: Klaus Zeitler; +Cc: gdb

> 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 :-(

> When I switch back to gdb 5.0, calling functions in the same program
> works just fine.

Now that's a worry.

> Does anybody have an idea what's causing this.


Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* calling functions in gdb sometimes doesn't work
@ 2003-05-22 12:41 Klaus Zeitler
  2003-05-22 13:52 ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Klaus Zeitler @ 2003-05-22 12:41 UTC (permalink / raw)
  To: gdb


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).

When I switch back to gdb 5.0, calling functions in the same program
works just fine.

Does anybody have an idea what's causing this.

Thanks

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Oh, I don't blame Congress.  If I had $600 billion at my
disposal, I'd be irresponsible, too.  -- Lichty & Wagner

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-05-23 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-23 13:13 calling functions in gdb sometimes doesn't work Klaus Zeitler
  -- strict thread matches above, loose matches on Subject: below --
2003-05-22 12:41 Klaus Zeitler
2003-05-22 13:52 ` Andrew Cagney
2003-05-22 15:46   ` Daniel Jacobowitz
2003-05-23 14:03     ` Klaus Zeitler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).