From ba94208e02e5c1ba320e49213dd48ae3527d6524 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 18 Nov 2002 15:42:54 +0000 Subject: [PATCH] new File --- .../eclipse/cdt/core/model/IBinaryParser.java | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryParser.java diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryParser.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryParser.java new file mode 100644 index 00000000000..0bbaae1172a --- /dev/null +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryParser.java @@ -0,0 +1,87 @@ +package org.eclipse.cdt.core.model; + +/* + * (c) Copyright IBM Corp. 2000, 2001. + * All Rights Reserved. + */ + +import java.io.IOException; +import java.io.InputStream; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IAdaptable; + +/** + */ +public interface IBinaryParser { + + /** + * Represents a binary file for example an ELF executable. + */ + public interface IBinaryFile extends IAdaptable { + public int OBJECT = 0x1; + public int EXECUTABLE = 0x02; + public int SHARED = 0x04; + public int ARCHIVE = 0x08; + + public IFile getFile(); + public int getType(); + public InputStream getContents(); + } + + /** + * Represents an archive. + */ + public interface IBinaryArchive extends IBinaryFile { + public IBinaryObject[] getObjects(); + } + + /** + * Represents a binary, for example an ELF excutable. + */ + public interface IBinaryObject extends IBinaryFile { + + public boolean hasDebug(); + + public String getCPU(); + + public long getText(); + + public long getData(); + + public long getBSS(); + + public boolean isLittleEndian(); + + public ISymbol[] getSymbols(); + + public String getName(); + + } + + /** + * An executable. + */ + public interface IBinaryExecutable extends IBinaryObject { + public String[] getNeededSharedLibs(); + } + + /** + * A DLL. + */ + public interface IBinaryShared extends IBinaryExecutable { + public String getSoName(); + } + + public interface ISymbol { + public int FUNCTION = 0x01; + public int VARIABLE = 0x02; + + public String getName(); + public int getLineNumber(); + public String getFilename(); + public int getType(); + } + + public IBinaryFile getBinary(IFile file) throws IOException; +}