print_disassembly (gdbarch, name, low, high, block, flags);
}
+/* Command completion for the disassemble command. */
+
+static void
+disassemble_command_completer (struct cmd_list_element *ignore,
+ completion_tracker &tracker,
+ const char *text, const char * /* word */)
+{
+ if (skip_over_slash_fmt (tracker, &text))
+ return;
+
+ const char *word = advance_to_expression_complete_word_point (tracker, text);
+ expression_completer (ignore, tracker, text, word);
+}
+
static void
make_command (const char *arg, int from_tty)
{
like in the \"break\" command.\n\
So, for example, if you want to disassemble function bar in file foo.c\n\
you must type \"disassemble 'foo.c'::bar\" and not \"disassemble foo.c:bar\"."));
- set_cmd_completer (c, location_completer);
+ set_cmd_completer_handle_brkchars (c, disassemble_command_completer);
c = add_com ("make", class_support, make_command, _("\
Run the ``make'' program using the rest of the line as arguments."));
gdb_test_no_output "alias set aaa_bbb_ccc=set debug"
gdb_test_no_output "maint deprecate set aaa_bbb_ccc"
test_gdb_complete_unique "set aaa_bbb_" "set aaa_bbb_ccc"
+
+# Test command completion for the disassemble command.
+test_gdb_complete_unique \
+ "disassemble multi_line_if" \
+ "disassemble multi_line_if_conditional"
+
+test_gdb_complete_multiple "disassemble " \
+ "multi_li" "ne_" {
+ "multi_line_if_conditional"
+ "multi_line_while_conditional"
+ }
+
+foreach_with_prefix spc { " " "" } {
+ test_gdb_complete_none "disassemble${spc}/"
+
+ foreach_with_prefix flg { "r" "b" "rb" "s" "m" "ms" } {
+ test_gdb_complete_unique "disassemble${spc}/${flg}" \
+ "disassemble${spc}/${flg}"
+
+ test_gdb_complete_unique \
+ "disassemble${spc}/${flg} multi_line_if" \
+ "disassemble${spc}/${flg} multi_line_if_conditional"
+
+ test_gdb_complete_multiple "disassemble${spc}/${flg} " \
+ "multi_li" "ne_" {
+ "multi_line_if_conditional"
+ "multi_line_while_conditional"
+ }
+ }
+}
"Cannot specify both /r and /b\\."
gdb_test "disassemble /br main" \
"Cannot specify both /r and /b\\."
+
+# Check disassembly using 'FILE'::FUNC syntax.
+gdb_test "disassemble '$srcfile'::main" \
+ "Dump of assembler code for function main:.*End of assembler dump\\."