Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Project Management/Project Manager    [ Add a report in this area ]  
Report #:  109291   Status: Closed
A series of delete/create operations on project build configuration cause .dproj file store incorrect value
Project:  Delphi Build #:  17.0.4625.53395
Version:    17.0 Submitted By:   Chee Yang Chau
Report Type:  Basic functionality failure Date Reported:  10/5/2012 2:32:58 AM
Severity:    Serious / Highly visible problem Last Updated: 6/19/2013 7:09:12 PM
Platform:    All versions Internal Tracking #:   32507
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : XE4 Update1
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
When Delphi IDE start introduce .dproj file and build configuration with option sets, it improve the project release management a lot.

However, it also has a side effect that is hard to replay and catch and I thought it was bugs in IDE.  The problem should have always confuse the users where some project is not able to debug in IDE debugger.  Even we check all the related settings the compiler and linking options in project, the debugger won't activate on the project.  Some project works and some project doesn't.  We even regard is to be memory problem or cpu problem.

I notice the problem is due to the .dproj file setting doesn't store correct information.  If the related .dproj file has something like this:


    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
        <Cfg_1>true</Cfg_1>
        <CfgParent>Base</CfgParent>
        <Base>true</Base>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
        <Cfg_2>true</Cfg_2>
        <CfgParent>Base</CfgParent>
        <Base>true</Base>
    </PropertyGroup>

    <Import Project="Release.optset" Condition="'$(Cfg_2)'!='' And Exists('Release.optset')"/>
    <PropertyGroup Condition="'$(Cfg_1)'!=''">
        <CfgDependentOn>Release.optset</CfgDependentOn>
    </PropertyGroup>
    <Import Project="Debug.optset" Condition="'$(Cfg_1)'!='' And Exists('Debug.optset')"/>
    <PropertyGroup Condition="'$(Cfg_2)'!=''">
        <CfgDependentOn>Debug.optset</CfgDependentOn>
    </PropertyGroup>

The Release.optset bind to Cfg_2 and Debug.optset bind to Cfg_1 but Release configuration is using Cfg_1 and Debug configuration is using Cfg_2.

When build the project, the debug info will not generate for in debug configuration but generate on release configuration.
Steps to Reproduce:
1. Extract sample project in the attachment

2. Open the project in XE3 IDE.  It should also happens in previous version of IDE.

3. Open Project Manager

4. Expand Build Configuration entirely.

5. There are 2 build configurations: Debug and Release.  Each configuration has attached by Debug.optset and Built.optset respectively.

6. Activate Debug build configuration, and build the project.

7. Press F8 to attempt project debugging and it should step in project source file.

8. Press Ctrl+F2 reset the debugger.

9. Activate Release build configuration, and build the project.

10. Press F8 to attempt project debugging and it should show the cpu windows.

11. Press Ctrl+F2 reset the debugger.

So far so good, the Debug and Release build configuration work as expected.

Next, follow these steps to see the problem I reported:

1. Activate Debug build configuration, delete the build configuration by pressing delete key.

2. Activate Release build configuration, delete the build configuration by pressing delete key.

3. Both build configurations should disappear in project manager.

4. Next, re-create a build configuration: Release and apply Option Set to Release configuration: release.optset (Add as reference).

5. Re-create a build configuration: Debug and apply Option Set to Debug configuration: debug.optset (Add as reference).

6. Activate Debug build configuration, and build the project.

7. Press F8 to attempt project debugging and but it step into CPU windows.

8. Press Ctrl+F2 reset the debugger.

9. Activate Release build configuration, and build the project.

10. Press F8 to attempt project debugging and but it step into project source file.

The build configuration for debug and release has been swap unintentionally.
Workarounds
Open .dproj with any text editor but not Delphi IDE, and update to:


    <Import Project="Release.optset" Condition="'$(Cfg_1)'!='' And Exists('Release.optset')"/>
    <PropertyGroup Condition="'$(Cfg_1)'!=''">
        <CfgDependentOn>Release.optset</CfgDependentOn>
    </PropertyGroup>
    <Import Project="Debug.optset" Condition="'$(Cfg_2)'!='' And Exists('Debug.optset')"/>
    <PropertyGroup Condition="'$(Cfg_2)'!=''">
        <CfgDependentOn>Debug.optset</CfgDependentOn>
    </PropertyGroup>
Attachment
109291.zip
Comments

Alexandre Poloziouk at 12/4/2012 2:02:52 PM -
This is the same issue as reported at http://qc.embarcadero.com/wc/qcmain.aspx?d=109079

Same bug exists in XE2 IDE.

Tomohiro Takahashi at 6/19/2013 7:09:46 PM -
Does this issue still occur with Delphi XE4 Update1?

Server Response from: ETNACODE01