+2021-05-10 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.guile/scm-frame-args.exp: Add with_test_prefix to resolve
+ duplicate test names.
+ * gdb.guile/scm-parameter.exp: Provide test names to avoid
+ duplicate names based on the command being run.
+ * gdb.guile/scm-symbol.exp: Extend test name to make it unique.
+ * gdb.guile/scm-type.exp (restart_gdb): Don't print PASS line when
+ loading a support module.
+ (test_equality): Update test name to match the actual test, making
+ the name unique in the process.
+ * gdb.guile/scm-value.exp (test_value_in_inferior): Add test names
+ to resolve duplicate tests.
+ (test_inferior_function_call): Likewise.
+ (test_subscript_regression): Likewise.
+
2021-05-10 Andrew Burgess <andrew.burgess@embecosm.com>
* lib/guile.exp (gdb_scm_load_file): Use empty test name to
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
# Test all combinations with raw off.
-
gdb_test_no_output "set print raw-frame-arguments off"
-
-gdb_test_no_output "set print frame-arguments none"
-gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
- "frame pretty,none"
-
-#gdb_test_no_output "set guile print-stack full"
-
-gdb_test_no_output "set print frame-arguments scalars"
-gdb_test "frame" ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \
- "frame pretty,scalars"
-
-gdb_test_no_output "set print frame-arguments all"
-gdb_test "frame" \
- ".*foo \\(x=42, ss=super struct = {a = m=<1>, b = m=<2>}\\).*" \
- "frame pretty,all"
+with_test_prefix "raw-frame-arguments=off" {
+ gdb_test_no_output "set print frame-arguments none"
+ gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
+ "frame pretty,none"
+
+ gdb_test_no_output "set print frame-arguments scalars"
+ gdb_test "frame" ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \
+ "frame pretty,scalars"
+
+ gdb_test_no_output "set print frame-arguments all"
+ gdb_test "frame" \
+ ".*foo \\(x=42, ss=super struct = {a = m=<1>, b = m=<2>}\\).*" \
+ "frame pretty,all"
+}
# Test all combinations with raw on.
-
gdb_test_no_output "set print raw-frame-arguments on"
-
-gdb_test_no_output "set print frame-arguments none"
-gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
- "frame raw,none"
-
-gdb_test_no_output "set print frame-arguments scalars"
-gdb_test "frame" ".*foo \\(x=42, ss=\[.\]{3}\\).*" \
- "frame raw,scalars"
-
-gdb_test_no_output "set print frame-arguments all"
-gdb_test "frame" \
- ".*foo \\(x=42, ss={a = {m = 1}, b = {m = 2}}\\).*" \
- "frame raw,all"
+with_test_prefix "raw-frame-arguments=on" {
+ gdb_test_no_output "set print frame-arguments none"
+ gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
+ "frame raw,none"
+
+ gdb_test_no_output "set print frame-arguments scalars"
+ gdb_test "frame" ".*foo \\(x=42, ss=\[.\]{3}\\).*" \
+ "frame raw,scalars"
+
+ gdb_test_no_output "set print frame-arguments all"
+ gdb_test "frame" \
+ ".*foo \\(x=42, ss={a = {m = 1}, b = {m = 2}}\\).*" \
+ "frame raw,all"
+}
"end"
with_test_prefix "test-restricted-param" {
- gdb_test "show test-restricted-param" "The value of the restricted parameter is 2."
+ gdb_test "show test-restricted-param" "The value of the restricted parameter is 2." \
+ "test-restricted-param is initially 2"
gdb_test_no_output "set test-restricted-param 10"
- gdb_test "show test-restricted-param" "The value of the restricted parameter is 10."
+ gdb_test "show test-restricted-param" "The value of the restricted parameter is 10." \
+ "test-restricted-param is now 10"
gdb_test "set test-restricted-param 42" "Error: Range of parameter is 0-10."
- gdb_test "show test-restricted-param" "The value of the restricted parameter is 2."
+ gdb_test "show test-restricted-param" "The value of the restricted parameter is 2." \
+ "test-restricted-param is back to 2 again"
}
# Test registering a parameter that already exists.
}
gdb_breakpoint [gdb_get_line_number "Break at end."]
-gdb_continue_to_breakpoint "Break at end."
+gdb_continue_to_breakpoint "Break at end again"
gdb_scm_test_silent_cmd "guile (define a (car (lookup-symbol \"a\")))" \
"get variable a for unload"
gdb_test "guile (print (symbol-valid? a))" \
return 0
}
gdb_scm_test_silent_cmd "guile (use-modules (gdb iterator))" \
- "load iterator module"
+ "load iterator module" 0
return 1
}
gdb_test "guile (print (eq? (value-type st) (value-type ar)))" \
"= #f" "test type eq? on not-equal types"
gdb_test "guile (print (equal? (value-type st) (value-type st)))" \
- "= #t" "test type eq? on equal types"
+ "= #t" "test type equal? on equal types"
gdb_test "guile (print (equal? (value-type st) (value-type ar)))" \
- "= #f" "test type eq? on not-equal types"
+ "= #f" "test type equal? on not-equal types"
if {$lang == "c++"} {
gdb_scm_test_silent_cmd "guile (define c (parse-and-eval \"c\"))" \
gdb_test "gu (print (value-lazy? inval))" \
"#t"
gdb_test "gu (define inval2 (value-add inval 1))" \
- "ERROR: Cannot access memory at address 0x0.*" $test
+ "ERROR: Cannot access memory at address 0x0.*" \
+ "$test, using value in value-add"
gdb_test "gu (value-fetch-lazy! inval))" \
- "ERROR: Cannot access memory at address 0x0.*" $test
+ "ERROR: Cannot access memory at address 0x0.*" \
+ "$test, using value in value-fetch-lazy!"
}
gdb_test_no_output "gu (define argc-lazy (parse-and-eval \"argc\"))"
gdb_test_no_output "gu (define argc-notlazy (parse-and-eval \"argc\"))"
gdb_test_no_output "gu (value-fetch-lazy! argc-notlazy)"
- gdb_test "gu (print (value-lazy? argc-lazy))" "= #t"
+ gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" \
+ "argc-lazy is initially lazy"
gdb_test "gu (print (value-lazy? argc-notlazy))" "= #f"
gdb_test "print argc" "= 1" "sanity check argc"
- gdb_test "gu (print (value-lazy? argc-lazy))" "= #t"
+ gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" \
+ "argc-lazy is still lazy after argc is printed"
gdb_test_no_output "set argc=2"
gdb_test "gu (print argc-notlazy)" "= 1"
gdb_test "gu (print argc-lazy)" "= 2"
- gdb_test "gu (print (value-lazy? argc-lazy))" "= #f"
+ gdb_test "gu (print (value-lazy? argc-lazy))" "= #f" \
+ "argc-lazy is no longer lazy"
# Test string fetches, both partial and whole.
gdb_test "print st" "\"divide et impera\""
"= void"
# Correct inferior call with arguments.
- gdb_test "p/x fp2" "= $hex.*"
+ gdb_test "p/x fp2" "= $hex.*" \
+ "place fp2 into value history, the first time"
gdb_scm_test_silent_cmd "gu (define fp2 (history-ref 0))" \
"get fp2 value from history"
gdb_scm_test_silent_cmd "gu (set! fp2 (value-dereference fp2))" \
"ERROR: .*: Wrong type argument in position 1 \\(expecting function \\(value of TYPE_CODE_FUNC\\)\\): .*"
# Incorrect number of arguments.
- gdb_test "p/x fp2" "= $hex.*"
+ gdb_test "p/x fp2" "= $hex.*" \
+ "place fp2 into value history, the second time"
gdb_scm_test_silent_cmd "gu (define fp3 (history-ref 0))" \
"get fp3 value from history"
gdb_scm_test_silent_cmd "gu (set! fp3 (value-dereference fp3))" \
}
gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"]
- gdb_continue_to_breakpoint "break to inspect struct and union"
+ gdb_continue_to_breakpoint "break to inspect struct and union in $lang"
gdb_scm_test_silent_cmd "gu (define intv (make-value 1))" \
"Create int value for subscript test"