Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Question: CDT Debugging on x86_64

This is currently handle via the binary parser extension point... the problem is that most binaries are Elf so everyone want to just add there little case for there chip since its easier then creating a plugin/extension/binary parser class. I guess part of the problem too is that the Elf class is not very extensible to sub class and add this type of functionality to to base other elf parser off of....

Recoskie, Chris wrote:

Ugh.  This explains why I was having some similar problems yesterday
with a TI specific GDB port.  You just saved me the effort of debugging
it myself :-)

How are we going to handle this in the future?  I don't think we want
every chip vendor having to go and modify this file to add support for
their chips.  It would be much nicer if vendors could use the extension
point mechanism to implement chip support.

Adding support for new chips is going to happen quite often for those of
us living in the embedded world.

___________________________________________

Chris Recoskie
Software Designer
IDE Frameworks Group
Texas Instruments, Toronto



-----Original Message-----
From: cdt-dev-admin@xxxxxxxxxxx [mailto:cdt-dev-admin@xxxxxxxxxxx] On
Behalf Of Peter Faltaous
Sent: Thursday, March 04, 2004 11:19 AM
To: cdt-dev@xxxxxxxxxxx
Cc: faltaous@xxxxxxxxxx
Subject: [cdt-dev] Question: CDT Debugging on x86_64


Hi,

I've been working on porting eclipse to 64 bit platforms. Currently I
am
experiencing the problem that the CDT debug configurations dialog
claims
that there is no debugger available, although debugging works just
fine
(after a simple fix that I've sent to the cdt-patch list). I believe
the
problem is in:

org.eclipse.cdt.launch.ui.CDebuggerTab.loadDebuggerComboBox(org.eclipse.
de
bug.core.ILaunchConfiguration, java.lang.String) at
CDebuggerTab.java:134
	programCPU = bin.getCPU();

which returns: 'java.lang.String "none"' on x86_64 but
returns: 'java.lang.String "x86"' on i386.


I've traced this problem down to the following code snippet in
org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java:

<snip>
              switch (ehdr.e_machine) {
                       case Elf.ELFhdr.EM_386 :
                       case Elf.ELFhdr.EM_486 :
                               attrib.cpu = new String("x86");
                               break;
                       case Elf.ELFhdr.EM_PPC :
                               attrib.cpu = new String("ppc");
                               break;
                       case Elf.ELFhdr.EM_SH :
                               attrib.cpu = new String("sh");
                               break;
                       case Elf.ELFhdr.EM_ARM :
                               attrib.cpu = new String("arm");
                               break;
                       case Elf.ELFhdr.EM_MIPS_RS3_LE :
                       case Elf.ELFhdr.EM_MIPS :
                       case Elf.ELFhdr.EM_RS6000 :
                               attrib.cpu = "mips";
                               break;
                       case Elf.ELFhdr.EM_SPARC32PLUS:
                       case Elf.ELFhdr.EM_SPARC:
                               attrib.cpu = "sparc";
                               break;
                       case Elf.ELFhdr.EM_68K:
                               attrib.cpu = "m68k";
                               break;
                       case Elf.ELFhdr.EM_NONE:
                       default:
                               attrib.cpu = "none";
               }
</snip>

Where there is no definition for X86_64 or IA64 architectures. Was
this
done intentionally or was it left out by mistake assuming that eclipse
(and the CDT) will not be used on 64 bit machines?

Can I just go ahead and add in the definitions for X86_64 and IA64? In
which case what are the values of e_machines for those 2 architectures
defined in the same file?

<snip>
              /* values of e_machine */
               public final static int EM_NONE = 0;
               public final static int EM_M32 = 1;
               public final static int EM_SPARC = 2;
               public final static int EM_386 = 3;
               public final static int EM_68K = 4;
               public final static int EM_88K = 5;
               public final static int EM_486 = 6;
               public final static int EM_860 = 7;
               public final static int EM_MIPS = 8;
               public final static int EM_MIPS_RS3_LE = 10;
               public final static int EM_RS6000 = 11;
               public final static int EM_PA_RSIC = 15;
               public final static int EM_nCUBE = 16;
               public final static int EM_VPP500 = 17;
               public final static int EM_SPARC32PLUS = 18;
               public final static int EM_PPC = 20;
               public final static int EM_ARM = 40;
               public final static int EM_SH = 42;
</snip>

Are there other changes that need to be made?

I appreciate any assistance with this.


Peter Faltaous




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


Back to the top