This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

Re: [rfa/i386] disconnect ``set dissassembly-flavour'' from ``set architecture''


> 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



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