Skip to content

Commit a16da4f

Browse files
authored
dwarf_extractor.cpp: Try to preserve link name (#3542)
mainly for C++.
1 parent 16e70f9 commit a16da4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/iwasm/compilation/debug/dwarf_extractor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ lldb_function_to_function_dbi(const AOTCompContext *comp_ctx,
290290
{
291291
SBFunction function(sc.GetFunction());
292292
const char *function_name = function.GetName();
293-
const char *link_name = function.GetName();
293+
const char *link_name = function.GetMangledName();
294294
SBTypeList function_args = function.GetType().GetFunctionArgumentTypes();
295295
SBType return_type = function.GetType().GetFunctionReturnType();
296296
const size_t num_function_args = function_args.GetSize();
@@ -389,8 +389,8 @@ lldb_function_to_function_dbi(const AOTCompContext *comp_ctx,
389389

390390
LLVMMetadataRef FunctionMetadata = LLVMDIBuilderCreateFunction(
391391
DIB, File, function_name, strlen(function_name), link_name,
392-
strlen(link_name), File, line_entry.GetLine(), FunctionTy, true, true,
393-
line_entry.GetLine(), LLVMDIFlagZero, false);
392+
link_name != NULL ? strlen(link_name) : 0, File, line_entry.GetLine(),
393+
FunctionTy, true, true, line_entry.GetLine(), LLVMDIFlagZero, false);
394394

395395
LLVMMetadataReplaceAllUsesWith(ReplaceableFunctionMetadata,
396396
FunctionMetadata);

0 commit comments

Comments
 (0)