From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8913 invoked by alias); 19 Aug 2003 22:32:41 -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 8896 invoked from network); 19 Aug 2003 22:32:40 -0000 Received: from unknown (HELO igw2.watson.ibm.com) (129.34.20.6) by sources.redhat.com with SMTP; 19 Aug 2003 22:32:40 -0000 Received: from sp1n293en1.watson.ibm.com (sp1n293en1.watson.ibm.com [9.2.112.57]) by igw2.watson.ibm.com (8.11.7/8.11.4) with ESMTP id h7JMUEj129702; Tue, 19 Aug 2003 18:30:14 -0400 Received: from kitch0.watson.ibm.com (kitch0.watson.ibm.com [9.2.224.107]) by sp1n293en1.watson.ibm.com (8.11.7/8.11.7) with ESMTP id h7JMWW159472; Tue, 19 Aug 2003 18:32:32 -0400 Received: (from jimix@localhost) by kitch0.watson.ibm.com (AIX4.3/8.9.3p2/8.9.3/09-18-2002) id SAA65074; Tue, 19 Aug 2003 18:32:32 -0400 From: Jimi Xenidis MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16194.42367.562777.115053@kitch0.watson.ibm.com> Date: Tue, 19 Aug 2003 22:32:00 -0000 To: Daniel Jacobowitz Cc: Kevin Buettner , gdb-patches@sources.redhat.com, Andrew Cagney Subject: Re: Powerpc and software single step In-Reply-To: <20030819191300.GA24336@nevyn.them.org> References: <16185.27333.689024.383508@kitch0.watson.ibm.com> <1030819175512.ZM31220@localhost.localdomain> <20030819191300.GA24336@nevyn.them.org> X-SW-Source: 2003-08/txt/msg00327.txt.bz2 >>>>> "DJ" == Daniel Jacobowitz writes: DJ> On Tue, Aug 19, 2003 at 10:55:13AM -0700, Kevin Buettner wrote: >> 2) Why is ``ppc_linux_single_step_mode'' an extern in tm-linux.h? I >> would really prefer that it be local to ppc-linux-tdep.c. If >> there's some compelling reason for it to not be local, then we can >> discuss adding it to ppc-tdep.h. DJ> Could we do this slightly differently? SOFTWARE_SINGLE_STEP_P is used DJ> in two non-platform-specific files: infptrace.c for a sanity DJ> check, This sanity check is wierd, does it expect PT_STEP to be defined _and_ not supported? DJ> Why not add a hook to check there which lets the user use software DJ> single step? It'll require playing with the target macros; we'd need DJ> something like: DJ> SOFTWARE_SINGLE_STEP - perform software single step DJ> SOFTWARE_SINGLE_STEP_P - SOFTWARE_SINGLE_STEP available DJ> SOFTWARE_SINGLE_STEP_ONLY_P - no hardware singlestep available DJ> (check that in infptrace instead of SOFTWARE_SINGLE_STEP_P?) I believe that this increases the complexity of the solution. On first inspection it looks like the proper solution is simply abstracting single step and let the code do the appropriate thing.. but that could easily break older targets that are not actively maintained, but I yield to senior heads on this. My first attempt was to drag ppc/rs6000 into the gdbarch world and drop the #defines all together. However, the test (_P) rotuine tests a function pointer and it was not readily apparent how to have a set command set a function pointer or actually run code to do so. Perhaps pairing it with a gdbarch boolean? -JX BTW: since generating the patch I have discovered that the add_set_cmd() should actually be using var_boolean.