From: Konstantin Baladurin Date: Tue, 12 Sep 2017 10:44:24 +0000 (+0300) Subject: [GDBJIT] Specify C# language in DWARF debug information (dotnet/coreclr#13720) X-Git-Tag: submit/tizen/20210909.063632~11030^2~6513^2~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4d6c3d3fc2be74372869bad21bf04f4aa19dd7c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [GDBJIT] Specify C# language in DWARF debug information (dotnet/coreclr#13720) * [GDBJIT] Specify C# language in DWARF debug information To correctly support C# language in lldb DWARF debug information should contain correct information about language. Now we use 0x9e57 constant for specify C# language. * [GDBJIT] Introduce FEATURE_GDBJIT_LANGID_CS If this feature is set gdbjit will use 0x9e57 as c# lang id, otherwise it will use DW_LANG_C89. Commit migrated from https://github.com/dotnet/coreclr/commit/18ab3567e2ea6e2a385527bb247b0eec32a995cb --- diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index c6f4ad6..6cec17b 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -122,6 +122,9 @@ endif() if(FEATURE_GDBJIT_FRAME) add_definitions(-DFEATURE_GDBJIT_FRAME) endif(FEATURE_GDBJIT_FRAME) +if(FEATURE_GDBJIT_LANGID_CS) + add_definitions(-DFEATURE_GDBJIT_LANGID_CS) +endif(FEATURE_GDBJIT_LANGID_CS) if(CLR_CMAKE_PLATFORM_LINUX) add_definitions(-DFEATURE_PERFTRACING) endif(CLR_CMAKE_PLATFORM_LINUX) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index fde04d2..3d5d155 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -1,5 +1,6 @@ if(CLR_CMAKE_TARGET_TIZEN_LINUX) set(FEATURE_EVENT_TRACE 0) + set(FEATURE_GDBJIT_LANGID_CS 1) endif() if(FEATURE_STANDALONE_GC_ONLY) diff --git a/src/coreclr/src/vm/gdbjit.cpp b/src/coreclr/src/vm/gdbjit.cpp index f931614..1ffab8a 100644 --- a/src/coreclr/src/vm/gdbjit.cpp +++ b/src/coreclr/src/vm/gdbjit.cpp @@ -756,6 +756,11 @@ const int AbbrevTableSize = sizeof(AbbrevTable); #define DWARF_LINE_RANGE 14 #define DWARF_OPCODE_BASE 13 +#ifdef FEATURE_GDBJIT_LANGID_CS +/* TODO: use corresponding constant when it will be added to llvm */ +#define DW_LANG_MICROSOFT_CSHARP 0x9e57 +#endif + DwarfLineNumHeader LineNumHeader = { 0, 2, 0, 1, 1, DWARF_LINE_BASE, DWARF_LINE_RANGE, DWARF_OPCODE_BASE, {0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1} }; @@ -769,7 +774,11 @@ struct __attribute__((packed)) DebugInfoCU uint32_t m_cu_name; uint32_t m_line_num; } debugInfoCU = { +#ifdef FEATURE_GDBJIT_LANGID_CS + 1, 0, DW_LANG_MICROSOFT_CSHARP, 0, 0 +#else 1, 0, DW_LANG_C89, 0, 0 +#endif }; struct __attribute__((packed)) DebugInfoTryCatchSub