public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* 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
* 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

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-22 12:41 calling functions in gdb sometimes doesn't work Klaus Zeitler
2003-05-22 13:52 ` Andrew Cagney
2003-05-22 15:46   ` Daniel Jacobowitz
2003-05-23 14:03     ` Klaus Zeitler
2003-05-23 13:13 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).