diff --git a/harbour/ChangeLog b/harbour/ChangeLog index af0d5a456a..e88dbdb8f1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2001-02-04 22:50 GMT+1 Maurilio Longo + * 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 * source/debug/debugger.prg * little changes, like adding K_LEFT and K_RIGHT to CodeWindowProcessKey (but they don't work) diff --git a/harbour/source/debug/debugger.prg b/harbour/source/debug/debugger.prg index b4f8b7c22a..89d88979c1 100644 --- a/harbour/source/debug/debugger.prg +++ b/harbour/source/debug/debugger.prg @@ -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 ),;