From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32254 invoked by alias); 24 Mar 2005 19:57:52 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32235 invoked from network); 24 Mar 2005 19:57:47 -0000 Received: from unknown (HELO e32.co.us.ibm.com) (32.97.110.130) by sourceware.org with SMTP; 24 Mar 2005 19:57:47 -0000 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e32.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j2OJvl5j533864 for ; Thu, 24 Mar 2005 14:57:47 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j2OJvfqa182100 for ; Thu, 24 Mar 2005 12:57:46 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j2OJvfqr008086 for ; Thu, 24 Mar 2005 12:57:41 -0700 Received: from dyn9047022123.beaverton.ibm.com (dyn9047022123.beaverton.ibm.com [9.47.22.123]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j2OJvfoH008065; Thu, 24 Mar 2005 12:57:41 -0700 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb@sources.redhat.com Subject: Re: RFC : Handling breakpoints on archs. with imprecise exceptions. Date: Thu, 24 Mar 2005 19:57:00 -0000 User-Agent: KMail/1.6.2 Cc: Ramana Radhakrishnan , Daniel Jacobowitz , amit bhor References: <42431904.7010708@codito.com> In-Reply-To: <42431904.7010708@codito.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200503241153.01472.pgilliam@us.ibm.com> X-SW-Source: 2005-03/txt/msg00215.txt.bz2 Isn't this usually handled by the kernel? On Thursday 24 March 2005 11:46, Ramana Radhakrishnan wrote: > Hi, > > While looking at a GDB port to a processor that has > imprecise exceptions/ interrupts i.e. the equivalent of a > software breakpoint would require 4 instructions to stop. > With my research I was unable to find any GDB port that > needed to handle such a case. > > The mechanism that is in mind is the following for setting > breakpoints. > > > Description > ------------ > > Maintain a separate breakpoint table to which control would > branch to from the debuggee. So gdb's breakpoint instruction > is replaced by a branch to the corresponding breakpoint > table for the > > 1 . Replace the instruction with a branch to an entry in a > breakpoint table which already contains the necessary > instructions for this purpose. So all that > breakpoint_from_pc does is to encode this branch instruction > and return this as the breakpoint instruction. > > 2. The breakpoint once hit gets informed to gdb as a > breakpoint being hit at some location in the breakpoint > table. So when GDB checks for a breakpoint as having been > hit the PC it should use should be the value of the PC at > which the breakpoint was actually set. > > GDB specifics.: > --------------- > > a. Define gdbarch_adjust_breakpoint_address in the backend > to store the mapping in the backend for the PC at which > breakpoint has been set to the actual value for the PC where > the breakpoint would be reported to have been hit. > > b. Define deprecated_target_wait_hook in the backend to > restore the actual value of the PC for GDB to continue with > its work.However as this is a deprecated hook I would not > like to use this in a new port. > > c. Add a new notify_backend_breakpoint_deleted_hook since > the backend needs notification for the breakpoint being > deleted and hence free an entry in the breakpoint table. > > > > cheers > Ramana