View Issue Details

IDProjectCategoryView StatusLast Update
0001920LazarusIDEpublic2010-03-30 10:15
ReporterFlávio Etrusco Assigned ToPaul Ishenin  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.9.13 (SVN) 
Fixed in Version0.9.29 (SVN) 
Summary0001920: Please add "Find Execution Point" to the Debug menu
DescriptionI know selecting the topmost entry in the Stack Window attains the same result, but it would be nice to have this menu command nevertheless :-)
And people comming from Delphi will miss it ;-)
TagsNo tags attached.
Fixed in Revision23567
LazTarget-
WidgetsetGTK
Attached Files

Activities

2010-01-27 17:48

 

ShowExecutionPoint.diff (7,328 bytes)   
diff -r 8795437d17c6 ide/basedebugmanager.pas
--- a/ide/basedebugmanager.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/basedebugmanager.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -101,8 +101,9 @@
 
     function InitDebugger: Boolean; virtual; abstract;
     
     function DoPauseProject: TModalResult; virtual; abstract;
+    function DoShowExecutionPoint: TModalResult; virtual; abstract;
     function DoStepIntoProject: TModalResult; virtual; abstract;
     function DoStepOverProject: TModalResult; virtual; abstract;
     function DoRunToCursor: TModalResult; virtual; abstract;
     function DoStopProject: TModalResult; virtual; abstract;
diff -r 8795437d17c6 ide/debugmanager.pas
--- a/ide/debugmanager.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/debugmanager.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -159,8 +159,9 @@
 
     function InitDebugger: Boolean; override;
 
     function DoPauseProject: TModalResult; override;
+    function DoShowExecutionPoint: TModalResult; override;
     function DoStepIntoProject: TModalResult; override;
     function DoStepOverProject: TModalResult; override;
     function DoRunToCursor: TModalResult; override;
     function DoStopProject: TModalResult; override;
@@ -1977,8 +1978,9 @@
     itmRunMenuRun.Enabled := RunSpeedButton.Enabled;
     PauseSpeedButton.Enabled := (not DebuggerInvalid)
                                 and (dcPause in FDebugger.Commands);
     itmRunMenuPause.Enabled := PauseSpeedButton.Enabled;
+    itmRunMenuShowExecutionPoint.Enabled := (not DebuggerInvalid) and (FDebugger.State = dsPause);
     StepIntoSpeedButton.Enabled := DebuggerInvalid
             or (dcStepInto in FDebugger.Commands) or (FDebugger.State = dsIdle);
     itmRunMenuStepInto.Enabled := StepIntoSpeedButton.Enabled;
     StepOverSpeedButton.Enabled := DebuggerInvalid or
@@ -2301,8 +2303,22 @@
   FDebugger.Pause;
   Result := mrOk;
 end;
 
+function TDebugManager.DoShowExecutionPoint: TModalResult;
+var
+  DummyLocation: TDBGLocationRec;
+begin
+  Result := mrCancel;
+  if (MainIDE.ToolStatus <> itDebugger)
+  or (FDebugger = nil) or Destroying
+  then Exit;
+
+  DummyLocation.SrcLine := 0;
+  DebuggerCurrentLine(FDebugger, DummyLocation);
+  Result := mrOk;
+end;
+
 function TDebugManager.DoStepIntoProject: TModalResult;
 begin
   if (MainIDE.DoInitProjectRun <> mrOK)
   or (MainIDE.ToolStatus <> itDebugger)
diff -r 8795437d17c6 ide/keymapping.pp
--- a/ide/keymapping.pp	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/keymapping.pp	Wed Jan 27 13:37:10 2010 -0300
@@ -2760,8 +2760,9 @@
     ecQuickCompile);
   AddDefault(C, 'Abort building', lisKMAbortBuilding, ecAbortBuild);
   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, 'Run to cursor', lisMenuRunToCursor, ecRunToCursor);
   AddDefault(C, 'Stop program', lisKMStopProgram, ecStopProgram);
diff -r 8795437d17c6 ide/lazarusidestrconsts.pas
--- a/ide/lazarusidestrconsts.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/lazarusidestrconsts.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -330,8 +330,9 @@
   lisBFWorkingDirectoryLeaveEmptyForFilePath2 = 'Working Directory (Leave '
     +'empty for file path)';
   lisBFRunCommand = 'Run Command';
   lisMenuPause = 'Pause';
+  lisMenuShowExecutionPoint = 'Show execution point';
   lisMenuStepInto = 'Step into';
   lisMenuStepOver = 'Step over';
   lisMenuRunToCursor = 'Run to cursor';
   lisKMStopProgram = 'Stop program';
diff -r 8795437d17c6 ide/main.pp
--- a/ide/main.pp	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/main.pp	Wed Jan 27 13:37:10 2010 -0300
@@ -292,8 +292,9 @@
     procedure mnuQuickCompileProjectClicked(Sender: TObject);
     procedure mnuAbortBuildProjectClicked(Sender: TObject);
     procedure mnuRunProjectClicked(Sender: TObject);
     procedure mnuPauseProjectClicked(Sender: TObject);
+    procedure mnuShowExecutionPointClicked(Sender: TObject);
     procedure mnuStepIntoProjectClicked(Sender: TObject);
     procedure mnuStepOverProjectClicked(Sender: TObject);
     procedure mnuRunToCursorProjectClicked(Sender: TObject);
     procedure mnuStopProjectClicked(Sender: TObject);
@@ -2412,8 +2413,10 @@
     itmRunMenuAbortBuild.OnClick := @mnuAbortBuildProjectClicked;
     itmRunMenuRun.OnClick := @mnuRunProjectClicked;
     itmRunMenuPause.Enabled := False;
     itmRunMenuPause.OnClick := @mnuPauseProjectClicked;
