Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -107,6 +107,9 @@ { { "packet-timeout" , OptionValue::eTypeUInt64 , true , 1, NULL, NULL, "Specify the default packet timeout in seconds." }, { "target-definition-file" , OptionValue::eTypeFileSpec , true, 0 , NULL, NULL, "The file that provides the description for remote target registers." }, + { "breakpoint-pc-offset", OptionValue::eTypeSInt64, true, 0, NULL, NULL, "Architecture specific PC offset when a breakpoint is hit. " + "Needed if debug stub does not rollback PC after hitting a breakpoint. " + "For negative values, use '--' before settings variable." }, { NULL , OptionValue::eTypeInvalid, false, 0, NULL, NULL, NULL } }; @@ -113,7 +116,8 @@ enum { ePropertyPacketTimeout, - ePropertyTargetDefinitionFile + ePropertyTargetDefinitionFile, + ePropertyBreakpointOffset }; class PluginProperties : public Properties @@ -158,6 +162,13 @@ const uint32_t idx = ePropertyTargetDefinitionFile; return m_collection_sp->GetPropertyAtIndexAsFileSpec (NULL, idx); } + + int64_t + GetBreakpointOffset() const + { + const uint32_t idx = ePropertyBreakpointOffset; + return m_collection_sp->GetPropertyAtIndexAsSInt64(NULL, idx, 0); + } }; typedef std::shared_ptr ProcessKDPPropertiesSP; @@ -399,6 +410,10 @@ const uint64_t timeout_seconds = GetGlobalPluginProperties()->GetPacketTimeout(); if (timeout_seconds > 0) m_gdb_comm.SetPacketTimeout(timeout_seconds); + + const int64_t settings_bp_offset = GetGlobalPluginProperties()->GetBreakpointOffset(); + if (settings_bp_offset != 0) + m_breakpoint_pc_offset = settings_bp_offset; } //----------------------------------------------------------------------