aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.compile
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2019-06-13 00:06:53 +0100
committerPedro Alves <palves@redhat.com>2019-06-13 00:18:33 +0100
commite6ed716cd5514c08b9d7c469d185b1aa177dbc22 (patch)
tree525665341239f4e18870f5c6406deefb0a79944b /gdb/testsuite/gdb.compile
parent7d8062de98203eeec70d4439ab460b9ef50a2e0f (diff)
downloadfsf-binutils-gdb-e6ed716cd5514c08b9d7c469d185b1aa177dbc22.zip
fsf-binutils-gdb-e6ed716cd5514c08b9d7c469d185b1aa177dbc22.tar.gz
fsf-binutils-gdb-e6ed716cd5514c08b9d7c469d185b1aa177dbc22.tar.bz2
Migrate rest of compile commands to new options framework
As I was in the neighbourhood, I converted the other "compile" subcommands to the new options framework too. Specifically, "compile code" and "compile file". The user-visible changes are: - All abbreviations of "-raw" are accepted now, instead of just -r. Obviously that means "-ra" is now accepted. - Option completion now works. - "compile file" did not have a completer yet, and now it knows to complete on filenames. - You couldn't use "compile file" with a file named "-something". You can now, with "compile file -- -something". gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * compile/compile.c (struct compile_options): New. (compile_flag_option_def, compile_command_option_defs) (make_compile_options_def_group): New. (compile_file_command): Handle options with gdb::option::process_options. (compile_file_command_completer): New function. (compile_code_command): Handle options with gdb::option::process_options. (compile_code_command_completer): New function. (_initialize_compiler): Install completers for "compile code" and "compile file". Mention available options in "compile code" and "compile code"'s help. * completer.c (advance_to_completion_word): New, factored out from ... (advance_to_expression_complete_word_point): ... this. (advance_to_filename_complete_word_point): New. * completer.h (advance_to_filename_complete_word_point): New declaration. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.compile/compile.exp: Adjust expected output to option processing changes.
Diffstat (limited to 'gdb/testsuite/gdb.compile')
-rw-r--r--gdb/testsuite/gdb.compile/compile.exp15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index b4e8847..20a6a72 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -325,7 +325,7 @@ gdb_test_no_output "set debug compile off"
gdb_test "show debug compile" "Compile debugging is .*"
gdb_test "show compile-args" \
"Compile command command-line arguments are .*"
-gdb_test "compile code -z" "Unknown argument.*"
+gdb_test "compile code -z" "Unrecognized option at: -z"
gdb_test "set lang rust" \
"Warning: the current language does not match this frame."
@@ -340,12 +340,17 @@ gdb_test "compile file" \
"You must provide a filename for this command.*" \
"Test compile file without a filename"
gdb_test "compile file -r" \
- "You must provide a filename with the raw option set.*" \
+ "You must provide a filename for this command.*" \
"Test compile file and raw option without a filename"
gdb_test "compile file -z" \
- "Unknown argument.*" \
- "test compile file with unknown argument"
-
+ "Unrecognized option at: -z" \
+ "test compile file with unknown option"
+gdb_test "compile file -z --" \
+ "Unrecognized option at: -z --" \
+ "test compile file with unknown option plus --"
+gdb_test "compile file -raw -- -raw" \
+ "/-raw: No such file or directory.*" \
+ "test compile file \"-raw\" file"
# LOC_CONST tests.