From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6525 invoked by alias); 14 Nov 2001 05:28:30 -0000 Mailing-List: contact gdb-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6481 invoked from network); 14 Nov 2001 05:28:26 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sourceware.cygnus.com with SMTP; 14 Nov 2001 05:28:26 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id C72993D6C; Wed, 14 Nov 2001 00:28:25 -0500 (EST) Message-ID: <3BF200F9.4070601@cygnus.com> Date: Fri, 02 Nov 2001 12:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Alan Modra Cc: binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: objdump -M for x86 References: <20011114134429.G6922@bubble.sa.bigpond.net.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00041.txt.bz2 > 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 '' 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