From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11786 invoked by alias); 16 Sep 2002 15:26:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11778 invoked from network); 16 Sep 2002 15:26:48 -0000 Received: from unknown (HELO kerberos.suse.cz) (195.47.106.10) by sources.redhat.com with SMTP; 16 Sep 2002 15:26:48 -0000 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (SuSE SMTP server) with ESMTP id 7717059D348; Mon, 16 Sep 2002 17:26:47 +0200 (CEST) Received: from suse.cz (naga.suse.cz [10.20.1.16]) by chimera.suse.cz (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id g8GFQk328096; Mon, 16 Sep 2002 17:26:46 +0200 X-Authentication-Warning: chimera.suse.cz: Host naga.suse.cz [10.20.1.16] claimed to be suse.cz Message-ID: <3D85F836.5090500@suse.cz> Date: Mon, 16 Sep 2002 08:26:00 -0000 From: Michal Ludvig Organization: SuSE CR User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: Mark Kettenis Cc: GDB Patches Subject: Re: [PATCH] Multi-arch i386 instruction printing References: <200209151402.g8FE22B7007402@elgar.kettenis.dyndns.org> Content-Type: multipart/mixed; boundary="------------000702050908070605020905" X-SW-Source: 2002-09/txt/msg00309.txt.bz2 This is a multi-part message in MIME format. --------------000702050908070605020905 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Content-length: 537 Mark Kettenis wrote: > This patch multi-arch's i386 instruction printing. In doing so I took > a somewhat different approach than what's done for other targets, by > always overriding the disassemble_info fields that the i386 > instruction printer cares about. > > Seems to work fine, and should also be able to handle x86_64. Here's the same for x86-64 - just for easier merge when you'll do the multiarch gdb ;-) Can I commit it? Michal Ludvig -- * SuSE CR, s.r.o * mludvig@suse.cz * +420 2 9654 5373 * http://www.suse.cz --------------000702050908070605020905 Content-Type: text/plain; name="x86_64_print_insn.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="x86_64_print_insn.diff" Content-length: 2229 2002-09-16 Michal Ludvig * x86-64-tdep.c (gdb_print_insn_x86_64): Removed. (86_64_print_insn): Added. (x86_64_gdbarch_init): Set print_insn to i386_print_insns. (_initialize_x86_64_tdep): Don't initialize tm_print_insn and tm_print_insn_info. Index: x86-64-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v retrieving revision 1.27 diff -u -p -r1.27 x86-64-tdep.c --- x86-64-tdep.c 12 Sep 2002 08:39:26 -0000 1.27 +++ x86-64-tdep.c 16 Sep 2002 15:19:22 -0000 @@ -820,19 +820,14 @@ x86_64_register_number (const char *name =0C =20 =20 -/* We have two flavours of disassembly. The machinery on this page - deals with switching between those. */ - +/* This is the same as i386_print_insn(). */ static int -gdb_print_insn_x86_64 (bfd_vma memaddr, disassemble_info * info) +x86_64_print_insn (bfd_vma pc, disassemble_info *info) { - if (disassembly_flavour =3D=3D att_flavour) - return print_insn_i386_att (memaddr, info); - else if (disassembly_flavour =3D=3D intel_flavour) - return print_insn_i386_intel (memaddr, info); - /* Never reached -- disassembly_flavour is always either att_flavour - or intel_flavour. */ - internal_error (__FILE__, __LINE__, "failed internal consistency check"); + info->disassembler_options =3D (char *) disassembly_flavour; + info->mach =3D gdbarch_bfd_arch_info (current_gdbarch)->mach; + + return print_insn_i386 (pc, info); } =0C =20 @@ -1021,6 +1016,8 @@ x86_64_gdbarch_init (struct gdbarch_info =20 set_gdbarch_read_fp (gdbarch, cfi_read_fp); =20 + set_gdbarch_print_insn (gdbarch, x86_64_print_insn); +=20=20 /* Discard from the stack the innermost frame, restoring all registers. */ set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame); =20 @@ -1142,9 +1139,6 @@ _initialize_x86_64_tdep (void) offset +=3D x86_64_register_info_table[i].size; } } - - tm_print_insn =3D gdb_print_insn_x86_64; - tm_print_insn_info.mach =3D bfd_mach_x86_64; =20 /* Add the variable that controls the disassembly flavour. */ { --------------000702050908070605020905--