From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10412 invoked by alias); 19 Aug 2003 17:55:21 -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 10397 invoked from network); 19 Aug 2003 17:55:20 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 19 Aug 2003 17:55:20 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h7JHtJt18751 for ; Tue, 19 Aug 2003 13:55:19 -0400 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 h7JHtJs03704; Tue, 19 Aug 2003 13:55:19 -0400 Received: from localhost.localdomain (vpn50-17.rdu.redhat.com [172.16.50.17]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h7JHtInc015896; Tue, 19 Aug 2003 13:55:18 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h7JHtDo31221; Tue, 19 Aug 2003 10:55:13 -0700 Date: Tue, 19 Aug 2003 17:55:00 -0000 From: Kevin Buettner Message-Id: <1030819175512.ZM31220@localhost.localdomain> In-Reply-To: Jimi Xenidis "Powerpc and software single step" (Aug 12, 6:31pm) References: <16185.27333.689024.383508@kitch0.watson.ibm.com> To: Jimi Xenidis , gdb-patches@sources.redhat.com Subject: Re: Powerpc and software single step Cc: Andrew Cagney MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-08/txt/msg00320.txt.bz2 On Aug 12, 6:31pm, Jimi Xenidis wrote: > The AIX kernel does not support single step but the Linux kernel does. > > However, I am working with a remote machine level debugger for PowerPC > that allows me to debug a running Linux kernel and cannot support > single stepping. For this I require that when debugging a Linux > target I need to turn on SOFTWARE_SINGLE_STEP. > > I would like to add this to an "obscure" setting that will turn it on > even under Linux. > Here is the patch.. please accept, feel free to mangle the symbol > names to taste. The patch looks mostly okay to me. I do have some comments and questions though... 1) It is customary to provide ChangeLog entries with patch submissions. 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. 3) Is a copyright assignment needed for this patch? [ This question is not just for Jimi, but for others reading this list as well. I'm leaving Jimi's patch quoted below so that others can look without having to dig up the original patch submission. ] > diff -Naur -X ./Xdiff src/gdb/config/powerpc/tm-linux.h mygdb/gdb/config/powerpc/tm-linux.h > --- src/gdb/config/powerpc/tm-linux.h Thu Jun 12 19:58:07 2003 > +++ mygdb/gdb/config/powerpc/tm-linux.h Tue Aug 12 09:05:02 2003 > @@ -33,9 +33,11 @@ > > /* We can single step on linux */ > #undef SOFTWARE_SINGLE_STEP > -#define SOFTWARE_SINGLE_STEP(p,q) internal_error (__FILE__, __LINE__, "Will never execute!") > +extern void ppc_linux_software_single_step (enum target_signal, int); > +#define SOFTWARE_SINGLE_STEP(sig,bp_p) ppc_linux_software_single_step (sig, bp_p) > #undef SOFTWARE_SINGLE_STEP_P > -#define SOFTWARE_SINGLE_STEP_P() 0 > +extern int ppc_linux_single_step_mode; > +#define SOFTWARE_SINGLE_STEP_P() ppc_linux_single_step_mode > > /* Make sure nexti gets the help it needs for debugging assembly code > without symbols */ > diff -Naur -X ./Xdiff src/gdb/ppc-linux-tdep.c mygdb/gdb/ppc-linux-tdep.c > --- src/gdb/ppc-linux-tdep.c Tue Jun 24 19:09:22 2003 > +++ mygdb/gdb/ppc-linux-tdep.c Tue Aug 12 09:22:11 2003 > @@ -1075,10 +1075,35 @@ > } > } > > +int ppc_linux_single_step_mode = 0; > +void > +ppc_linux_software_single_step (enum target_signal sig , int bp_p) > +{ > + if (ppc_linux_single_step_mode) > + { > + rs6000_software_single_step (sig, bp_p); > + } > + else > + { > + internal_error (__FILE__, __LINE__, "Will never execute!"); > + } > +} > + > void > _initialize_ppc_linux_tdep (void) > { > gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_LINUX, > ppc_linux_init_abi); > add_core_fns (&ppc_linux_regset_core_fns); > + > + add_show_from_set (add_set_cmd("single-step-mode", class_obscure, > + var_integer, > + &ppc_linux_single_step_mode, "\ > +Set single step mode for PowerPCtarget:\n\ > + 0 = Target supports single stepping (i.e. Linux)\n\ > + 1 = Target does not support single stepping (i.e. AIX, Simulators).", > + &setlist), > + &showlist); > } > + > +