PeterPanettone 157 Posted November 6, 2019 If you configure the Uses Clause Manager to use the map file to build the list of Project Units in a Windows 64-bit program then the list of Project Units does not contain the units from the map file: It contains only the list of units from the project file (.dpr). I have investigated the problem and found out that the compiler generates a different map file with 32-bit programs and with 64-bit programs respectively: • 32-bit programs: The ACBP alignment denomination is used • 64-bit programs: The ALIGN alignment denomination is used I will now fix this bug in GExperts and post a patch here. 1 1 Share this post Link to post
PeterPanettone 157 Posted November 6, 2019 Done: In \Source\Utils\GX_dzMapFileReader.pas, the original TMapFileReader.ParseSegments method is as follows: procedure TMapFileReader.ParseSegments(_StartIdx: Integer); var i: Integer; s: string; p: Integer; begin for i := _StartIdx to FContent.Count - 1 do begin s := FContent[i]; if s = '' then Exit; if TryCutAt(' M=', s) then begin p := Pos(' ACBP=', s); if p > 0 then begin s := Copy(s, 1, p); s := Trim(s); FUnits.add(s); end; end; end; end; Replace it with this code: procedure TMapFileReader.ParseSegments(_StartIdx: Integer); const StrACBP = ' ACBP='; StrALIGN = ' ALIGN='; var i: Integer; s: string; p: Integer; AlignStr: string; begin //CodeSite.Send('TMapFileReader.ParseSegments: AlignTest START'); p := Pos(StrACBP, FContent.Text); if p > 0 then // 32-bit platform AlignStr := StrACBP else begin p := Pos(StrALIGN, FContent.Text); if p > 0 then // 64-bit platform AlignStr := StrALIGN else EXIT; end; //CodeSite.Send('TMapFileReader.ParseSegments: AlignTest END'); // time not measurable for i := _StartIdx to FContent.Count - 1 do begin s := FContent[i]; if s = '' then Exit; if TryCutAt(' M=', s) then begin p := Pos({' ACBP='}AlignStr, s); if p > 0 then begin s := Copy(s, 1, p); s := Trim(s); FUnits.add(s); end; end; end; //CodeSite.Send('TMapFileReader.ParseSegments: FUnits-List at end of ParseSegments', FUnits.Text); end; Share this post Link to post
dummzeuch 1505 Posted November 6, 2019 Thanks a lot. I was expecting the reason for this functionlity to fail to be a compiler / map file incompatibility but didn't know if I was right. This will solve it for Win64, but probably not for the other target platforms because they use yet another compiler. Share this post Link to post
PeterPanettone 157 Posted November 6, 2019 Now the GExperts UCM MapFile-based ProjectUnitsList works for the Win32 platform and for the Win64 platform. Anybody is invited to add other platforms. BTW, thanks to Thomas for the Uses Clause Manager which is a very good idea! Share this post Link to post
dummzeuch 1505 Posted November 8, 2019 Committed (with changes) Note: There is still a problem with the Uses manager not finding the .map file if the output directory contains the default place holders $(Platform) or $(Config). This probably also affects other places that can use the map file, like Grep or Open File. I'll file a bug report for this. Share this post Link to post