Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 6919d9f

Browse files
author
Evgeny Pavlov
committed
Use LLVM headers for generation ELF and Dwarf files
1 parent c8f12d0 commit 6919d9f

File tree

2 files changed

+16
-432
lines changed

2 files changed

+16
-432
lines changed

src/vm/gdbjit.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ const int DebugStringCount = sizeof(DebugStrings) / sizeof(DebugStrings[0]);
210210

211211
/* Static data for .debug_abbrev */
212212
const unsigned char AbbrevTable[] = {
213-
1, DW_TAG_compile_unit, DW_children_yes,
213+
1, DW_TAG_compile_unit, DW_CHILDREN_yes,
214214
DW_AT_producer, DW_FORM_strp, DW_AT_language, DW_FORM_data2, DW_AT_name, DW_FORM_strp,
215215
DW_AT_stmt_list, DW_FORM_sec_offset, 0, 0,
216-
2, DW_TAG_subprogram, DW_children_no,
216+
2, DW_TAG_subprogram, DW_CHILDREN_no,
217217
DW_AT_name, DW_FORM_strp, DW_AT_decl_file, DW_FORM_data1, DW_AT_decl_line, DW_FORM_data1,
218218
DW_AT_type, DW_FORM_ref4, DW_AT_external, DW_FORM_flag_present, 0, 0,
219-
3, DW_TAG_base_type, DW_children_no,
219+
3, DW_TAG_base_type, DW_CHILDREN_no,
220220
DW_AT_name, DW_FORM_strp, DW_AT_encoding, DW_FORM_data1, DW_AT_byte_size, DW_FORM_data1,0, 0,
221221
0
222222
};
@@ -269,7 +269,7 @@ void NotifyGdb::MethodCompiled(MethodDesc* MethodDescPtr)
269269
/* Get method name & size of jitted code */
270270
LPCUTF8 methodName = MethodDescPtr->GetName();
271271
EECodeInfo codeInfo(pCode);
272-
TADDR codeSize = codeInfo.GetCodeManager()->GetFunctionSize(codeInfo.GetGCInfo());
272+
TADDR codeSize = codeInfo.GetCodeManager()->GetFunctionSize(codeInfo.GetGCInfoToken());
273273

274274
#ifdef _TARGET_ARM_
275275
pCode &= ~1; // clear thumb flag for debug info
@@ -944,14 +944,14 @@ int NotifyGdb::Leb128Encode(int32_t num, char* buf, int size)
944944
/* ELF 32bit header */
945945
Elf32_Ehdr::Elf32_Ehdr()
946946
{
947-
e_ident[EI_MAG0] = ELFMAG0;
948-
e_ident[EI_MAG1] = ELFMAG1;
949-
e_ident[EI_MAG2] = ELFMAG2;
950-
e_ident[EI_MAG3] = ELFMAG3;
947+
e_ident[EI_MAG0] = ElfMagic[0];
948+
e_ident[EI_MAG1] = ElfMagic[1];
949+
e_ident[EI_MAG2] = ElfMagic[2];
950+
e_ident[EI_MAG3] = ElfMagic[3];
951951
e_ident[EI_CLASS] = ELFCLASS32;
952952
e_ident[EI_DATA] = ELFDATA2LSB;
953953
e_ident[EI_VERSION] = EV_CURRENT;
954-
e_ident[EI_OSABI] = ELFOSABI_SYSV;
954+
e_ident[EI_OSABI] = ELFOSABI_NONE;
955955
e_ident[EI_ABIVERSION] = 0;
956956
for (int i = EI_PAD; i < EI_NIDENT; ++i)
957957
e_ident[i] = 0;
@@ -974,14 +974,14 @@ Elf32_Ehdr::Elf32_Ehdr()
974974
/* ELF 64bit header */
975975
Elf64_Ehdr::Elf64_Ehdr()
976976
{
977-
e_ident[EI_MAG0] = ELFMAG0;
978-
e_ident[EI_MAG1] = ELFMAG1;
979-
e_ident[EI_MAG2] = ELFMAG2;
980-
e_ident[EI_MAG3] = ELFMAG3;
977+
e_ident[EI_MAG0] = ElfMagic[0];
978+
e_ident[EI_MAG1] = ElfMagic[1];
979+
e_ident[EI_MAG2] = ElfMagic[2];
980+
e_ident[EI_MAG3] = ElfMagic[3];
981981
e_ident[EI_CLASS] = ELFCLASS64;
982982
e_ident[EI_DATA] = ELFDATA2LSB;
983983
e_ident[EI_VERSION] = EV_CURRENT;
984-
e_ident[EI_OSABI] = ELFOSABI_SYSV;
984+
e_ident[EI_OSABI] = ELFOSABI_NONE;
985985
e_ident[EI_ABIVERSION] = 0;
986986
for (int i = EI_PAD; i < EI_NIDENT; ++i)
987987
e_ident[i] = 0;

0 commit comments

Comments
 (0)