|
|
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 |
omari
Messages: 275 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 |
|
Klugier
Messages: 1093 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 |
omari
Messages: 275 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 #47763 is a reply to message #47760] |
Mon, 20 March 2017 23:33 |
omari
Messages: 275 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 #47776 is a reply to message #47770] |
Fri, 24 March 2017 23:46 |
omari
Messages: 275 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 #47779 is a reply to message #47778] |
Sat, 25 March 2017 23:55 |
omari
Messages: 275 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 #47790 is a reply to message #47788] |
Sun, 26 March 2017 14:04 |
|
Klugier
Messages: 1093 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
|
|
|
|
|
Goto Forum:
Current Time: Thu Jan 02 16:59:38 CET 2025
Total time taken to generate the page: 0.04262 seconds
|
|
|