aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-07-17 20:24:41 +0100
committerPedro Alves <palves@redhat.com>2017-07-17 20:24:41 +0100
commita245927022bc4351fafd9e6275e217021ec93e08 (patch)
tree0446dc2f9ce7476bc3ef3d8649c419b86b20378e /gdb/completer.c
parentc6756f62e04846d68c24ee922ddb0377d4bd17f2 (diff)
downloadgdb-a245927022bc4351fafd9e6275e217021ec93e08.zip
gdb-a245927022bc4351fafd9e6275e217021ec93e08.tar.gz
gdb-a245927022bc4351fafd9e6275e217021ec93e08.tar.bz2
Explicit locations -label completer
We're missing a completer for (gdb) break -function func -label [TAB] This patch adds one. Tests will be added later in the series. gdb/ChangeLog: 2017-07-17 Pedro Alves <palves@redhat.com> * completer.c (collect_explicit_location_matches): Handle MATCH_LABEL. (convert_explicit_location_to_linespec): New, factored out from ... (convert_explicit_location_to_sals): ... this. (complete_label): New. (linespec_complete_label, find_label_symbols_in_block): New. (find_label_symbols): Add completion_mode parameter and adjust to call find_label_symbols_in_block. * linespec.h (linespec_complete_label): Declare.
Diffstat (limited to 'gdb/completer.c')
-rw-r--r--gdb/completer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/completer.c b/gdb/completer.c
index 1e4fe18..c2bb4ee 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -627,7 +627,13 @@ collect_explicit_location_matches (completion_tracker &tracker,
break;
case MATCH_LABEL:
- /* Not supported. */
+ {
+ const char *label = string_or_empty (explicit_loc->label_name);
+ linespec_complete_label (tracker, language,
+ explicit_loc->source_filename,
+ explicit_loc->function_name,
+ label);
+ }
break;
default: