This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review] gdb: Dynamic string length support
Simon Marchi has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/737
......................................................................
Patch Set 1: Code-Review+2
(2 comments)
| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +13,19 @@ Currently gFortran generates DWARF for some strings that make use of
| +DW_AT_string_length like this:
| +
| + <1><2cc>: Abbrev Number: 20 (DW_TAG_string_type)
| + <2cd> DW_AT_string_length: 5 byte block: 99 bd 1 0 0 (DW_OP_call4: <0x1bd>)
| + <2d3> DW_AT_byte_size : 4
| + <2d4> DW_AT_sibling : <0x2e2>
| +
| +In this type entry the DW_AT_string_length attribute references a
| +second DW_TAG_formal_parameter that contains the string length. The
| +DW_AT_bye_size indicates that the length is a 4-byte value.
PS1, Line 22:
byte
| +
| +This commit extends GDB's DWARF parsing for strings so that we can
| +create dynamic types as well as static types, based on the attribute
| +the DWARF contains.
| +
| +I then extend the dynamic type resolution code in gdbtypes.c to add
| +support for resolving dynamic strings.
| +
| +gdb/ChangeLog:
| --- gdb/gdbtypes.c
| +++ gdb/gdbtypes.c
| @@ -982,18 +982,19 @@ /* Create a range type using either a blank type supplied in
| INDEX_TYPE.
|
| Indices will be of type INDEX_TYPE, and will range from LOW_BOUND
| to HIGH_BOUND, inclusive.
|
| FIXME: Maybe we should check the TYPE_CODE of RESULT_TYPE to make
| sure it is TYPE_CODE_UNDEF before we bash it into a range type? */
|
| struct type *
| +
PS1, Line 991:
Unintended change?
| create_static_range_type (struct type *result_type, struct type *index_type,
| LONGEST low_bound, LONGEST high_bound)
| {
| struct dynamic_prop low, high;
|
| low.kind = PROP_CONST;
| low.data.const_val = low_bound;
|
| high.kind = PROP_CONST;
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I03f2d181b26156f48f27a03c8a59f9bd4d71ac17
Gerrit-Change-Number: 737
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Sat, 30 Nov 2019 03:54:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment