Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Frédéric Riss" <frederic.riss@gmail.com>
Cc: Frederic RISS <frederic.riss@st.com>,
	Andreas Schwab <schwab@suse.de>,
		gdb-patches@sources.redhat.com
Subject: Re: [RFC] New threadnum command for breakpoints
Date: Tue, 08 Aug 2006 18:22:00 -0000	[thread overview]
Message-ID: <20060808182207.GE24779@nevyn.them.org> (raw)
In-Reply-To: <1154376407.5120.27.camel@funkylaptop>

On Mon, Jul 31, 2006 at 10:06:47PM +0200, Frédéric Riss wrote:
> Here's a code patch for discussion and a tentative doco patch. I've
> chosen to initialize the variable early in handle_inferior_event, so
> that it's set whatever happens. I thought that if we document it, it'd
> rather be always set and not only for breakpoint condition evaluation. 

Good choice.  My rule of thumb is that if I'd have to apologize for
something in the manual, then I implemented it wrong - this is a
perfect example of that :-)

> 1. Should it change on a user requested thread switch? That would be a
> simple patch to thread.c:switch_to_thread. But maybe documenting it as
> 'the id of the last stopped thread' wouldn't be a bad idea. I don't
> think GDB provides a way for the user to get this information (I mean
> once he has selected another thread). This way 'thread $_gdb_thread'
> would always bring you back to the stopped thread.

What worries me here is that it locks us into a one-thread-at-a-time
model.  One of the unpleasant realities of thread debugging is that
two threads can hit breakpoints simultaneously.  You can pretend to the
user that first one happened, then the other; or you can try to expose
both.  We haven't really thought about these issues.  But, hey, it's
probably going to be a major version bump if we ever do; so let's worry
about it later :-)

If you want it to be the last stopped thread, which seems reasonable,
is there a better name we could give it?  Or is $_gdb_thread
sufficiently clear?

> 2. Should we add support for read-only convenience variables? Writing in
> $_gdb_thread makes no sense... but it causes no harm either. We already
> have $bpnum in the same situation. I see some ways to support this:

I don't think we need to worry about this.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2006-08-08 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-28 13:44 Frederic RISS
2006-07-28 14:03 ` Andreas Schwab
2006-07-28 14:13   ` Daniel Jacobowitz
2006-07-28 14:20     ` Andreas Schwab
2006-07-28 14:59     ` Frederic RISS
2006-07-28 15:14       ` Daniel Jacobowitz
2006-07-31  8:32         ` Frederic RISS
2006-07-31 12:53           ` Daniel Jacobowitz
2006-07-31 14:00             ` Frederic RISS
2006-07-31 20:07               ` Frédéric Riss
2006-07-31 20:14                 ` Eli Zaretskii
2006-08-08 18:22                 ` Daniel Jacobowitz [this message]
2006-08-08 19:43                   ` Frédéric Riss
2006-08-16 14:15                     ` Frederic RISS
2006-08-31  7:23                       ` Frederic RISS
2006-07-28 14:28   ` Frederic RISS
2006-07-28 14:30     ` Frederic RISS

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=20060808182207.GE24779@nevyn.them.org \
    --to=drow@false.org \
    --cc=frederic.riss@gmail.com \
    --cc=frederic.riss@st.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=schwab@suse.de \
    /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