From: Markus.Grunwald@pruftechnik.com
To: Michael Snyder <gdb@sourceware.org>
Subject: Re: gdb continues when I want "next"
Date: Thu, 08 Mar 2007 14:50:00 -0000 [thread overview]
Message-ID: <OF9290451D.B995458B-ONC1257298.004E8C2D-C1257298.00518C25@pruftechnik.com> (raw)
In-Reply-To: <1173294544.22513.4.camel@localhost.localdomain>
Hello,
> > Breakpoint 1, CPTLinearGraphic::CalculateLinLines (this=0x9251de0)
> > at
> > /home/gru/projects/vxp/branches/branch-0-2-10-
> X/Dafit_Code/drawdevices/CPTLinearGraphic.cpp:1640
> > (gdb) n
> > (gdb) n
> > Detaching after fork from child process 29873.
> > [Thread -1863816272 (LWP 29869) exited]
> >
> > Program received signal SIGTRAP, Trace/breakpoint trap.
> > [Switching to Thread -1863816272 (LWP 29869)]
> > 0xb7446891 in __nptl_death_event () from
> > /lib/tls/i686/cmov/libpthread.so.0
> Hang on -- are we forking a multi-threaded program?
Well, not intentionally. But now that you asked, I used catch fork (which
seems to work allthough the manual tells me it works only on HP-UX...) and
it stopped several times. So, I think the answer is "yes".
The first halt of the catch fork gives me this, for example:
(gdb) catch fork
Catchpoint 1 (fork)
(gdb) run
[Thread debugging using libthread_db enabled]
[New Thread -1223350592 (LWP 25310)]
[Switching to Thread -1223350592 (LWP 25310)]
Catchpoint 1 (forked process 25313), 0xb7f9d410 in ?? ()
(gdb) bt
#0 0xb7f9d410 in ?? ()
#1 0x00000001 in ?? ()
#2 0x00000000 in ?? ()
#3 0xb72ad61e in strtold_l () from /lib/tls/i686/cmov/libc.so.6
#4 0xb7422add in system () from /lib/tls/i686/cmov/libpthread.so.0
#5 0x080f9827 in CPTApplication::SetupTmpDir (this=0x90f7260)
at
/home/gru/projects/vxp/branches/branch-0-2-00-X/Dafit_Code/dafit2/dafit2/CPTApplication.cpp:1676
#6 0x080f50a4 in CPTApplication::CPTApplication (this=0x90f7260,
nSuccess=@0xbf8a2ba4, nArgc=1, aszArgv=0xbf8a2c24)
at
/home/gru/projects/vxp/branches/branch-0-2-00-X/Dafit_Code/dafit2/dafit2/CPTApplication.cpp:467
#7 0x080fbafa in main (nArgs=1, aszArgs=0xbf8a2c24)
at
/home/gru/projects/vxp/branches/branch-0-2-00-X/Dafit_Code/dafit2/dafit2/main.cpp:55
(gdb) up 5
#5 0x080f9827 in CPTApplication::SetupTmpDir (this=0x90f7260)
1676 nReturn = system( oszRm.arg( GetCFTempDir()+"*" ).latin1()
);
(gdb) info thread
* 1 Thread -1223350592 (LWP 25310) 0x080f9827 in
CPTApplication::SetupTmpDir (
this=0x90f7260)
at
/home/gru/projects/vxp/branches/branch-0-2-00-X/Dafit_Code/dafit2/dafit2/CPTApplication.cpp:1676
So there's just one thread here and the fork is caused by the "system"
call.
> Can't really do that, you know... or at least, it's
> likely to be quite unpredictable unles the *only* thing
> the fork-child does is call exec.
Could you explain this a bit further ? The system call surely isn't the
only thing this thread does but it seems to work quite well - for now...
I found other examples, when we have more than one thread running when the
catchpoint is reached, but in many cases the fork seems to be done by the
qt library so that we don't really have any choice at this point ...
I have to admit that I don't understand why this shouldn't work ...
Thanks for your help,
Markus Grunwald
next prev parent reply other threads:[~2007-03-08 14:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-02 13:44 Markus.Grunwald
2007-03-02 13:57 ` Daniel Jacobowitz
2007-03-07 19:09 ` Michael Snyder
2007-03-08 14:50 ` Markus.Grunwald [this message]
2007-03-08 15:01 ` Daniel Jacobowitz
2007-03-07 11:20 Markus.Grunwald
2007-03-07 12:13 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OF9290451D.B995458B-ONC1257298.004E8C2D-C1257298.00518C25@pruftechnik.com \
--to=markus.grunwald@pruftechnik.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox