Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -2630,6 +2630,31 @@ m_saved_registers_map[save_id] = register_data_sp; } + /** The following code is specific to Linux x86 based architectures, + * where the register orig_eax (32 bit)/orig_rax (64 bit) is set to + * -1 to solve the bug 23659, such a setting prevents the automatic + * decrement of the instruction pointer which was causing the SIGILL + * exception. + * **/ + + ArchSpec process_arch; + if (m_debugged_process_sp->GetArchitecture(process_arch)) + { + llvm::Triple t_triple = process_arch.GetTriple(); + + if (t_triple.getOS() == llvm::Triple::Linux && + (t_triple.getArch() == llvm::Triple::x86 || + t_triple.getArch() == llvm::Triple::x86_64)) + { + const RegisterInfo *reg_info = reg_context_sp->GetRegisterInfoByName ("orig_eax"); + if (reg_info == nullptr) + reg_info = reg_context_sp->GetRegisterInfoByName ("orig_rax"); + + if (reg_info != nullptr) + reg_context_sp->WriteRegisterFromUnsigned(reg_info, -1); + + } + } // Write the response. StreamGDBRemote response; response.Printf ("%" PRIu32, save_id);