#42 "GDB OpenOCD Debugger > Start OpenOCD locally" not working in my environment

Version 1.x
closed
None
5
2014-08-25
2014-03-01
John Moule
No

Hi,

When using the the "GDB OpenOCD Debugger" launch, I can't get the "Start OpenOCD locally" option to work. After a short time of launching I received an error in final launch sequence:

localhost:3333: The system tried to join a drive to a directory on a joined drive.

However, I am able to successfully launch the debug session if I start the openocd server manually, using the same command line that Eclipse issues when the "Start OpenOCD locally" option is selected,ie

D:\openocd\bin>openocd.exe -c gdb_port 3333 -c telnet_port 4444 -f openocd.cfg

I've run this in an Eclipse SDK with a self hosted runtime workbench.

In the method

ilg.gnuarmeclipse.debug.gdbjtag.openocd.Backend.GdbServerStep

the call to launch openocd:

fServerProcess = launchGDBProcess(commandLineArray);

appears to succeed, but the target-select remote localhost:3333 command fails.

Below you can see the versions of stuff I'm using. Any ideas on why the openocd spawn isn't working in my environment?

cheers john

<dsf trace="" attached="">

Versions:
ilg.gnuarmeclipse.debug.gdbjtag.openocd: 1.1.1 (latest from git)

openocd.exe --version
Open On-Chip Debugger 0.8.0-dev-00328-g0b26376 (2014-02-23-19:04)

gdb: gnu gdb 7.6

eclipse/cdt: kepler SR1

host: windows 8.0

1 Attachments

Discussion

1 2 3 > >> (Page 1 of 3)
  • from your log I see:

    'The system tried to join a drive to a directory on a joined drive'

    which I could not find in the CDT source tree, might be an answer from OpenOCD.

    did you also try with the stable 0.7?

    on my Mac I had no problems with OpenOCD 0.7.

     
    • status: open --> accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • any progress with this?

     
  • John Moule
    John Moule
    2014-03-04

    Hi,

    yes I've found the problem thanks. It was more an issue with my usage of openocd; specifically a path issue.

    For the failing case In the GDB OpenOCD Debugging > Debugger > "Other options" field I had:

    "-f openocd.cfg"

    (where openocd.cfg is located in D:\openocd\somn-openocd-20140223\bin)

    And the Executable is:

    "D:\openocd\somn-openocd-20140223\bin\openocd.exe"

    When I used an absolute path in the "Other options" field, eg

    "-f D:\openocd\somn-openocd-20140223\bin\openocd.cfg"

    it worked.

    I'm a little confused as to what openocd is using as its working directory. Perhaps an enhancement could be to add a "Working directory" field to the Debugger LCD tab, like the C/C++ Application>Arguments tab has.

    Incidentally the error message:

    'The system tried to join a drive to a directory on a joined drive'

    is from the Windows USB system I think.

    Best rgds john

     
  • confused as to what openocd is using as its working directory

    yes, this is a known problem with openocd.

    the location of the working directory is configured at build time and is platform dependent. you should find it on your computer, it contains lots of configuration files, and this is the place where it is recommended to store your configuration files.

    an enhancement could be to add a "Working directory" field

    it is not very portable to add absolute paths to configuration files, if really necessary this should be done in two steps, with a global variable and a new interface field.

    but this becomes complicated. the easiest solution is to store your files in the existing configuration folder.

     
  • John Moule
    John Moule
    2014-03-04

    Hi,

    I was referring to the working directory in the context of the following:

    [OpenOCD User’s Guide, Section 4 Running]
    "Configuration files and scripts are searched for in
    1. the current directory,
    2. any search dir specified on the command line using the ‘-s’ option,
    3. any search dir specified using the add_script_search_dir command,
    "

    When I run openocd on the command line I expect the working directory it uses is the directory you are in when openocd is launched. But with Eclipse I'm not sure where that is; is it the installation directory of eclipse, or the location of the C/C++ project you're working with, or ...? My suggestion is to have a new text field, with a browse and variables button etc, to specify this type of working directory. Maybe it could be populated with a default path, perhaps the path of the openocd executable.

    I agree about having absolute paths, but I'm struggling to specify a relative one because I don't know where its relative to.

    cheers john

     
  • working directory ... with Eclipse I'm not sure where that is

    I made a change and the plug-in starts openocd in the project folder. it is functional on my Mac, but did not test it on Windows. could you test it?

    My suggestion is to have a new text field ... populated with a default path, perhaps the path of the openocd executable.

    I considered this, but the default is very platform dependent, and, as I mentioned, it is set at openocd build, so it can be anywhere.

    but you can get the same effect by using -s/--search in the current interface.

    I agree about having absolute paths, but I'm struggling to specify a relative one because I don't know where its relative to.

    relative ones should normally use macros. now they can also be relative to the project folder.

     
  • as always for beta versions, the new one is available from updates-test

     
  • John Moule
    John Moule
    2014-03-04

    Great! I'll give it a go and get back to you (probably tomorrow now).

    cheers john

     
  • John Moule
    John Moule
    2014-03-14

    Hi Liviu,

    I just had some time and came to try this but I can't find the change in http://gnuarmeclipse.sourceforge.net/updates-test. Am I too late? Did you remove it?

    I think the problem has been sorted out for me. The underlying openocd tool has now been modified to put some smarts into it to find its configuration scripts (I think you alluded to this before) so having the facility inside the GUI is less important now.

    cheers john

     
1 2 3 > >> (Page 1 of 3)