Skip to content

Commit f045d01

Browse files
authored
Merge pull request #185 from royqh1979/develop
Develop
2 parents a21352d + f4a8c28 commit f045d01

11 files changed

+189
-72
lines changed

NEWS.txt

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Version 6.7.3
2+
3+
- fix: gdb annotation infos are not correctly displayed
4+
- fix: the symbol completion option for ']' doesn't work
5+
- experiment support for clang (msys2 64bit build)
6+
issues for clang:
7+
- gdb used by clang dosen't support path name without non-ascii characters
8+
- clang doesn't support encoding arguments
9+
- Parser can't correctly parse libc++ header files (support will be done in the QT version of devcpp)
10+
11+
12+
Version 6.7.2 JUNE 2021
13+
14+
- fix: show value of the variable under cursor when debugging
15+
- add: open .asm file with assembly language highlighter
16+
117
Version 6.7.1 MAY 2021
218

319
- fix: gdb.exe included in the gcc 10.2 distribution may fail to debug

Source/Compiler.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ procedure TCompiler.Compile(silent:boolean = False);
726726
GetLibrariesParams;
727727
GetIncludesParams;
728728

729-
if fCompilerSet.AddCharset then begin
729+
if fCompilerSet.AddCharset and (fCompilerSet.CompilerType = ctGCC) then begin
730730
if not fCheckSyntax and UseUTF8 then begin
731731
fCompileParams := fCompileParams + ' -finput-charset=utf-8 -fexec-charset='
732732
+GetSystemCharsetName();

Source/DebugReader.pas

