Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-03

Criteria to add/remove UnitName from project (lpi) file

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

luiz americo pereira camara
From time to time, the UnitName row is added or removed from the Unit entry

in lpi file.

This occurs even in the same Lazarus version.

Take as example the following:

http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added in lpi

http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files have UnitName removed

Is this a bug ?

Lazarus 1.5 r48168 FPC 2.6.4 i386-win32-win32/win64

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150322/0436aa7a/attachment.html>

Reply by email

Mattias Gaertner
to luiz americo pereira camara
Show quoted text 14 lines
>From time to time, the UnitName row is added or removed from the Unit entry in lpi file. This occurs even in the same Lazarus version. Take as example the following: http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added in lpi http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files have UnitName removed Is this a bug ?

Probably. Do you know how to reproduce it?

Lazarus 1.5 r48168 FPC 2.6.4 i386-win32-win32/win64

Mattias

Reply by email

luiz americo pereira camara
to Mattias Gaertner

2015-03-22 16:32 GMT-03:00 Mattias Gaertner :

Show quoted text 13 lines
On Sun, 22 Mar 2015 10:15:23 -0300 > http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added in > lpi > > http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files have > UnitName removed > > Is this a bug ? Probably. Do you know how to reproduce it?

Not yet. Trying.

Tracked until TUnitInfo.SaveToXMLConfig where fUnitName sometimes is empty.

Tried to find where fUnitName is set (put breakpoints at ImproveUnitNameCache, SetUnitName, ReadUnitSource and LoadFromXMLConfig) but no luck.

Still trying

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150322/83dbf491/attachment.html>

Reply by email

luiz americo pereira camara
to luiz americo pereira camara

2015-03-22 16:59 GMT-03:00 luiz americo pereira camara :

Show quoted text 19 lines
2015-03-22 16:32 GMT-03:00 Mattias Gaertner : > On Sun, 22 Mar 2015 10:15:23 -0300 > > http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added > in > > lpi > > > > http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files > have > > UnitName removed > > > > Is this a bug ? > > Probably. Do you know how to reproduce it? >

Found something that may be related:

Take the following entry:

<Unit1>
<Filename Value="views\mainview.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainViewForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>

In TUnitInfo.LoadFromXMLConfig:

A Filename is set to  FileName ('views\mainview.pas')
AFilename:=XMLConfig.GetValue(Path+'Filename/Value','');
Later AFileName is set again this time to ResourceFileName, that is empty
AFilename:=XMLConfig.GetValue(Path+'ResourceFilename/Value','');
Later AFilename is checked before setting fUnitName:
if FilenameIsPascalSource(AFilename) then
fUnitName:=XMLConfig.GetValue(Path+'UnitName/Value',ExtractFileNameOnly(AFilename));

Since AFileName is empty, fUnitName will not be set

In the other side, in the following file

<Unit2>
<Filename Value="models\patientclasses.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PatientClasses"/>
</Unit2>

fUnitName is set to empty at LoadFromXMLConfig, but at the time of saving fUnitName gets its correct value 'PatientClasses'. Could not detect where gets the correct value. Breakpoints at ImproveUnitNameCache, SetUnitName, ReadUnitSource and LoadFromXMLConfig

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150322/058f6367/attachment-0001.html>

Reply by email

luiz americo pereira camara
to luiz americo pereira camara

2015-03-22 17:44 GMT-03:00 luiz americo pereira camara :

Show quoted text 23 lines
2015-03-22 16:59 GMT-03:00 luiz americo pereira camara : > > > 2015-03-22 16:32 GMT-03:00 Mattias Gaertner : > >> On Sun, 22 Mar 2015 10:15:23 -0300 >> > Is this a bug ? >> >> Probably. Do you know how to reproduce it? >> > > fUnitName is set to empty at LoadFromXMLConfig, but at the time of saving fUnitName gets its correct value 'PatientClasses'. Could not detect where gets the correct value. Breakpoints at ImproveUnitNameCache, SetUnitName, ReadUnitSource and LoadFromXMLConfig

In the case of 'PatientClasses' the FUnitName is set through ReadUnitNameFromSource. Follows backtrace.

I think i can reproduce now. If i do i will create a bug report

#0 TUNITINFO__SETFUNITNAME(0x15984878 'PatientClasses', <error reading variable>) at project.pp:1996
#1 TUNITINFO__READUNITNAMEFROMSOURCE(false, <error reading variable>) at project.pp:1626
#2 TFILEOPENER__OPENKNOWN(<error reading variable>) at sourcefilemanager.pas:849
#3 TFILEOPENER__OPENEDITORFILE(-1, 0, 0x158c63c8,
[OFPROJECTLOADING..OFONLYIFEXISTS, OFMULTIOPEN], <error reading variable>) at sourcefilemanager.pas:1157
#4 OPENEDITORFILE(0x15882278
'D:\repositories\nefrolog\lclclient\models\patientclasses.pas', -1, 0, 0x158c63c8, [OFPROJECTLOADING..OFONLYIFEXISTS, OFMULTIOPEN], true) at sourcefilemanager.pas:338
#5 TLAZSOURCEFILEMANAGER__INITOPENEDPROJECTFILE(0x15674318 'D:\repositories\nefrolog\lclclient\NefroLog.lpi', [OFADDTORECENT], <error reading variable>) at sourcefilemanager.pas:3406
#6 TMAINIDE__DOOPENPROJECTFILE(0x15674318
'D:\repositories\nefrolog\lclclient\NefroLog.lpi', [OFADDTORECENT], <error reading variable>) at main.pp:6319
#7 TLAZSOURCEFILEMANAGER__OPENPROJECT(0x155b31d0, <error reading variable>) at sourcefilemanager.pas:3778

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150322/ba61daf1/attachment.html>

Reply by email

luiz americo pereira camara
to Mattias Gaertner: On Sun, 22 Mar 2015 10:15:23 -0300 Probably. Do you know how to reproduce it? Mattias

2015-03-22 16:32 GMT-03:00 Mattias Gaertner :

Show quoted text 13 lines
On Sun, 22 Mar 2015 10:15:23 -0300 luiz americo pereira camara wrote: > >From time to time, the UnitName row is added or removed from the Unit entry > in lpi file. > > Is this a bug ? Probably. Do you know how to reproduce it?

See http://bugs.freepascal.org/view.php?id=27713

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150322/8928b14d/attachment.html>

Reply by email