This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Adding support for 64bit SGI Dwarf2


Hello,

Benjamin Gamsa wrote:

> It seems that gdb 4.17 doesn't work with programs compiled for 64-bit
> mode on SGIs using either gcc or the native compiler.  The number of
> changes seems to be quite small to get it to work, but I'd like to make
> the changes as consistent as possible with the general structure of
> gdb.
>

I think many people would be interested in the changes you needed to make to
get GDB working with SGI's 64 bit ABI.


>
> The problem I have is producing a single gdb that can debug both 64-bit
> and 32-bit SGI programs.  The key problem is with the fundamental or
> builtin types.  In particular, the definition of types like "long" or
> "ptr" depend on how the program was compiled.  I've added a new
> field to objfile to record the word-size of the program being debugged,
> but I find I need the equivalent of c_language_defn_64 and
> c_language_defn_32 to handle the different executables in a clean
> manner.
>
> Is there an example of how to handle this problem from other architectures
> that support both 32 and 64 bit executables?

Unfortunatly, this isn't so simple.

At present GDB is (for the most part) restricted to just a single ISA
(Instruction Set Architecture) and ABI (Application Binary Interface).  To
support both 32 and 64 bit ISA/ABI's you would need to break some fundamental
GDB assumptions, such as the size of a register and the register file, that are
currently pretty much hard-compiled into the GDB binary.

As a starter,  I'd first just look into building two separate GDBs, one for
each of the 32 and 64 bit ABIs.

        hope this helps,

            Andrew