From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126300 invoked by alias); 27 Oct 2016 14:55:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 126282 invoked by uid 89); 27 Oct 2016 14:55:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=nec, apparent, *size, NEC X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Oct 2016 14:55:22 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C87B8F294; Thu, 27 Oct 2016 14:55:21 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9REtKcx026291; Thu, 27 Oct 2016 10:55:20 -0400 Subject: Re: [PATCH 07/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind To: Yao Qi , gdb-patches@sourceware.org References: <1472655965-12212-1-git-send-email-yao.qi@linaro.org> <1472655965-12212-8-git-send-email-yao.qi@linaro.org> From: Pedro Alves Message-ID: <8b3bfe2b-c4ea-176d-4647-fed605e09004@redhat.com> Date: Thu, 27 Oct 2016 14:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1472655965-12212-8-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00758.txt.bz2 Note the "brekapoint" typo -- it appears through the series several times, both in code and in email subjects. I suggest using git format-patch, and grep the patches to find them all. On 08/31/2016 04:05 PM, Yao Qi wrote: > +static const gdb_byte * > +mips_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) > +{ > + case MIPS_BP_KIND_32BIT: > + { > + /* The IDT board uses an unusual breakpoint value, and > + sometimes gets confused when it sees the usual MIPS > + breakpoint instruction. */ > + static gdb_byte big_breakpoint[] = { 0, 0x5, 0, 0xd }; > + static gdb_byte little_breakpoint[] = { 0xd, 0, 0x5, 0 }; > + static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd }; > + static gdb_byte pmon_little_breakpoint[] = { 0xd, 0, 0, 0 }; > + static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd }; > + static gdb_byte idt_little_breakpoint[] = { 0xd, 0x0a, 0, 0 }; > + /* Likewise, IRIX appears to expect a different breakpoint, > + although this is not apparent until you try to use pthreads. */ > + static gdb_byte irix_big_breakpoint[] = { 0, 0, 0, 0xd }; > + > + *size = 4; > + > + if (strcmp (target_shortname, "mips") == 0) > + { > + if (byte_order_for_code == BFD_ENDIAN_BIG) > + return idt_big_breakpoint; > + else > + return idt_little_breakpoint; > + } > + else if (strcmp (target_shortname, "ddb") == 0 > + || strcmp (target_shortname, "pmon") == 0 > + || strcmp (target_shortname, "lsi") == 0) > + { > + if (byte_order_for_code == BFD_ENDIAN_BIG) > + return pmon_big_breakpoint; > + else > + return pmon_little_breakpoint; > + } > + else if (gdbarch_osabi (gdbarch) == GDB_OSABI_IRIX) > + return irix_big_breakpoint; FYI, I think all of these above could be removed. target mips/ddb/pmon/etc. are all gone, and we don't support IRIX any longer either: *** Changes in GDB 7.12*** Changes in GDB 7.12 * Support for various remote target protocols and ROM monitors has been removed: target m32rsdi Remote M32R debugging over SDI target mips MIPS remote debugging protocol target pmon PMON ROM monitor target ddb NEC's DDB variant of PMON for Vr4300 target rockhopper NEC RockHopper variant of PMON target lsi LSI variant of PMO *** Changes in GDB 7.10 Support for these obsolete configurations has been removed. SGI Irix-5.x mips-*-irix5* SGI Irix-6.x mips-*-irix6* > + else > + { > + if (byte_order_for_code == BFD_ENDIAN_BIG) > + return big_breakpoint; > + else > + return little_breakpoint; > + } > + } > + default: > + gdb_assert_not_reached ("unexpected mips breakpoint kind"); > + }; > +} > + > +/* This function implements gdbarch_breakpoint_from_pc. It uses the > + program counter value to determine whether a 16- or 32-bit breakpoint > + should be used. It returns a pointer to a string of bytes that encode a > + breakpoint instruction, stores the length of the string to *lenptr, and > + adjusts pc (if necessary) to point to the actual memory location where > + the breakpoint should be inserted. */ I see this comment repeated in several places. Shouldn't we replace it with some "implement foo" comment ? /me reads rest of series... Oh, this is all eliminated in the end. So nevermind. > + > +GDBARCH_BREAKPOINT_FROM_PC (mips) > + Thanks, Pedro Alves