From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29905 invoked by alias); 24 Mar 2005 21:30:37 -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 29751 invoked from network); 24 Mar 2005 21:30:31 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 24 Mar 2005 21:30:31 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j2OLUV1P000964 for ; Thu, 24 Mar 2005 16:30:31 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j2OLUVO12947 for ; Thu, 24 Mar 2005 16:30:31 -0500 Received: from localhost.localdomain (vpn50-40.rdu.redhat.com [172.16.50.40]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j2OLUUmq010335 for ; Thu, 24 Mar 2005 16:30:30 -0500 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id j2OLUPge030607 for ; Thu, 24 Mar 2005 14:30:25 -0700 Date: Thu, 24 Mar 2005 21:30:00 -0000 From: Kevin Buettner To: gdb@sources.redhat.com Subject: Re: RFC : Handling breakpoints on archs. with imprecise exceptions. Message-ID: <20050324143025.45e7d57d@ironwood.lan> In-Reply-To: <42431904.7010708@codito.com> References: <42431904.7010708@codito.com> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-03/txt/msg00218.txt.bz2 On Fri, 25 Mar 2005 01:16:12 +0530 Ramana Radhakrishnan wrote: > 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. Another approach, different from the one you outlined, is to use a branch-to-self as the breakpoint instruction. The stub needs to periodically check to see if the task being debugged is stopped at one of these infinite loop instructions upon which a breakpoint has been placed. If so, it interrupts the task and reports a SIGTRAP to GDB. I know of at least one case where this was done - though, as I recall, it was done because the processor provided no other suitable breakpoint instruction. This approach makes the stub somewhat more complicated, but has the virtue of keeping the GDB implementation relatively simple. Kevin