Menu

#68 Segger Excecutable path with spaces

Next release
closed-fixed
None
5
2013-12-24
2013-12-23
No

Hi,
I'm using the GNU ARM Eclipse plugins Version 1.1.7-201312221905 with Windows7 64bit and Eclipse Kepler.
In the debugger launch configuration I have the following path to Segger
C:\Program Files (x86)\SEGGER\JLinkARM_V480\JLinkGDBServerCL.exe
(this is the default installation path)
However, the debugger plugin does not like the space in the path.

It reports:
Error in services launch sequence
Error while launching command C:\Program\ Files\ (x86)\SEGGER\JLinkARM_V480\JLinkGDBServerCL.exe -if swd -device MKL25Z128xxx4 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir
Error while launching command C:\Program\ Files\ (x86)\SEGGER\JLinkARM_V480\JLinkGDBServerCL.exe -if swd -device MKL25Z128xxx4 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir
Cannot run program "C:\Program\": Launching failed

Using a path without spaces solves the problem.

Thanks!
Erich Styger

Discussion

  • Liviu Ionescu (ilg)

    oops! :-(

    will be fixed shortly

     
  • Liviu Ionescu (ilg)

    • status: open --> open-accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • Liviu Ionescu (ilg)

    Hi Erich,

    as expected, the problem was in the routine to escape whitespaces, that should behave differently on Windows than on unix.

    could you test the fixed version from

    http://gnuarmeclipse.sourceforge.net/updates-test
    

    and let me know if it is ok, so I can publish it on the main site?

    thank you for your help,

    Liviu

     
  • Erich Styger

    Erich Styger - 2013-12-23

    Hi Liviu,
    things get double quoted now better, but it still fails?

    Error in services launch sequence
    Error while launching command "C:\Program Files (x86)\SEGGER\JLinkARM_V472\JLinkGDBServerCL.exe" -if swd -device MKL25Z128xxx4 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir
    Error while launching command "C:\Program Files (x86)\SEGGER\JLinkARM_V472\JLinkGDBServerCL.exe" -if swd -device MKL25Z128xxx4 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir
    Cannot run program ""C:\Program": Launching failed

     
  • Liviu Ionescu (ilg)

    ok, here is the story:

    • first I thought that using double quotes instead of escaping spaces will fix it
    • then I discovered that the exec() code will try to extract the program name from the command line, but stopped at the first space, inside the the folder name
    • I fixed the code used to start the server and replaced the exec(String) to exec(String[]), which should normally used to avoid the problem with spaces in paths
    • then I tried use absolute path for the gdb client too, and, unfortunately, it failed similarly
    • this time it was worse, since the code to start the client was not in the plug-in, but in CDT, so I had to bring it to the plug-in and do a lot of patching to fix it too

    the version in updates-test now should accept spaces for both the server and the client. please confirm if it works for you too.

    in addition, it should process variable substitutions from the RUn/Debug substitution set and from the C/C++ build variables.

    finally, I disabled the swo output command if the interface is not swd, since I noticed your comment about it.

    thank you for your help to improve the plug-in, and thank you for your very in-depth review.

    I would appreciate if you could open bug/feature request tickets for all problems you identify, so I can keep track of them and finally fix.

    regards,

    Liviu

     
  • Erich Styger

    Erich Styger - 2013-12-24

    Hi Liviu,
    thanks, that new update fixes the problem: I can launch Segger GDB server now even with a space in the path :-)
    Yes, I know that handling spaces in CDT is a pain, and there are still many places where things probably do not work. But any fixes into handling it properly is a good thing to make the tools work with that problem (I know it for myself too).

    About the Segger crash with SWO enabled: I have reported this to Segger yesterday, and they were able to reproduce the problem, and will work on fixing it.

    And yes, I'll open tickets for anything I see worth to change/improve. And I'm a very happy user of your plugins :-)

    Best regards,
    Erich

     
    • Liviu Ionescu (ilg)

      I can launch Segger GDB server now even with a space in the path

      could you also try the client with spaces in the path?

       
  • Erich Styger

    Erich Styger - 2013-12-24

    could you also try the client with spaces in the path?
    You mean Eclipse with a space in the path? Yes, that works.

     
    • Liviu Ionescu (ilg)

      no, the GDB client (arm-none-eabi-gdb) with an absolute path, if you installed the toolchain in the default location it should also have a space in the path.

       
  • Erich Styger

    Erich Styger - 2013-12-24

    Yes, I have the ARM tools in the default path:
    C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q2\bin
    And this worked fine for me.

    Does this help?

     
  • Liviu Ionescu (ilg)

    if the GDB client executable field defines only the program name, with or without macros, then the path is passed separately to the exec() system call, and it works even with spaces.

    if you enter an absolute path (like C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q2\bin\arm-none-eabi-gdb), then things change, and here the original plug-in failed. now it should be fine.

     
  • Erich Styger

    Erich Styger - 2013-12-24

    ah, ok, now I understand.
    I downloaded the latest plugins, and used
    C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q2\bin\arm-none-eabi-gdb.exe
    as my client path.
    And that worked fine :-)

     
  • Liviu Ionescu (ilg)

    good news!

    if no further problems, we'll close this bug.

    thank you for your help.

     
  • Liviu Ionescu (ilg)

    fixed in 1.1.7-201312241058

     
  • Liviu Ionescu (ilg)

    • status: open-accepted --> closed-fixed
     
MongoDB Logo MongoDB