From: Pedro Alves <palves@redhat.com>
To: Muhammad Waqas <mwaqas@codesourcery.com>
Cc: Yao Qi <yao@codesourcery.com>,
gdb-patches@sourceware.org, tromey@redhat.com,
ali_anwar@codesourcery.com
Subject: Re: [PATCH with testcase] Bug 11568 - delete thread-specific breakpoint on the thread exit
Date: Fri, 02 Aug 2013 09:45:00 -0000 [thread overview]
Message-ID: <51FB7F9E.30701@redhat.com> (raw)
In-Reply-To: <51FA5806.7050505@codesourcery.com>
On 08/01/2013 01:43 PM, Muhammad Waqas wrote:
>>> >> + || !target_thread_alive (tp->ptid)))
>>> >> + if ( tp != NULL && (tp->state == THREAD_EXITED
>>> >> + || !target_thread_alive (tp->ptid)))
>> > Do we really need this target_thread_alive call? It
>> > means we have extra remote traffic whenever we have a thread
>> > specific breakpoint in the list. If the user (or GDB itself)
>> > hasn't refreshed the thread list, is there any harm in delaying
>> > deleting the breakpoint?
>> >
>> > But, I think I agree with Yao in that this doesn't look like
>> > the right way to do this.
>> >
>> > In fact, breakpoint_auto_delete is only called when the
>> > target reports some stop. If you're trying to delete
>> > stale thread specific breakpoints, then you'd want to
>> > do that even if the target hasn't reported a stop, right?
>> >
>> > Say, in non-stop mode, w/ the remote target, if you have two
>> > threads, set a thread-specific break on thread 2, and while
>> > all threads are running free in busy loops, not reporting
>> > any event, keep doing "info threads", and "info break". At some
>> > point thread #2 exits. You can see that from "info threads".
>> > But "info break" will still show you the stale breakpoint...
> If breakpoint will be deleted when thread list is updated through
> user or GDB and also when info break command is executed
> by user, Will it work? What will you say about this technique?
>
I wouldn't even consider special casing "info break". Otherwise,
you end up considering whether to handle all sorts of breakpoint
manipulation commands, like "enable", "disable", etc., and what
to do if the thread is already gone.
Tie this to GDB's own lifetime of the inferior's threads. If GDB
learns the thread is gone, remove the breakpoint. Otherwise,
leave it there. Whether to remove the breakpoint immediately,
or mark it as disp_del_at_next_stop (and hide it, say, set its
bp->num to 0) is another question. You'll note that
clear_thread_inferior_resources does the latter. (That's because
most of GDB's native targets can't touch memory of running processes.)
--
Pedro Alves
next prev parent reply other threads:[~2013-08-02 9:45 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 7:29 Muhammad Waqas
2013-07-29 9:21 ` Yao Qi
2013-07-29 11:42 ` Muhammad Waqas
2013-07-29 14:18 ` Yao Qi
2013-07-30 10:34 ` Muhammad Waqas
2013-07-31 2:41 ` Yao Qi
2013-08-01 10:51 ` Pedro Alves
2013-08-01 10:59 ` Yao Qi
2013-08-01 11:27 ` Pedro Alves
2013-08-01 12:10 ` Yao Qi
2013-08-01 11:57 ` Pedro Alves
2013-08-01 12:44 ` Muhammad Waqas
2013-08-02 9:45 ` Pedro Alves [this message]
2013-08-05 12:01 ` Muhammad Waqas
2013-08-05 13:57 ` Tom Tromey
2013-08-06 6:12 ` Muhammad Waqas
2013-08-22 9:42 ` Muhammad Waqas
2013-08-22 17:14 ` Pedro Alves
2013-08-23 5:31 ` Muhammad Waqas
2013-08-27 11:31 ` Muhammad Waqas
2013-08-27 19:02 ` Pedro Alves
2013-08-27 19:06 ` Pedro Alves
2013-08-28 12:26 ` Muhammad Waqas
2013-08-28 12:26 ` Muhammad Waqas
2013-08-30 16:28 ` Pedro Alves
2013-09-02 4:06 ` Muhammad Waqas
2013-09-02 8:39 ` Pedro Alves
2013-09-02 9:46 ` Muhammad Waqas
2013-09-02 10:24 ` Pedro Alves
2013-09-02 10:32 ` Muhammad Waqas
2013-09-02 10:48 ` Pedro Alves
2013-09-02 16:46 ` Pedro Alves
2013-09-02 16:52 ` [PATCH] PR gdb/11568 - delete thread-specific breakpoints on " Pedro Alves
2013-09-09 16:07 ` Tom Tromey
2013-09-17 19:36 ` Pedro Alves
2013-09-19 14:48 ` [COMMIT PATCH] Fix regressions caused by thread-specific breakpoint deletion. (was: Re: [PATCH] PR gdb/11568 - delete thread-specific breakpoints on thread exit) Pedro Alves
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=51FB7F9E.30701@redhat.com \
--to=palves@redhat.com \
--cc=ali_anwar@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mwaqas@codesourcery.com \
--cc=tromey@redhat.com \
--cc=yao@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