This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Can decode_line_1() return sals.nelts > 1?


Andrew Cagney wrote:
> 
> Hello,
> 
> Grubbing through break_command_1() and noticed:
> 
>   if (sals.nelts > 1)
>     {
>       warning ("Multiple breakpoints were set.");
>       warning ("Use the \"delete\" command to delete unwanted
> breakpoints.");
>     }
> 
> I'm left wondering _how_ break_command_1() can end up with sals.nelts
> with a value of anything other than one.  Looking through
> decode_line_1() which is used to decode the breakpoint expression I
> can't find anything other than sals.nelts being set to zero or one.
> 
> Anyone know?

Without looking at the code, my first guess would be overloaded
functions.  Oh, OK, I'll look at the code.  Yep, look for a call
to "build_canonical_line_spec".  This function disambiguates
function/method names by adding the filename.  It's used when
there are multiple functions/methods by the same name.  If you
get that chooser prompt (Which one do you mean?), one of your
choices is "all".  Ah, the guy who gives that overload-choice
prompt is "decode_line_2".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]