From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25479 invoked by alias); 23 Jun 2003 21:40:42 -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 17614 invoked from network); 23 Jun 2003 21:38:14 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 23 Jun 2003 21:38:14 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id C3F052B5F; Mon, 23 Jun 2003 17:35:57 -0400 (EDT) Message-ID: <3EF772BD.3020100@redhat.com> Date: Mon, 23 Jun 2003 21:40:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Fred Fish Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Don't clobber info->mach in gdb_print_insn_mips References: <20030623211823.AEF0E2F2F2C@beeville.vert.intrinsity.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00742.txt.bz2 > info->mach field being clobbered by gdb_print_insn_mips. The attached >> > patch fixes it, though I'm not sure if this is the correct solution. > >> >> What happens if info->mach is never set? gdb_disassemble_info should >> have already set it correctly. > > > Yes, gdb_disassemble_info sets it correctly, and then gdb_print_insn_mips > clobbers it back to zero. Here is a typescript showing the order that > various functions are called. > > Without my patch, gdb_disassemble_info sets it to a correct value, > gdb_print_insn_mips clobbers it back to zero, and then eventually > choose_arch_by_number gets called with mach==0 (my typescript shows > 10611501, the expected value for my port, since I have my patch > installed). Since choose_arch_by_number then returns zero, > the code in set_default_mips_dis_options that sets mips_isa > never gets executed: So you're ok if I delete that bit of gdb_print_insn_mips? Andrew