Index: source/Plugins/JITLoader/GDB/JITLoaderGDB.h =================================================================== --- source/Plugins/JITLoader/GDB/JITLoaderGDB.h +++ source/Plugins/JITLoader/GDB/JITLoaderGDB.h @@ -83,7 +83,7 @@ bool ReadJITDescriptor(bool all_entries); - template + template bool ReadJITDescriptorImpl(bool all_entries); Index: source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp =================================================================== --- source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -90,14 +90,24 @@ JIT_UNREGISTER_FN } jit_actions_t; -template +template struct jit_code_entry { ptr_t next_entry; // pointer ptr_t prev_entry; // pointer ptr_t symfile_addr; // pointer - uint64_t symfile_size; + uint64_t symfile_size __attribute__ ((aligned (8))); }; + +template +struct jit_code_entry +{ + ptr_t next_entry; // pointer + ptr_t prev_entry; // pointer + ptr_t symfile_addr; // pointer + uint64_t symfile_size __attribute__ ((packed)); +}; + template struct jit_descriptor { @@ -269,13 +279,20 @@ JITLoaderGDB::ReadJITDescriptor(bool all_entries) { Target &target = m_process->GetTarget(); - if (target.GetArchitecture().GetAddressByteSize() == 8) - return ReadJITDescriptorImpl(all_entries); + const ArchSpec &arch_spec = target.GetArchitecture(); + if (arch_spec.GetAddressByteSize() == 8) + return ReadJITDescriptorImpl(all_entries); else - return ReadJITDescriptorImpl(all_entries); + { + ArchSpec::Core core = arch_spec.GetCore(); + if (ArchSpec::kCore_x86_32_first <= core && core <= ArchSpec::kCore_x86_32_last) + return ReadJITDescriptorImpl(all_entries); + else + return ReadJITDescriptorImpl(all_entries); + } } -template +template bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { @@ -309,7 +326,7 @@ while (jit_relevant_entry != 0) { - jit_code_entry jit_entry; + jit_code_entry jit_entry; const size_t jit_entry_size = sizeof(jit_entry); bytes_read = m_process->DoReadMemory(jit_relevant_entry, &jit_entry, jit_entry_size, error); if (bytes_read != jit_entry_size || !error.Success())