This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: objdump -M for x86
- To: Alan Modra <amodra at bigpond dot net dot au>
- Subject: Re: objdump -M for x86
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 14 Nov 2001 00:28:25 -0500
- Cc: binutils at sources dot redhat dot com, gdb at sources dot redhat dot com
- References: <20011114134429.G6922@bubble.sa.bigpond.net.au>
> Applying to mainline. Note to gdb people: Some backwards compatibility
> stuff can be removed when i386-tdep.c and x86-64-tdep are updated to use
> the new (old!) print_insn_i386.
>
> binutils/ChangeLog
> * doc/binutils.texi (objdump): Document x86 -M options.
> include/ChangeLog
> * dis-asm.h (print_insn_i386): Declare.
> opcodes/ChangeLog
> * disassemble.c (disassembler): Call print_insn_i386.
> * i386-dis.c (SUFFIX_ALWAYS): Define.
> (struct dis_private): Add orig_sizeflag.
> (print_insn_i386): Make it a wrapper, calling..
> (print_insn): ..The old body of print_insn_i386. Avoid longjmp
> warning without using volatile by moving orig_sizeflag to priv,
> and removing inbuf. Parse disassembler_options.
> (print_insn_i386_att, print_insn_i386_intel): Move initialisation
> code to print_insn.
> (putop): Remove #ifdef SUFFIX_ALWAYS.
>
Hmm, I was wondering what you were talking about until I found this:
> + for (p = info->disassembler_options; p != NULL; )
> + {
> + if (strncmp (p, "x86_64", 6) == 0)
> + {
> + mode_64bit = 1;
> + priv.orig_sizeflag = AFLAG | DFLAG;
> + }
> + else if (strncmp (p, "i386", 4) == 0)
> + {
> + mode_64bit = 0;
> + priv.orig_sizeflag = AFLAG | DFLAG;
> + }
> + else if (strncmp (p, "i8086", 5) == 0)
> + {
> + mode_64bit = 0;
> + priv.orig_sizeflag = 0;
> + }
> + else if (strncmp (p, "intel", 5) == 0)
> + {
> + intel_syntax = 1;
> + }
> + else if (strncmp (p, "att", 3) == 0)
> + {
> + intel_syntax = 0;
> + }
>
(x86-64?)
Thanks!
Next problem ... If I understand things correctly, the set of possible
options, for a given ISA family, is finite. Could that finite list be
made available via a published interface? That way GDB could
incorporate them into its CLI so that things like ``set
disassembly-options <tab>'' worked.
To get the feel for what I'm talking about check gdb/arm-tdep.c which
queries opcodes for the ARM register naming conventions.
enjoy,
Andrew