Changeset 415
- Timestamp:
- 06/16/07 22:57:20 (15 months ago)
- Location:
- branches/thune/thread_safe
- Files:
-
- 7 modified
-
debugger/StackDisplay.cpp (modified) (1 diff)
-
debugger/ThuneDebugger.cpp (modified) (10 diffs)
-
debugger/ThuneDebugger.h (modified) (3 diffs)
-
debugger/project.r (modified) (1 diff)
-
doc/UserManual (modified) (2 diffs)
-
env.h (modified) (1 diff)
-
thune.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/debugger/StackDisplay.cpp
r114 r415 15 15 Show current stack. 16 16 */ 17 void StackDisplay::update( UThread* u r_thread, UString* tmp )17 void StackDisplay::update( UThread* ut, UString* tmp ) 18 18 { 19 19 clear(); 20 20 21 if( u r_env)21 if( ut ) 22 22 { 23 23 UCell* it = UR_TOS; -
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 -
branches/thune/thread_safe/debugger/ThuneDebugger.h
r114 r415 7 7 8 8 #include <QMainWindow> 9 #include " urlan.h"9 #include "env.h" 10 10 11 11 … … 59 59 QString strippedName(const QString &fullFileName); 60 60 61 static int monitorIgnore( int cmd, UCell* pc, UCell* end );62 static int monitorRun (int cmd, UCell* pc, UCell* end );63 static int monitorStep (int cmd, UCell* pc, UCell* end );61 static int monitorIgnore( UThread*, int cmd, UCell* pc, UCell* end ); 62 static int monitorRun ( UThread*, int cmd, UCell* pc, UCell* end ); 63 static int monitorStep ( UThread*, int cmd, UCell* pc, UCell* end ); 64 64 65 65 void showPC( UThread*, UCell* pc, UCell* end ); … … 94 94 QEventLoop* _loop; 95 95 UrlanEnv _env; 96 UIndex _tmpStrN;97 UIndex _tmpStrHold;98 96 99 97 enum -
branches/thune/thread_safe/debugger/project.r
r114 r415 11 11 12 12 include_from %.. 13 libs_from %../ %thune 013 libs_from %../ %thune_emh 14 14 15 cflags "-D UR_CONFIG_EMH"15 cflags "-DLANG_THUNE -DUR_CONFIG_EMH" 16 16 17 17 linux [ 18 18 ;libs_from %/usr/X11R6/lib64 19 19 ; {SM Xinerama Xext Xrandr Xrender Xcursor Xi Xft X11} 20 include_from %../unix 21 libs {bz2} 20 22 libs {png freetype dl} 21 23 ] -
branches/thune/thread_safe/doc/UserManual
r414 r415 75 75 block! [] [a b c] 76 76 paren! () (a b c) 77 macro! <size 2 mul> 77 78 vector! #[1 2 3] #[-85.33 2 44.8] 78 79 function! [2 add] proc :inc2 … … 91 92 context! 92 93 =========== ========== 94 95 96 Macros 97 ------ 98 99 Reader macros are simply blocks of code evaluated by the tokenizer. 100 Any reduced values created by the evaluation are appended to the block 101 currently being read. 102 103 Macros can be used wherever a constant is needed to improve evaluation 104 speed. 105 106 Example:: 107 108 <34 2 mul :border> 109 110 box-width <border> add 111 112 113 Currently, macro! values cannot be created by the user. 114 A literal macro syntax may be added in the future. 93 115 94 116 -
branches/thune/thread_safe/env.h
r388 r415 33 33 OSMutex mutex; 34 34 #ifdef UR_CONFIG_EMH 35 int (*monitor)( int,UCell*,UCell*);35 int (*monitor)(UThread*,int,UCell*,UCell*); 36 36 #endif 37 37 }; -
branches/thune/thread_safe/thune.c
r408 r415 284 284 #ifdef UR_CONFIG_EMH 285 285 #define EMH_STEP(pc,end) \ 286 if( ut->env->monitor( UR_EMH_STEP,pc,end) ) \286 if( ut->env->monitor(ut,UR_EMH_STEP,pc,end) ) \ 287 287 goto call_return; 288 288 289 289 #define EMH_HALT(pc,end) \ 290 if( ! ut->env->monitor( UR_EMH_HALT,pc,end) ) \290 if( ! ut->env->monitor(ut,UR_EMH_HALT,pc,end) ) \ 291 291 goto execute; 292 292 #else … … 769 769 case UT_CALL: 770 770 val->call.addr( ut, UR_TOS ); 771 #if def UR_CONFIG_DT_CODE771 #if defined(UR_CONFIG_EMH) || defined(UR_CONFIG_DT_CODE) 772 772 call_return: 773 773 #endif
