~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to ide/basedebugmanager.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{  $Id: basedebugmanager.pas 28730 2010-12-16 18:56:37Z martin $  }
 
1
{  $Id: basedebugmanager.pas 40307 2013-02-13 19:20:51Z martin $  }
2
2
{
3
3
 /***************************************************************************
4
4
                         basedebugmanager.pp
41
41
  MemCheck,
42
42
{$ENDIF}
43
43
  Classes, SysUtils, Forms, Project, SourceMarks, Debugger, ProjectDefs,
44
 
  Laz_XMLCfg, IDEOptionsIntf, LazarusIDEStrConsts;
 
44
  IDEOptionsIntf, LazarusIDEStrConsts, Laz2_XMLCfg;
45
45
 
46
46
type
47
47
  TDebugDialogType = (
54
54
    ddtEvaluate,
55
55
    ddtRegisters,
56
56
    ddtAssembler,
57
 
    ddtInspect
58
 
    );
 
57
    ddtInspect,
 
58
    ddtPseudoTerminal,
 
59
    ddtThreads,
 
60
    ddtHistory
 
61
    );
 
62
 
 
63
const
 
64
  // used as ID for layout storage.
 
65
  // Do not change. Do not translate
 
66
  DebugDialogNames: array [TDebugDialogType] of string = (
 
67
    'DbgOutput',
 
68
    'DbgEvents',
 
69
    'BreakPoints',
 
70
    'Watches',
 
71
    'Locals',
 
72
    'CallStack',
 
73
    'EvaluateModify',
 
74
    'Registers',
 
75
    'Assembler',
 
76
    'Inspect',
 
77
    'PseudoTerminal',
 
78
    'Threads',
 
79
    'DbgHistory'
 
80
    );
 
81
 
 
82
type
59
83
 
60
84
  { TBaseDebugManager }
61
85
  
81
105
    function GetDebuggerClass(const AIndex: Integer): TDebuggerClass;
82
106
  protected
83
107
    FDestroying: boolean;
84
 
    FCallStack: TIDECallStack;
 
108
    FCallStack: TCallStackMonitor;
85
109
    FDisassembler: TIDEDisassembler;
86
110
    FExceptions: TIDEExceptions;
87
111
    FSignals: TIDESignals;
88
112
    FBreakPoints: TIDEBreakPoints;
89
113
    FBreakPointGroups: TIDEBreakPointGroups;
90
 
    FLocals: TIDELocals;
 
114
    FLocals: TLocalsMonitor;
91
115
    FLineInfo: TIDELineInfo;
92
 
    FWatches: TIDEWatches;
 
116
    FWatches: TWatchesMonitor;
 
117
    FThreads: TThreadsMonitor;
93
118
    FRegisters: TIDERegisters;
 
119
    FSnapshots: TSnapshotManager;
94
120
    FManagerStates: TDebugManagerStates;
95
121
    function  FindDebuggerClass(const Astring: String): TDebuggerClass;
96
122
    function  GetState: TDBGState; virtual; abstract;
106
132
    procedure SetupMainBarShortCuts; virtual; abstract;
107
133
    procedure SetupSourceMenuShortCuts; virtual; abstract;
108
134
    procedure UpdateButtonsAndMenuItems; virtual; abstract;
 
135
    procedure UpdateToolStatus; virtual; abstract;
109
136
 
110
137
    procedure LoadProjectSpecificInfo(XMLConfig: TXMLConfig;
111
138
                                      Merge: boolean); virtual; abstract;
128
155
    function DoRunToCursor: TModalResult; virtual; abstract;
129
156
    function DoStopProject: TModalResult; virtual; abstract;
130
157
    procedure DoToggleCallStack; virtual; abstract;
 
158
    procedure DoSendConsoleInput(AText: String); virtual; abstract;
131
159
    procedure ProcessCommand(Command: word; var Handled: boolean); virtual; abstract;
132
160
 
133
161
    procedure LockCommandProcessing; virtual; abstract;
138
166
    procedure EndDebugging; virtual; abstract;
139
167
 
140
168
    function Evaluate(const AExpression: String; var AResult: String;
141
 
                     var ATypeInfo: TDBGType): Boolean; virtual; abstract; // Evaluates the given expression, returns true if valid
 
169
                      var ATypeInfo: TDBGType;
 
170
                      EvalFlags: TDBGEvaluateFlags = []): Boolean; virtual; abstract; // Evaluates the given expression, returns true if valid
142
171
    function Modify(const AExpression: String; const ANewValue: String): Boolean; virtual; abstract; // Modify the given expression, returns true if valid
143
172
 
 
173
    function GetFullFilename(const AUnitinfo: TDebuggerUnitInfo;
 
174
                             out Filename: string; AskUserIfNotFound: Boolean): Boolean; virtual; abstract;
144
175
    function GetFullFilename(var Filename: string; AskUserIfNotFound: Boolean): Boolean; virtual; abstract;
 
176
 
 
177
    procedure EvaluateModify(const AExpression: String); virtual; abstract;
145
178
    procedure Inspect(const AExpression: String); virtual; abstract;
146
179
 
147
180
    function DoCreateBreakPoint(const AFilename: string; ALine: integer;
148
181
                                WarnIfNoDebugger: boolean): TModalResult; virtual; abstract;
 
182
    function DoCreateBreakPoint(const AFilename: string; ALine: integer;
 
183
                                WarnIfNoDebugger: boolean;
 
184
                                out ABrkPoint: TIDEBreakPoint): TModalResult; virtual; abstract;
 
185
    function DoCreateBreakPoint(const AnAddr: TDBGPtr;
 
186
                                WarnIfNoDebugger: boolean;
 
187
                                out ABrkPoint: TIDEBreakPoint): TModalResult; virtual; abstract;
149
188
    function DoDeleteBreakPoint(const AFilename: string; ALine: integer
150
189
                                ): TModalResult; virtual; abstract;
151
190
    function DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
152
191
                                     ): TModalResult; virtual; abstract;
153
192
 
154
193
    function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract;
155
 
    function ShowWatchProperties(const AWatch: TIDEWatch; AWatchExpression: String = ''): TModalresult; virtual; abstract;
 
194
    function ShowWatchProperties(const AWatch: TCurrentWatch; AWatchExpression: String = ''): TModalresult; virtual; abstract;
156
195
 
 
196
    // Dialog routines
 
197
    procedure CreateDebugDialog(Sender: TObject; aFormName: string;
 
198
                          var AForm: TCustomForm; DoDisableAutoSizing: boolean); virtual;
157
199
    procedure ViewDebugDialog(const ADialogType: TDebugDialogType;
158
200
                              BringToFront: Boolean = True; Show: Boolean = true;
159
201
                              DoDisableAutoSizing: boolean = false); virtual; abstract;
 
202
    procedure ViewDisassembler(AnAddr: TDBGPtr;
 
203
                              BringToFront: Boolean = True; Show: Boolean = true;
 
204
                              DoDisableAutoSizing: boolean = false); virtual; abstract;
160
205
  public
161
206
    property Commands: TDBGCommands read GetCommands;  // All current available commands of the debugger
162
207
    property Debuggers[const AIndex: Integer]: TDebuggerClass read GetDebuggerClass;
166
211
    property BreakPoints: TIDEBreakPoints read FBreakpoints;   // A list of breakpoints for the current project
167
212
    property BreakPointGroups: TIDEBreakPointGroups read FBreakPointGroups;
168
213
    property Exceptions: TIDEExceptions read FExceptions;      // A list of exceptions we should ignore
169
 
    property CallStack: TIDECallStack read FCallStack;
 
214
    property CallStack: TCallStackMonitor read FCallStack;
170
215
    property Disassembler: TIDEDisassembler read FDisassembler;
171
 
    property Locals: TIDELocals read FLocals;
 
216
    property Locals: TLocalsMonitor read FLocals;
172
217
    property LineInfo: TIDELineInfo read FLineInfo;
173
218
    property Registers: TIDERegisters read FRegisters;
174
219
    property Signals: TIDESignals read FSignals;               // A list of actions for signals we know of
175
 
    property Watches: TIDEWatches read FWatches;
 
220
    property Watches: TWatchesMonitor read FWatches;
 
221
    property Threads: TThreadsMonitor read FThreads;
 
222
    property Snapshots: TSnapshotManager read FSnapshots;
176
223
    {$IFDEF DBG_WITH_DEBUGGER_DEBUG}
177
224
    property Debugger: TDebugger read GetDebugger;
178
225
    {$ENDIF}
182
229
 
183
230
var
184
231
  DebugBoss: TBaseDebugManager;
 
232
  DebuggerOptions: TDebuggerOptions = nil;
185
233
 
186
234
implementation
187
235
 
211
259
  else Result := TDebuggerClass(MDebuggerClasses.Objects[idx]);
212
260
end;
213
261
 
 
262
procedure TBaseDebugManager.CreateDebugDialog(Sender: TObject; aFormName: string;
 
263
  var AForm: TCustomForm; DoDisableAutoSizing: boolean);
 
264
begin
 
265
  //
 
266
end;
 
267
 
214
268
function TBaseDebugManager.GetDebuggerClass(const AIndex: Integer): TDebuggerClass;
215
269
begin
216
270
  Result := TDebuggerClass(MDebuggerClasses.Objects[AIndex]);
225
279
 
226
280
class function TDebuggerOptions.GetInstance: TAbstractIDEOptions;
227
281
begin
228
 
  Result := nil;
 
282
  Result := DebuggerOptions;
229
283
end;
230
284
 
231
285
initialization