[RFA] Sort overload menu (decode_line_2)
Keith Seitz
keiths@redhat.com
Wed Feb 29 01:41:00 GMT 2012
On 02/28/2012 02:38 PM, Joel Brobecker wrote:
> That's not the only ordering issue you might get, and I confirm
> they can be a real pain! I've had to write some pretty scary regexps
> to be able to match orders that flip-flop depending of debugger
> version, linker mood and phase of the moon. I wish your patch took
> care of that too (not an official request, just commenting on your
> patch).
I was tempted to write a more generic "info break" handler, but that
would only delay my linespec rewrite more, so I'm putting it off for now.
> It would have been cool if you had kept the little cleanups as
> a separate patch ("git add -p" is your friend).
I've attached the patch split in two: one containing simply the cleanup
and the other with the "guts" of the change. I apologize for being a
little too lazy.
> Just a question, wondering if that matters at all. Do we have a
> convention for indentation in TCL/expect files? I am sort of used
> to using 4 spaces, although I couldn't really care less.
As much as I try, I keep forgetting to check this. My editor is set to
the standard that I use in insight, which is a mix of four- and
two-space indents. I've updated the patches accordingly (they might
still contain tabs).
>> + # Probe for the actual type.
>> + send_gdb "print&foo::overload1arg($types($type))\n"
>> + gdb_expect {
>
> Can we use test_gdb_multiple, here?
Doh! Yes, I can. I've updated that, too.
> Personally, I think we would have less damage if we just poisoned
> send_gdb, accepting to give up some testcases that we wouldn't be
> able to write differently, over trying to make sure we only use them
> when necessary.
I hear that. If I had a dime for every time I forgot the newline at the
end of send_gdb, I'd have at least a quarter or two... :-)
Thank you for taking a look.
Keith
For the cleanup:
testsuite/ChangeLog
2012-02-28 Keith Seitz <keiths@redhat.com>
* gdb.cp/method2.exp: Use prepare_for_testing and cleanup
some Tcl syntax.
* gdb.cp/ovldbreak.exp: Likewise.
For the menu-sorting patch:
ChangeLog
2012-02-28 Keith Seitz <keiths@redhat.com>
* linespec.c (decode_line_2): Sort the list of methods
alphabetically before presenting the user with a selection
menu.
testsuite/ChangeLog
2012-02-28 Keith Seitz <keiths@redhat.com>
* gdb.cp/method2.exp: Output of overload menu is now
alphabetized. Update tests for "break A::method".
* gdb.cp/ovldbreak.exp: Use gdb_get_line_number instead
of hard-coding them.
Overload menu is alphabetized: rewrite to accommodate.
Unset variables LINE and TYPES which are used in other tests.
Compute the output of "info break".
Update the breakpoint table after all breakpoints are deleted.
(continue_to_bp_overloaded): Rename ACTUALS to ARGUMENT and
compute ACTUALS and the method body based on parameters.
Update expected output accordingly.
* gdb.cp/ovldbreak.cc (foo::overload1arg): Reformat and add
unique comments to allow the use of gdb_get_line_number.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ovldbreak-method2-cleanup.patch
Type: text/x-patch
Size: 2057 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120229/aaf36ee1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sort-overload-menu.patch
Type: text/x-patch
Size: 20042 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120229/aaf36ee1/attachment-0001.bin>
More information about the Gdb-patches
mailing list