From f096b2fa387f07fcb25fbb12e7ab219661aeb186 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 17 Jun 2024 19:02:12 +0900 Subject: [PATCH] wamrc: Fix truncated DW_AT_producer (#3537) --- core/iwasm/compilation/debug/dwarf_extractor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/iwasm/compilation/debug/dwarf_extractor.cpp b/core/iwasm/compilation/debug/dwarf_extractor.cpp index 251bd696..a3cbd6e7 100644 --- a/core/iwasm/compilation/debug/dwarf_extractor.cpp +++ b/core/iwasm/compilation/debug/dwarf_extractor.cpp @@ -39,6 +39,7 @@ typedef struct dwarf_extractor { #define TO_EXTRACTOR(handle) (dwarf_extractor *)(handle) +static const char *compiler_name = "WAMR AoT compiler"; static bool is_debugger_initialized; dwarf_extractor_handle_t @@ -209,8 +210,8 @@ dwarf_gen_comp_unit_info(const AOTCompContext *comp_ctx) comp_unit = LLVMDIBuilderCreateCompileUnit( comp_ctx->debug_builder, LLDB_TO_LLVM_LANG_TYPE(lang_type), - comp_ctx->debug_file, "WAMR AoT compiler", 12, 0, NULL, 0, 1, NULL, - 0, LLVMDWARFEmissionFull, 0, 0, 0, "/", 1, "", 0); + comp_ctx->debug_file, compiler_name, strlen(compiler_name), 0, NULL, + 0, 1, NULL, 0, LLVMDWARFEmissionFull, 0, 0, 0, "/", 1, "", 0); } return comp_unit; }