Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: DEBUG PROBLEM (32bit C++ VCL Application - source on network share)


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Jan 20, 2016 12:26 AM Last Post By: Davide Quagliotto
Leif Nielsen

Posts: 10
Registered: 11/30/07
DEBUG PROBLEM (32bit C++ VCL Application - source on network share)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 29, 2015 5:05 AM
I have a problem regarding IDE debugging a project where the source is located on a network share (similar to Quality Central Report #: 98110).
If the project is copied to the local drive - also hosting the IDE - then no problems exist. This problem only occurs in C++ Windows 32 (Debug) and only on one dev. machine. Not in Delphi and not in 64bit mode.

Steps to reproduce:
1. Create new C++ VCL Application (Debug, 32bit Windows)
2. Save project as "C:\LocalProject\HelloWorld"
3. Clean & Build HelloWorld.
4. Set Breakpoint in Button1Click(..)
5. Press F9 to Run => Blue dots and EventLog: "Module Load: HelloWorld.exe. Has Debug Info..."
6. Terminate HelloWorld, Save all, Close All
7. Copy "C:\LocalProject\" to Shared Network drive "Z:\RemoteProject\"
8 Open project "Z:\RemoteProject\HelloWorld"
9 Clean & Build HelloWorld.
10. Set Breakpoint in Button1Click(..)
11. Press F9 to Run => No Blue dots and EventLog: "Module Load: HelloWorld.exe. No Debug Info..."
12. Copy "C:\LocalProject\HelloWorld\Win32\Debug\HelloWorld.exe" to "Z:\RemoteProject\HelloWorld\Win32\Debug\HelloWorld.exe"
13. Press F9 to Run => Blue dots and EventLog: "Module Load: HelloWorld.exe. Has Debug Info..." and debugging WORKS!

So Point 12/13 proves that it is the compiler/linker output that is wrong. All files in the two output dirs. Win32\Debug are of the same size, but small differences exist in

C:\LocalProject\Win32\Debug Z:\RemoteProject\Win32\Debug
HelloWorld.#00 4992686 29-09-15 13:50:43 = 29-09-15 13:52:44 4992686 HelloWorld.#00
HelloWorld.exe 108032 29-09-15 13:50:43 != 29-09-15 13:52:48 108032 HelloWorld.exe
HelloWorld.ilc 589824 29-09-15 13:50:43 = 29-09-15 13:52:32 589824 HelloWorld.ilc
HelloWorld.ild 65536 29-09-15 13:50:43 = 29-09-15 13:52:32 65536 HelloWorld.ild
HelloWorld.ilf 2555904 29-09-15 13:50:43 != 29-09-15 13:52:32 2555904 HelloWorld.ilf
HelloWorld.ils 7995392 29-09-15 13:50:43 != 29-09-15 13:52:32 7995392 HelloWorld.ils
HelloWorld.map 246 29-09-15 13:50:43 = 29-09-15 13:52:48 246 HelloWorld.map
HelloWorld.obj 35719 29-09-15 13:50:43 != 29-09-15 13:52:46 35719 HelloWorld.obj
HelloWorld.pch 21330462 29-09-15 13:50:43 != 29-09-15 13:52:46 21330462 HelloWorld.pch
HelloWorld.pdi 24 29-09-15 13:50:43 = 29-09-15 13:52:48 24 HelloWorld.pdi
HelloWorld.tds 5111808 29-09-15 13:50:43 = 29-09-15 13:52:32 5111808 HelloWorld.tds
Main.obj 76703 29-09-15 13:50:43 != 29-09-15 13:52:46 76703 Main.obj

The differences in the exe and in the Main.obj are not substantial but never the less crucial to the debugging facillities.

I'm not sure where to look in order to cure this. I have uninstalled/re-installed XE7. It did not work - as soon as the source and exe files are NOT located on the dev. machine I get a wrong exe file, that cannot be debugged with-in the IDE.
Has any body ever dealt with something like this?
- (might be compiler related might be PC related, might be an XE7 installation problem)

Running Windows 7 64bit

Hope to hear from someone.

Best regards
Leif Nielsen

Edited by: Leif Nielsen on Sep 29, 2015 6:01 AM

Edited by: Leif Nielsen on Sep 29, 2015 6:11 AM
Leif Nielsen

Posts: 10
Registered: 11/30/07
Re: DEBUG PROBLEM (32bit C++ VCL Application - source on network share)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2015 4:58 AM   in response to: Leif Nielsen in response to: Leif Nielsen
Hi,

I have been digging deeper into this annoying debugger scenario:

This problem is caused by wrong timestamps being set by the Compiler/linker and not as I suggested by a wrongly generated EXE file.
If I change the timestamp of the HelloWorld.EXE file to be <= (timestamp of the HelloWorld.TDS file + 5 secs.) then the IDE accepts the DEBUG info in the EXE file.

This makes it quite simple to activate Debugging on a shared network, BUT where and how do I control this 5 seconds time limit in the IDE settings, so I don't need an external tool to mingle with the timestamps before every debug attempt?

Out network is running @ 1GB, and I would suspect, that if the debugger uses the timestamps of two independent files to match, then it would have been natural, that the IDE ensured that these timestamps were in proper order and not depend on an ideal network/server system that has absolutely no delays.

And BTW. if using the 64 bit compiler the timestamp of the generated HelloWorld.EXE is not important to the debugger - it just works.

Hope someone from Embarcadero knows how to control the TimeStamp thing for the 32bit debugger - I cannot find any settings for that.

Best regards
Leif Nielsen

Edited by: Leif Nielsen on Sep 30, 2015 4:59 AM
Leif Nielsen

Posts: 10
Registered: 11/30/07
Re: DEBUG PROBLEM (32bit C++ VCL Application - source on network share)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2015 11:50 PM   in response to: Leif Nielsen in response to: Leif Nielsen
OK I got some help from NOHAU.DK on this one - thanks Anders!

Embarcadero included a TOUCH.EXE utility in the RAD Studio binaries.

Since timestamps of EXE & TDS must match in order to debug Win32 C++ apps, the supplied TOUCH.EXE command can be used in a Post Build Command to achieve this:

Project Options (Debug conf. 32bit ..) | Build Events | Post Build Events | Commands:

"$(BDSBIN)\touch.exe" -v -r"$(OUTPUTDIR)$(OUTPUTNAME).exe" "$(OUTPUTDIR)$(OUTPUTNAME).tds"

This solves the problem :-)

Best regards
Leif Nielsen
Davide Quagliotto

Posts: 13
Registered: 10/5/08
Re: DEBUG PROBLEM (32bit C++ VCL Application - source on network share)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 20, 2016 12:26 AM   in response to: Leif Nielsen in response to: Leif Nielsen
Leif Nielsen wrote:
OK I got some help from NOHAU.DK on this one - thanks Anders!

Embarcadero included a TOUCH.EXE utility in the RAD Studio binaries.

Since timestamps of EXE & TDS must match in order to debug Win32 C++ apps, the supplied TOUCH.EXE command can be used in a Post Build Command to achieve this:

Project Options (Debug conf. 32bit ..) | Build Events | Post Build Events | Commands:

"$(BDSBIN)\touch.exe" -v -r"$(OUTPUTDIR)$(OUTPUTNAME).exe" "$(OUTPUTDIR)$(OUTPUTNAME).tds"

This solves the problem :-)

Best regards
Leif Nielsen

Hi,
I'm Davide (the same that opened Quality Central Report #: 98110) and finally I understood how to compile with debug informations with the solution above.
Another way to compile with debug informations is to change the computer time so that it is the same of remote device.
Thanks

Best Regards.
Davide.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02