renamed and deprecated inconsistent prop names in the debug category

+ moved generateStackFrame to category debug
This commit is contained in:
Basile Burg 2016-03-18 04:30:16 +01:00
parent 0602e047d6
commit 5898cd6bbf
2 changed files with 41 additions and 26 deletions

View File

@ -147,13 +147,14 @@ type
property inlining: boolean read fInline write setInline default false; property inlining: boolean read fInline write setInline default false;
property boundsCheck: TBoundCheckKind read fBoundsCheck write setBoundsCheck default safeOnly; property boundsCheck: TBoundCheckKind read fBoundsCheck write setBoundsCheck default safeOnly;
property optimizations: boolean read fOptimz write setOptims default false; property optimizations: boolean read fOptimz write setOptims default false;
property generateStackFrame: boolean read fGenStack write setGenStack default false;
property addMain: boolean read fAddMain write setAddMain default false; property addMain: boolean read fAddMain write setAddMain default false;
property release: boolean read fRelease write setRelease default false; property release: boolean read fRelease write setRelease default false;
property unittest: boolean read fUnittest write setUnittest default false; property unittest: boolean read fUnittest write setUnittest default false;
property versionIdentifiers: TStringList read fVerIds write setVerIds; property versionIdentifiers: TStringList read fVerIds write setVerIds;
property generateAllTmpCode: boolean read fAllInst write setAllInst default false; property generateAllTmpCode: boolean read fAllInst write setAllInst default false;
property addStackStompCode: boolean read fStackStomp write setStackStomp default false; property addStackStompCode: boolean read fStackStomp write setStackStomp default false;
//TODO-cmaintenace: remove deprecated props after next rlz
property generateStackFrame: boolean write setGenStack stored false; deprecated;
public public
constructor create; constructor create;
destructor destroy; override; destructor destroy; override;
@ -166,27 +167,33 @@ type
*) *)
TDebugOpts = class(TOptsGroup) TDebugOpts = class(TOptsGroup)
private private
fDebug: boolean; fDebugConditions: boolean;
fDbgD: boolean; fGenInfos: boolean;
fDbgC: boolean; fDbgC: boolean;
fGenMap: boolean; fGenMap: boolean;
fDbgIdents: TStringList; fDbgIdents: TStringList;
fDbgLevel: Integer; fDbgLevel: Integer;
fForceDbgBool: boolean; fForceDbgBool: boolean;
fGenFrame: boolean;
procedure updateForceDbgBool; procedure updateForceDbgBool;
procedure setDebug(const aValue: boolean); procedure setGenFrame(const aValue: boolean);
procedure setDbgD(const aValue: boolean); procedure setDebugConditions(const aValue: boolean);
procedure setGenInfos(const aValue: boolean);
procedure setDbgC(const aValue: boolean); procedure setDbgC(const aValue: boolean);
procedure setGenMap(const aValue: boolean); procedure setGenMap(const aValue: boolean);
procedure setDbgLevel(const aValue: Integer); procedure setDbgLevel(const aValue: Integer);
procedure setDbgIdents(aValue: TStringList); procedure setDbgIdents(aValue: TStringList);
published published
property debug: boolean read fDebug write setDebug default false; property debugConditions: boolean read fDebugConditions write setDebugConditions default false;
property debugIdentifiers: TStringList read fDbgIdents write setDbgIdents; property debugIdentifiers: TStringList read fDbgIdents write setDbgIdents;
property debugLevel: Integer read fDbgLevel write setDbgLevel default 0; property debugLevel: Integer read fDbgLevel write setDbgLevel default 0;
property codeviewDexts: boolean read fDbgD write setDbgD default false; property generateInfos: boolean read fGenInfos write setGenInfos default false;
property codeviewCformat: boolean read fDbgC write setDbgC default false;
property generateMapFile: boolean read fGenMap write setGenMap default false; property generateMapFile: boolean read fGenMap write setGenMap default false;
property generateStackFrame: boolean read fGenFrame write setGenFrame default false;
//TODO-cmaintenace: remove deprecated props after next rlz
property debug: boolean write setDebugConditions; deprecated;
property codeviewDexts: boolean write setGenInfos stored false; deprecated;
property codeviewCformat: boolean write setDbgC stored false; deprecated;
public public
constructor create; constructor create;
destructor destroy; override; destructor destroy; override;
@ -632,7 +639,6 @@ begin
if fUnittest then aList.Add('-unittest'); if fUnittest then aList.Add('-unittest');
if fInline then aList.Add('-inline'); if fInline then aList.Add('-inline');
if fOptimz then aList.Add('-O'); if fOptimz then aList.Add('-O');
if fGenStack then aList.Add('-gs');
if fStackStomp then aList.Add('-gx'); if fStackStomp then aList.Add('-gx');
if fAllInst then aList.Add('-allinst'); if fAllInst then aList.Add('-allinst');
if fAddMain then aList.Add('-main'); if fAddMain then aList.Add('-main');
@ -675,7 +681,6 @@ begin
if baseopt.fUnittest or fUnittest then aList.Add('-unittest'); if baseopt.fUnittest or fUnittest then aList.Add('-unittest');
if baseopt.fInline or fInline then aList.Add('-inline'); if baseopt.fInline or fInline then aList.Add('-inline');
if baseopt.fOptimz or fOptimz then aList.Add('-O'); if baseopt.fOptimz or fOptimz then aList.Add('-O');
if baseopt.fGenStack or fGenStack then aList.Add('-gs');
if baseopt.fStackStomp or fStackStomp then aList.Add('-gx'); if baseopt.fStackStomp or fStackStomp then aList.Add('-gx');
if baseopt.fAllInst or fAllInst then aList.Add('-allinst'); if baseopt.fAllInst or fAllInst then aList.Add('-allinst');
if baseopt.fAddMain or fAddMain then aList.Add('-main'); if baseopt.fAddMain or fAddMain then aList.Add('-main');
@ -827,18 +832,19 @@ var
begin begin
if base.isNil then if base.isNil then
begin begin
if fDebug then aList.Add('-debug'); if fDebugConditions then aList.Add('-debug');
if fDbgLevel <> 0 then if fDbgLevel <> 0 then
aList.Add('-debug=' + intToStr(fDbgLevel)); aList.Add('-debug=' + intToStr(fDbgLevel));
for idt in fDbgIdents do for idt in fDbgIdents do
aList.Add('-debug=' + idt); aList.Add('-debug=' + idt);
if fDbgD then aList.Add('-g'); if fGenInfos then aList.Add('-g');
if fDbgC then aList.Add('-gc'); if fDbgC then aList.Add('-gc');
if fGenMap then aList.Add('-map'); if fGenMap then aList.Add('-map');
if fGenFrame and (aList.IndexOf('-gs') = -1) then aList.Add('-gs');
end else end else
begin begin
baseopt := TDebugOpts(base); baseopt := TDebugOpts(base);
if baseopt.fDebug or fDebug then aList.Add('-debug'); if baseopt.fDebugConditions or fDebugConditions then aList.Add('-debug');
if (baseopt.fDbgLevel <> 0) and (fDbgLevel = 0) then if (baseopt.fDbgLevel <> 0) and (fDbgLevel = 0) then
aList.Add('-debug=' + intToStr(baseopt.fDbgLevel)) aList.Add('-debug=' + intToStr(baseopt.fDbgLevel))
else if fDbgLevel <> 0 then else if fDbgLevel <> 0 then
@ -846,9 +852,10 @@ begin
if fDbgIdents.Count = 0 then if fDbgIdents.Count = 0 then
for idt in baseopt.fDbgIdents do aList.Add('-debug=' + idt) for idt in baseopt.fDbgIdents do aList.Add('-debug=' + idt)
else for idt in fDbgIdents do aList.Add('-debug=' + idt); else for idt in fDbgIdents do aList.Add('-debug=' + idt);
if baseopt.fDbgD or fDbgD then aList.Add('-g'); if baseopt.fGenInfos or fGenInfos then aList.Add('-g');
if baseopt.fDbgC or fDbgC then aList.Add('-gc'); if baseopt.fDbgC or fDbgC then aList.Add('-gc');
if baseopt.fGenMap or fGenMap then aList.Add('-map'); if baseopt.fGenMap or fGenMap then aList.Add('-map');
if (baseopt.fGenFrame or fGenFrame) and (aList.IndexOf('-gs') = -1) then aList.Add('-gs');
end; end;
end; end;
@ -861,11 +868,12 @@ begin
src := TDebugOpts(aValue); src := TDebugOpts(aValue);
// //
fDbgIdents.Assign(src.fDbgIdents); fDbgIdents.Assign(src.fDbgIdents);
fDebug := src.fDebug; fDebugConditions := src.fDebugConditions;
fDbgLevel := src.fDbgLevel; fDbgLevel := src.fDbgLevel;
fDbgD := src.fDbgD; fGenInfos := src.fGenInfos;
fDbgC := src.fDbgC; fDbgC := src.fDbgC;
fGenMap := src.fGenMap; fGenMap := src.fGenMap;
fGenFrame := src.fGenFrame;
end end
else inherited; else inherited;
end; end;
@ -873,25 +881,32 @@ end;
procedure TDebugOpts.updateForceDbgBool; procedure TDebugOpts.updateForceDbgBool;
begin begin
fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0); fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0);
if fForceDbgBool then setDebug(true); if fForceDbgBool then setDebugConditions(true);
end; end;
procedure TDebugOpts.setDebug(const aValue: boolean); procedure TDebugOpts.setDebugConditions(const aValue: boolean);
begin begin
if fForceDbgBool then if fForceDbgBool then
begin begin
fDebug := true; fDebugConditions := true;
exit; exit;
end; end;
if fDebug = aValue then exit; if fDebugConditions = aValue then exit;
fDebug := aValue; fDebugConditions := aValue;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setDbgD(const aValue: boolean); procedure TDebugOpts.setGenFrame(const aValue: boolean);
begin begin
if fDbgD = aValue then exit; if fGenFrame = aValue then exit;
fDbgD := aValue; fGenFrame:=aValue;
doChanged;
end;
procedure TDebugOpts.setGenInfos(const aValue: boolean);
begin
if fGenInfos = aValue then exit;
fGenInfos := aValue;
doChanged; doChanged;
end; end;

View File

@ -354,8 +354,8 @@ begin
with TCompilerConfiguration(fConfigs.Add) do with TCompilerConfiguration(fConfigs.Add) do
begin begin
Name := 'debug'; Name := 'debug';
debugingOptions.debug := true; debugingOptions.debugConditions := true;
debugingOptions.codeviewCformat := true; debugingOptions.generateInfos := true;
outputOptions.boundsCheck := onAlways; outputOptions.boundsCheck := onAlways;
end; end;
with TCompilerConfiguration(fConfigs.Add) do with TCompilerConfiguration(fConfigs.Add) do