gdb: fix value.c build on 32-bits
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 27 Oct 2021 13:38:51 +0000 (09:38 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 27 Oct 2021 13:41:59 +0000 (09:41 -0400)
commit5612b5d21e41796c9d6fb024c4bbf70719153373
tree9ec3077a7aa777c37546cbc075a451e5536c01ab
parent437e2ff1ad8a1d5f20ebd27af2f04e1a1bcb48a7
gdb: fix value.c build on 32-bits

When building on ARM (32-bits), we errors like this:

    /home/smarchi/src/binutils-gdb/gdb/value.c: In function 'gdb::array_view<const unsigned char> value_contents_for_printing(value*)':
    /home/smarchi/src/binutils-gdb/gdb/value.c:1252:35: error: narrowing conversion of 'length' from 'ULONGEST' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} [-Werror=narrowing]
     1252 |   return {value->contents.get (), length};
          |                                   ^~~~~~

Fix that by using gdb::make_array_view, which does the appropriate
conversion.

Change-Id: I7d6f2e75d7440d248b8fb18f8272ee92954b404d
gdb/value.c