67{
68 std::vector<std::string> CmdVec;
71
72 auto CmdIt = command.begin();
73 auto CmdEnd = command.end();
74
75 while (CmdIt != CmdEnd)
76 {
77
78
79
80 CmdIt = std::find_if_not(CmdIt, CmdEnd, ::isspace);
81 if (CmdIt == CmdEnd)
82 break;
83 if (*CmdIt == '{')
84 {
85
86
87
88 auto CloseIt = std::find(CmdIt + 1, CmdEnd, '}');
89 if (CloseIt != CmdEnd)
90 {
91 if (CmdVec.size() < 2)
92 {
93
94
95
96
97 CmdVec.emplace_back("");
98 }
99 std::string RawAsm(CmdIt + 1, CloseIt);
100 CmdVec.emplace_back(RawAsm);
101 CmdIt = CloseIt + 1;
102 }
103 else
104 {
105
106
107
109 }
110 }
111 else
112 {
113
114
115
116 auto SpaceIt = std::find_if(CmdIt, CmdEnd, ::isspace);
117 CmdVec.emplace_back(CmdIt, SpaceIt);
118 CmdIt = SpaceIt;
119 }
120 }
121
122
123
124
125 auto PidIt = std::find_if(CmdVec.begin(), CmdVec.end(), [](const std::string & s) { return s.find("pid") != std::string::npos; });
126 if (PidIt != CmdVec.end())
127 {
128 bool IsLast = (PidIt == std::prev(CmdVec.end()));
129 bool IsSecondLast = (PidIt == std::prev(CmdVec.end(), 2));
130 if (!IsLast && !IsSecondLast)
131 {
133 return CmdEmpty;
134 }
136 {
138 return CmdEmpty;
139 }
140
141 if (std::next(PidIt) != CmdVec.end())
142 {
143 CMD.ProcIdStr = std::string(*(++PidIt));
144 }
145 else
146 {
147 ShowMessages(
"no hex number was provided as process id\n\n");
148 return CmdEmpty;
149 }
150 }
151 else
152 {
153
154
155
156 }
157
158
159
160
161 if (CmdVec.size() > 0)
162 CMD.CommandStr = CmdVec.at(0);
163 if (CmdVec.size() > 1)
164 CMD.AddressStr = CmdVec.at(1);
165 if (CmdVec.size() > 2)
166 CMD.AsmSnippet = CmdVec.at(2);
167 if (CmdVec.size() > 3)
168 CMD.StartAddressStr = CmdVec.at(3);
169
170
171 return CMD;
172}
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231