From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Doug Evans <dje@google.com>
Subject: Re: [RFA] improved thread id reporting
Date: Tue, 19 May 2009 03:39:00 -0000 [thread overview]
Message-ID: <200905190439.50707.pedro@codesourcery.com> (raw)
In-Reply-To: <200905190429.38917.pedro@codesourcery.com>
On Tuesday 19 May 2009 04:29:38, Pedro Alves wrote:
> On Tuesday 19 May 2009 00:23:15, Doug Evans wrote:
> > Ping.
> >
> > Ok to check in?
>
> I haven't convinced myself yet that your normal_stop change always
> does what you want. Won't it print:
>
> [Switching from thread #0 to thread #3, 0x41001960 (LWP 14407)]
> ^
>
> if the previosly selected thread happens to exit in a series
> of misfortunate events? Say,
Following a fork is also a case where the previously thread
may be long gone from the thread list when you get here. Note that
I contructed the contrived case below, because delete_thread
refuses to delete inferior_ptid from the thread list. There are
several options here: make a better effort at storing the previous
thread id; printing something about previous thread having exited;
or (ugly?) documenting this #0 thing. I do have my reservations
about being always possible to print a sensible previous thread id.
>
> thread 1
> break foo thread 2
> continue
> <thread 3 hits breakpoint at foo, gdb thread hops, having switched inferior_ptid to thread 3>
> <thread 1 exits, exit_lwp calls delete_thread>
> <thread 2 hits breakpoint at foo, call normal_stop, but previous_inferior_ptid is not in the thread list anymore>
>
> >
> >
> > On Thu, May 7, 2009 at 10:46 PM, Doug Evans <dje@google.com> wrote:
> > > Blech. Right list this time.
> > >
> > >
> > > On Sun, Apr 5, 2009 at 8:33 PM, Daniel Jacobowitz <drow@false.org> wrote:
> > >> On Sun, Apr 05, 2009 at 01:36:06PM -0700, Doug Evans wrote:
> > >>> Attached is a simplistic patch to help illustrate the challenge.
> > >>>
> > >>> Here is an example session that prints from/to and the thread number
> > >>> in "[New ...", "[Switching ...", etc. messages.
> > >>> I can think of two issues with the patch:
> > >>> 1) Printing "[tT]hread" twice in one line is a bit annoying.
> > >>> 2) Spreading from/to over two lines is a bit annoying.
> > >>
> > >> What do you think of this? On the theory that you can go look up
> > >> thread #2, either in 'info threads' or in a previous notification:
> > >>
> > >> [Switching from thread #2 to thread #3, Thread 0x41001960 (LWP 14407)]
> > >
> > > "works for me"
> > >
> > >> Or, migrating the "Thread" out:
> > >>
> > >> [Switching from thread #2 to thread #3, 0x41001960 (LWP 14407)]
> > >>
> > >> But that might be tricky with multi-process, some ptid_t's are not
> > >> threads.
> > >
> > > It's not clear how multi-process is going to work yet (or more likely
> > > I've forgotten). I played with attaching and running several
> > > processes via gdbserver and all processes appear in "info threads".
> > > [sidebar: I wouldn't mind "info threads" just showing the threads of
> > > the current process, otherwise it might get confusing. And given that
> > > "info inferiors" is used to show all the processes IWBN if "inferior
> > > N" switched to the specified process; a straightforward and intuitive
> > > mapping from "info threads" + "thread N".]
> > >
> > > How about this?
> > >
> >
>
>
>
--
Pedro Alves
prev parent reply other threads:[~2009-05-19 3:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090404184604.8524C1C759C@localhost>
[not found] ` <200904041904.n34J4UXV013513@brahms.sibelius.xs4all.nl>
[not found] ` <20090404192132.GA28232@caradoc.them.org>
[not found] ` <e394668d0904051336p56704603of8c9c31742dc04e6@mail.gmail.com>
[not found] ` <20090406033300.GA31715@caradoc.them.org>
[not found] ` <e394668d0905072243y22eee593u94d753edf0f807f0@mail.gmail.com>
2009-05-08 5:46 ` Doug Evans
2009-05-18 23:23 ` Doug Evans
2009-05-19 3:29 ` Pedro Alves
2009-05-19 3:39 ` Pedro Alves [this message]
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=200905190439.50707.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@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