Merged revision(s) 42832 #dbf7469826, 42886 #0a0a90e99b, 42909-42910 #88103f57a5-#88103f57a5, 42912-42913 #c5f9e05da6-#c5f9e05da6, 42917 #5efe201a20 from trunk:

Propedits: remove a test version of TCoolBarControlPropertyEditor.CheckNewValue
........
IDEIntf: Change TComponentPropertyEditor back to original behaviour so it lists all components from all forms.
........
IDE: add PowerPc processor types to selection list.
........
Converter: Define PUREPASCAL for units during conversion when simulate Delphi defines is set.
........
lcl: dbgrids: fixed memleak of KeyBookmark, patch from Luca Olivetti, bug #24412
........
Debugger: reset thread on start/init
........
Debugger: reset thread on start/init (rev 42913 #b49550e81b also did reset during run / fixed)
........

git-svn-id: branches/fixes_1_2@42933 -
This commit is contained in:
martin 2013-09-25 12:48:27 +00:00
parent 3a696e74d8
commit ced808e8cd
6 changed files with 72 additions and 33 deletions

View File

@ -620,12 +620,12 @@ type
procedure SetValue(const NewValue: ansistring); override;
end;
{ TComponentPropertyEditor
The default editor for TComponents. It allows the user to set the value of this
{ TComponentOneFormPropertyEditor
An editor for TComponents. It allows the user to set the value of this
property to point to a component in the same form that is type compatible
with the property being edited (e.g. the ActiveControl property). }
TComponentPropertyEditor = class(TPersistentPropertyEditor)
TComponentOneFormPropertyEditor = class(TPersistentPropertyEditor)
private
fIgnoreClass: TControlClass;
public
@ -635,19 +635,17 @@ type
{ TCoolBarControlPropertyEditor }
TCoolBarControlPropertyEditor = class(TComponentPropertyEditor)
protected
function CheckNewValue(APersistent: TPersistent): boolean; override;
TCoolBarControlPropertyEditor = class(TComponentOneFormPropertyEditor)
public
constructor Create(Hook: TPropertyEditorHook; APropCount: Integer); override;
end;
{ TComponentAllPropertyEditor
The default editor for TComponents. It allows the user to set the value of this
property to point to a component in any form in the project (?) that is
{ TComponentPropertyEditor
The default editor for TComponents. It allows the user to set the value of
this property to point to a component in any form in the project that is
type compatible with the property being edited. }
TComponentAllPropertyEditor = class(TPersistentPropertyEditor)
TComponentPropertyEditor = class(TPersistentPropertyEditor)
protected
function GetComponentReference: TComponent; virtual;
public
@ -660,7 +658,7 @@ type
a component on the form (or via form linking) that is type compatible
with the property being edited. }
TInterfacePropertyEditor = class(TComponentAllPropertyEditor)
TInterfacePropertyEditor = class(TComponentPropertyEditor)
private
protected
function GetComponent(const AInterface: IInterface): TComponent;
@ -674,7 +672,7 @@ type
{ TNoteBookActiveControlPropertyEditor }
TNoteBookActiveControlPropertyEditor = class(TComponentAllPropertyEditor)
TNoteBookActiveControlPropertyEditor = class(TComponentPropertyEditor)
protected
function CheckNewValue(APersistent: TPersistent): boolean; override;
public
@ -4344,9 +4342,9 @@ begin
end;
end;
{ TComponentPropertyEditor }
{ TComponentOneFormPropertyEditor }
function TComponentPropertyEditor.AllEqual: Boolean;
function TComponentOneFormPropertyEditor.AllEqual: Boolean;
var
AComponent: TComponent;
begin
@ -4357,7 +4355,7 @@ begin
Result:=csDesigning in AComponent.ComponentState;
end;
procedure TComponentPropertyEditor.GetValues(Proc: TGetStrProc);
procedure TComponentOneFormPropertyEditor.GetValues(Proc: TGetStrProc);
procedure TraverseComponents(Root: TComponent);
var
@ -4382,20 +4380,14 @@ begin
fIgnoreClass := TCustomCoolBar;
end;
function TCoolBarControlPropertyEditor.CheckNewValue(APersistent: TPersistent): boolean;
begin
Result:=false;
raise Exception.Create('TCoolBarControlPropertyEditor.CheckNewValue is called after all!');
end;
{ TComponentPropertyEditor }
{ TComponentAllPropertyEditor }
function TComponentAllPropertyEditor.GetComponentReference: TComponent;
function TComponentPropertyEditor.GetComponentReference: TComponent;
begin
Result := TComponent(GetObjectValue);
end;
function TComponentAllPropertyEditor.AllEqual: Boolean;
function TComponentPropertyEditor.AllEqual: Boolean;
var
AComponent: TComponent;
begin
@ -6701,8 +6693,8 @@ begin
// nil,'',TTimePropertyEditor);
RegisterPropertyEditor(TypeInfo(TDateTime), nil, '', TDateTimePropertyEditor);
RegisterPropertyEditor(TypeInfo(TCursor), nil, '', TCursorPropertyEditor);
RegisterPropertyEditor(TypeInfo(TComponent), nil, '', TComponentAllPropertyEditor);
RegisterPropertyEditor(TypeInfo(TComponent), nil, 'ActiveControl', TComponentPropertyEditor);
RegisterPropertyEditor(TypeInfo(TComponent), nil, '', TComponentPropertyEditor);
RegisterPropertyEditor(TypeInfo(TComponent), nil, 'ActiveControl', TComponentOneFormPropertyEditor);
RegisterPropertyEditor(TypeInfo(TControl), TCoolBand, 'Control', TCoolBarControlPropertyEditor);
RegisterPropertyEditor(TypeInfo(TCollection), nil, '', TCollectionPropertyEditor);
RegisterPropertyEditor(TypeInfo(AnsiString), TFileDialog, 'Filter', TFileDlgFilterProperty);

View File

@ -1319,7 +1319,8 @@ begin
// "Borland" and "Ver150" are defined by Delphi7.
// "Delphi7" and "Compiler6_Up" are defined by Jedi library based on other settings.
// They are needed because Jedi.inc undefines "Borland" when "FPC" is defined. Nuts.
s:='-dBorland -dVer150 -dDelphi7 -dCompiler6_Up';
// PUREPASCAL is defined by some code to not use x86 assembly code.
s:='-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL';
Options.CustomOptions:=s;
fSettings.AddLogLine(Format(lisConvDelphiAddedCustomOptionDefines, [s]));
end;

View File

@ -2272,6 +2272,7 @@ type
protected
procedure ChangeCurrentThread({%H-}ANewId: Integer); virtual;
procedure RequestMasterData; virtual;
procedure DoStateChange(const AOldState: TDBGState); override;
procedure DoStateEnterPause; override;
procedure DoStateLeavePause; override;
procedure DoStateLeavePauseClean; override;
@ -5816,6 +5817,13 @@ begin
//
end;
procedure TThreadsSupplier.DoStateChange(const AOldState: TDBGState);
begin
if (Debugger.State = dsStop) and (CurrentThreads <> nil) then
CurrentThreads.Clear;
inherited DoStateChange(AOldState);
end;
procedure TThreadsSupplier.DoStateEnterPause;
begin
if (CurrentThreads = nil) then Exit;

View File

@ -7192,6 +7192,8 @@ begin
if (State = dsError) and (DebugProcessRunning) then begin
FCurrentStackFrameValid := False;
FCurrentThreadIdValid := False;
FCurrentThreadId := 0;
FCurrentStackFrame := 0;
SendCmdLn('kill'); // try to kill the debugged process. bypass all queues.
DebugProcess.Terminate(0);
end;
@ -7210,6 +7212,12 @@ end;
procedure TGDBMIDebugger.DoBeforeState(const OldState: TDBGState);
begin
if State in [dsStop] then begin
FCurrentStackFrameValid := False;
FCurrentThreadIdValid := False;
FCurrentThreadId := 0;
FCurrentStackFrame := 0;
end;
inherited DoBeforeState(OldState);
Threads.CurrentThreads.CurrentThreadId := FCurrentThreadId; // TODO: Works only because CurrentThreadId is always valid
end;

View File

@ -231,6 +231,14 @@ var
aList.Add('ATHLON64');
end;
procedure PowerPc(aList: TStrings);
begin
aList.Add('604');
aList.Add('750');
aList.Add('7400');
aList.Add('970');
end;
procedure Sparc(aList: TStrings);
begin
aList.Add('SPARC V7');
@ -271,7 +279,7 @@ begin
'arm' : Arm(TargetProcComboBox.Items);
'i386' : Intel_i386(TargetProcComboBox.Items);
'm68k' : begin end;
'powerpc': begin end;
'powerpc': PowerPc(TargetProcComboBox.Items);
'sparc' : Sparc(TargetProcComboBox.Items);
'x86_64' : Intel_x86_64(TargetProcComboBox.Items);
'mipsel' : Mips(TargetProcComboBox.Items);

View File

@ -1099,7 +1099,10 @@ begin
if MultiSel and not (dgMultiSelect in FOptions) then begin
FSelectedRows.Clear;
FKeyBookmark:=nil;
if FKeyBookmark<>nil then begin
FDatalink.DataSet.FreeBookmark(FKeyBookmark);
FKeyBookmark:=nil;
end;
end;
EndLayout;
@ -1765,6 +1768,10 @@ procedure TCustomDBGrid.LinkActive(Value: Boolean);
begin
if not Value then begin
FSelectedRows.Clear;
if FKeyBookmark<>nil then begin
FDatalink.DataSet.FreeBookmark(FKeyBookmark);
FKeyBookmark:=nil;
end;
RemoveAutomaticColumns;
end;
LayoutChanged;
@ -1985,6 +1992,7 @@ var
OnKeyDown(Self, Key, Shift);
{$ifdef dbgGrid}DebugLn('DoOnKeyDown FIN');{$endif}
end;
{$ifdef dbgGrid}
function OperToStr(AOper: TOperation): string;
begin
@ -1997,6 +2005,7 @@ var
end;
end;
{$endif}
procedure DoOperation(AOper: TOperation; Arg: Integer = 0);
begin
{$IfDef dbgGrid}DebugLn('KeyDown.DoOperation(%s,%d) INIT',[OperToStr(AOper),arg]);{$Endif}
@ -2020,6 +2029,7 @@ var
GridFlags := GridFlags - [gfEditingDone];
{$IfDef dbgGrid}DebugLn('KeyDown.DoOperation(%s,%d) DONE',[OperToStr(AOper),arg]);{$Endif}
end;
procedure SelectNext(const AStart,ADown:Boolean);
var
N: Integer;
@ -2044,7 +2054,8 @@ var
exit;
end;
FKeySign := 0;
end;
end else
FDatalink.DataSet.FreeBookmark(CurBookmark);
n := 4*Ord(FKeySign>=0) + 2*Ord(ADown) + 1*Ord(AStart);
case n of
@ -2060,6 +2071,7 @@ var
end else
ClearSelection(true);
end;
function doVKDown: boolean;
begin
{$ifdef dbgGrid}DebugLn('DoVKDown INIT');{$endif}
@ -2083,6 +2095,7 @@ var
end;
{$ifdef dbgGrid}DebugLn('DoVKDown FIN');{$endif}
end;
function DoVKUP: boolean;
begin
{$ifdef dbgGrid}DebugLn('DoVKUP INIT');{$endif}
@ -2096,6 +2109,7 @@ var
result := FDatalink.DataSet.BOF;
{$ifdef dbgGrid}DebugLn('DoVKUP FIN');{$endif}
end;
procedure MoveSel(AReset: boolean);
begin
if (DeltaCol<>0) or (DeltaRow<>0) then begin
@ -2115,6 +2129,7 @@ var
if AReset then
ResetEditor;
end;
begin
{$IfDef dbgGrid}DebugLnEnter('DBGrid.KeyDown %s INIT Key=%d',[Name,Key]);{$Endif}
case Key of
@ -2369,7 +2384,10 @@ begin
else
begin
FKeyBookmark:=nil; // force new keyboard selection start
if FKeyBookmark<>nil then begin
FDatalink.DataSet.FreeBookmark(FKeyBookmark);
FKeyBookmark:=nil; // force new keyboard selection start
end;
SetFocus;
P:=MouseToCell(Point(X,Y));
@ -3312,7 +3330,10 @@ begin
if SelCurrent then
SelectRecord(true);
end;
FKeyBookmark:=nil;
if FKeyBookmark<>nil then begin
FDatalink.DataSet.FreeBookmark(FKeyBookmark);
FKeyBookmark:=nil;
end;
end;
function TCustomDBGrid.NeedAutoSizeColumns: boolean;
@ -3976,7 +3997,8 @@ begin
// store it here as pointer
FList.Insert(Index, Bookmark);
FGrid.Invalidate;
end;
end else
FDataset.FreeBookmark(Bookmark);
end;
end;