+10-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,16 @@ procedure TDebugReader.SyncFinishedParsing;
268268
if (devDebugger.ShowCommandLog) or (assigned(fCurrentCmd) and fCurrentCmd^.ShowInConsole) then begin
269269
if devDebugger.ShowAnnotations then begin
270270
strOutput := StringReplace(fOutput, #26, '>', [rfReplaceAll]);
271-
MainForm.DebugOutput.Lines.Add(strOutput);
271+
strList := TStringList.Create;
272+
try
273+
strList.Text := strOutput;
274+
for i:=0 to strList.Count-1 do
275+
MainForm.DebugOutput.Lines.Add(strList[i]);
276+
MainForm.DebugOutput.Lines.Add('');
277+
MainForm.DebugOutput.Lines.Add('');
278+
finally
279+
strList.Destroy;
280+
end;
272281
end else begin
273282
strList := TStringList.Create;
274283
outStrList := TStringList.Create;

Source/Editor.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ procedure TEditor.HandleSymbolCompletion(var Key: Char);
18981898
HandleArrayCompletion;
18991899
end;
19001900
']': begin
1901-
if devEditor.ParentheseComplete then
1901+
if devEditor.ArrayComplete then
19021902
HandleArraySkip;
19031903
end;
19041904
'*': begin

Source/Version.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface
3232

3333
// exe properties
3434
DEVCPP = 'Red Panda Dev-C++';
35-
DEVCPP_VERSION = '6.7.2';
35+
DEVCPP_VERSION = '6.7.3';
3636

3737
// delimiters
3838
DEV_INTERNAL_OPEN = '$__DEV_INTERNAL_OPEN';

Source/devCFG.pas

+135-35
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ interface
3232
's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
3333

3434
type
35+
TCompilerType = (ctGCC,ctClang);
36+
3537
// the comments are an example of the record
3638
PCompilerOption = ^TCompilerOption;
3739
TCompilerOption = record
@@ -70,6 +72,7 @@ TdevCompilerSet = class(TPersistent)
7072
fDefInclude: TStringList; // default include dir
7173
fDefines: TStringList; // list of predefined constants
7274
fTarget: AnsiString; // 'X86_64' / 'i686'
75+
fCompilerType: TCompilerType; // 'Clang'/ 'GCC'
7376

7477
// User settings
7578
fCompAdd: boolean;
@@ -136,6 +139,7 @@ TdevCompilerSet = class(TPersistent)
136139
property Target: AnsiString read fTarget;
137140
property DefInclude: TStringList read fDefInclude;
138141
property Defines: TStringList read fDefines;
142+
property CompilerType: TCompilerType read fCompilerType;
139143

140144
// Options
141145
property Options: TList read fOptions write fOptions;
@@ -1305,6 +1309,7 @@ procedure TdevCompilerSet.Assign(Source: TPersistent);
13051309
fType := input.fType;
13061310
fName := input.fName;
13071311
fFolder := input.fFolder;
1312+
fCompilerType := input.fCompilerType;
13081313
fDefInclude.Assign(input.fDefInclude);
13091314
fDefines.Assign(input.fDefines);
13101315

@@ -1346,41 +1351,60 @@ procedure TdevCompilerSet.SetProperties(const BinDir, BinFile: AnsiString);
13461351
else
13471352
fTarget := 'i686';
13481353

1349-
//version
1350-
DelimPos1 := Pos('gcc version ', output);
1351-
if DelimPos1 = 0 then
1352-
Exit; // unknown binary
1353-
1354-
// Find version number
1355-
Inc(DelimPos1, Length('gcc version '));
1356-
DelimPos2 := DelimPos1;
1357-
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] in [#0..#32]) do
1358-
Inc(DelimPos2);
1359-
fVersion := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1360-
1361-
// Set compiler folder
1362-
DelimPos1 := RPos(pd, BinDir);
1363-
if DelimPos1 > 0 then
1364-
fFolder := Copy(BinDir, 1, DelimPos1 - 1);
1365-
1366-
// Find compiler builder
1367-
DelimPos1 := DelimPos2;
1368-
while (DelimPos1 <= Length(output)) and not (output[DelimPos1] = '(') do
1369-
Inc(DelimPos1);
1370-
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] = ')') do
1371-
Inc(DelimPos2);
1372-
fType := Copy(output, DelimPos1 + 1, DelimPos2 - DelimPos1 - 1);
1373-
1374-
// Assemble user friendly name if we don't have one yet
1375-
if fName = '' then begin
1376-
if ContainsStr(fType, 'tdm64') then
1377-
fName := 'TDM-GCC ' + fVersion
1378-
else if ContainsStr(fType, 'tdm') then
1379-
fName := 'TDM-GCC ' + fVersion
1380-
else if ContainsStr(fType, 'GCC') then
1381-
fName := 'MinGW GCC ' + fVersion
1382-
else
1383-
fName := 'MinGW GCC' + fVersion;
1354+
//Compiler Type
1355+
DelimPos1 := Pos('clang version ', output);
1356+
if (DelimPos1 <> 0) then begin
1357+
fCompilerType := ctClang;
1358+
Inc(DelimPos1, Length('clang version '));
1359+
DelimPos2 := DelimPos1;
1360+
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] in [#0..#32]) do
1361+
Inc(DelimPos2);
1362+
fVersion := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1363+
1364+
// Set compiler folder
1365+
DelimPos1 := RPos(pd, BinDir);
1366+
if DelimPos1 > 0 then
1367+
fFolder := Copy(BinDir, 1, DelimPos1 - 1);
1368+
if fName = '' then
1369+
fName := 'Clang ' + fVersion;
1370+
end else begin
1371+
fCompilerType := ctGCC;
1372+
//version
1373+
DelimPos1 := Pos('gcc version ', output);
1374+
if DelimPos1 = 0 then
1375+
Exit; // unknown binary
1376+
1377+
// Find version number
1378+
Inc(DelimPos1, Length('gcc version '));
1379+
DelimPos2 := DelimPos1;
1380+
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] in [#0..#32]) do
1381+
Inc(DelimPos2);
1382+
fVersion := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1383+
1384+
// Set compiler folder
1385+
DelimPos1 := RPos(pd, BinDir);
1386+
if DelimPos1 > 0 then
1387+
fFolder := Copy(BinDir, 1, DelimPos1 - 1);
1388+
1389+
// Find compiler builder
1390+
DelimPos1 := DelimPos2;
1391+
while (DelimPos1 <= Length(output)) and not (output[DelimPos1] = '(') do
1392+
Inc(DelimPos1);
1393+
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] = ')') do
1394+
Inc(DelimPos2);
1395+
fType := Copy(output, DelimPos1 + 1, DelimPos2 - DelimPos1 - 1);
1396+
1397+
// Assemble user friendly name if we don't have one yet
1398+
if fName = '' then begin
1399+
if ContainsStr(fType, 'tdm64') then
1400+
fName := 'TDM-GCC ' + fVersion
1401+
else if ContainsStr(fType, 'tdm') then
1402+
fName := 'TDM-GCC ' + fVersion
1403+
else if ContainsStr(fType, 'GCC') then
1404+
fName := 'MinGW GCC ' + fVersion
1405+
else
1406+
fName := 'MinGW GCC' + fVersion;
1407+
end;
13841408
end;
13851409

