2001-02-04 22:50 GMT+1 Maurilio Longo <maurilio.longo@libero.it>

* source/debug/debugger.prg
     ! fixed CommandWindowProcessKey() where a K_DOWN on an empty command list was killing
     debugger with an out of bounds error.
     + Added a begin..end sequence to K_ENTER processing to survive requests to print
     variables which don't exist (like mispelled ones).
This commit is contained in:
Maurilio Longo
2001-02-04 21:50:54 +00:00
parent d1163f7754
commit b85b76b2c8
2 changed files with 24 additions and 3 deletions

View File

@@ -1,3 +1,10 @@
2001-02-04 22:50 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
* source/debug/debugger.prg
! fixed CommandWindowProcessKey() where a K_DOWN on an empty command list was killing
debugger with an out of bounds error.
+ Added a begin..end sequence to K_ENTER processing to survive requests to print
variables which don't exist (like mispelled ones).
2001-02-04 22:15 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
* source/debug/debugger.prg
* little changes, like adding K_LEFT and K_RIGHT to CodeWindowProcessKey (but they don't work)

View File

@@ -254,7 +254,8 @@ return nil
METHOD CommandWindowProcessKey( nKey ) CLASS TDebugger
local cCommand, cResult
local cCommand, cResult, oE
local bLastHandler
do case
case nKey == K_UP
@@ -269,7 +270,7 @@ METHOD CommandWindowProcessKey( nKey ) CLASS TDebugger
endif
case nKey == K_DOWN
if ::nCommand <= Len( ::aLastCommands )
if ::nCommand > 0 .AND. ::nCommand <= Len( ::aLastCommands )
::oGetListCommand:oGet:VarPut( ::aLastCommands[ ::nCommand ] )
::oGetListCommand:oGet:Buffer := ::aLastCommands[ ::nCommand ]
::oGetListCommand:oGet:Pos := 1
@@ -284,10 +285,23 @@ METHOD CommandWindowProcessKey( nKey ) CLASS TDebugger
AAdd( ::aLastCommands, cCommand )
::nCommand++
::oWndCommand:ScrollUp( 1 )
bLastHandler := ErrorBlock({ |objErr| BREAK (objErr) })
if SubStr( LTrim( cCommand ), 1, 2 ) == "? "
cResult := ValToStr( &( AllTrim( SubStr( LTrim( cCommand ), 3 ) ) ) )
begin sequence
cResult := ValToStr( &( AllTrim( SubStr( LTrim( cCommand ), 3 ) ) ) )
recover using oE
cResult := "Command error: " + oE:description
end sequence
else
cResult := "Command error"
ErrorBlock(bLastHandler)
endif
DispOutAt( ::oWndCommand:nBottom - 1, ::oWndCommand:nLeft + 1,;
Space( ::oWndCommand:nRight - ::oWndCommand:nLeft - 1 ),;