MCPcopy Create free account
hub / github.com/anjo76/angelscript / InterpretCommand

Method InterpretCommand

sdk/add_on/debugger/debugger.cpp:316–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316bool CDebugger::InterpretCommand(const string &cmd, asIScriptContext *ctx)
317{
318 if( cmd.length() == 0 ) return true;
319
320 switch( cmd[0] )
321 {
322 case 'c':
323 m_action = CONTINUE;
324 break;
325
326 case 's':
327 m_action = STEP_INTO;
328 break;
329
330 case 'n':
331 m_action = STEP_OVER;
332 m_lastCommandAtStackLevel = ctx ? ctx->GetCallstackSize() : 1;
333 break;
334
335 case 'o':
336 m_action = STEP_OUT;
337 m_lastCommandAtStackLevel = ctx ? ctx->GetCallstackSize() : 0;
338 break;
339
340 case 'b':
341 {
342 // Set break point
343 size_t p = cmd.find_first_not_of(" \t", 1);
344 size_t div = cmd.find(':');
345 if( div != string::npos && div > 2 && p > 1 )
346 {
347 string file = cmd.substr(2, div-2);
348 string line = cmd.substr(div+1);
349
350 int nbr = atoi(line.c_str());
351
352 AddFileBreakPoint(file, nbr);
353 }
354 else if( div == string::npos && p != string::npos && p > 1 )
355 {
356 string func = cmd.substr(p);
357
358 AddFuncBreakPoint(func);
359 }
360 else
361 {
362 Output("Incorrect format for setting break point, expected one of:\n"
363 " b <file name>:<line number>\n"
364 " b <function name>\n");
365 }
366 }
367 // take more commands
368 return false;
369
370 case 'r':
371 {
372 // Remove break point
373 size_t p = cmd.find_first_not_of(" \t", 1);

Callers 1

TestFunction · 0.80

Calls 7

PrintHelpFunction · 0.85
GetCallstackSizeMethod · 0.80
findMethod · 0.80
beginMethod · 0.80
AbortMethod · 0.80
lengthMethod · 0.45
sizeMethod · 0.45

Tested by 1

TestFunction · 0.64