From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26931 invoked by alias); 26 Apr 2005 01:29:40 -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 26880 invoked from network); 26 Apr 2005 01:29:33 -0000 Received: from unknown (HELO heavymobile.ringle.org) (12.153.69.6) by sourceware.org with SMTP; 26 Apr 2005 01:29:33 -0000 Received: by heavymobile.ringle.org (Postfix, from userid 503) id C4FCE6FD1E; Mon, 25 Apr 2005 21:29:32 -0400 (EDT) From: Jon Ringle To: Daniel Jacobowitz Subject: Re: Writing regs to corefile Date: Tue, 26 Apr 2005 08:16:00 -0000 User-Agent: KMail/1.7.1 Cc: gdb@sources.redhat.com References: <200504251636.13657.jon.ringle@comdial.com> <200504252002.33948.jon.ringle@comdial.com> <20050426003139.GA1133@nevyn.them.org> In-Reply-To: <20050426003139.GA1133@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504252129.32245.jon.ringle@comdial.com> X-SW-Source: 2005-04/txt/msg00188.txt.bz2 On Monday 25 April 2005 20:31, Daniel Jacobowitz wrote: > On Mon, Apr 25, 2005 at 08:02:33PM -0400, Jon Ringle wrote: > > On Monday 25 April 2005 17:45, Daniel Jacobowitz wrote: > > > On Mon, Apr 25, 2005 at 04:51:09PM -0400, Jon Ringle wrote: > > > > > > I can't seem to write directly to the core file register set from > > > > > > within gdb (which is why I was hand editing the core file): > > > > > > (gdb) set $r0 = 0xffffffe4 > > > > > > You can't do that without a process to debug. > > > > > > > > > > Yeah. This is a bit unfortunate. Maybe we should allow the loaded > > > > > copy of the registers to be changed. > > > > > > > > I was looking at corelow.c to see if I could add a > > > > core_ops.to_store_registers function to do just that. However, the > > > > first problem I encountered is that the to_store_registers definition > > > > seems to only have a regno parameter. How do I get access to the > > > > value of regno to be stored? > > > > > > From the register cache. You probably don't need to do anything in > > > your dummy to_store_registers routine. > > > > Ok, I created a dummy to_store_registers and a dummy to_prepare_to_store > > in corelow.c. Now I don't get the error message, but setting a register > > doesn't seem to reflect a change: > > > > (gdb) p/x $r0 > > $1 = 0xbee0244c > > (gdb) set $r0=0x1234 > > (gdb) p/x $r0 > > $2 = 0xbee0244c > > Dunno; probably you need to change the way to_fetch_registers works. Yup, that was it. Got it working now. I put a test if (regno==-1) {} around the code contained in get_core_registers(), so that the code doesn't get run when a specific register gets changed. Jon