summaryrefslogtreecommitdiff
path: root/packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch')
-rw-r--r--packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch b/packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch
new file mode 100644
index 0000000000..8865e4b467
--- /dev/null
+++ b/packaging/0028-added-DWARF-exprloc-for-static-value-class-fields-11.patch
@@ -0,0 +1,81 @@
+From 30757da1fd337ff40013311551715a4d0bf13fe7 Mon Sep 17 00:00:00 2001
+From: Buyduck <ivan.vagin@partner.samsung.com>
+Date: Mon, 29 May 2017 14:26:41 +0300
+Subject: [PATCH 28/29] added DWARF exprloc for static value class fields
+ (#11911)
+
+---
+ src/vm/gdbjit.cpp | 45 +++++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 37 insertions(+), 8 deletions(-)
+
+diff --git a/src/vm/gdbjit.cpp b/src/vm/gdbjit.cpp
+index 5a3f074..d21b4da 100644
+--- a/src/vm/gdbjit.cpp
++++ b/src/vm/gdbjit.cpp
+@@ -1106,6 +1106,7 @@ void TypeMember::DumpDebugInfo(char* ptr, int& offset)
+ void TypeMember::DumpStaticDebugInfo(char* ptr, int& offset)
+ {
+ const int ptrSize = sizeof(TADDR);
++ int bufSize = 0;
+ if (ptr != nullptr)
+ {
+ DebugInfoStaticMember memberEntry;
+@@ -1114,19 +1115,47 @@ void TypeMember::DumpStaticDebugInfo(char* ptr, int& offset)
+ memberEntry.m_member_specification = m_member_offset;
+ memcpy(ptr + offset, &memberEntry, sizeof(DebugInfoStaticMember));
+
+- char buf[ptrSize + 2] = {0};
+- buf[0] = ptrSize + 1;
+- buf[1] = DW_OP_addr;
+-
+- for (int i = 0; i < ptrSize; i++)
++ // for value type static fields compute address as:
++ // addr = (*addr+sizeof(OBJECTREF))
++ if (m_member_type->GetTypeHandle().GetSignatureCorElementType() ==
++ ELEMENT_TYPE_VALUETYPE)
+ {
+- buf[i + 2] = m_static_member_address >> (i * 8);
++ bufSize = ptrSize + 6;
++
++ char buf[ptrSize + 6] = {0};
++ buf[0] = ptrSize + 5;
++ buf[1] = DW_OP_addr;
++
++ for (int i = 0; i < ptrSize; i++)
++ {
++ buf[i + 2] = m_static_member_address >> (i * 8);
++ }
++
++ buf[ptrSize + 2] = DW_OP_deref;
++ buf[ptrSize + 3] = DW_OP_const1u;
++ buf[ptrSize + 4] = sizeof(OBJECTREF);
++ buf[ptrSize + 5] = DW_OP_plus;
++
++ memcpy(ptr + offset + sizeof(DebugInfoStaticMember), &buf, bufSize);
+ }
++ else
++ {
++ bufSize = ptrSize + 2;
+
+- memcpy(ptr + offset + sizeof(DebugInfoStaticMember), &buf, ptrSize + 2);
++ char buf[ptrSize + 2] = {0};
++ buf[0] = ptrSize + 1;
++ buf[1] = DW_OP_addr;
++
++ for (int i = 0; i < ptrSize; i++)
++ {
++ buf[i + 2] = m_static_member_address >> (i * 8);
++ }
++
++ memcpy(ptr + offset + sizeof(DebugInfoStaticMember), &buf, bufSize);
++ }
+ }
+ offset += sizeof(DebugInfoStaticMember);
+- offset += ptrSize + 2;
++ offset += bufSize;
+ }
+
+ void FunctionMember::MangleName(char *buf, int &buf_offset, const char *name)
+--
+2.7.4
+