1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
From 1e96f53060b04c63877c607684066baa421145e3 Mon Sep 17 00:00:00 2001
From: Konstantin Baladurin <k.baladurin@partner.samsung.com>
Date: Thu, 7 Sep 2017 18:24:01 +0300
Subject: [PATCH] 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.
---
clrdefinitions.cmake | 3 +++
clrfeatures.cmake | 1 +
src/vm/gdbjit.cpp | 6 ++++++
3 files changed, 10 insertions(+)
diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake
index 6db2b24..627cfff 100644
--- a/clrdefinitions.cmake
+++ b/clrdefinitions.cmake
@@ -113,6 +113,9 @@ if(FEATURE_EVENT_TRACE)
endif(FEATURE_EVENT_TRACE)
if(CLR_CMAKE_PLATFORM_LINUX)
add_definitions(-DFEATURE_PERFTRACING)
+if(FEATURE_GDBJIT_LANGID_CS)
+ add_definitions(-DFEATURE_GDBJIT_LANGID_CS)
+endif(FEATURE_GDBJIT_LANGID_CS)
endif(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
diff --git a/clrfeatures.cmake b/clrfeatures.cmake
index 0e2801c..b9261f6 100644
--- a/clrfeatures.cmake
+++ b/clrfeatures.cmake
@@ -1,5 +1,6 @@
if(CLR_CMAKE_TARGET_TIZEN_LINUX)
set(FEATURE_EVENT_TRACE 1)
+ set(FEATURE_GDBJIT_LANGID_CS 1)
endif()
if(NOT DEFINED FEATURE_EVENT_TRACE)
diff --git a/src/vm/gdbjit.cpp b/src/vm/gdbjit.cpp
index 9b70a6b..37466e3 100644
--- a/src/vm/gdbjit.cpp
+++ b/src/vm/gdbjit.cpp
@@ -740,8 +740,10 @@ 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}
@@ -756,7 +758,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
--
2.7.4
|