+2015-09-01 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * ada-lang.c (ada_resolve_function): Do not ask the user what
+ match to use when in completion mode.
+
2015-08-31 Andrew Burgess <andrew.burgess@embecosm.com>
* tui/tui-data.c (tui_win_name): Make local variable const, remove
}
}
+ /* If we got multiple matches, ask the user which one to use. Don't do this
+ interactive thing during completion, though, as the purpose of the
+ completion is providing a list of all possible matches. Prompting the
+ user to filter it down would be completely unexpected in this case. */
if (m == 0)
return -1;
- else if (m > 1)
+ else if (m > 1 && !parse_completion)
{
printf_filtered (_("Multiple matches for %s\n"), name);
user_select_syms (syms, m, 1);
+2015-09-01 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * gdb.ada/complete.exp: Add "pck.ambiguous_func" to the relevant
+ expected outputs. Add two testcases for completing ambiguous
+ functions.
+ * gdb.ada/complete/aux_pck.adb: New file.
+ * gdb.ada/complete/aux_pck.ads: New file.
+ * gdb.ada/complete/foo.adb: Pull Aux_Pck and call the two
+ Ambiguous_Func functions.
+ * gdb.ada/complete/pck.ads: Add an Ambiguous_Func function.
+ * gdb.ada/complete/pck.adb: Likewise.
+
2015-08-27 Ulrich Weigand <uweigand@de.ibm.com>
* lib/cell.exp (skip_cell_tests): Report UNRESOLVED on unexpected
test_gdb_complete "pck" \
[multi_line "(p pck\\.ad\[sb\])?" \
"(p pck\\.ad\[sb\])?" \
+ "p pck.ambiguous_func" \
"p pck.external_identical_one" \
"p pck.inner.inside_variable" \
"p pck.local_identical_one" \
test_gdb_complete "pck." \
[multi_line "(p pck\\.ad\[sb\])?" \
"(p pck\\.ad\[sb\])?" \
+ "p pck.ambiguous_func" \
"p pck.external_identical_one" \
"p pck.inner.inside_variable" \
"p pck.local_identical_one" \
}
}
}
+
+# Usually, parsing a function name that is ambiguous yields a menu through
+# which users can select a specific function. This should not happen during
+# completion, though.
+test_gdb_complete "ambig" \
+ [multi_line "p ambiguous_func" \
+ "p ambiguous_proc" ]
+test_gdb_complete "ambiguous_f" \
+ "p ambiguous_func"
+test_gdb_complete "ambiguous_func" \
+ "p ambiguous_func"
--- /dev/null
+-- Copyright 2015 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Aux_Pck is
+
+ procedure Ambiguous_Func is
+ begin
+ null;
+ end Ambiguous_Func;
+
+ procedure Ambiguous_Proc is
+ begin
+ null;
+ end Ambiguous_Proc;
+
+end Aux_Pck;
--- /dev/null
+-- Copyright 2015 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package Aux_Pck is
+
+ procedure Ambiguous_Func;
+ procedure Ambiguous_Proc;
+
+end Aux_Pck;
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-with Pck; use Pck;
+with Aux_Pck; use Aux_Pck;
+with Pck; use Pck;
procedure Foo is
Some_Local_Variable : Integer := 1;
begin
My_Global_Variable := Some_Local_Variable + 1; -- START
Proc (External_Identical_Two);
+ Aux_Pck.Ambiguous_Func;
+ Aux_Pck.Ambiguous_Proc;
+ Pck.Ambiguous_Func;
end Foo;
Inner.Inside_Variable := Not_In_Scope + I;
end Proc;
+ procedure Ambiguous_Func is
+ begin
+ null;
+ end Ambiguous_Func;
+
end Pck;
procedure Proc (I : Integer);
+ procedure Ambiguous_Func;
+
end Pck;