mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:26:02 +02:00
# revisions: 42037,42038,42039,42087
git-svn-id: branches/fixes_3_2@42098 -
This commit is contained in:
parent
0668d7385b
commit
d093d252d5
@ -4259,17 +4259,17 @@ implementation
|
|||||||
{ now the information about the length of the string }
|
{ now the information about the length of the string }
|
||||||
if deref then
|
if deref then
|
||||||
begin
|
begin
|
||||||
if (chardef.size=1) then
|
if not (is_widestring(def) and (tf_winlikewidestring in target_info.flags)) then
|
||||||
upperopcodes:=13
|
upperopcodes:=13
|
||||||
else
|
else
|
||||||
upperopcodes:=15;
|
upperopcodes:=16;
|
||||||
{ lower bound is always 1, upper bound (length) needs to be calculated }
|
{ lower bound is always 1, upper bound (length) needs to be calculated }
|
||||||
append_entry(DW_TAG_subrange_type,false,[
|
append_entry(DW_TAG_subrange_type,false,[
|
||||||
DW_AT_lower_bound,DW_FORM_udata,1,
|
DW_AT_lower_bound,DW_FORM_udata,1,
|
||||||
DW_AT_upper_bound,DW_FORM_block1,upperopcodes
|
DW_AT_upper_bound,DW_FORM_block1,upperopcodes
|
||||||
]);
|
]);
|
||||||
|
|
||||||
{ high(string) is stored sizeof(ptrint) bytes before the string data }
|
{ high(string) is stored sizeof(sizeint) bytes before the string data }
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_dup)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_dup)));
|
||||||
@ -4281,12 +4281,22 @@ implementation
|
|||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(3));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(3));
|
||||||
{ no -> load length }
|
{ no -> load length }
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizeof(ptrint)));
|
if upperopcodes=16 then
|
||||||
|
{ for Windows WideString the size is always a DWORD }
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit4)))
|
||||||
|
else
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizesinttype.size));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_minus)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_minus)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
|
if upperopcodes=16 then
|
||||||
|
begin
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref_size)));
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(4));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
|
||||||
|
|
||||||
{ for widestrings, the length is specified in bytes, so divide by two }
|
{ for widestrings, the length is specified in bytes, so divide by two }
|
||||||
if (upperopcodes=15) then
|
if (upperopcodes=16) then
|
||||||
begin
|
begin
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit1)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit1)));
|
||||||
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_shr)));
|
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_shr)));
|
||||||
@ -4340,15 +4350,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
st_widestring:
|
st_widestring:
|
||||||
begin
|
begin
|
||||||
if not(tf_winlikewidestring in target_info.flags) then
|
addstringdef('WideString',cwidechartype,true,-1)
|
||||||
addstringdef('WideString',cwidechartype,true,-1)
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
{ looks like a pwidechar (no idea about length location) }
|
|
||||||
append_entry(DW_TAG_pointer_type,false,[]);
|
|
||||||
append_labelentry_ref(DW_AT_type,def_dwarf_lab(cwidechartype));
|
|
||||||
finish_entry;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user