# The test uses the "maintenance test-options" subcommands to exercise
# TAB-completion and option processing.
#
-# It also tests option integration in various commands, including
-# "print" and "compile print".
+# It also tests option integration in various commands, including:
+#
+# - print
+# - compile print
+# - backtrace
load_lib completion-support.exp
"Left operand of assignment is not an lvalue\\."
}
+# Basic option-machinery + "backtrace" command integration tests.
+proc_with_prefix test-backtrace {} {
+ clean_restart
+
+ test_gdb_complete_unique "backtrace" "backtrace"
+ test_gdb_complete_none "backtrace "
+
+ gdb_test "backtrace -" "Ambiguous option at: -"
+ gdb_test "backtrace --" "No stack\\."
+ gdb_test "backtrace -- -" "No stack\\."
+
+ test_gdb_complete_multiple "backtrace " "-" "" {
+ "-entry-values"
+ "-frame-arguments"
+ "-full"
+ "-hide"
+ "-no-filters"
+ "-past-entry"
+ "-past-main"
+ "-raw-frame-arguments"
+ }
+
+ global binfile
+ clean_restart $binfile
+
+ if ![runto_main] {
+ fail "cannot run to main"
+ return
+ }
+
+ # COUNT in "backtrace COUNT" is parsed as an expression. Check
+ # that we complete expressions.
+
+ test_gdb_complete_unique \
+ "backtrace xxx" \
+ "backtrace xxx1"
+
+ test_gdb_complete_unique \
+ "backtrace -xxx" \
+ "backtrace -xxx1"
+
+ test_gdb_complete_unique \
+ "backtrace 1 + xxx" \
+ "backtrace 1 + xxx1"
+
+ test_gdb_complete_unique \
+ "backtrace (1 + xxx" \
+ "backtrace (1 + xxx1"
+}
+
# Miscellaneous tests.
proc_with_prefix test-misc {variant} {
global all_options
if ![skip_compile_feature_tests] {
test-print "compile "
}
+
+# Basic "backtrace" integration tests.
+test-backtrace