Changeset 415 for branches/thune/thread_safe/debugger/ThuneDebugger.cpp
- Timestamp:
- 06/16/07 22:57:20 (17 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/debugger/ThuneDebugger.cpp
r152 r415 24 24 25 25 _mode = kModeVoid; 26 _env.threads = 0; 26 27 27 28 _loop = new QEventLoop( this ); … … 484 485 485 486 486 void ThuneDebugger::showPC( UThread* u r_thread, UCell* pc, UCell* end )487 { 488 UString* str = ur_ binPtr( _tmpStrN);487 void ThuneDebugger::showPC( UThread* ut, UCell* pc, UCell* end ) 488 { 489 UString* str = ur_threadTmp( ut ); 489 490 490 491 ur_arrayReserve( str, 1, 4 ); … … 515 516 _console->append( str->ptr.c ); 516 517 517 _stack->update( u r_thread, str );518 } 519 520 521 int ThuneDebugger::monitorIgnore( int, UCell*, UCell* )518 _stack->update( ut, str ); 519 } 520 521 522 int ThuneDebugger::monitorIgnore( UThread*, int, UCell*, UCell* ) 522 523 { 523 524 return 0; … … 525 526 526 527 527 int ThuneDebugger::monitorRun( int cmd, UCell* pc, UCell* end ) 528 { 529 UThread* ur_thread = &ur_env->mainThread; 530 528 int ThuneDebugger::monitorRun( UThread* ut, int cmd, UCell* pc, UCell* end ) 529 { 531 530 switch( cmd ) 532 531 { … … 547 546 gDB->setMode( kModeStep ); 548 547 549 gDB->showPC( u r_thread, pc, end );548 gDB->showPC( ut, pc, end ); 550 549 int ret = gDB->_loop->exec(); 551 550 if( ret < 0 ) … … 560 559 561 560 562 int ThuneDebugger::monitorStep( int cmd, UCell* pc, UCell* end ) 563 { 564 UThread* ur_thread = &ur_env->mainThread; 565 561 int ThuneDebugger::monitorStep( UThread* ut, int cmd, UCell* pc, UCell* end ) 562 { 566 563 switch( cmd ) 567 564 { 568 565 case UR_EMH_STEP: 569 gDB->showPC( u r_thread, pc, end );566 gDB->showPC( ut, pc, end ); 570 567 int ret = gDB->_loop->exec(); 571 568 //printf( "KR ret %d\n", ret ); … … 641 638 _env.monitor = monitorIgnore; 642 639 643 if( ur_startup( &_env ) )640 if( ur_startup( &_env, 0, 0 ) ) 644 641 return false; 645 642 646 _tmpStrN = ur_makeBinary( 256 );647 _tmpStrHold = ur_hold( UT_STRING, _tmpStrN );648 649 643 return true; 650 644 } … … 653 647 void ThuneDebugger::destroyEnv() 654 648 { 655 if( ur_env)649 if( _env.threads ) 656 650 ur_shutdown( &_env ); 657 651 } … … 662 656 UCell* res; 663 657 QByteArray cmd; 664 UThread* u r_thread = &ur_env->mainThread;658 UThread* ut = _env.threads; 665 659 666 660 cmd = _editor->toPlainText().toAscii(); 667 661 668 switch( ur_evalCStr( u r_thread, cmd, cmd.size() ) )662 switch( ur_evalCStr( ut, cmd, cmd.size() ) ) 669 663 { 670 664 case UR_EVAL_OK: 671 665 { 672 res = ur_result( u r_thread, 0 );666 res = ur_result( ut, 0 ); 673 667 674 668 if( ! ur_is(res, UT_UNSET) && … … 707 701 UString* str; 708 702 709 res = ur_result( u r_thread, 0 );703 res = ur_result( ut, 0 ); 710 704 str = ur_binPtr( res->err.messageStr ); 711 705
