Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » [Bug+Patch] when there is a space in Upp path (gdb does not find exefile, && problem using windres)
[Bug+Patch] when there is a space in Upp path [message #47744] Fri, 17 March 2017 16:55 Go to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,
I have to install upp in Program Files, so I found the following two bug:

1: gdb does not find the exe file

solution: add quote before and after the path of the exe file
in ide\Debuggers\Gdb.cpp line 338
	dbg = host->StartProcess(GdbCommand(console) + "\"" + GetHostPath(exefile) + "\"");


2: windres does not find the preprocessor
in it's internal, windres use it's path (without quotes) as base in order to find the propressor.
solution: call windres using it's ShortPath:
in ide\Builders\GccBuilder.cpp, line 217:
				exec << GetHostPathShort( FindInDirs(((LocalHost*)host)->exedirs, "windres.exe")) << " -i " << GetHostPathQ(fn);


instead of:
				exec << "windres -i " << GetHostPathQ(fn);


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47751 is a reply to message #47744] Sat, 18 March 2017 20:54 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

The problems you are talking about definitely needs further processing. So, I created following redmine ticket #1661.

Please keep in mind other platforms like POSIX. Does the double quote work there? Do you test on POSIX?

Can you explain for me what following lines do?
GetHostPathShort( FindInDirs(((LocalHost*)host)->exedirs, "windres.exe"))


Sincerely and thanks,
Klugier


U++ - one framework to rule them all.

[Updated on: Sat, 18 March 2017 20:56]

Report message to a moderator

Re: [Bug+Patch] when there is a space in Upp path [message #47756 is a reply to message #47751] Sun, 19 March 2017 10:14 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

Tested on Linux Mint / GCC :
gdb bug is there too, and the quote fix it.
I think this fix this bug too.


windres bug is PLATFORM_WIN specific as .rc file is.


Quote:

Can you explain for me what following lines do?

GetHostPathShort( FindInDirs(((LocalHost*)host)->exedirs, "windres.exe"))




FindInDirs(((LocalHost*)host)->exedirs, "windres.exe")

localhost.exedir is a vector of the PATH directorys
FindInDirs find "windres.exe" in this list of directory, and return the full path, for example :"c:\\program files\\upp\\bin\\mingw\\bin\\windres.exe"

GetHostPathShort convert this to: "c:\\program~1\\upp\\bin\\mingw\\bin\\windres.exe"


in the current version, FindInDirs(..) is called inside CppBuilder::Run() { LocalHost::Run() { FindCommand(const Vector<String>& exedir, const String& mdline)}}



regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47758 is a reply to message #47756] Sun, 19 March 2017 21:06 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

The first part is actually on trunk. You can see changes made by me https://github.com/ultimatepp/mirror/commit/1a22ae0c9fbc0879 715e1472c4eb2cf92c10ab80. This is a little bit different, but solve exactly the same issue in other way. The funny thing is that TheIDE crashes when the output dir contains space Sad

The second point is not process yet. I will need to have time to check and reproduce the error on my own. This should happens soon - I hope in next weekend.

Sincerely and thanks for cooperating,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 19 March 2017 23:14]

Report message to a moderator

Re: [Bug+Patch] when there is a space in Upp path [message #47759 is a reply to message #47758] Sun, 19 March 2017 23:04 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Thanks Klugier,

The first part is enough for me, the second part is needed to compile theide only.

i can now use the latest theide without the need of compilation.

the second point is a bug in windres.exe (reported on bugzilla)

the solution proposed is a work around that.


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47760 is a reply to message #47759] Sun, 19 March 2017 23:22 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

It seems that the second scenario is not critical like the first one and it seems more like problem of third party software. We should wait for them when they will repair it on their side. What do you think - can I close redmine ticket?

And one more important question - when they fix their error - will our workaround work also? This is important information, because this allow us to have more stable code.

You said that I can reproduce this by building TheIDE - what should I do? Should I build TheIDE with MinGW from program files?

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [Bug+Patch] when there is a space in Upp path [message #47763 is a reply to message #47760] Mon, 20 March 2017 23:33 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hello,
exemple steps to reproduce the probleme:

1 - download the nightly builds for Windows with MinGW-w64 toolchain
2 - extract it in "c:\u pp\"
3 - run "c:\u pp\theide.exe" and compile examples/GeoFun


i think, the workaround will work after windres bug fix.


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47770 is a reply to message #47763] Wed, 22 March 2017 22:35 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I tested the second part yesterday, but it seem not to work with about example. Probably my winres.exe is not in the vector. I will proceed it later - the thing is worth fixing and let you know. Let's keep in touch to fix that problem.

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [Bug+Patch] when there is a space in Upp path [message #47776 is a reply to message #47770] Fri, 24 March 2017 23:46 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

in the proposed patch:
GetHostPathShort( FindInDirs(((LocalHost*)host)->exedirs, "windres.exe"))

the cast (LocalHost*)host, does not work properly.
i have tested with
LocalHost*h = dynamic_cast<LocalHost*>(host)

host is not NULL, but after the execution of this line, h is equal to NULL !

to avoid this, we can extract the PATH from Host.GetEnvironnement() instead of Localhost.exedirs

here the new patch :
			if(rc) {

 				String windres = "windres";
				String env = host->GetEnvironment();
				const char* path = (const char*) env.begin();
				while(*path)
				{
					if(path[0] == 'P' && path[1] == 'A' && path[2] == 'T' && path[3] == 'H' && path[4] == '=')
					{
						path+=5;
						Vector<String> dirs = Split(path, ";") ;
						String fullpath = FindInDirs(dirs, "windres.exe");
						windres = GetHostPathShort( fullpath);
						break;
					}
					
					while(*path)++path;
					++path;
				}
				
				String exec;
				exec << windres << " -i " << GetHostPathQ(fn);
				....
 


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47778 is a reply to message #47776] Sat, 25 March 2017 23:16 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

So, this is my path after executing your patch:
D:\u pp\bin/mingw64/64/bin\windres.exe -i "D:\u pp\examples\GeoFun\icon.rc"


Printed with:
Cout() << exec;


The GeoFun still cannot be compiled with your patch when the directory contains space. I think the previous patch do exactly the same (The both paths are equal). Anyway, I will introduced patch that allows you to obtain on host all executable dirs via virtual method.

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [Bug+Patch] when there is a space in Upp path [message #47779 is a reply to message #47778] Sat, 25 March 2017 23:55 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

the call to
windres = GetHostPathShort( fullpath);

is supposed to convert
C:\u pp\bin/mingw64/64/bin\windres.exe

to
C:\UPP~1\bin/mingw64/64/bin\windres.exe


and it work like that for me.

can you look inside GetHostPathShort (breakpoint for example) and verify why it fail ?


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47780 is a reply to message #47779] Sun, 26 March 2017 00:29 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

It seems that the function returns exactly the same string over and over again. So, the conversion to short path never happens. As documentation said:
Quote:

"If the specified path is already in its short form and conversion is not needed, the function simply copies the specified path to the buffer specified by the lpszShortPath parameter."


What is your operating system? My is Windows 10 Pro x86_64.

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [Bug+Patch] when there is a space in Upp path [message #47781 is a reply to message #47780] Sun, 26 March 2017 00:53 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
My is Win 7 pro 64.


regards
omari.
Re: [Bug+Patch] when there is a space in Upp path [message #47788 is a reply to message #47781] Sun, 26 March 2017 12:54 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hello,

i noticed that you corriged a bug by replacing :
#ifdef PLATFORM_WIN32

by
#ifdefied PLATFORM_WIN32 || PLATFORM_WIN64

Is PLATFORM_WIN32 defined when the OS is Windows 10?


regards
omari.

[Updated on: Sun, 26 March 2017 13:32]

Report message to a moderator

Re: [Bug+Patch] when there is a space in Upp path [message #47790 is a reply to message #47788] Sun, 26 March 2017 14:04 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I changed this already and it doesn't help. Yes, PLATFORM_WIN32 is define on 64 bit system and on Windows 10 too.

Can we make something that will not require GetHostPathShort()? For example escaping dir with space etc.

Update:
Seems that when I copied the folder to c:\\ drive GetHostPathShort() is executed correctly. But, this is not solution that making us happy. We need to have bulletproof solution. And the output seems like this:
Final: C:\UPP~1\bin/mingw64/64/bin\windres.exe -i "D:\u pp\examples\GeoFun\icon.rc" -o "D:/u pp/out/examples/GeoFun/MINGWx64.Debug.Debug_Full.Gui.Main.Mt.Noblitz\icon$rc.o" --include-dir="D:\u pp/examples" --include-dir="D:\u pp/uppsrc" --include-dir="C:\UPP~1\bin/mingw64/64/X86_64~1/include" --include-dir="C:\UPP~1\bin/mingw64/64/opt/include" --include-dir="D:/u pp/out/examples/GeoFun/MINGWx64.Debug.Debug_Full.Gui.Main.Mt.Noblitz" -DflagGUI -DflagMT -DflagMAIN -DflagGCC -DflagDEBUG -DflagDEBUG_FULL -DflagWIN32 -D_DEBUG


OK, I seem the problem the assemblies paths are copied from d:\\ drive. I will change and let you know.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 26 March 2017 14:40]

Report message to a moderator

Re: [Bug+Patch] when there is a space in Upp path [message #47791 is a reply to message #47790] Sun, 26 March 2017 15:35 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

After googling I find that your partition needs to support something called "8.3 short file name". This can be done through registry. More information can be found on following page: http://omtool.com/documentation/HPCR/v1.2.0/ServerHelp/Enabl ing_8.3_name_creation.htm. It seems that "C" drive supports it by default.

UPDATE:
Patch on trunk: https://github.com/ultimatepp/mirror/commit/b931d46746ac4a77 d1201053e1d1ece388f05d84. Can you check this implementation?

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 26 March 2017 16:00]

Report message to a moderator

Re: [Bug+Patch] when there is a space in Upp path [message #47792 is a reply to message #47791] Sun, 26 March 2017 23:22 Go to previous message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
It work fine,

Thenks Klugier.


regards
omari.
Previous Topic: Files save issue
Next Topic: MySql and upp 2017r1
Goto Forum:
  


Current Time: Thu Mar 28 22:45:07 CET 2024

Total time taken to generate the page: 0.01019 seconds