13861410
// Obtain compiler target
@@ -1421,12 +1445,82 @@ procedure TdevCompilerSet.SetExecutables;
14211445
end;
14221446

14231447
procedure TdevCompilerSet.SetDirectories;
1448+
var
1449+
DelimPos1,DelimPos2: integer;
1450+
output,s: string;
1451+
sl: TStringList;
1452+
i:integer;
14241453
procedure AddExistingDirectory(var list: TStringList; const Directory: AnsiString);
14251454
begin
14261455
if DirectoryExists(Directory) then
14271456
list.Add(Directory);
14281457
end;
14291458
begin
1459+
1460+
// Find default directories
1461+
// C include dirs
1462+
output := GetCompilerOutput(IncludeTrailingPathDelimiter(fFolder) + 'bin' + pd, fgccName, '-xc -v -E NUL');
1463+
//Target
1464+
DelimPos1 := Pos('#include <...> search starts here:',output);
1465+
DelimPos2 := Pos('End of search list.', output);
1466+
if (delimPos1 >0) and ( delimPos2>0 ) then begin
1467+
Inc(DelimPos1,Length('#include <...> search starts here:'));
1468+
output := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1469+
sl := TStringList.Create;
1470+
try
1471+
ExtractStrings([#10], [], PAnsiChar(output), sl);
1472+
for i:=0 to sl.Count -1 do begin
1473+
s := Trim(sl[i]);
1474+
if (s <> '') then
1475+
addExistingDirectory(fCDir,s);
1476+
end;
1477+
finally
1478+
sl.Destroy;
1479+
end;
1480+
end;
1481+
// Find default directories
1482+
// C++ include dirs
1483+
output := GetCompilerOutput(IncludeTrailingPathDelimiter(fFolder) + 'bin' + pd, fgccName, '-xc++ -v -E NUL');
1484+
//Target
1485+
DelimPos1 := Pos('#include <...> search starts here:',output);
1486+
DelimPos2 := Pos('End of search list.', output);
1487+
if (delimPos1 >0) and ( delimPos2>0 ) then begin
1488+
Inc(DelimPos1,Length('#include <...> search starts here:'));
1489+
output := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1490+
sl := TStringList.Create;
1491+
try
1492+
ExtractStrings([#10], [], PAnsiChar(output), sl);
1493+
for i:=0 to sl.Count -1 do begin
1494+
s := Trim(sl[i]);
1495+
if (s <> '') then
1496+
addExistingDirectory(fCppDir,s);
1497+
end;
1498+
finally
1499+
sl.Destroy;
1500+
end;
1501+
end;
1502+
// Find default directories
1503+
// lib dirs
1504+
output := GetCompilerOutput(IncludeTrailingPathDelimiter(fFolder) + 'bin' + pd, fgccName, '-print-search-dirs');
1505+
DelimPos1 := Pos('libraries: =',output);
1506+
if (delimPos1 >0) then begin
1507+
Inc(DelimPos1,Length('libraries: ='));
1508+
DelimPos2 := DelimPos1;
1509+
while (DelimPos2 <= Length(output)) and not (output[DelimPos2] in [#0..#32]) do
1510+
Inc(DelimPos2);
1511+
output := Copy(output, DelimPos1, DelimPos2 - DelimPos1);
1512+
sl := TStringList.Create;
1513+
try
1514+
ExtractStrings([';'], [], PAnsiChar(output), sl);
1515+
for i:=0 to sl.Count -1 do begin
1516+
s := Trim(sl[i]);
1517+
if (s <> '') then
1518+
addExistingDirectory(fLibDir,s);
1519+
end;
1520+
finally
1521+
sl.Destroy;
1522+
end
1523+
end;
14301524
// Add both the default and the autoconf directories
14311525
AddExistingDirectory(fBinDir, fFolder + pd + 'bin');
14321526
AddExistingDirectory(fLibDir, fFolder + pd + 'lib');
@@ -1865,9 +1959,11 @@ function TdevCompilerSet.ValidateExes(var msg:string): boolean;
18651959
if not FindFile(fBinDir, fgdbName) then begin
18661960
msg := msg + Format(Lang[ID_COMPVALID_BINNOTFOUND], [Lang[ID_COMPVALID_DEBUGGER], fgdbName]) + #13#10;
18671961
end;
1962+
{
18681963
if not FindFile(fBinDir, fgprofName) then begin
18691964
msg := msg + Format(Lang[ID_COMPVALID_BINNOTFOUND], [Lang[ID_COMPVALID_PROFILER], fgprofName]) + #13#10;
18701965
end;
1966+
}
18711967
if not FindFile(fBinDir, fmakeName) then begin
18721968
msg := msg + Format(Lang[ID_COMPVALID_BINNOTFOUND], [Lang[ID_COMPVALID_MAKE], fmakeName]) + #13#10;
18731969
end;
@@ -2388,6 +2484,10 @@ procedure TdevCompilerSets.FindSets;
23882484
AddSets(devDirs.Exec + 'MinGW32');
23892485
// Assume 64bit compilers are put in the MinGW64 folder
23902486
AddSets(devDirs.Exec + 'MinGW64');
2487+
// Assume 32bit clang compilers are put in the Clang32 folder
2488+
AddSets(devDirs.Exec + 'Clang32');
2489+
// Assume 64bit clang compilers are put in the Clang64 folder
2490+
AddSets(devDirs.Exec + 'Clang64');
23912491
end;
23922492

23932493
procedure TdevCompilerSets.ClearSets;

Source/devcpp.dof

+3-11
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,10 @@ OriginalFilename=devcpp.exe
134134
ProductName=Dev-C++
135135
ProductVersion=6
136136
Comments=Under the GNU General Public License
137-
[HistoryLists\hlDebugSourcePath]
138-
Count=1
139-
Item0=C:\Program Files (x86)\Dev-Cpp\Source\VCL\SynEdit\Source\;C:\Program Files (x86)\Dev-Cpp\Source\VCL\ClassBrowsing\
140137
[HistoryLists\hlUnitAliases]
141138
Count=1
142139
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143140
[HistoryLists\hlSearchPath]
144-
Count=1
145-
Item0=VCL\ClassBrowsing;VCL\devFileMonitor;VCL\devShortcuts;VCL\CompOptionsList;VCL\SynEdit\Source
146-
[HistoryLists\hlUnitOutputDirectory]
147-
Count=1
148-
Item0=Units
149-
[HistoryLists\hlOutputDirectorry]
150-
Count=1
151-
Item0=..
141+
Count=2
142+
Item0=..\VirtualTreeView\Source
143+
Item1=..\..\Common

0 commit comments

Comments
 (0)