diff options
author | Konstantin Baladurin <k.baladurin@partner.samsung.com> | 2017-09-12 13:44:24 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-09-12 12:44:24 +0200 |
commit | 18ab3567e2ea6e2a385527bb247b0eec32a995cb (patch) | |
tree | 2f5ca1bd77e5382b39ae1f9f539d525c498df456 | |
parent | 9b0ba4188ac7161c4b04b30fed5eaa117d72eaed (diff) | |
download | coreclr-18ab3567e2ea6e2a385527bb247b0eec32a995cb.tar.gz coreclr-18ab3567e2ea6e2a385527bb247b0eec32a995cb.tar.bz2 coreclr-18ab3567e2ea6e2a385527bb247b0eec32a995cb.zip |
[GDBJIT] Specify C# language in DWARF debug information (#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.
-rw-r--r-- | clrdefinitions.cmake | 3 | ||||
-rw-r--r-- | clrfeatures.cmake | 1 | ||||
-rw-r--r-- | src/vm/gdbjit.cpp | 9 |
3 files changed, 13 insertions, 0 deletions
diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake index c6f4ad67eb..6cec17b13e 100644 --- a/clrdefinitions.cmake +++ b/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/clrfeatures.cmake b/clrfeatures.cmake index fde04d2af2..3d5d155c3a 100644 --- a/clrfeatures.cmake +++ b/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/vm/gdbjit.cpp b/src/vm/gdbjit.cpp index f931614f91..1ffab8a3ce 100644 --- a/src/vm/gdbjit.cpp +++ b/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 |