View Issue Details

IDProjectCategoryView StatusLast Update
0015760LazarusDebuggerpublic2010-03-30 10:15
ReporterFlávio Etrusco Assigned ToMarc Weustink  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.9.28.3 (SVN) 
Fixed in Version0.9.29 (SVN) 
Summary0015760: [patch] Implement Step Out debugger operation
DescriptionDescription says it all. Patch against svn r23700.
Obs.
1) Add toolbar button but doesn't show it.
2) It seems gdb exec-finish steps out a bit too much. It really steps out of the call instead of the function exit point, but it's not less useful.
TagsNo tags attached.
Fixed in Revision23717
LazTarget-
Widgetset
Attached Files

Activities

Flávio Etrusco

2010-02-14 04:00

developer   ~0034458

"Only" forgot to attach it.
BTW it's in git (because it contains an image), unified format.

Paul Ishenin

2010-02-15 09:15

manager   ~0034484

Can you create a patch from the SVN and attach it?

Flávio Etrusco

2010-02-15 17:41

developer   ~0034505

Last edited: 2010-02-15 21:11

1) Where's my attachment? O_o Am I going nuts?
2) Are you on Windows (and only using TSVN) or may I send something else that works with 'patch'? (because I'm using hg)

2010-02-15 17:42

 

debugger_step_out.diff (24,287 bytes)   
diff --git a/debugger/debugger.pp b/debugger/debugger.pp
--- a/debugger/debugger.pp
+++ b/debugger/debugger.pp
@@ -55,10 +55,11 @@ type
     dcRun,
     dcPause,
     dcStop,
     dcStepOver,
     dcStepInto,
+    dcStepOut,
     dcRunTo,
     dcJumpto,
     dcBreak,
     dcWatch,
     dcLocal,
@@ -1321,10 +1322,11 @@ type
     procedure Run;                                   // Starts / continues debugging
     procedure Pause;                                 // Stops running
     procedure Stop;                                  // quit debugging
     procedure StepOver;
     procedure StepInto;
+    procedure StepOut;
     procedure RunTo(const ASource: String; const ALine: Integer);                // Executes til a certain point
     procedure JumpTo(const ASource: String; const ALine: Integer);               // No execute, only set exec point
     function  Evaluate(const AExpression: String; var AResult: String;
                           var ATypeInfo: TDBGType): Boolean;                     // Evaluates the given expression, returns true if valid
     function  Modify(const AExpression, AValue: String): Boolean;                // Modifies the given expression, returns true if valid
@@ -1368,10 +1370,11 @@ const
     'Run',
     'Pause',
     'Stop',
     'StepOver',
     'StepInto',
+    'StepOut',
     'RunTo',
     'Jumpto',
     'Break',
     'Watch',
     'Local',
@@ -1413,13 +1416,13 @@ const
   INTERNAL_STATES = [dsInit];
 
   COMMANDMAP: array[TDBGState] of TDBGCommands = (
   {dsNone } [],
   {dsIdle } [dcEnvironment],
-  {dsStop } [dcRun, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch,
+  {dsStop } [dcRun, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto, dcBreak, dcWatch,
              dcEvaluate, dcEnvironment],
-  {dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak,
+  {dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto, dcBreak,
              dcWatch, dcLocal, dcEvaluate, dcModify, dcEnvironment, dcSetStackFrame,
              dcDisassemble],
   {dsInit } [],
   {dsRun  } [dcPause, dcStop, dcBreak, dcWatch, dcEnvironment],
   {dsError} [dcStop]
@@ -1892,10 +1895,16 @@ procedure TDebugger.StepInto;
 begin
   if ReqCmd(dcStepInto, []) then exit;
   DebugLn('TDebugger.StepInto Class=',ClassName,' failed.');
 end;
 
+procedure TDebugger.StepOut;
+begin
+  if ReqCmd(dcStepOut, []) then exit;
+  DebugLn('TDebugger.StepOut Class=', ClassName, ' failed.');
+end;
+
 procedure TDebugger.StepOver;
 begin
   if ReqCmd(dcStepOver, []) then exit;
   DebugLn('TDebugger.StepOver Class=',ClassName,' failed.');
 end;
diff --git a/debugger/gdbmidebugger.pp b/debugger/gdbmidebugger.pp
--- a/debugger/gdbmidebugger.pp
+++ b/debugger/gdbmidebugger.pp
@@ -141,10 +141,11 @@ type
     function  GDBRun: Boolean;
     function  GDBPause(const AInternal: Boolean): Boolean;
     function  GDBStop: Boolean;
     function  GDBStepOver: Boolean;
     function  GDBStepInto: Boolean;
+    function  GDBStepOut: Boolean;
     function  GDBRunTo(const ASource: String; const ALine: Integer): Boolean;
     function  GDBJumpTo(const ASource: String; const ALine: Integer): Boolean;
     function  GDBDisassemble(AAddr: TDbgPtr; ABackward: Boolean; out ANextAddr: TDbgPtr;
                              out ADump, AStatement, AFile: String; out ALine: Integer): Boolean;
     function  GDBSourceAdress(const ASource: String; ALine, AColumn: Integer; out AAddr: TDbgPtr): Boolean;
@@ -2789,10 +2790,26 @@ begin
       DebugLn('[WARNING] Debugger: Unable to step in idle state');
     end;
   end;
 end;
 
+function TGDBMIDebugger.GDBStepOut: Boolean;
+begin
+  Result := False;
+  case State of
+    dsStop: begin
+      Result := StartDebugging('');
+    end;
+    dsPause: begin
+      Result := ExecuteCommand('-exec-finish', [cfExternal]);
+    end;
+    dsIdle: begin
+      DebugLn('[WARNING] Debugger: Unable to step out in idle state');
+    end;
+  end;
+end;
+
 function TGDBMIDebugger.GDBStepOver: Boolean;
 begin
   Result := False;
   case State of
     dsStop: begin
@@ -3066,11 +3083,11 @@ begin
   Result := UTF8Encode(WStr);
 end;
 
 function TGDBMIDebugger.GetSupportedCommands: TDBGCommands;
 begin
-  Result := [dcRun, dcPause, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto,
+  Result := [dcRun, dcPause, dcStop, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto,
              dcBreak, dcWatch, dcLocal, dcEvaluate, dcModify, dcEnvironment,
              dcSetStackFrame, dcDisassemble];
 end;
 
 function TGDBMIDebugger.GetTargetWidth: Byte;
@@ -3780,10 +3797,11 @@ begin
     dcRun:         Result := GDBRun;
     dcPause:       Result := GDBPause(False);
     dcStop:        Result := GDBStop;
     dcStepOver:    Result := GDBStepOver;
     dcStepInto:    Result := GDBStepInto;
+    dcStepOut:     Result := GDBStepOut;
     dcRunTo:       Result := GDBRunTo(String(AParams[0].VAnsiString), AParams[1].VInteger);
     dcJumpto:      Result := GDBJumpTo(String(AParams[0].VAnsiString), AParams[1].VInteger);
     dcEvaluate:    Result := GDBEvaluate(String(AParams[0].VAnsiString), String(AParams[1].VPointer^),TGDBType(AParams[2].VPointer^));
     dcEnvironment: Result := GDBEnvironment(String(AParams[0].VAnsiString), AParams[1].VBoolean);
     dcDisassemble: Result := GDBDisassemble(AParams[0].VQWord^, AParams[1].VBoolean, TDbgPtr(AParams[2].VPointer^),
diff --git a/ide/basedebugmanager.pas b/ide/basedebugmanager.pas
--- a/ide/basedebugmanager.pas
+++ b/ide/basedebugmanager.pas
@@ -103,10 +103,11 @@ type
     
     function DoPauseProject: TModalResult; virtual; abstract;
     function DoShowExecutionPoint: TModalResult; virtual; abstract;
     function DoStepIntoProject: TModalResult; virtual; abstract;
     function DoStepOverProject: TModalResult; virtual; abstract;
+    function DoStepOutProject: TModalResult; virtual; abstract;
     function DoRunToCursor: TModalResult; virtual; abstract;
     function DoStopProject: TModalResult; virtual; abstract;
     procedure DoToggleCallStack; virtual; abstract;
     procedure ProcessCommand(Command: word; var Handled: boolean); virtual; abstract;
 
diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas
--- a/ide/debugmanager.pas
+++ b/ide/debugmanager.pas
@@ -161,10 +161,11 @@ type
 
     function DoPauseProject: TModalResult; override;
     function DoShowExecutionPoint: TModalResult; override;
     function DoStepIntoProject: TModalResult; override;
     function DoStepOverProject: TModalResult; override;
+    function DoStepOutProject: TModalResult; override;
     function DoRunToCursor: TModalResult; override;
     function DoStopProject: TModalResult; override;
     procedure DoToggleCallStack; override;
     procedure ProcessCommand(Command: word; var Handled: boolean); override;
 
@@ -1984,10 +1985,13 @@ begin
             or (dcStepInto in FDebugger.Commands) or (FDebugger.State = dsIdle);
     itmRunMenuStepInto.Enabled := StepIntoSpeedButton.Enabled;
     StepOverSpeedButton.Enabled := DebuggerInvalid or
               (dcStepOver in FDebugger.Commands)  or (FDebugger.State = dsIdle);
     itmRunMenuStepOver.Enabled := StepOverSpeedButton.Enabled;
+    StepOutSpeedButton.Enabled := DebuggerInvalid or
+              (dcStepOut in FDebugger.Commands)  or (FDebugger.State = dsIdle);
+    itmRunMenuStepOut.Enabled := StepOutSpeedButton.Enabled;
 
     itmRunMenuRunToCursor.Enabled := DebuggerInvalid
                                      or (dcRunTo in FDebugger.Commands);
     itmRunMenuStop.Enabled := not DebuggerInvalid;
     StopSpeedButton.Enabled := itmRunMenuStop.Enabled;
@@ -2345,10 +2349,24 @@ begin
 
   FDebugger.StepOver;
   Result := mrOk;
 end;
 
+function TDebugManager.DoStepOutProject: TModalResult;
+begin
+  if (MainIDE.DoInitProjectRun <> mrOK)
+  or (MainIDE.ToolStatus <> itDebugger)
+  or (FDebugger = nil) or Destroying
+  then begin
+    Result := mrAbort;
+    Exit;
+  end;
+
+  FDebugger.StepOut;
+  Result := mrOk;
+end;
+
 function TDebugManager.DoStopProject: TModalResult;
 begin
   Result := mrCancel;
   SourceNotebook.ClearExecutionLines;
   if (MainIDE.ToolStatus=itDebugger) and (FDebugger<>nil) and (not Destroying)
@@ -2373,10 +2391,11 @@ begin
   Handled := True;
   case Command of
     ecPause:             DoPauseProject;
     ecStepInto:          DoStepIntoProject;
     ecStepOver:          DoStepOverProject;
+    ecStepOut:           DoStepOutProject;
     ecRunToCursor:       DoRunToCursor;
     ecStopProgram:       DoStopProject;
     ecResetDebugger:     ResetDebugger;
     ecToggleCallStack:   DoToggleCallStack;
     ecEvaluate:          ViewDebugDialog(ddtEvaluate);
diff --git a/ide/keymapping.pp b/ide/keymapping.pp
--- a/ide/keymapping.pp
+++ b/ide/keymapping.pp
@@ -536,10 +536,11 @@ begin
   ecRun: SetResult(VK_F9,[],VK_UNKNOWN,[]);
   ecPause: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_F8,[],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_F8,[ssShift],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_F4,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_F2,[SSCtrl],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunParameters: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecBuildFile: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -957,10 +958,11 @@ begin
   ecRun: SetResult(VK_F9,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecPause: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_F8,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_F8,[ssShift],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_F4,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunParameters: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecBuildFile: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -1560,10 +1562,11 @@ begin
   ecRun: SetResult(VK_R,[ssMeta],VK_UNKNOWN,[]);
   ecPause: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_R,[ssMeta,ssAlt],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_R,[ssMeta,ssShift],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_RETURN,[ssShift,ssMeta],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunParameters: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecBuildFile: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -1723,10 +1726,11 @@ begin
   ecRun: SetResult(VK_F9,[],VK_F9,[ssMeta]);
   ecPause: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_F7,[ssMeta]);
   ecStepOver: SetResult(VK_F8,[],VK_F8,[ssMeta]);
+  ecStepOut: SetResult(VK_F8,[],VK_F8,[ssShift,ssMeta]);
   ecRunToCursor: SetResult(VK_F4,[],VK_F4,[ssMeta]);
   ecStopProgram: SetResult(VK_F2,[ssCtrl],VK_F2,[ssCtrl,ssMeta]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunParameters: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecBuildFile: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -2076,10 +2080,11 @@ begin
     ecRun                     : Result:= srkmecRun;
     ecPause                   : Result:= srkmecPause;
     ecShowExecutionPoint      : Result:= srkmecShowExecutionPoint;
     ecStepInto                : Result:= lisMenuStepInto;
     ecStepOver                : Result:= lisMenuStepOver;
+    ecStepOut                 : Result:= lisMenuStepOut;
     ecRunToCursor             : Result:= lisMenuRunToCursor;
     ecStopProgram             : Result:= srkmecStopProgram;
     ecResetDebugger           : Result:= srkmecResetDebugger;
     ecRunParameters           : Result:= srkmecRunParameters;
     ecBuildFile               : Result:= srkmecBuildFile;
@@ -2767,10 +2772,11 @@ begin
   AddDefault(C, 'Run program', lisKMRunProgram, ecRun);
   AddDefault(C, 'Pause program', lisKMPauseProgram, ecPause);
   AddDefault(C, 'Show execution point', lisMenuShowExecutionPoint, ecShowExecutionPoint);
   AddDefault(C, 'Step into', lisMenuStepInto, ecStepInto);
   AddDefault(C, 'Step over', lisMenuStepOver, ecStepOver);
+  AddDefault(C, 'Step out', lisMenuStepOut, ecStepOut);
   AddDefault(C, 'Run to cursor', lisMenuRunToCursor, ecRunToCursor);
   AddDefault(C, 'Stop program', lisKMStopProgram, ecStopProgram);
   AddDefault(C, 'Reset debugger', lisMenuResetDebugger, ecResetDebugger);
   AddDefault(C, 'Run parameters', dlgRunParameters, ecRunParameters);
   AddDefault(C, 'Build File', lisMenuBuildFile, ecBuildFile);
diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas
--- a/ide/lazarusidestrconsts.pas
+++ b/ide/lazarusidestrconsts.pas
@@ -332,10 +332,11 @@ resourcestring
   lisBFRunCommand = 'Run Command';
   lisMenuPause = 'Pause';
   lisMenuShowExecutionPoint = 'Show execution point';
   lisMenuStepInto = 'Step into';
   lisMenuStepOver = 'Step over';
+  lisMenuStepOut = 'Step out';
   lisMenuRunToCursor = 'Run to cursor';
   lisKMStopProgram = 'Stop program';
   lisMenuStop = 'Stop';
   lisContinue = 'Continue';
   lisMenuResetDebugger = 'Reset debugger';
@@ -813,11 +814,12 @@ resourcestring
   lisHintRun = 'Run';
   lisHintPause = 'Pause';
   lisHintStop = 'Stop';
   lisHintStepInto = 'Step Into';
   lisHintStepOver = 'Step Over';
-  
+  lisHintStepOut  = 'Run until function returns';
+
   lisGPLNotice =
     '<description>'
    +'%s'
    +'Copyright (C) <year> <name of author> <contact>'
    +'%s'
diff --git a/ide/main.pp b/ide/main.pp
--- a/ide/main.pp
+++ b/ide/main.pp
@@ -294,10 +294,11 @@ type
     procedure mnuRunProjectClicked(Sender: TObject);
     procedure mnuPauseProjectClicked(Sender: TObject);
     procedure mnuShowExecutionPointClicked(Sender: TObject);
     procedure mnuStepIntoProjectClicked(Sender: TObject);
     procedure mnuStepOverProjectClicked(Sender: TObject);
+    procedure mnuStepOutProjectClicked(Sender: TObject);
     procedure mnuRunToCursorProjectClicked(Sender: TObject);
     procedure mnuStopProjectClicked(Sender: TObject);
     procedure mnuRunParametersClicked(Sender: TObject);
     procedure mnuBuildFileClicked(Sender: TObject);
     procedure mnuRunFileClicked(Sender: TObject);
@@ -1755,10 +1756,11 @@ begin
   MainIDEBar.RunSpeedButton      := CreateButton(MainIDEBar.tbViewDebug, 'RunSpeedButton'     , 'menu_run'                  , @mnuRunProjectClicked, lisHintRun);
   MainIDEBar.PauseSpeedButton    := CreateButton(MainIDEBar.tbViewDebug, 'PauseSpeedButton'   , 'menu_pause'                , @mnuPauseProjectClicked, lisHintPause);
   MainIDEBar.StopSpeedButton     := CreateButton(MainIDEBar.tbViewDebug, 'StopSpeedButton'    , 'menu_stop'                 , @mnuStopProjectClicked, lisHintStop);
   MainIDEBar.StepIntoSpeedButton := CreateButton(MainIDEBar.tbViewDebug, 'StepIntoSpeedButton', 'menu_stepinto'             , @mnuStepIntoProjectClicked, lisHintStepInto);
   MainIDEBar.StepOverSpeedButton := CreateButton(MainIDEBar.tbViewDebug, 'StepOverpeedButton' , 'menu_stepover'             , @mnuStepOverProjectClicked, lisHintStepOver);
+  MainIDEBar.StepOutSpeedButton  := CreateButton(MainIDEBar.tbViewDebug, 'StepOutSpeedButton' , 'menu_stepout'              , @mnuStepOutProjectClicked, lisHintStepOut);
 
   MainIDEBar.CreatePopupMenus(OwningComponent);
 
   MainIDEBar.OpenFileSpeedBtn.Style := tbsDropDown;
   MainIDEBar.OpenFileSpeedBtn.DropDownMenu := MainIDEBar.OpenFilePopUpMenu;
@@ -3860,10 +3862,15 @@ end;
 Procedure TMainIDE.mnuStepOverProjectClicked(Sender: TObject);
 begin
   DebugBoss.DoStepOverProject;
 end;
 
+procedure TMainIDE.mnuStepOutProjectClicked(Sender: TObject);
+begin
+  DebugBoss.DoStepOutProject;
+end;
+
 Procedure TMainIDE.mnuRunToCursorProjectClicked(Sender: TObject);
 begin
   DebugBoss.DoRunToCursor;
 end;
 
diff --git a/ide/mainbar.pas b/ide/mainbar.pas
--- a/ide/mainbar.pas
+++ b/ide/mainbar.pas
@@ -69,10 +69,11 @@ type
       RunSpeedButton       : TToolButton;
       PauseSpeedButton     : TToolButton;
       StopSpeedButton      : TToolButton;
       StepIntoSpeedButton  : TToolButton;
       StepOverSpeedButton  : TToolButton;
+      StepOutSpeedButton   : TToolButton;
 
     NewUnitFormPopupMenu : TPopupMenu;
       NewUFSetDefaultMenuItem: TMenuItem;
 
     // MainMenu
@@ -253,10 +254,11 @@ type
         itmRunMenuRun: TIDEMenuCommand;
         itmRunMenuPause: TIDEMenuCommand;
         itmRunMenuShowExecutionPoint: TIDEMenuCommand;
         itmRunMenuStepInto: TIDEMenuCommand;
         itmRunMenuStepOver: TIDEMenuCommand;
+        itmRunMenuStepOut: TIDEMenuCommand;
         itmRunMenuRunToCursor: TIDEMenuCommand;
         itmRunMenuStop: TIDEMenuCommand;
         itmRunMenuRunParameters: TIDEMenuCommand;
         itmRunMenuResetDebugger: TIDEMenuCommand;
       //itmRunBuildingFile: TIDEMenuSection;
diff --git a/ide/mainbase.pas b/ide/mainbase.pas
--- a/ide/mainbase.pas
+++ b/ide/mainbase.pas
@@ -653,10 +653,11 @@ begin
     CreateMenuItem(ParentMI,itmRunMenuRun,'itmRunMenuRun',lisMenuProjectRun,'menu_run');
     CreateMenuItem(ParentMI,itmRunMenuPause,'itmRunMenuPause',lisMenuPause,'menu_pause');
     CreateMenuItem(ParentMI,itmRunMenuShowExecutionPoint,'itmRunMenuShowExecutionPoint',lisMenuShowExecutionPoint,'debugger_show_execution_point');
     CreateMenuItem(ParentMI,itmRunMenuStepInto,'itmRunMenuStepInto',lisMenuStepInto,'menu_stepinto');
     CreateMenuItem(ParentMI,itmRunMenuStepOver,'itmRunMenuStepOver',lisMenuStepOver,'menu_stepover');
+    CreateMenuItem(ParentMI,itmRunMenuStepOut,'itmRunMenuStepOut',lisMenuStepOut,'menu_stepout');
     CreateMenuItem(ParentMI,itmRunMenuRunToCursor,'itmRunMenuRunToCursor',lisMenuRunToCursor,'menu_run_cursor');
     CreateMenuItem(ParentMI,itmRunMenuStop,'itmRunMenuStop',lisMenuStop,'menu_stop');
     CreateMenuItem(ParentMI,itmRunMenuRunParameters,'itmRunMenuRunParameters',lisMenuRunParameters, 'menu_run_parameters');
     CreateMenuItem(ParentMI,itmRunMenuResetDebugger,'itmRunMenuResetDebugger',lisMenuResetDebugger, 'menu_reset_debugger');
 
@@ -950,10 +951,11 @@ begin
     itmRunMenuAbortBuild.Command:=GetCommand(ecAbortBuild);
     itmRunMenuRun.Command:=GetCommand(ecRun);
     itmRunMenuPause.Command:=GetCommand(ecPause);
     itmRunMenuStepInto.Command:=GetCommand(ecStepInto);
     itmRunMenuStepOver.Command:=GetCommand(ecStepOver);
+    itmRunMenuStepOut.Command:=GetCommand(ecStepOut);
     itmRunMenuRunToCursor.Command:=GetCommand(ecRunToCursor);
     itmRunMenuStop.Command:=GetCommand(ecStopProgram);
     itmRunMenuResetDebugger.Command:=GetCommand(ecResetDebugger);
     itmRunMenuRunParameters.Command:=GetCommand(ecRunParameters);
     itmRunMenuBuildFile.Command:=GetCommand(ecBuildFile);
diff --git a/ideintf/idecommands.pas b/ideintf/idecommands.pas
--- a/ideintf/idecommands.pas
+++ b/ideintf/idecommands.pas
@@ -230,10 +230,11 @@ const
   ecConfigBuildFile         = ecFirstLazarus + 414;
   ecInspect                 = ecFirstLazarus + 415;
   ecEvaluate                = ecFirstLazarus + 416;
   ecAddWatch                = ecFirstLazarus + 417;
   ecShowExecutionPoint      = ecFirstLazarus + 418;
+  ecStepOut                 = ecFirstLazarus + 419;
 
   // project menu
   ecNewProject              = ecFirstLazarus + 500;
   ecNewProjectFromFile      = ecFirstLazarus + 501;
   ecOpenProject             = ecFirstLazarus + 502;
diff --git a/images/laz_images.lrs b/images/laz_images.lrs
--- a/images/laz_images.lrs
+++ b/images/laz_images.lrs
@@ -7605,10 +7605,36 @@ LazarusResources.Add('menu_stepover','PN
   +#239#167#151#127#208#168'^'#227'o'#171#133'V'#179#137'f'#24'"'#188#186#130
   +#148#194#3'D'#242'7'#206#149'g9xu'#12'k'#13'.'#194#19#28'n'#26#255'|Y'#19'B`'
   +#174'<'#155#254#141#177'&0E'#184'l'#157#227#249#233'$'#166#167#167#30#221#198
   +#255#229#235'7>oE;>'#0#0#0#0'IEND'#174'B`'#130
 ]);
+LazarusResources.Add('menu_stepout','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+  +#0#0#0#1'sRGB'#0#174#206#28#233#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167
+  +#147#0#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#218#2
+  +#14#2#6#28#164#177#158#29#0#0#1#242'IDAT8'#203#149#147';kTA'#24#134#159#153
+  +'9'#231#236'& (QBP'#17#193'FD'#237#21#4#181#176#20'b%$'#193#206#31#144#248#11
+  +#20'1^~ED'#172#20','#188#20#137#196#152'tZx!'#130#149'A'#13'F'#179#168'dwg'
+  +#231#246'Yl'#142#187'k'#18#209#23#6'f'#134#247'}x?'#134'Qtiaa^'#248'Oe'#221
+  +#135#166'mr'#234#228#233#127#14#207'<'#157'F'#1#188'Xz">8'#154#173':>:B'#240
+  +#248#232'8s'#232#194#150#225#162#168#240#232#241#195'v'#3#235#26#248#224#177
+  +#174'A'#136#30#31#28'>:*'#213#190'M'#195#141#250#26#0#214#218#18#208'$'#4'G'
+  +#237'm'#193#185#225#243#0#196#24'i'#212'/n'#10'0'#198#252#9'h'#16#130#195#218
+  +'b'#131#233'o'#218#208'@$'#239'1L'#221#158'"'#198'H'#140#177#231'~lt'#140#162
+  +#168't'#0'-'#215#192'G'#135#170'V'#19' '#128#1#24#29#25#237#9#139#8'"'#130
+  +#214#186#183#193'rm'#233#139'Rz0W'#9#17#137'J)'#211'=J'#25','#149'R{'#223'j'
+  +#173#3'V'#127','#15#250#232#25#192#136#136'$!E'#173#140#185'~c'#18#17#217'0'
+  +#194#196#248#165#222#6#223#215'jT'#242#10'?'#243#207'jv'#241'^'#182#189#127
+  +#167':'#186#239'DZ7*'#239#189'*['#136#200#239#6#214'Z'#244#200#173'#'#226#130
+  +#197'G'#143'Ku='#255#238'A6'#253#250#174'>{e'#143'&'#165#148#146'x'#165'4'
+  +#229#210'Z#'#146':'#13'B'#240#4#237#240':'#195#232#12#163#29'3/'#239'3wg'#215
+  +'''}u['#14#244#1#9#168#150'#|]Y'#233#0#150'V'#222#179#127#232' &:B'#204#152
+  +'{5'#195#179'I'#251#205'^n'#237#136'!d)I'#17'B'#160'{'#4#163'U'#7'0'#127#211
+  +#15#28#159#200#223#28#216'}xh'#241#195'sf'#175'5k'#198#152#162#191#175#31'h'
+  +#255#149#238#23'('#165#148#194'Z'#219'6'#0#28#27#207'd'#239#199#225'Ukm'#21
+  +#200#215#127#170'*!['#233#23'Jg/'#196'4'#4#9#139#0#0#0#0'IEND'#174'B`'#130
+]);
 LazarusResources.Add('menu_stop','PNG',[
   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
   +#0#0#0#245'IDATx^'#197#147'AJ'#196'P'#16'D'#171#131'x'#7'='#134''''#152#149
   +'{'#239#228#210#197#220'A'#247#194',]y'#26#231#4'Iw'#255'?'#16#187#231#215
   +''''#12#146#136#204#194#134'O%'#129'WU'#157#16#153#231#25#215#204#128'+'#231
diff --git a/images/laz_images_list.txt b/images/laz_images_list.txt
--- a/images/laz_images_list.txt
+++ b/images/laz_images_list.txt
@@ -88,10 +88,11 @@ menu/menu_search_openfile_atcursor.png
 menu/menu_search_previous_bookmark.png
 menu/menu_search_replace.png
 menu/menu_select_all.png
 menu/menu_stepinto.png
 menu/menu_stepover.png
+menu/menu_stepout.png
 menu/menu_stop.png
 menu/menu_tool_check_lfm.png
 menu/menu_tool_dfm_to_lfm.png
 menu/menu_tool_diff.png
 menu/menu_tool_make_resourcestring.png
diff --git a/images/menu/menu_stepout.png b/images/menu/menu_stepout.png
new file mode 100644
index 0000000000000000000000000000000000000000..7db38e7af6fbf4dc77335315132fba14b3f86a7a
GIT binary patch
literal 626
zc$@)p0*(ENP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igJ-
z0tOtUv7Q|O00HtzL_t(I%axNmYg9oPhM$=^=j<jRC{aRC5y3`8?G*&IuoPk?B*D%f
zkoXG}F<yQ}M647nycCJVm~>irA%c}b4Mwx5WOrxh_E~I>yK55B7Y1gA_kDOjhEa5B
zVPRhQPi5VQrfqWS<mrD7&pe$*0lZjxB0e~ptvWtBLh$(LICJR2mf@nP@aXZwb_44g
z_~5awL5Ln796mZK)xJ%`jrtk@*4h%#Bm_t8ZNa(W^8mycY1A)n3NXg}31|?4!`fnl
z>2KQ5KqT)mOx>O$#z>5@=YDK-jH0M?04>+RM~A9b6Ci*A7#$hy35y6Kg4VjX!E$Zs
zi&A<pR|ye`N-5JlN*OGbQhVQOtpiqnED!qV8Ni5$Bq2qujJbYe5)s)j!o>Kc-Ui>-
zYE<$HKl9IOcJW@ey?>`Vy6;3<H!APFDqD!i?*`Ud^vJCv;)2CTk4tqu|L#FH{ravx
zdu5L%rIeC*r8MQzS|gG=4MOk)?eIFo=nSJBGcWHmcW2ipeRW$7^Z^N|mLq&!S?K_l
zR^GFJ=pZIKLd=+ZHN&$>`^{c%?T8^{DM=ARpnC+PRR=JC(+?b<$ln~;eRyc`!*gb@
zHEYJ0qQ9>nX#bV&7bvBa!dlxl02~|7Wben}Rcmb($k%_WDj{3x7fNR@#54p6ivR!s
M07*qoM6N<$f{BF-T>t<8

debugger_step_out.diff (24,287 bytes)   

Paul Ishenin

2010-02-16 04:09

manager   ~0034513

It is imposible to just apply your patch without extra work. TSVN outputs in the same format as "svn diff > mypatch.diff". Git is using something different as I see (regards png).

Flávio Etrusco

2010-02-16 08:49

developer   ~0034521

It's said the svn 1.7 will have native support for 'patch' command and will support git format. Hope it's true :-/

2010-02-16 09:21

 

dbg_ste_out_nopng.diff (17,195 bytes)   
diff -r 8319afb5696d debugger/debugger.pp
--- a/debugger/debugger.pp	Tue Feb 16 07:09:23 2010 +0100
+++ b/debugger/debugger.pp	Tue Feb 16 06:16:51 2010 -0200
@@ -57,6 +57,7 @@
     dcStop,
     dcStepOver,
     dcStepInto,
+    dcStepOut,
     dcRunTo,
     dcJumpto,
     dcBreak,
@@ -1323,6 +1324,7 @@
     procedure Stop;                                  // quit debugging
     procedure StepOver;
     procedure StepInto;
+    procedure StepOut;
     procedure RunTo(const ASource: String; const ALine: Integer);                // Executes til a certain point
     procedure JumpTo(const ASource: String; const ALine: Integer);               // No execute, only set exec point
     function  Evaluate(const AExpression: String; var AResult: String;
@@ -1370,6 +1372,7 @@
     'Stop',
     'StepOver',
     'StepInto',
+    'StepOut',
     'RunTo',
     'Jumpto',
     'Break',
@@ -1415,9 +1418,9 @@
   COMMANDMAP: array[TDBGState] of TDBGCommands = (
   {dsNone } [],
   {dsIdle } [dcEnvironment],
-  {dsStop } [dcRun, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch,
+  {dsStop } [dcRun, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto, dcBreak, dcWatch,
              dcEvaluate, dcEnvironment],
-  {dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak,
+  {dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto, dcBreak,
              dcWatch, dcLocal, dcEvaluate, dcModify, dcEnvironment, dcSetStackFrame,
              dcDisassemble],
   {dsInit } [],
@@ -1894,6 +1897,12 @@
   DebugLn('TDebugger.StepInto Class=',ClassName,' failed.');
 end;
 
+procedure TDebugger.StepOut;
+begin
+  if ReqCmd(dcStepOut, []) then exit;
+  DebugLn('TDebugger.StepOut Class=', ClassName, ' failed.');
+end;
+
 procedure TDebugger.StepOver;
 begin
   if ReqCmd(dcStepOver, []) then exit;
diff -r 8319afb5696d debugger/gdbmidebugger.pp
--- a/debugger/gdbmidebugger.pp	Tue Feb 16 07:09:23 2010 +0100
+++ b/debugger/gdbmidebugger.pp	Tue Feb 16 06:16:51 2010 -0200
@@ -143,6 +143,7 @@
     function  GDBStop: Boolean;
     function  GDBStepOver: Boolean;
     function  GDBStepInto: Boolean;
+    function  GDBStepOut: Boolean;
     function  GDBRunTo(const ASource: String; const ALine: Integer): Boolean;
     function  GDBJumpTo(const ASource: String; const ALine: Integer): Boolean;
     function  GDBDisassemble(AAddr: TDbgPtr; ABackward: Boolean; out ANextAddr: TDbgPtr;
@@ -2791,6 +2792,22 @@
   end;
 end;
 
+function TGDBMIDebugger.GDBStepOut: Boolean;
+begin
+  Result := False;
+  case State of
+    dsStop: begin
+      Result := StartDebugging('');
+    end;
+    dsPause: begin
+      Result := ExecuteCommand('-exec-finish', [cfExternal]);
+    end;
+    dsIdle: begin
+      DebugLn('[WARNING] Debugger: Unable to step out in idle state');
+    end;
+  end;
+end;
+
 function TGDBMIDebugger.GDBStepOver: Boolean;
 begin
   Result := False;
@@ -3068,7 +3085,7 @@
 
 function TGDBMIDebugger.GetSupportedCommands: TDBGCommands;
 begin
-  Result := [dcRun, dcPause, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto,
+  Result := [dcRun, dcPause, dcStop, dcStepOver, dcStepInto, dcStepOut, dcRunTo, dcJumpto,
              dcBreak, dcWatch, dcLocal, dcEvaluate, dcModify, dcEnvironment,
              dcSetStackFrame, dcDisassemble];
 end;
@@ -3782,6 +3799,7 @@
     dcStop:        Result := GDBStop;
     dcStepOver:    Result := GDBStepOver;
     dcStepInto:    Result := GDBStepInto;
+    dcStepOut:     Result := GDBStepOut;
     dcRunTo:       Result := GDBRunTo(String(AParams[0].VAnsiString), AParams[1].VInteger);
     dcJumpto:      Result := GDBJumpTo(String(AParams[0].VAnsiString), AParams[1].VInteger);
     dcEvaluate:    Result := GDBEvaluate(String(AParams[0].VAnsiString), String(AParams[1].VPointer^),TGDBType(AParams[2].VPointer^));
diff -r 8319afb5696d ide/basedebugmanager.pas
--- a/ide/basedebugmanager.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/basedebugmanager.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -105,6 +105,7 @@
     function DoShowExecutionPoint: TModalResult; virtual; abstract;
     function DoStepIntoProject: TModalResult; virtual; abstract;
     function DoStepOverProject: TModalResult; virtual; abstract;
+    function DoStepOutProject: TModalResult; virtual; abstract;
     function DoRunToCursor: TModalResult; virtual; abstract;
     function DoStopProject: TModalResult; virtual; abstract;
     procedure DoToggleCallStack; virtual; abstract;
diff -r 8319afb5696d ide/debugmanager.pas
--- a/ide/debugmanager.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/debugmanager.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -163,6 +163,7 @@
     function DoShowExecutionPoint: TModalResult; override;
     function DoStepIntoProject: TModalResult; override;
     function DoStepOverProject: TModalResult; override;
+    function DoStepOutProject: TModalResult; override;
     function DoRunToCursor: TModalResult; override;
     function DoStopProject: TModalResult; override;
     procedure DoToggleCallStack; override;
@@ -1986,6 +1987,9 @@
     StepOverSpeedButton.Enabled := DebuggerInvalid or
               (dcStepOver in FDebugger.Commands)  or (FDebugger.State = dsIdle);
     itmRunMenuStepOver.Enabled := StepOverSpeedButton.Enabled;
+    StepOutSpeedButton.Enabled := DebuggerInvalid or
+              (dcStepOut in FDebugger.Commands)  or (FDebugger.State = dsIdle);
+    itmRunMenuStepOut.Enabled := StepOutSpeedButton.Enabled;
 
     itmRunMenuRunToCursor.Enabled := DebuggerInvalid
                                      or (dcRunTo in FDebugger.Commands);
@@ -2347,6 +2351,20 @@
   Result := mrOk;
 end;
 
+function TDebugManager.DoStepOutProject: TModalResult;
+begin
+  if (MainIDE.DoInitProjectRun <> mrOK)
+  or (MainIDE.ToolStatus <> itDebugger)
+  or (FDebugger = nil) or Destroying
+  then begin
+    Result := mrAbort;
+    Exit;
+  end;
+
+  FDebugger.StepOut;
+  Result := mrOk;
+end;
+
 function TDebugManager.DoStopProject: TModalResult;
 begin
   Result := mrCancel;
@@ -2375,6 +2393,7 @@
     ecPause:             DoPauseProject;
     ecStepInto:          DoStepIntoProject;
     ecStepOver:          DoStepOverProject;
+    ecStepOut:           DoStepOutProject;
     ecRunToCursor:       DoRunToCursor;
     ecStopProgram:       DoStopProject;
     ecResetDebugger:     ResetDebugger;
diff -r 8319afb5696d ide/keymapping.pp
--- a/ide/keymapping.pp	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/keymapping.pp	Tue Feb 16 06:16:51 2010 -0200
@@ -538,6 +538,7 @@
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_F8,[],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_F8,[ssShift],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_F4,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_F2,[SSCtrl],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -959,6 +960,7 @@
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_F8,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_F8,[ssShift],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_F4,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -1562,6 +1564,7 @@
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_R,[ssMeta,ssAlt],VK_UNKNOWN,[]);
   ecStepOver: SetResult(VK_R,[ssMeta,ssShift],VK_UNKNOWN,[]);
+  ecStepOut: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecRunToCursor: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStopProgram: SetResult(VK_RETURN,[ssShift,ssMeta],VK_UNKNOWN,[]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -1725,6 +1728,7 @@
   ecShowExecutionPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
   ecStepInto: SetResult(VK_F7,[],VK_F7,[ssMeta]);
   ecStepOver: SetResult(VK_F8,[],VK_F8,[ssMeta]);
+  ecStepOut: SetResult(VK_F8,[],VK_F8,[ssShift,ssMeta]);
   ecRunToCursor: SetResult(VK_F4,[],VK_F4,[ssMeta]);
   ecStopProgram: SetResult(VK_F2,[ssCtrl],VK_F2,[ssCtrl,ssMeta]);
   ecRemoveBreakPoint: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -2078,6 +2082,7 @@
     ecShowExecutionPoint      : Result:= srkmecShowExecutionPoint;
     ecStepInto                : Result:= lisMenuStepInto;
     ecStepOver                : Result:= lisMenuStepOver;
+    ecStepOut                 : Result:= lisMenuStepOut;
     ecRunToCursor             : Result:= lisMenuRunToCursor;
     ecStopProgram             : Result:= srkmecStopProgram;
     ecResetDebugger           : Result:= srkmecResetDebugger;
@@ -2769,6 +2774,7 @@
   AddDefault(C, 'Show execution point', lisMenuShowExecutionPoint, ecShowExecutionPoint);
   AddDefault(C, 'Step into', lisMenuStepInto, ecStepInto);
   AddDefault(C, 'Step over', lisMenuStepOver, ecStepOver);
+  AddDefault(C, 'Step out', lisMenuStepOut, ecStepOut);
   AddDefault(C, 'Run to cursor', lisMenuRunToCursor, ecRunToCursor);
   AddDefault(C, 'Stop program', lisKMStopProgram, ecStopProgram);
   AddDefault(C, 'Reset debugger', lisMenuResetDebugger, ecResetDebugger);
diff -r 8319afb5696d ide/lazarusidestrconsts.pas
--- a/ide/lazarusidestrconsts.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/lazarusidestrconsts.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -334,6 +334,7 @@
   lisMenuShowExecutionPoint = 'Show execution point';
   lisMenuStepInto = 'Step into';
   lisMenuStepOver = 'Step over';
+  lisMenuStepOut = 'Step out';
   lisMenuRunToCursor = 'Run to cursor';
   lisKMStopProgram = 'Stop program';
   lisMenuStop = 'Stop';
@@ -815,7 +816,8 @@
   lisHintStop = 'Stop';
   lisHintStepInto = 'Step Into';
   lisHintStepOver = 'Step Over';
-  
+  lisHintStepOut  = 'Run until function returns';
+
   lisGPLNotice =
     '<description>'
    +'%s'
diff -r 8319afb5696d ide/main.pp
--- a/ide/main.pp	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/main.pp	Tue Feb 16 06:16:51 2010 -0200
@@ -296,6 +296,7 @@
     procedure mnuShowExecutionPointClicked(Sender: TObject);
     procedure mnuStepIntoProjectClicked(Sender: TObject);
     procedure mnuStepOverProjectClicked(Sender: TObject);
+    procedure mnuStepOutProjectClicked(Sender: TObject);
     procedure mnuRunToCursorProjectClicked(Sender: TObject);
     procedure mnuStopProjectClicked(Sender: TObject);
     procedure mnuRunParametersClicked(Sender: TObject);
@@ -1757,6 +1758,7 @@
   MainIDEBar.StopSpeedButton     := CreateButton(MainIDEBar.tbViewDebug, 'StopSpeedButton'    , 'menu_stop'                 , @mnuStopProjectClicked, lisHintStop);
   MainIDEBar.StepIntoSpeedButton := CreateButton(MainIDEBar.tbViewDebug, 'StepIntoSpeedButton', 'menu_stepinto'             , @mnuStepIntoProjectClicked, lisHintStepInto);
   MainIDEBar.StepOverSpeedButton := CreateButton(MainIDEBar.tbViewDebug, 'StepOverpeedButton' , 'menu_stepover'             , @mnuStepOverProjectClicked, lisHintStepOver);
+  MainIDEBar.StepOutSpeedButton  := CreateButton(MainIDEBar.tbViewDebug, 'StepOutSpeedButton' , 'menu_stepout'              , @mnuStepOutProjectClicked, lisHintStepOut);
 
   MainIDEBar.CreatePopupMenus(OwningComponent);
 
@@ -3862,6 +3864,11 @@
   DebugBoss.DoStepOverProject;
 end;
 
+procedure TMainIDE.mnuStepOutProjectClicked(Sender: TObject);
+begin
+  DebugBoss.DoStepOutProject;
+end;
+
 Procedure TMainIDE.mnuRunToCursorProjectClicked(Sender: TObject);
 begin
   DebugBoss.DoRunToCursor;
diff -r 8319afb5696d ide/mainbar.pas
--- a/ide/mainbar.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/mainbar.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -71,6 +71,7 @@
       StopSpeedButton      : TToolButton;
       StepIntoSpeedButton  : TToolButton;
       StepOverSpeedButton  : TToolButton;
+      StepOutSpeedButton   : TToolButton;
 
     NewUnitFormPopupMenu : TPopupMenu;
       NewUFSetDefaultMenuItem: TMenuItem;
@@ -255,6 +256,7 @@
         itmRunMenuShowExecutionPoint: TIDEMenuCommand;
         itmRunMenuStepInto: TIDEMenuCommand;
         itmRunMenuStepOver: TIDEMenuCommand;
+        itmRunMenuStepOut: TIDEMenuCommand;
         itmRunMenuRunToCursor: TIDEMenuCommand;
         itmRunMenuStop: TIDEMenuCommand;
         itmRunMenuRunParameters: TIDEMenuCommand;
diff -r 8319afb5696d ide/mainbase.pas
--- a/ide/mainbase.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ide/mainbase.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -655,6 +655,7 @@
     CreateMenuItem(ParentMI,itmRunMenuShowExecutionPoint,'itmRunMenuShowExecutionPoint',lisMenuShowExecutionPoint,'debugger_show_execution_point');
     CreateMenuItem(ParentMI,itmRunMenuStepInto,'itmRunMenuStepInto',lisMenuStepInto,'menu_stepinto');
     CreateMenuItem(ParentMI,itmRunMenuStepOver,'itmRunMenuStepOver',lisMenuStepOver,'menu_stepover');
+    CreateMenuItem(ParentMI,itmRunMenuStepOut,'itmRunMenuStepOut',lisMenuStepOut,'menu_stepout');
     CreateMenuItem(ParentMI,itmRunMenuRunToCursor,'itmRunMenuRunToCursor',lisMenuRunToCursor,'menu_run_cursor');
     CreateMenuItem(ParentMI,itmRunMenuStop,'itmRunMenuStop',lisMenuStop,'menu_stop');
     CreateMenuItem(ParentMI,itmRunMenuRunParameters,'itmRunMenuRunParameters',lisMenuRunParameters, 'menu_run_parameters');
@@ -952,6 +953,7 @@
     itmRunMenuPause.Command:=GetCommand(ecPause);
     itmRunMenuStepInto.Command:=GetCommand(ecStepInto);
     itmRunMenuStepOver.Command:=GetCommand(ecStepOver);
+    itmRunMenuStepOut.Command:=GetCommand(ecStepOut);
     itmRunMenuRunToCursor.Command:=GetCommand(ecRunToCursor);
     itmRunMenuStop.Command:=GetCommand(ecStopProgram);
     itmRunMenuResetDebugger.Command:=GetCommand(ecResetDebugger);
diff -r 8319afb5696d ideintf/idecommands.pas
--- a/ideintf/idecommands.pas	Tue Feb 16 07:09:23 2010 +0100
+++ b/ideintf/idecommands.pas	Tue Feb 16 06:16:51 2010 -0200
@@ -232,6 +232,7 @@
   ecEvaluate                = ecFirstLazarus + 416;
   ecAddWatch                = ecFirstLazarus + 417;
   ecShowExecutionPoint      = ecFirstLazarus + 418;
+  ecStepOut                 = ecFirstLazarus + 419;
 
   // project menu
   ecNewProject              = ecFirstLazarus + 500;
diff -r 8319afb5696d images/laz_images.lrs
--- a/images/laz_images.lrs	Tue Feb 16 07:09:23 2010 +0100
+++ b/images/laz_images.lrs	Tue Feb 16 06:16:51 2010 -0200
@@ -7607,6 +7607,32 @@
   +#174'<'#155#254#141#177'&0E'#184'l'#157#227#249#233'$'#166#167#167#30#221#198
   +#255#229#235'7>oE;>'#0#0#0#0'IEND'#174'B`'#130
 ]);
+LazarusResources.Add('menu_stepout','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+  +#0#0#0#1'sRGB'#0#174#206#28#233#0#0#0#6'bKGD'#0#255#0#255#0#255#160#189#167
+  +#147#0#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#0#7'tIME'#7#218#2
+  +#14#2#6#28#164#177#158#29#0#0#1#242'IDAT8'#203#149#147';kTA'#24#134#159#153
+  +'9'#231#236'& (QBP'#17#193'FD'#237#21#4#181#176#20'b%$'#193#206#31#144#248#11
+  +#20'1^~ED'#172#20','#188#20#137#196#152'tZx!'#130#149'A'#13'F'#179#168'dwg'
+  +#231#246'Yl'#142#187'k'#18#209#23#6'f'#134#247'}x?'#134'Qtiaa^'#248'Oe'#221
+  +#135#166'mr'#234#228#233#127#14#207'<'#157'F'#1#188'Xz">8'#154#173':>:B'#240
+  +#248#232'8s'#232#194#150#225#162#168#240#232#241#195'v'#3#235#26#248#224#177
+  +#174'A'#136#30#31#28'>:*'#213#190'M'#195#141#250#26#0#214#218#18#208'$'#4'G'
+  +#237'm'#193#185#225#243#0#196#24'i'#212'/n'#10'0'#198#252#9'h'#16#130#195#218
+  +'b'#131#233'o'#218#208'@$'#239'1L'#221#158'"'#198'H'#140#177#231'~lt'#140#162
+  +#168't'#0'-'#215#192'G'#135#170'V'#19' '#128#1#24#29#25#237#9#139#8'"'#130
+  +#214#186#183#193'rm'#233#139'Rz0W'#9#17#137'J)'#211'=J'#25','#149'R{'#223'j'
+  +#173#3'V'#127','#15#250#232#25#192#136#136'$!E'#173#140#185'~c'#18#17#217'0'
+  +#194#196#248#165#222#6#223#215'jT'#242#10'?'#243#207'jv'#241'^'#182#189#127
+  +#167':'#186#239'DZ7*'#239#189'*['#136#200#239#6#214'Z'#244#200#173'#'#226#130
+  +#197'G'#143'Ku='#255#238'A6'#253#250#174'>{e'#143'&'#165#148#146'x'#165'4'
+  +#229#210'Z#'#146':'#13'B'#240#4#237#240':'#195#232#12#163#29'3/'#239'3wg'#215
+  +'''}u['#14#244#1#9#168#150'#|]Y'#233#0#150'V'#222#179#127#232' &:B'#204#152
+  +'{5'#195#179'I'#251#205'^n'#237#136'!d)I'#17'B'#160'{'#4#163'U'#7'0'#127#211
+  +#15#28#159#200#223#28#216'}xh'#241#195'sf'#175'5k'#198#152#162#191#175#31'h'
+  +#255#149#238#23'('#165#148#194'Z'#219'6'#0#28#27#207'd'#239#199#225'Ukm'#21
+  +#200#215#127#170'*!['#233#23'Jg/'#196'4'#4#9#139#0#0#0#0'IEND'#174'B`'#130
+]);
 LazarusResources.Add('menu_stop','PNG',[
   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
   +#0#0#0#245'IDATx^'#197#147'AJ'#196'P'#16'D'#171#131'x'#7'='#134''''#152#149
diff -r 8319afb5696d images/laz_images_list.txt
--- a/images/laz_images_list.txt	Tue Feb 16 07:09:23 2010 +0100
+++ b/images/laz_images_list.txt	Tue Feb 16 06:16:51 2010 -0200
@@ -90,6 +90,7 @@
 menu/menu_select_all.png
 menu/menu_stepinto.png
 menu/menu_stepover.png
+menu/menu_stepout.png
 menu/menu_stop.png
 menu/menu_tool_check_lfm.png
 menu/menu_tool_dfm_to_lfm.png
diff -r 8319afb5696d images/menu/menu_stepout.png
Binary file images/menu/menu_stepout.png has changed
dbg_ste_out_nopng.diff (17,195 bytes)   

2010-02-16 09:23

 

menu_stepout.png (626 bytes)   
menu_stepout.png (626 bytes)   

Paul Ishenin

2010-02-16 13:36

manager   ~0034529

dbg_ste_out_nopng.diff is also not usable by tortoise svn. seems format is different from "svn diff". I will try to apply it manually.

Paul Ishenin

2010-02-16 14:06

manager   ~0034531

Thanks, applied. I modified your patch since event handler was not attached to the menu item and OSX key combination was not set.

Please close if ok.

Issue History

Date Modified Username Field Change
2010-02-14 03:51 Flávio Etrusco New Issue
2010-02-14 03:51 Flávio Etrusco Status new => assigned
2010-02-14 03:51 Flávio Etrusco Assigned To => Marc Weustink
2010-02-14 04:00 Flávio Etrusco Note Added: 0034458
2010-02-15 09:15 Paul Ishenin Note Added: 0034484
2010-02-15 17:41 Flávio Etrusco Note Added: 0034505
2010-02-15 17:42 Flávio Etrusco File Added: debugger_step_out.diff
2010-02-15 21:11 Flávio Etrusco Note Edited: 0034505
2010-02-16 04:09 Paul Ishenin Note Added: 0034513
2010-02-16 08:49 Flávio Etrusco Note Added: 0034521
2010-02-16 09:21 Flávio Etrusco File Added: dbg_ste_out_nopng.diff
2010-02-16 09:23 Flávio Etrusco File Added: menu_stepout.png
2010-02-16 13:36 Paul Ishenin Note Added: 0034529
2010-02-16 14:06 Paul Ishenin Fixed in Revision => 23717
2010-02-16 14:06 Paul Ishenin LazTarget => -
2010-02-16 14:06 Paul Ishenin Status assigned => resolved
2010-02-16 14:06 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-02-16 14:06 Paul Ishenin Resolution open => fixed
2010-02-16 14:06 Paul Ishenin Note Added: 0034531
2010-03-30 10:15 Flávio Etrusco Status resolved => closed