1

The Eclipse CDT Binary Parser 'GNU Elf Parser' is having trouble on my Eclipse install on Windows.

  • All works fine on linux install

Problem

I have a compiled ELF in the GNU ELF 32 format. When I attempt to view this with the GNU Elf Parser, I get:

java.io.IOException: Cannot run program "objdump": Launching failed
at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:347)
...
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

Deubg

Of course, this just means the CDT-plugins can't find objdump.

  • The ELF tested opens correctly in a linux-eclipse-cdt install

  • Say my objdump is located at 'C:\binutils\bin'

  • How the heck do you setup Eclipse's CLASSPATH to search there?

I've tried several things, from editing my system PATH, or CLASSPATH. I've also tried setting Workspace & C/C++ Build/Env settings. Nothing has worked.

Question

How the heck do you get this to work?

Edit - Basic Solution

Feel kind of silly, but to solve you just need to install MinGW and add C:/MinGW/bin to PATH. Then restart Eclipse.

  • I'm producing my own Eclipse distro with our own in-house toolchain & objdump versions, thus the mixup!

  • I've tried several other ways to get this to work (so I can eventually use our own objdump instance, but no luck!

Basic Solution Notes:

  1. All you need from C:\MinGW\bin to make this work is:

    • objdump.exe
    • addr2line.exe
    • c++filt.exe
    • libgcc_s_sw2-1.dll
    • zlib1.dll

So if you move these to, say C:\myGnuBinUtils and add that to your system PATH (not some eclipse-setting, the actual path), then this works too.

  • these files are 24MB total; MinGW is 715MB...

Does anyone know how to achieve the same result with out HAVING to modify system PATH?

J-Dizzle
  • 4,861
  • 4
  • 40
  • 50

1 Answers1

2

It sounds like you need an "ObjDump" Java wrapper. For example:

"CLASSPATH" is Java-only: it won't affect running a non-Java .exe

Java exec() will use the system PATH of your Java VM. You can, however, modify it at runtime. For example:

using Runtime.exec() in Java

ProcessBuilder proc = new ProcessBuilder("<Directory PAth>" + "Executable.exe");
proc.redirectOutput(ProcessBuilder.Redirect.INHERIT);
proc.directory(fi); //fi = the output directory path
proc.start();
Community
  • 1
  • 1
FoggyDay
  • 11,962
  • 4
  • 34
  • 48