Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] [CDT] - Disassembling .a file does not work

The code works for IBinary. .a is IArchive it ends up falling in last state of the condition which just opens the file (nad don't parse it).

The class where this condition is executed is DefaultBinaryFileEditor (package org.eclipse.cdt.internal.ui.editor). And the method is:

@Override
        public IStorage getStorage() throws CoreException {
            if (fStorage == null) {
                IBinaryParser.IBinaryObject object= (IBinaryParser.IBinaryObject)fBinary.getAdapter(IBinaryParser.IBinaryObject.class);
                if (object != null) {
                    IGnuToolFactory factory= (IGnuToolFactory) object.getBinaryParser().getAdapter(IGnuToolFactory.class);
                    if (factory != null) {
                        Objdump objdump= factory.getObjdump(object.getPath());
                        if (objdump != null) {
                            try {
                                fStorage= new FileStorage(new ByteArrayInputStream(objdump.getOutput()), object.getPath());
                            } catch (IOException exc) {
                                CUIPlugin.log(exc);
                            }
                        }
                    }
                }
                if (fStorage == null) {
                    // backwards compatibility
                    fStorage= EditorUtility.getStorage(fBinary);
                    if (fStorage == null) {
                        // fall back to binary content
                        fStorage= (IFile)fBinary.getResource(); -> we achieve here when trying to open .a
                    }
                }
            }
            return fStorage;
        }





On 07/12/2013 09:50 PM, Marc-Andre Laperle wrote:
CDT tries to use objdump when you open a binary with the Default Binary File Editor. Looking at the code, it only works with executables and object files, not archives (.a). Also, I got it working only with Cygwin.

Marc-Andre

On 7/11/2013 4:01 PM, Derek Morris wrote:
CDT doesn't support disassembling of any library of object file.

The only time you can see disassembly is through the debugger, when debugging an application.

If you want to disassemble files, you will need to use an appropriate external tool, such as objdump.


On 11 Jul 2013, at 15:00, Rafael Peria de Sene <rpsene@xxxxxxxxxxxxxxxxxx> wrote:

Hello,

When creating a static library project, after building It I'm unable to disassemble the .a file generate by double clicking on it. I have tried it using the latest CDT version. Does anyone knows why it is happening ?

<ehcagdaa.png>

<djbgcegh.png>


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top