Re: display character strings in fortran

Tobias Burnus
2009-06-10T11:56:45Z

kamaraju kusumanchi wrote:
> However, when debugged, the character strings are not displayed properly.
> [...]
> (gdb) p first_name
> $1 = (32 ' ', 107 'k', 97 'a', 109 'm', 97 'a', 114 'r', 97 'a', 106
> 'j', 117 'u', 32 ' ', 32 ' ', 32 ' ', 32 ' ', 32 ' ', 32 ' ', 32 ' ',
> 32 ' ', 32 ' ', 32 ' ', 32 ' ')
> [...]
> gcc version 4.3.2 (Debian 4.3.2-1.1)

> Is this a bug in gdb or gfortran? I appreciate if you could fix it.

The GCC bug was fixed about half a year ago. Please use GCC 4.4.0 (which
was released April 21, 2009) or later. Using GCC 4.4.x, one gets:

(gdb) p first_name
$1 = ' kamaraju', ' ' <repeats 11 times>

Tobias