Support for "break *ADDRESS thread THREADNO"

Daniel Jacobowitz drow@false.org
Tue Apr 12 18:55:00 GMT 2005


On Tue, Apr 12, 2005 at 09:46:31PM +0300, Eli Zaretskii wrote:
> In addition to the above, I don't like the idea of supporting a
> general feature in language-specific files.  That seems wrong.
> 
> Why was it done like this? because "*ADDRESS" is interpreted as an
> expression in the current language, or is there some other reason?

I assume so.  It is parsed as an expression, not just an address; for
instance "break *thread" would actually work if thread is a pointer to
a function.

There's already common code for this, that's where most of the 'thread
THREADNO' support is.  I think it's in linespec.c somewhere, but it
might be in breakpoint.c.  It seems to need a little extra help from
the language... we need to know that a 'thread NUMBER' suffix is not
part of the expression.

TBH, the mechanism is fragile; I can't think of a more robust way but
there must be one.  Right now if and thread are handled similarly.  But
if separates two expressions, whereas thread can only be followed by a
thread number.  Perhaps that can be used to simplify.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gdb-patches mailing list