This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
``set disassembly-flavour'' vs ``set architecture'' for i386
- To: gdb at sources dot redhat dot com
- Subject: ``set disassembly-flavour'' vs ``set architecture'' for i386
- From: Jim Ingham <jingham at apple dot com>
- Date: Thu, 8 Nov 2001 10:49:31 -0800
Note that this command works both on x86 and on arm, so you have to
check both if you are doing anything to it. However, it is not
implemented for other architectures - which is formally incorrect,
though these are the only two that have more than one flavor, so it
hasn't mattered up to now.
I am not sure how far the "set architecture" goes here, but
theoretically set architecture and set disassembly-flavor are not wholly
independent. The way it should really work is that each architecture
should have a list of disassembly flavors. Then when you switch
architectures, you should check the disassembly flavor list. If the
current flavor exists in the list for the new architecture then the
flavor should not be changed. Otherwise, you should switch it to
whatever the default for the new architecture is. If you switched, for
instance, from i586 to arm, you would have to choose a new
disassembly-flavor, since there are more than one flavor in each set,
and they are non-overlapping.
However, it is pretty clear that having the set disassembly-flavor
change the architecture is wrong. For instance, in the future when I
can run gdb and do set architecture from x86 to arm, if I were running
in x86 mode I would NOT expect "set disassembly-flavor std" to switch
the architecture to arm. I would expect it to give me an error saying
"no such disassembly flavor "std""...
Jim
On Thursday, November 8, 2001, at 04:03 AM, gdb-digest-
help@sources.redhat.com wrote:
> Date: Wed, 07 Nov 2001 21:13:57 -0500
> From: Andrew Cagney <ac131313@cygnus.com>
> Subject: Re: ``set disassembly-flavour'' vs ``set architecture'' for
> i386
> To: Fernando Nasser <fnasser@redhat.com>
> Cc: gdb@sources.redhat.com
> Message-id: <3BE9EA65.30207@cygnus.com>
> MIME-version: 1.0
> Content-type: text/plain; format=flowed; charset=us-ascii
> Content-transfer-encoding: 7BIT
>
>>
>> This was added by Jim Ingham in 1999. Perhaps there was no set
>> architecture
>> command at that time?
>
> There probably was but what it did back then probably wasn't what it
> does now.
>
> Anyway, I think Eli is right. The disassembler style and the
> architecture are orthogonal. ``set disassembly..'' shouldn't be forcing
> things to a 386 when the cpu could be a [0123456789]86.
>
> Andrew
>
--
Jim Ingham jingham@apple.com
Developer Tools - gdb
Apple Computer