Wrong dwarf-3 info for unicodestring
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
Typeinfo (dwarf 3) for unicodestring will be (64 bit / not tested if present on 32 bit):
<1><1b0>: Abbrev Number: 11 (DW_TAG_array_type)
<1b1> DW_AT_name : UnicodeString
<1bf> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref)
<1c2> DW_AT_type : <0x200>
<2><1c6>: Abbrev Number: 12 (DW_TAG_subrange_type)
<1c7> DW_AT_lower_bound : 1
<1c8> DW_AT_upper_bound : 15 byte block: 97 6 12 28 4 0 30 2f 3 0 38 1c 6 31 25 (DW_OP_push_object_address; DW_OP_deref; DW_OP_dup; DW_OP_bra: 4; DW_OP_lit0; DW_OP_skip: 3; DW_OP_lit8; DW_OP_minus; DW_OP_deref; DW_OP_lit1; DW_OP_shr)
The unicode string stores the number of widechar in front of the string (for the string in the example that is: 4 / and I checked, that is what is in memory)
But DW_AT_upper_bound retrieves that number, and then does a DW_OP_shr => that means the debugger gets to believe there are only 2 elements.
As far as I can see the DW_OP_shr is incorrect?
Steps to reproduce:
program Project1;
procedure test;
var
x : unicodestring;
begin
x:=copy('abc',1,2)+'12';
end;
begin
test;
end.
Mantis conversion info:
- Mantis ID: 35359
- OS: win 10
- OS Build: 10
- Platform: 64bit Intel
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 42037 (#1349f1db)
- Monitored by: » @martin_frb (Martin Friebe)