--- testsuite/gdb.base/printcmds.exp | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/testsuite/gdb.base/printcmds.exp +++ b/testsuite/gdb.base/printcmds.exp @@ -775,6 +775,12 @@ proc test_printf_with_dfp {} { gdb_test "printf \"%DDf\\n\",1.2E6144dl" "1.200000000000000000000000000000000E\\+6144" } +#Test printing internal var values with printf +proc test_printf_with_internalvar {} { + gdb_test_no_output {set $a={'a','b'}} + gdb_test {printf "%s\n", $a} "ab" +} + # Escape a left curly brace to prevent it from being interpreted as # the beginning of a bound proc gdb_test_escape_braces { args } { @@ -816,6 +822,8 @@ if { [test_compiler_info "armcc-*"] } { } gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1" +test_printf_with_internalvar + gdb_load ${binfile} if ![runto_main] then { @@ -842,3 +850,4 @@ test_print_array_constants test_print_enums test_printf test_printf_with_dfp +test_printf_with_internalvar