From e0a4d1083e0845e8e402b75b32b0e81b1a3f4e10 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Thu, 1 Mar 2012 20:33:09 +0000 Subject: [PATCH] * linespec.c (decode_line_2): Sort the list of methods alphabetically before presenting the user with a selection menu. --- gdb/ChangeLog | 6 ++++++ gdb/linespec.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2b06661..1230229 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-03-01 Keith Seitz + + * linespec.c (decode_line_2): Sort the list of methods + alphabetically before presenting the user with a selection + menu. + 2012-03-01 Doug Evans * dwarf2read.c (dwarf2_cu): Remove unused members has_form_ref_addr, diff --git a/gdb/linespec.c b/gdb/linespec.c index 94e8ef6..c2057cf 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -650,6 +650,11 @@ decode_line_2 (struct linespec_state *self, return; } + /* Sort the list of method names alphabetically. */ + qsort (VEC_address (const_char_ptr, item_names), + VEC_length (const_char_ptr, item_names), + sizeof (const_char_ptr), compare_strings); + printf_unfiltered (_("[0] cancel\n[1] all\n")); for (i = 0; VEC_iterate (const_char_ptr, item_names, i, iter); ++i) printf_unfiltered ("[%d] %s\n", i + 2, iter); -- 2.7.4