Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?

Jim Blandy
2008-01-15T17:13:57Z

Michael Snyder <msnyder at specifix.com> writes:
> On Sun, 2008-01-13 at 10:21 +0100, Mark Kettenis wrote:
>> > Date: Sun, 13 Jan 2008 06:21:36 +0200
>> > From: Eli Zaretskii <eliz@gnu.org>
>> >
>> > > In Ada, as Joel said, this is not true. *FUNCTION won't work
>> >
>> > That's too bad: this is an important feature, so if we cannot make it
>> > work in all languages, we should at least document that.
>>
>> This is exactly the reason why documenting *FUNCTION on its own is the
>> wrong thing to do. What we implement in GDB is *EXPRESSION, where
>> EXPRESSION is an expression in the current language yielding an
>> address.
>
> Mark, I don't think that is true -- at least it used to be not
> (damn English language...)
>
> When you say "break *<something>", the asterisk is NOT
> interpreted by the expression parser -- it is interpreted
> by the break command, or more precisely, by the LINESPEC
> parser.

Mark is agreeing with you. He said the syntax is:

break *EXPRESSION

Since the * is written out explicitly, it is not part of EXPRESSION.
If Mark had wanted to indicate that the expression parser was handling
that *, he would have written

break EXPRESSION

We're all in violent agreement that this isn't what GDB does at
present. :) From decode_line_1:

/* See if arg is *PC. */

if (**argptr == '*')
return decode_indirect (argptr);

where:

/* Decode arg of the form *PC. */

static struct symtabs_and_lines
decode_indirect (char **argptr)
{
struct symtabs_and_lines values;
CORE_ADDR pc;

(*argptr)++;
pc = parse_and_eval_address_1 (argptr);

...
}