From 91f9a3f12cefda2fd665bf9aaa192d25a2889b24 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 3 Mar 2010 01:39:10 +0000 Subject: [PATCH] 2010-03-03 02:38 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/doc/en/hvm.txt - removed __DBGVMVARLGET() description * harbour/src/debug/dbgbrwsr.prg % small speed improvement * harbour/include/hbextern.ch * harbour/src/vm/debug.c + added internal debug function: __DBGVMLOCALLIST( ) -> --- harbour/ChangeLog | 11 +++++++++ harbour/doc/en/hvm.txt | 30 ------------------------ harbour/include/hbextern.ch | 21 +++++++++-------- harbour/src/debug/dbgbrwsr.prg | 11 +++++---- harbour/src/vm/debug.c | 43 +++++++++++++++++++++++++++------- 5 files changed, 62 insertions(+), 54 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cfa00ac71b..ac0f45162d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-03 02:38 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/doc/en/hvm.txt + - removed __DBGVMVARLGET() description + + * harbour/src/debug/dbgbrwsr.prg + % small speed improvement + + * harbour/include/hbextern.ch + * harbour/src/vm/debug.c + + added internal debug function: __DBGVMLOCALLIST( ) -> + 2010-03-03 02:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - examples/pe - Deleted empty dir. diff --git a/harbour/doc/en/hvm.txt b/harbour/doc/en/hvm.txt index b22dd6b5c1..c7bcdd55de 100644 --- a/harbour/doc/en/hvm.txt +++ b/harbour/doc/en/hvm.txt @@ -405,33 +405,3 @@ * Library is rtl * $END$ */ - -/* $DOC$ - * $TEMPLATE$ - * Function - * $NAME$ - * __DBGVMVARLGET() - * $CATEGORY$ - * API - * $SUBCATEGORY$ - * Variable Management - * $ONELINER$ - * Retrive a local variable from a procedure level - * $SYNTAX$ - * __DBGVMVARLGET( , ) --> - * $ARGUMENTS$ - * Is the procedure level, same as used in ProcName() - * and ProcLine(), from which a local variable containts is going to - * be retrieved. - * - * Is the index of the local variable to retrieve. - * $RETURNS$ - * The content of a specific local variable - * $DESCRIPTION$ - * This function is used from the debugger - * $COMPLIANCE$ - * - * $FILES$ - * Library is vm - * $END$ - */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 54ea9996a4..aba0f88c17 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -577,21 +577,22 @@ EXTERNAL __I18N_POTARRAYJOIN /* The debugger interface */ EXTERNAL __DBGINVOKEDEBUG +EXTERNAL __DBGVMVARGLIST +EXTERNAL __DBGVMVARGGET +EXTERNAL __DBGVMVARGSET +EXTERNAL __DBGVMVARSLEN +EXTERNAL __DBGVMVARSLIST +EXTERNAL __DBGVMVARSGET +EXTERNAL __DBGVMVARSSET +EXTERNAL __DBGVMVARLGET +EXTERNAL __DBGVMVARLSET +EXTERNAL __DBGPROCLEVEL +EXTERNAL __DBGVMLOCALLIST EXTERNAL __DBGVMPARLLIST EXTERNAL __DBGVMSTKGCOUNT EXTERNAL __DBGVMSTKGLIST EXTERNAL __DBGVMSTKLCOUNT EXTERNAL __DBGVMSTKLLIST -EXTERNAL __DBGVMVARGGET -EXTERNAL __DBGVMVARGLIST -EXTERNAL __DBGVMVARGSET -EXTERNAL __DBGVMVARLGET -EXTERNAL __DBGVMVARLSET -EXTERNAL __DBGVMVARSGET -EXTERNAL __DBGVMVARSSET -EXTERNAL __DBGVMVARSLEN -EXTERNAL __DBGVMVARSLIST -EXTERNAL __DBGPROCLEVEL /* RDD related symbols */ diff --git a/harbour/src/debug/dbgbrwsr.prg b/harbour/src/debug/dbgbrwsr.prg index a9f4212c87..f0b4270d61 100644 --- a/harbour/src/debug/dbgbrwsr.prg +++ b/harbour/src/debug/dbgbrwsr.prg @@ -131,7 +131,7 @@ METHOD New( nTop, nLeft, nBottom, nRight, oParentWindow ) CLASS HBDbBrowser METHOD Configure() ::rowCount := ::nBottom - ::nTop + 1 - ASize( ::aRowState, ::rowCount ) + AFill( ASize( ::aRowState, ::rowCount ), .F. ) ::lConfigured := .T. RETURN Self @@ -164,8 +164,9 @@ METHOD ForceStable() IF !::lConfigured ::Configure() ENDIF + DispBegin() FOR nRow := 1 TO ::rowCount - IF Empty( ::aRowState[ nRow ] ) + IF !::aRowState[ nRow ] ::GoTo( ::nFirstVisible + nRow - 1 ) IF ::hitBottom hb_dispOutAt( ::nTop + nRow - 1, ::nLeft, Space( ::nRight - ::nLeft + 1 ), ::aColorSpec[ 1 ] ) @@ -182,10 +183,9 @@ METHOD ForceStable() ELSE nClr := oCol:defColor[ nClr ] ENDIF - IF oCol:width == NIL + nWid := oCol:width + IF nWid == NIL nWid := Len( xData ) - ELSE - nWid := oCol:width ENDIF hb_dispOutAt( ::nTop + nRow - 1, nColX, PadR( xData, nWid ) + iif( nCol < Len( ::aColumns ), " ", "" ), ::aColorSpec[ nClr ] ) nColX += nWid + 1 @@ -197,6 +197,7 @@ METHOD ForceStable() NEXT ::GoTo( ::nFirstVisible + ::rowPos - 1 ) SetPos( ::nTop + ::rowPos - 1, ::nLeft ) + DispEnd() RETURN Self METHOD GoTo( nRow ) diff --git a/harbour/src/vm/debug.c b/harbour/src/vm/debug.c index d55b0c2dcd..0714133a79 100644 --- a/harbour/src/vm/debug.c +++ b/harbour/src/vm/debug.c @@ -63,6 +63,8 @@ * __DBGVMSTKGCOUNT() * __DBGVMSTKGLIST() * __DBGVMSTKLCOUNT() + * __DBGVMSTKLLIST() + * __DBGVMLOCALLIST() * __DBGVMPARLLIST() * for locals: * __DBGVMVARLGET() (debugger.prg) @@ -84,7 +86,7 @@ * __DBGVMVARSLEN() * __DBGVMVARSGET() (debugger.prg) * __DBGVMVARSSET() (debugger.prg) - * hb_dbg_vmVarSGet(int,int) (dbgentry.c) + * hb_dbg_vmVarSGet(PHB_ITEM,int)(dbgentry.c) * for globals (unused): * __DBGVMVARGLIST() * __DBGVMVARGGET() (debugger.prg) @@ -104,7 +106,6 @@ */ - /* $Doc$ * $FuncName$ AddToArray( , , ) * $Description$ Add to array at pos @@ -220,13 +221,37 @@ HB_FUNC( __DBGVMSTKLLIST ) hb_itemReturnRelease( pReturn ); } -/* $Doc$ - * $FuncName$ __dbgvmParLGet() - * $Description$ Returns the passed parameters of the calling function - * $End$ */ - /* TODO : put bLocals / bParams */ - /* somewhere for declared parameters */ - /* and locals */ +HB_FUNC( __DBGVMLOCALLIST ) +{ + PHB_ITEM pArray; + HB_LONG lBaseOffset, lPrevOffset, lLen, l; + int iLevel = hb_parni( 1 ) + 1; + + lBaseOffset = hb_stackBaseOffset(); + while( --iLevel > 0 && lBaseOffset > 1 ) + lBaseOffset = hb_stackItem( lBaseOffset - 1 )->item.asSymbol.stackstate->lBaseItem + 1; + + if( lBaseOffset > 1 ) + { + PHB_ITEM pSymItm; + + lPrevOffset = hb_stackItem( lBaseOffset - 1 )->item.asSymbol.stackstate->lBaseItem; + pSymItm = hb_stackItem( lPrevOffset ); + lPrevOffset += HB_MAX( pSymItm->item.asSymbol.paramdeclcnt, + pSymItm->item.asSymbol.paramcnt ) + 1; + lLen = lBaseOffset - lPrevOffset - 2; + } + else + lLen = lPrevOffset = 0; + + pArray = hb_itemArrayNew( lLen ); + for( l = 1; l <= lLen; ++l ) + hb_itemCopyFromRef( hb_arrayGetItemPtr( pArray, l ), + hb_stackItem( lPrevOffset + l ) ); + + hb_itemReturnRelease( pArray ); +} + HB_FUNC( __DBGVMPARLLIST ) { hb_itemReturnRelease( hb_arrayFromParams( hb_parni( 1 ) + 1 ) );