2
0
Эх сурвалжийг харах

* do not write DW_AT_allocated and DW_AT_data_location tags for old style objects and cppobjects, resolves #36017

git-svn-id: trunk@43183 -
florian 5 жил өмнө
parent
commit
6e58178963
1 өөрчлөгдсөн 15 нэмэгдсэн , 9 устгасан
  1. 15 9
      compiler/dbgdwarf.pas

+ 15 - 9
compiler/dbgdwarf.pas

@@ -4459,15 +4459,21 @@ implementation
           else
             append_entry(DW_TAG_structure_type,true,[]);
           append_attribute(DW_AT_byte_size,DW_FORM_udata,[tobjectsymtable(def.symtable).datasize]);
-          // The pointer to the class-structure is hidden. The debug-information
-          // does not contain an implicit pointer, but the data-adress is dereferenced here.
-          // In case of a nil-pointer, report the class as being unallocated.
-          append_block1(DW_AT_allocated,2);
-          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)));
-          append_block1(DW_AT_data_location,2);
-          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)));
+          { an old style object and a cpp class are accessed directly, so we do not need DW_AT_allocated and DW_AT_data_location tags,
+            see issue #36017 }
+          if not(is_object(def) or is_cppclass(def)) then
+            begin
+              { The pointer to the class-structure is hidden. The debug-information
+                does not contain an implicit pointer, but the data-adress is dereferenced here.
+                In case of a nil-pointer, report the class as being unallocated.
+              }
+              append_block1(DW_AT_allocated,2);
+              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)));
+              append_block1(DW_AT_data_location,2);
+              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)));
+            end;
           finish_entry;
         end;