[PATCH][gdb/symtab] Handle DW_AT_string_length with location list

Tom de Vries tdevries@suse.de
Thu Oct 28 08:44:24 GMT 2021


On 10/15/21 5:22 PM, Simon Marchi wrote:
> On 2021-10-14 3:58 p.m., Tom de Vries via Gdb-patches wrote:
>> Hi,
>>
>> Consider a fortran routine where a string variable s is modified:
>> ...
>> subroutine f(s)
>>   character*(*) s
>>   print *, s
>>   s(1:3) = 'oof'
>>   print *, s
>> end subroutine f
>> ...
>>
>> When compiling with optimization level -O1 and printing the type of
>> variable s we get:
>> ...
>> $ gdb -q -batch outputs/gdb.opt/fortran-string/fortran-string \
>>   -ex "b f" \
>>   -ex run \
>>   -ex "ptype s"
>> Breakpoint 1 at 0x4006f7: file fortran-string.f90, line 21.
>>
>> Breakpoint 1, f (s=..., _s=_s@entry=3) at fortran-string.f90:21
>> 21      subroutine f(s)
>> type = character*1
> 
> I'm not familiar with fortran, does this notation ("character*1") have a
> meaning in fortran?
> 
> Again, I don't know anything about fortran, but the change in dwarf2/read.c
> looks good to me.

I've reviewed the test-case once more, and did the following updates:
- removed the "contributed by" lines in the test-case, since we no
  longer do that.
  ( https://sourceware.org/gdb/wiki/ContributionChecklist#Attribution )
- updated the copyright license version to gplv3, and replaced the
  snailmail pointer to copy of license with the url.

Committed with those changes (too trivial to repost).

Thanks,
- Tom


More information about the Gdb-patches mailing list