+    itmRunMenuShowExecutionPoint.Enabled := False;
+    itmRunMenuShowExecutionPoint.OnClick := @mnuShowExecutionPointClicked;
     itmRunMenuStepInto.OnClick := @mnuStepIntoProjectClicked;
     itmRunMenuStepOver.OnClick := @mnuStepOverProjectClicked;
     itmRunMenuRunToCursor.OnClick := @mnuRunToCursorProjectClicked;
     itmRunMenuStop.Enabled := False;
@@ -3843,8 +3846,13 @@
 begin
   DebugBoss.DoPauseProject;
 end;
 
+Procedure TMainIDE.mnuShowExecutionPointClicked(Sender: TObject);
+begin
+  DebugBoss.DoShowExecutionPoint;
+end;
+
 Procedure TMainIDE.mnuStepIntoProjectClicked(Sender: TObject);
 begin
   DebugBoss.DoStepIntoProject;
 end;
diff -r 8795437d17c6 ide/mainbar.pas
--- a/ide/mainbar.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/mainbar.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -251,8 +251,9 @@
         itmRunMenuAbortBuild: TIDEMenuCommand;
       //itmRunnning: TIDEMenuSection;
         itmRunMenuRun: TIDEMenuCommand;
         itmRunMenuPause: TIDEMenuCommand;
+        itmRunMenuShowExecutionPoint: TIDEMenuCommand;
         itmRunMenuStepInto: TIDEMenuCommand;
         itmRunMenuStepOver: TIDEMenuCommand;
         itmRunMenuRunToCursor: TIDEMenuCommand;
         itmRunMenuStop: TIDEMenuCommand;
diff -r 8795437d17c6 ide/mainbase.pas
--- a/ide/mainbase.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ide/mainbase.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -651,8 +651,9 @@
     ParentMI:=itmRunnning;
 
     CreateMenuItem(ParentMI,itmRunMenuRun,'itmRunMenuRun',lisMenuProjectRun,'menu_run');
     CreateMenuItem(ParentMI,itmRunMenuPause,'itmRunMenuPause',lisMenuPause,'menu_pause');
+    CreateMenuItem(ParentMI,itmRunMenuShowExecutionPoint,'itmRunMenuShowExecutionPoint',lisMenuShowExecutionPoint,''{'menu_show_execution_point'});
     CreateMenuItem(ParentMI,itmRunMenuStepInto,'itmRunMenuStepInto',lisMenuStepInto,'menu_stepinto');
     CreateMenuItem(ParentMI,itmRunMenuStepOver,'itmRunMenuStepOver',lisMenuStepOver,'menu_stepover');
     CreateMenuItem(ParentMI,itmRunMenuRunToCursor,'itmRunMenuRunToCursor',lisMenuRunToCursor,'menu_run_cursor');
     CreateMenuItem(ParentMI,itmRunMenuStop,'itmRunMenuStop',lisMenuStop,'menu_stop');
diff -r 8795437d17c6 ideintf/idecommands.pas
--- a/ideintf/idecommands.pas	Wed Jan 27 14:14:34 2010 +0100
+++ b/ideintf/idecommands.pas	Wed Jan 27 13:37:10 2010 -0300
@@ -230,8 +230,9 @@
   ecConfigBuildFile         = ecFirstLazarus + 414;
   ecInspect                 = ecFirstLazarus + 415;
   ecEvaluate                = ecFirstLazarus + 416;
   ecAddWatch                = ecFirstLazarus + 417;
+  ecShowExecutionPoint      = ecFirstLazarus + 418;
 
   // project menu
   ecNewProject              = ecFirstLazarus + 500;
   ecNewProjectFromFile      = ecFirstLazarus + 501;
ShowExecutionPoint.diff (7,328 bytes)   

Flávio Etrusco

2010-01-27 17:49

developer   ~0033924

S***. I intended to add some notes on the patch but this "nice" Mantis interface lost it.

Flávio Etrusco

2010-01-27 17:50

developer   ~0033925

Based on svn r23572.

Paul Ishenin

2010-01-28 04:53

manager   ~0033939

Thanks, applied with small additions.

Please test and close if ok.

Flávio Etrusco

2010-01-28 15:36

developer   ~0033962

Thanks, Paul!
Actually I thought it would need some comes-and-goes before inclusion - like some comments or refactor to extract a method from DebuggerCurrentLine and document some of its promises and preconditions, but hey! ;)

Issue History

Date Modified Username Field Change
2006-03-21 02:25 Flávio Etrusco New Issue
2006-03-21 02:25 Flávio Etrusco Widgetset => GTK
2006-03-21 06:47 Vincent Snijders Target => post 1.0
2006-03-21 06:47 Vincent Snijders Status new => acknowledged
2010-01-27 17:48 Flávio Etrusco File Added: ShowExecutionPoint.diff
2010-01-27 17:49 Flávio Etrusco Note Added: 0033924
2010-01-27 17:50 Flávio Etrusco Note Added: 0033925
2010-01-28 04:53 Paul Ishenin Fixed in Revision => 23567
2010-01-28 04:53 Paul Ishenin LazTarget post 1.0 => -
2010-01-28 04:53 Paul Ishenin Status acknowledged => resolved
2010-01-28 04:53 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-01-28 04:53 Paul Ishenin Resolution open => fixed
2010-01-28 04:53 Paul Ishenin Assigned To => Paul Ishenin
2010-01-28 04:53 Paul Ishenin Note Added: 0033939
2010-01-28 15:36 Flávio Etrusco Note Added: 0033962
2010-03-30 10:15 Flávio Etrusco Status resolved => closed