Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>,
	Tom Tromey <tromey@redhat.com>,
	pfee@talk21.com
Subject: Re: Enhancement - show old and new thread info when switching during debugging
Date: Sat, 30 Jul 2011 11:44:00 -0000	[thread overview]
Message-ID: <201107301231.58274.pedro@codesourcery.com> (raw)
In-Reply-To: <20110730024405.GJ5177@adacore.com>

On Saturday 30 July 2011 03:44:05, Joel Brobecker wrote:
> So, I would think that adding something similar in
> thread.c:switch_to_thread would do the job.

It wouldn't.  What he wants is the last user selected thread,
not the thread that happens to be current when switch_to_thread
is called.

- user resumes with thread 1 selected
- thread 2 hits breakpoint, gdb switches to thread 2
  - breakpoint doesn't cause stop, target is re-resumed
- thread 3 hits breakpoint, gdb switches to thread 3
  - breakpoint causes stop, previous_inferior_ptid is
    thread 1, but the last switch_to_thread would have
    recorded $previous_thread as thread 2

If you want a convenience variable, please model it on
$_thread --- see end of thread.c:_initialize_thread.

Note that the previously selected thread may not exist anymore,
it may have exited meanwhile, for example, or the inferior
exec'ed.

-- 
Pedro Alves


  reply	other threads:[~2011-07-30 11:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 15:29 pfee
2011-07-29 16:01 ` Joel Brobecker
2011-07-29 16:33   ` pfee
2011-07-29 17:38     ` Joel Brobecker
2011-07-29 17:47       ` pfee
2011-07-29 20:40         ` Philippe Waroquiers
2011-07-30  2:44   ` Tom Tromey
2011-07-30 11:39     ` Joel Brobecker
2011-07-30 11:44       ` Pedro Alves [this message]
2011-07-30 14:12         ` pfee
2011-08-08 11:35           ` pfee
2011-08-08 15:07             ` Pedro Alves
2011-08-08 15:20               ` pfee
2011-08-09 15:25                 ` pfee
2011-08-10 15:10                   ` Pedro Alves
2011-08-16 16:01                     ` pfee
2011-07-30 12:40       ` pfee
2011-07-30 11:32 ` Tom Tromey
2011-07-30 22:07 ` Jan Kratochvil

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=201107301231.58274.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pfee@talk21.com \
    --cc=tromey@redhat.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