Problem with remote debugging via Momentics

It’s been a while since I used the Momentics IDE (I’m more of a hands on debug via gdb on the actual machine guy) but someone else here wants to debug via the Momentics IDE.

So he has Momentics setup with the project and it’s building a debug version.

I created a target machine and I can connect to the target (qconn is running and pdebug is on the target machine) and view processes etc.

So I am trying to create a debug session via Run->Debug. I set the main tab to get the process I want to debug. I set the download tab to download to the directory on the target I want the exe copied to. I remembered to uncheck the strip debug info. I apply. Then I click debug.

At this point I get the following error from Momentics:

Errors Running Operation:

Launching (error: unable to start debugger session)

Unable to start debugger session.
org.eclipse.core.runtime.CoreException: An internal error occurred during: “Starting gdb session”.
com.qnx.tools.ide.qde.internal.ui.launch.LaunchConfigurationDelegate.launch(LaunchConfigurationDelegate.java:493)
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:150)
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:792)
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:955)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
An internal error occurred during: “Starting gdb session”.
org.eclipse.core.runtime.CoreException: An internal error occurred during: “Starting gdb session”.
com.qnx.tools.ide.qde.internal.ui.launch.LaunchConfigurationDelegate.launch(LaunchConfigurationDelegate.java:493)
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:150)
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:792)
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:955)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

Starting gdb session (error: An internal error occurred during: “Starting gdb session”)

An internal error occurred during: “Starting gdb session”.
java.lang.NullPointerException
com.qnx.tools.ide.core.QNXIdePlugin.getBinPaths(QNXIdePlugin.java:126)
com.qnx.tools.ide.core.QNXIdePlugin.getBinaryFullpath(QNXIdePlugin.java:152)
com.qnx.tools.ide.qde.debug.internal.core.QDEDebugger.createAttachSessionWithWait(QDEDebugger.java:134)
com.qnx.tools.ide.qde.debug.internal.core.QDEDebugger.createAttachSession(QDEDebugger.java:93)
com.qnx.tools.ide.qde.internal.ui.launch.LaunchConfigurationDelegate$DebugSessionJob.run(LaunchConfigurationDelegate.java:119)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

Anyone know why I’m getting the NULL pointer exception in Java?

TIA,

Tim

Hi Tim, i too have this problem from time to time, relaunching the debug almost ever helped me.
It seems that the IDE is trying to start debugging before qconn and the download have ended their communication.
Somehow there is a race condition, but i couldn´t reproduce it yet. As i already told, i restart the debugging once or twice
and the it works for me. I did not yet file any report, since it happens just about 7once a month.

It is much easier to just use pdebug on the target and gdb on your dev_station.
No IDE complexity at all.
By default pdebug will listen on port 8000. When you start gdb you will need to set target

target qnx <target_ip_addr>:8000
And you are there. Well it is text based but simple and work excellent for me.

It sounds to me like there is something in your launch configuration that is querying the project to find the location of the binary.
A couple of questions/things to try:
0) Is the binary specified in the launch configuration actually present? If you deleted or moved the binary then the launch
configuration doesn’t automatically update.

  1. Is the binary selected for launch the right match for the target? By default the launch configuration will filter the binaries
    to match the target, but it can be turned off/bypassed.
  2. Is the project using linked folders or files? Are the binaries in the linked folders/files? There were some outstanding
    issues with this scenario
  3. So you have any additional dependent libraries specified in the debug configuration.

If all else fails you might want to grab the Tau next generation release of the IDE from www.foundry27.com in the
IDE project. There are preliminary builds there of the next gen IDE release.

It is also a great place to ask IDE questions.

Koko,

If it was me, I’d just use gdb directly on the QNX node. But the other developer wants to use the full graphical capabilites of the IDE because he comes from a Visual Studio background.

Thomas,

  1. Yes, I browsed directly to the executable file when I was trying to launch and it did indeed exist.

  2. I don’t understand what you mean here. How would the IDE know if the binary matches the target? Shouldn’t it just copy any binary to the target and attempt to debug it?

  3. By linked folders do you mean on the target machine or my Windows one? No on the windows, yes on the target. Just in case you meant the target, I changed the target location of where to copy the exe to the users home directory which obviously has no links. Still no go.

  4. No. I statically link everything so the exe is completely self contained.

Also, I changed the debug parameters on the IDE to just debug an exe directly on the target (ie not copy the file as part of the launch). Then I manually copied the exe there. When I attempt to debug I get the same error. So the problem is nothing to do with copying the file but rather connecting to the target in some way.

Incidentally, the Windows machine has 2 NIC cards in it. One for a corporate Windows network and one where the target system resides. They are on completely seperate IP networks (10...* vs 192.168..). I wonder if that might be an issue for the IDE when launching debug sessions (even tho the IDE can in fact see the target machine and let me view processes).

Tim

On our project ever question is fullfilled too (Also as mentioned we do not have this problem that often)
0)Yes it is the right executable and available
1)Yes it is for our x86 architecture and it is still in the same place
2)no linked folders or similar
3)no additional depencies.

It looks like the IDE tries to contact qconn but is not able to download the executable to the target,
something like: Could not download ex… Java NULL Pointer Exception (something like this was our error message)

Also on a unrelated note.

I want to check the base IDE configuration (.metadata folder and .cdtproject, .project files) into a source tree but I don’t want to save the target machine information, just the code base. So each developer can set their target machine info when they check out the project tree.

Does anyone know where the target machine info is saved? Is it in the .metadata folder or the .cdtproject/.project files?

Tim