Author Topic: Passing short names as arguments to GCC tools  (Read 3228 times)

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Passing short names as arguments to GCC tools
« on: November 10, 2022, 07:18:33 pm »
This is based on the report on wxForum, where a user using
Code
wxStandardPaths::Get().GetExecutablePath();
in their wxWidgets application unexpectedly received a short name (the long name converted to MS-DOS 8.3 format) when running their application under the C::B debugger.

I think (maybe incorrectly) that the reason is when C::B finds a space in the debugee path, it converts it to short format to pass it to the GNU tools.
IOW, "C:/dev/cb-tests/test-paths-tdm-gcc/bin/Debug/test paths.exe" becomes "C:/dev/cb-tests/TEST-P~2/bin/Debug/TESTPA~1.EXE", see the details in the linked post.

It seems that C::B uses shortened path also when calling windres.

I know that (some) GCC/MinGW toolchain executables had problems with paths with spaces. But perhaps it has been fixed (AFAIK, these days many Windows volumes even do not have short-names generation on) and C::B could have a setting (e.g., in Compiler/Debugger Settings per a compiler/debugger) to not convert the paths? Or is there already a way to do that (tried 20.03 and the latest nightly) or are there still problems with spaces in paths and recent versions of GCC tools?

Thanks
« Last Edit: November 10, 2022, 07:23:28 pm by PB »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Passing short names as arguments to GCC tools
« Reply #1 on: November 11, 2022, 06:11:43 am »
"GetShortPath" is used in CB in a few places.

No idea how many months or years old was my SVN folder.

But one of the seven files was "src\plugins\debuggergdb\debuggergdb.cpp".

It appears to check for a colon ":" and space in the path.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: Passing short names as arguments to GCC tools
« Reply #2 on: November 11, 2022, 11:52:34 am »
Thanks for the reply.

The issue  I referenced is probably quite a rare one, I suppose using 8.3 names for GNU tools usually does not have an adverse effect.

Still, long file names were introduced to the desktop mainstream with Windows 95, i.e., almost three decades ago...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Passing short names as arguments to GCC tools
« Reply #3 on: November 11, 2022, 05:07:36 pm »
If you or the other person reports an issue on the debugging problem; there is a chance one of the devs will take a look and either fix it or add an option to disable it.

The WINDRES usage of short file names is likely still needed; the most common toolchain bug in the past two decades was the need for that reoccurring after it was fixed.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org