|
From: <lo...@us...> - 2006-11-19 07:04:49
|
Revision: 688
http://svn.sourceforge.net/wxdsgn/?rev=688&view=rev
Author: lowjoel
Date: 2006-11-18 23:04:46 -0800 (Sat, 18 Nov 2006)
Log Message:
-----------
Added support for Visual C++ compilers's debug information adding and recompile.
Modified Paths:
--------------
branches/VC_Debugger/wxdevcpp/source/debugger.pas
Modified: branches/VC_Debugger/wxdevcpp/source/debugger.pas
===================================================================
--- branches/VC_Debugger/wxdevcpp/source/debugger.pas 2006-11-19 06:03:04 UTC (rev 687)
+++ branches/VC_Debugger/wxdevcpp/source/debugger.pas 2006-11-19 07:04:46 UTC (rev 688)
@@ -597,45 +597,66 @@
spos: integer;
opts: TProjProfile;
begin
- CloseDebugger(nil);
//Todo: lowjoel: Add multiple-compiler support
- if (MessageDlg(Lang[ID_MSG_NODEBUGSYMBOLS], mtConfirmation, [mbYes, mbNo], 0) = mrYes) then begin
- if devCompiler.FindOption('-g3', opt, idx) then begin
- opt.optValue := 1;
- if not Assigned(MainForm.fProject) then
- devCompiler.Options[idx]:=opt; // set global debugging option only if not working with a project
+ if MessageDlg(Lang[ID_MSG_NODEBUGSYMBOLS], mtConfirmation, [mbYes, mbNo], 0) = mrYes then
+ begin
+ CloseDebugger(nil);
+ if devCompiler.CompilerType = ID_COMPILER_MINGW then
+ begin
+ if devCompiler.FindOption('-g3', opt, idx) then
+ begin
+ opt.optValue := 1;
+ if not Assigned(MainForm.fProject) then
+ devCompiler.Options[idx] := opt; // set global debugging option only if not working with a project
- MainForm.SetProjCompOpt(idx, True); // set the project's correpsonding option too
+ MainForm.SetProjCompOpt(idx, True); // set the project's correpsonding option too
- // remove "-s" from the linker''s command line
- if Assigned(MainForm.fProject) then begin
- opts := MainForm.fProject.CurrentProfile;
- // look for "-s" in all the possible ways
- // NOTE: can't just search for "-s" because we might get confused with
- // some other option starting with "-s...."
- spos := Pos('-s ', opts.Linker); // following more opts
- if spos = 0 then
- spos := Pos('-s'#13, opts.Linker); // end of line
- if spos = 0 then
- spos:=Pos('-s_@@_', opts.Linker); // end of line (dev 4.9.7.3+)
- if (spos = 0) and
- (Length(opts.Linker) >= 2) and // end of string
- (Copy(opts.Linker, Length(opts.Linker)-1, 2) = '-s') then
- spos := Length(opts.Linker) - 1;
- // if found, delete it
- if spos>0 then begin
- Delete(opts.Linker, spos, 2);
- MainForm.fProject.CurrentProfile.CopyProfileFrom(opts);
+ // remove "-s" from the linker''s command line
+ if Assigned(MainForm.fProject) then begin
+ opts := MainForm.fProject.CurrentProfile;
+ // look for "-s" in all the possible ways
+ // NOTE: can't just search for "-s" because we might get confused with
+ // some other option starting with "-s...."
+ spos := Pos('-s ', opts.Linker); // following more opts
+ if spos = 0 then
+ spos := Pos('-s'#13, opts.Linker); // end of line
+ if spos = 0 then
+ spos := Pos('-s_@@_', opts.Linker); // end of line (dev 4.9.7.3+)
+ if (spos = 0) and (Length(opts.Linker) >= 2) and // end of string
+ (Copy(opts.Linker, Length(opts.Linker)-1, 2) = '-s') then
+ spos := Length(opts.Linker) - 1;
+
+ // if found, delete it
+ if spos>0 then
+ begin
+ Delete(opts.Linker, spos, 2);
+ MainForm.fProject.CurrentProfile.CopyProfileFrom(opts);
+ end;
end;
+
+ // remove -s from the compiler options
+ if devCompiler.FindOption('-s', opt, idx) then begin
+ opt.optValue := 0;
+ if not Assigned(MainForm.fProject) then
+ devCompiler.Options[idx] := opt; // set global debugging option only if not working with a project
+ MainForm.SetProjCompOpt(idx, False); // set the project's correpsonding option too
+ end;
end;
- if devCompiler.FindOption('-s', opt, idx) then begin
- opt.optValue := 0;
- if not Assigned(MainForm.fProject) then
- devCompiler.Options[idx]:=opt; // set global debugging option only if not working with a project
- MainForm.SetProjCompOpt(idx, False); // set the project's correpsonding option too
- end;
- MainForm.actRebuildExecute(nil);
+ end
+ else if devCompiler.CompilerType in ID_COMPILER_VC then
+ begin
+ for idx := 0 to devCompiler.OptionsCount - 1 do
+ if devCompiler.Options[idx].optName = 'Debugging' then
+ Break;
+
+ opt := devCompiler.Options[idx];
+ opt.optValue := 1;
+ if not Assigned(MainForm.fProject) then
+ devCompiler.Options[idx] := opt;
+ MainForm.fProject.CurrentProfile.CompilerOptions[idx + 1] := '1';
+ MainForm.fProject.CurrentProfile.Linker := MainForm.fProject.CurrentProfile.Linker + '/Debug';
end;
+ MainForm.actRebuildExecute(nil);
end;
end;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|