From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: "Pedro Alves" <pedro@codesourcery.com>, <gdb@sourceware.org>
Subject: RE: Setting breakpoint misbehaving with all threads running in Non-Stop on Linux
Date: Sun, 03 May 2009 02:30:00 -0000 [thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA071521E9@ecamlmw720.eamcs.ericsson.se> (raw)
In-Reply-To: <200905021814.26543.pedro@codesourcery.com>
> > I'm using HEAD (from yesterday) with Non-Stop locally on Linux.
> > I notice that when all my threads are running, setting a breakpoint
> > is misbehaving.
> >
> > First, should I be able to set a breakpoint when all threads
> > are running (on Linux)?
>
> I've worked with non-stop mode in a few targets other than linux
> already, and so far, only linux has this issue, and it
> is *really* a nuisance. I've been thinking we should make it
> possible on linux to insert breakpoints when threads are running
> as well. The user experience is just bad otherwise.
I very much agree with you.
And that is really what we need
on the frontend side. I'll probably have to force such a behavior
(by suspending a thread, planting the bp, and resuming)
if GDB does not provide it directly.
> > Either way though, setting a bp reports an error -with-
> > a breakpoint id, and then 'info break' shows the breakpoint
> > as being set. However, the breakpoint does not actually hit.
> >
> > See below for the session.
> >
> > (gdb)
> > info b
> > &"info b\n"
> > ~"Num Type Disp Enb Address What\n"
> > ~"1 breakpoint keep y 0x080485dc in main at
> > MultiThread.cc:24\n"
> > ~"2 breakpoint keep y 0x0804857a in thread_exec(void*) at
> > MultiThread.cc:10\n"
> > ~"3 breakpoint keep y 0x0804857e in thread_exec(void*) at
> > MultiThread.cc:11\n"
> > ^done
> >
> > == Both 'failed' breakpoints show as installed, but they ==
> > == don't actually stop the thread. ==
>
> I don't think this output indicates the breakpoints are installed or not.
> "Enb" is a high level user setting; The "Address" field showing a resolved address
> means that GDB is sure of the breakpoint address and believes those addresses
> belong to currently mapped memory area --- if the breakpoints that failed
> to insert pointed at code in a shared library, GDB would have made the
> breakpoint locations pending (<PENDING>), because it would assume that
> the reason the insertion failed was due to the shared library having
> been unloaded. But, GDB doesn't do that for breakpoints set in
> the main executable -- only in shlibs.
I'm just surprised that GDB returns an ^error, and still shows the breakpoint
in the list. If the bp was <PENDING> I don't believe GDB would have returned
an ^error.
> What would people think of adding a new column in "info breakpoints" showing
> the "inserted" status of the breakpoint? It should be used to
> show 'inserted', 'not inserted', 'not inserted due to error' state,
> and perhaps more states.
>
> E.g.:
>
> Num Type Disp Enb Ins Address What
> 1 breakpoint keep y y 0x080485dc in main at MultiThread.cc:24
> 2 breakpoint keep y n <PENDING> at foo
> 3 breakpoint keep y E 0xaaff8f45 at foo2
What is the value of have a bp shown with an Error? Will that bp ever
work? Why should it be kept around?
What I noticed is that even after the main thread stops, in my test,
the failed bp still does not hit. So, I'm wondering of it usefulness.
Thanks
Marc
next prev parent reply other threads:[~2009-05-03 2:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-01 19:31 Marc Khouzam
2009-05-02 17:14 ` Pedro Alves
2009-05-03 2:30 ` Marc Khouzam [this message]
2009-05-05 17:41 ` Pedro Alves
2009-05-05 19:30 ` Marc Khouzam
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=6D19CA8D71C89C43A057926FE0D4ADAA071521E9@ecamlmw720.eamcs.ericsson.se \
--to=marc.khouzam@ericsson.com \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
/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