MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / findBreakLine

Method findBreakLine

Engine/source/console/codeBlock.cpp:209–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207};
208
209void CodeBlock::findBreakLine(U32 ip, U32 &line, U32 &instruction)
210{
211 U32 min = 0;
212 U32 max = lineBreakPairCount - 1;
213 LinePair *p = (LinePair *) lineBreakPairs;
214
215 U32 found;
216 if(!lineBreakPairCount || p[min].ip > ip || p[max].ip < ip)
217 {
218 line = 0;
219 instruction = OP_INVALID;
220 return;
221 }
222 else if(p[min].ip == ip)
223 found = min;
224 else if(p[max].ip == ip)
225 found = max;
226 else
227 {
228 for(;;)
229 {
230 if(min == max - 1)
231 {
232 found = min;
233 break;
234 }
235 U32 mid = (min + max) >> 1;
236 if(p[mid].ip == ip)
237 {
238 found = mid;
239 break;
240 }
241 else if(p[mid].ip > ip)
242 max = mid;
243 else
244 min = mid;
245 }
246 }
247 instruction = p[found].instLine & 0xFF;
248 line = p[found].instLine >> 8;
249}
250
251const char *CodeBlock::getFileLine(U32 ip)
252{

Callers 1

sendBreakMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected