From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24070 invoked by alias); 25 May 2007 13:19:19 -0000 Received: (qmail 24056 invoked by uid 22791); 25 May 2007 13:19:18 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 25 May 2007 13:19:16 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 4A354982D1; Fri, 25 May 2007 13:19:14 +0000 (GMT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by nan.false.org (Postfix) with ESMTP id B2325982D0; Fri, 25 May 2007 13:19:13 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1HrZhH-0007gq-8D; Fri, 25 May 2007 09:19:11 -0400 Date: Fri, 25 May 2007 13:19:00 -0000 From: Daniel Jacobowitz To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, Chris Dearman , "Maciej W. Rozycki" Subject: Re: mips-tdep.c: Adjust breakpoints in branch delay slots Message-ID: <20070525131910.GA28994@caradoc.them.org> Mail-Followup-To: "Maciej W. Rozycki" , gdb-patches@sourceware.org, Chris Dearman , "Maciej W. Rozycki" References: <20070524183129.GA10094@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes 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 X-SW-Source: 2007-05/txt/msg00391.txt.bz2 On Fri, May 25, 2007 at 01:21:57PM +0100, Maciej W. Rozycki wrote: > On Fri, 25 May 2007, Maciej W. Rozycki wrote: > > > In principle on bare iron it should be doable, but the problem is, IIRC, > > the state of cp0.cause.bd is not propagated under Linux to userland in any > > way. And at the moment I'm not sure how this would affect EJTAG debugging > > either. > > FYI, I have now checked Linux and it should be fine -- must have been my > bad memory. EJTAG has provisions for handling this correctly > (cp0.debug.dbd), but I'm not sure if associated software gets it right. Great. Want to take a look at doing this the other way then? The best option I can think of would be to fake the PC value based on the value of BD. You might be able to do this cleverly; have a register named "$pc" which shows the hardware contents of the PC register, and have read_pc / unwind_pc / write_pc adjust based on BD. I'm not sure if that will work, but it does mimic the architecture behavior, which is an encouraging sign; and some other platforms do similar magic (e.g. HP/UX and IA64). It might be best to eliminate the setting of PC_REGNUM first, but that's multi-arch work; I see that dwarf2-frame.c relies on it unless you set dwarf2_frame_default_init_reg. -- Daniel Jacobowitz CodeSourcery