aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-03-01 20:33:09 +0000
committerKeith Seitz <keiths@redhat.com>2012-03-01 20:33:09 +0000
commite0a4d1083e0845e8e402b75b32b0e81b1a3f4e10 (patch)
treed1da72a12d8415cbdae2af270b92929e6e575cba /gdb/linespec.c
parent7949c2a0b45bc5a0cb2c6a577535c3344c8d3c5a (diff)
downloadfsf-binutils-gdb-e0a4d1083e0845e8e402b75b32b0e81b1a3f4e10.zip
fsf-binutils-gdb-e0a4d1083e0845e8e402b75b32b0e81b1a3f4e10.tar.gz
fsf-binutils-gdb-e0a4d1083e0845e8e402b75b32b0e81b1a3f4e10.tar.bz2
* linespec.c (decode_line_2): Sort the list of methods
alphabetically before presenting the user with a selection menu.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c5
1 files changed, 5 insertions, 0 deletions
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);