On 6/17/24 6:17 PM, Mark Harmstone wrote:
Translate DW_TAG_const_type and DW_TAG_volatile_type DIEs into
LF_MODIFIER symbols.

     gcc/
             * dwarf2codeview.cc
             (struct codeview_custom_type): Add lf_modifier to union.
             (write_cv_padding, write_lf_modifier): New functions.
             (write_custom_types): Call write_lf_modifier.
             (get_type_num_const_type): New function.
             (get_type_num_volatile_type): Likewise.
             (get_type_num): Handle DW_TAG_const_type and
                 DW_TAG_volatile_type DIEs.
             * dwarf2codeview.h (MOD_const, MOD_volatile): Define.
             (LF_MODIFIER): Likewise.
---

@@ -903,6 +908,76 @@ write_lf_pointer (codeview_custom_type *t)
    asm_fprintf (asm_out_file, "%LLcv_type%x_end:\n", t->num);
  }
+/* All CodeView type definitions have to be aligned to a four-byte boundary,
+   so write some padding bytes if necessary.  These have to be specific values:
+   f3, f2, f1.  */
Consider changing the magic numbers to a #define or const object or an enum as a follow-up.


+
+  ct = (codeview_custom_type *) xmalloc (sizeof (codeview_custom_type));
So presumably you're freeing these objects elsewhere? I see the free (custom_types), but I don' see where you free an subobjects. Did I miss something?

I'll go ahead and commit, but please double check for memory leaks.

Jeff

Reply via email to