]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, Tcl 9.0] Fix uninitialized string in gdb.fortran/function-calls.f90
authorTom de Vries <tdevries@suse.de>
Fri, 20 Mar 2026 09:13:27 +0000 (10:13 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 20 Mar 2026 09:13:27 +0000 (10:13 +0100)
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 <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33948

gdb/testsuite/gdb.fortran/function-calls.f90

index ecb8a4ef29d43c351492a4dda4383668514494a3..5e015836152d9b498fbe0e51ca17d0077aaafbd8 100644 (file)
@@ -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