This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa/i386] disconnect ``set dissassembly-flavour'' from ``set architecture''
- To: Jim Ingham <jingham at apple dot com>
- Subject: Re: [rfa/i386] disconnect ``set dissassembly-flavour'' from ``set architecture''
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 08 Nov 2001 16:00:18 -0500
- Cc: gdb-patches at sources dot redhat dot com
- References: <62CE3729-D47C-11D5-B0DD-000393540DDC@apple.com>
> THis seems somehow wrong to me.
>
> The problem is that in BFD the architecture and the disassembly style are not separate bits, so you can't say i386 and oh by the way intel printing style, you just switch the architecture. If that is not going to change, and gdb has to work around it, then I would expect that gdb would have a list of disassembly flavors for each architecture (i386, i586, whatever) and a mapping from that pair {gdb-architecture, disassembly flavor} -> bfd architecture. Then when you switched disassembly flavors, gdb would look up the bfd architecture appropriate to that flavor, and use it.
Can you find anything, apart from GDB, that sets a BFD's arch/machine to
XXX_intel_syntax? I couldn't. I could find references and checks but
no actual uses.
> There are different architectures for each flavor in the i386 case. I am not a big BFD expert, but when I originally did this, whoever was working on the BFD side told me I ought to make this change too. If there are not for the other x86 architectures in BFD, that is not a problem, both flavors would just map to the same bfd architecture for this gdb architecture. But just not telling bfd about the change, when in at least one case - i386 - bfd wants to know, seems wrong.
I strongly suspect that the _intel_syntax machine variant is an artifact
of history. People started trying to add machine variants for assembler
flavours but then realised that was a silly idea. The ARM and x86-64
treat the flavour as something orthogonal.
Regarding the problem of:
set architecture arm
set assembler-flavour intel
Yes, that is eventually going to be a problem.
Andrew