From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3888 invoked by alias); 7 May 2004 14:40:18 -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 3873 invoked from network); 7 May 2004 14:40:17 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 7 May 2004 14:40:17 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i47EeH0o012107 for ; Fri, 7 May 2004 10:40:17 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i47EeGv23022; Fri, 7 May 2004 10:40:16 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id C0E2E2B9D; Fri, 7 May 2004 10:40:16 -0400 (EDT) Message-ID: <409B9FD0.8070003@gnu.org> Date: Fri, 07 May 2004 14:40:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Fix a few bugs in hppa-linux-nat References: <20040429061207.GW3965@tausq.org> In-Reply-To: <20040429061207.GW3965@tausq.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00196.txt.bz2 > These have been sitting in my system for a few days... when i submitted > the hppa-linux-nat code initially these weren't quite working. Finally > managed to track down the bugs. Ok to commit? > > Fixes thread_db handling and some corefile stuff. Just some tweaks before committing. > 2004-04-28 Randolph Chung > > * hppa-linux-nat.c (fetch_register, store_register): Define. > (fetch_inferior_registers, store_inferior_registers): Define. > (supply_gregset): Add comment and clean up some unneeded code. > (fill_gregset): Add comment and fix so that it saves registers in > the right place in the gregset. > (fill_fpregset): Fix buffer overrun problem. > * config/pa/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define. Don't forget Makefile.in, and mention those extra #includes. > Index: hppa-linux-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/hppa-linux-nat.c,v > retrieving revision 1.1 > diff -u -p -r1.1 hppa-linux-nat.c > --- hppa-linux-nat.c 29 Apr 2004 03:36:49 -0000 1.1 > +++ hppa-linux-nat.c 29 Apr 2004 05:49:59 -0000 > @@ -22,8 +22,10 @@ > #include "gdbcore.h" > #include "regcache.h" > #include "gdb_string.h" > +#include "inferior.h" > > #include > +#include > #include > #include > > @@ -199,6 +201,99 @@ static const int greg_map[] = > CCR_REGNUM, EIEM_REGNUM, > }; > > + > + > +/* Fetch one register. */ > + > +static void > +fetch_register (int regno) > +{ > + int tid; > + int val; > + > + if (CANNOT_FETCH_REGISTER (regno)) > + { > + supply_register (regno, NULL); > + return; > + } > + > + /* GNU/Linux LWP ID's are process ID's. */ > + tid = TIDGET (inferior_ptid); > + if (tid == 0) > + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ > + > + errno = 0; > + val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0); > + if (errno != 0) > + error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno), > + regno, safe_strerror (errno)); > + > + supply_register (regno, &val); use regcache_raw_supply.instead. > +} > + > +/* Store one register. */ > + > +static void > +store_register (int regno) > +{ > + int tid; > + int val; > + > + if (CANNOT_STORE_REGISTER (regno)) > + return; > + > + /* GNU/Linux LWP ID's are process ID's. */ > + tid = TIDGET (inferior_ptid); > + if (tid == 0) > + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ > + > + errno = 0; > + regcache_collect (regno, &val); use regcache_raw_collect instead. Andrew