[binutils-gdb] [gdb/testsuite, Tcl 9.0] Fix uninitialized string in gdb.fortran/function-calls.f90

Tom de Vries via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b78ee1c9b01aed7c2cdfd3a7b1a62f011218a42d

commit b78ee1c9b01aed7c2cdfd3a7b1a62f011218a42d
Author: Tom de Vries <[email protected]>
Date:   Fri Mar 20 10:13:27 2026 +0100

    [gdb/testsuite, Tcl 9.0] Fix uninitialized string in gdb.fortran/function-calls.f90
    
    With Tcl 9.0 and test-case gdb.fortran/function-calls.f90 I run into:
    ...
    (gdb) run ^M
    Starting program: function-calls ^M
    [Thread debugging using libthread_db enabled]^M
    Using host libthread_db library "/lib64/libthread_db.so.1".^M
                 (2.09999990,3.29999995)^M
               4           5^M
              23^M
                 (2.09999990,3.29999995)^M
       3.40000010    ^M
               6^M
     ^K^@^@^@^@^@^@^@ERROR: i_read(spawn_id fd=9): invalid or incomplete multibyte or wide character
    ...
    
    The problem seems to be the printing of an uninitialized string.
    
    Fix this by initializing the string.
    
    Approved-By: Tom Tromey <[email protected]>
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33948

Diff:
---
 gdb/testsuite/gdb.fortran/function-calls.f90 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/testsuite/gdb.fortran/function-calls.f90 b/gdb/testsuite/gdb.fortran/function-calls.f90
index ecb8a4ef29d..5e015836152 100644
--- a/gdb/testsuite/gdb.fortran/function-calls.f90
+++ b/gdb/testsuite/gdb.fortran/function-calls.f90
@@ -231,6 +231,7 @@ program function_calls
     integer_return = one_arg_value(10)
     integer_return = sum_some(1,2,3)
     returned_string = return_string()
+    returned_string_debugger = ''
     cout = build_cart(4,5)
     fft_result = complex_argument(fft)
     print *, cout
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.