From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14218 invoked by alias); 20 Aug 2004 06:15:11 -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 14193 invoked from network); 20 Aug 2004 06:15:06 -0000 Received: from unknown (HELO mail02.idc.renesas.com) (202.234.163.13) by sourceware.org with SMTP; 20 Aug 2004 06:15:06 -0000 Received: (from root@localhost) by guardian05.idc.renesas.com with id i7K6F2vv029414 for gdb-patches@sources.redhat.com; Fri, 20 Aug 2004 15:15:02 +0900 (JST) Received: from unknown [172.20.8.68] by guardian05.idc.renesas.com with SMTP id RAA29413 ; Fri, 20 Aug 2004 15:15:01 +0900 Received: from mrkaisv.hoku.renesas.com ([10.145.105.245]) by rnsmtp01.hoku_r.renesas.com (8.9.3/3.7W) with ESMTP id PAA05062 for ; Fri, 20 Aug 2004 15:14:57 +0900 (JST) Received: from E5A02646 (unknown [10.145.105.81]) by mrkaisv.hoku.renesas.com (Postfix) with SMTP id A3A247980E2 for ; Fri, 20 Aug 2004 15:14:56 +0900 (JST) Message-ID: <009201c4867d$03ee2830$5169910a@E5A02646> From: "Kei Sakamoto" To: References: <028d01c47aaa$9dbc2a40$5169910a@E5A02646> <200408050918.i759IO7N010150@juw15.nfra.nl> <006701c47b52$3ecdb5a0$5169910a@E5A02646> Subject: Re: [RFA/m32r] m32r-linux support Date: Fri, 20 Aug 2004 06:15:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_008F_01C486C8.73A37590" X-SW-Source: 2004-08/txt/msg00588.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_008F_01C486C8.73A37590 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Content-length: 9469 Hello, I revised the patch of m32r-linux support. Thanks to Mark Kettenis' advice, I removed many unnecessary codes from it and simplified it. But it still contains some stuff to support older versions of Linux because Linux/M32R does not support PTRACE_GETREGS. I also removed the gdbserver support from it. I'll post it as another patch after this patch is accepted. OK to commit? 2004-08-20 Kei Sakamoto Add m32r-linux support. * configure.tgt: Add m32r*-*-linux*. * Makefile.in (ALLDEPFILES): Add m32r-tdep.c, m32r-linux-nat.c and m32r-linux-tdep.c. (m32r-linux-nat.o, m32r-linux-tdep.o): New dependencies. * m32r-linux-nat.c, m32r-linux-tdep.c, config/m32r/linux.mh, config/m32r/linux.mt, config/m32r/m32r.mh, config/m32r/nm-linux.h, config/m32r/tm-linux.h: New files. Kei Sakamoto said: > Hello, Mark, > > Thank you for your reply. It is very useful. > > There is the summer holidays in Japan next week. So I'll modify my > patch and post it after that. > > Kei Sakamoto > > Mark Kettenis said: > > From: "Kei Sakamoto" > > Date: Thu, 5 Aug 2004 14:11:07 +0900 > > > > Hello, > > > > Hi Kei, > > > > First can you seperate out the gdbserver support, and submit that as a > > seperate patch? Daniel will have to review that part of the code. > > Making it seperate will make it more likely that the code can be > > checked in soon. > > > > The attached patch adds m32r-linux support. > > The M32R architecture is not added to the official Linux kernel yet. > > But Linux on M32R is already available. > > http://www.linux-m32r.org/ > > > > So Linux/M32R is a brand new port? Great, but in that case I have > > some comments. It looks like you based your GDB port on the > > Linux/i386 stuff. That's great, but you must realize that part of the > > i386 code that you copied and modified is only there to support older > > versions of Linux. I hope it isn't necessary for Linux/M32R and would > > like you to remove it before this gets committed. I've got a few > > other comments too. Here we go... > > > > diff -u -r1.144 configure.tgt=0A= > > --- configure.tgt 26 Jun 2004 10:06:34 -0000 1.144=0A= > > +++ configure.tgt 5 Aug 2004 04:48:33 -0000=0A= > > @@ -102,7 +103,10 @@ > > ;; > > ia64*-*-*) gdb_target=ia64 ;; > > > > -m32r-*-*) gdb_target=m32r ;; > > +m32r*-*-elf*) gdb_target=m32r ;; > > +m32r*-*-linux*) gdb_target=linux > > + build_gdbserver=3Dyes > > + ;; > > > > m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;; > > > > It might be a good idea to keep m32r-*-* as the generic M32R target. > > Just put the m32r-*-* entry in front of it. > > > > diff -N m32r-linux-nat.c > > --- /dev/null 1 Jan 1970 00:00:00 -0000 > > +++ m32r-linux-nat.c 5 Aug 2004 04:48:33 -0000 > > +/* The register sets used in GNU/Linux ELF core-dumps are identical to > > + the register sets in `struct user' that is used for a.out > > + core-dumps, and is also used by `ptrace'. The corresponding types > > + are `elf_gregset_t' for the general-purpose registers (with > > + `elf_greg_t' the type of a single GP register) and `elf_fpregset_t' > > + for the floating-point registers. > > + > > + Those types used to be available under the names `gregset_t' and > > + `fpregset_t' too, and this file used those names in the past. But > > + those names are now used for the register sets used in the > > + `mcontext_t' type, and have a different size and layout. */ > > + > > +/* Mapping between the general-purpose registers in `struct user' > > + format and GDB's register array layout. */ > > +static int regmap[] = { > > + 4, 5, 6, 7, 0, 1, 2, 8, > > + 9, 10, 11, 12, 13, 24, 25, 23, > > + 19, 31, 26, 23, 20, 30, 16, 15, > > + 32 > > +}; > > > > Does Linux/M32R support a.out? That would really surprise me. So I > > don't think you need this stuff. > > > > +#define M32R_NUM_GREGS 25=0A= > > > > I think that one really belongs in m32r-tdep.h. > > > > +/* Doee apply to the corresponding SET requests as well. * > > +#define GETREGS_SUPPLIES(regno) (0 <=3D (regno) && (regno) <= > M32R_NUM_GREGS) > > +#define GETFPREGS_SUPPLIES(regno) 0 > > > > Does the M32R support floating point registers at all? If not, you > > could rip out all the FPREGS stuff. > > > > +/* Does the current host support the GETREGS request? */ > > +int have_ptrace_getregs = > > +#ifdef HAVE_PTRACE_GETREGS > > + 1 > > +#else > > + 0 > > +#endif > > + ; > > > > I really hope that all released M32R kernels support the > > PTRACE_GETREGS request. In that case this should not be necessary. > > > > > > +/* Support for the user struct. */ > > + > > +/* Return the address of register REGNUM. BLOCKEND is the value of > > + u.u_ar0, which should point to the registers. */ > > + > > +CORE_ADDR > > +register_u_addr (CORE_ADDR blockend, int regnum) > > +{ > > + return (blockend + 4 * regmap[regnum]); > > +} > > + > > +/* Return the size of the user struct. */ > > + > > +int > > +kernel_u_size (void) > > +{ > > + return (sizeof (struct user)); > > +} > > > > The `user struct' is a wart from ancient UNIX. There really is no > > point in supporting it on modern versions of Linux. If Linux/M32R is > > ELF-only and fully supports PTRACE_GETREGS, this can go too. > > > > +#ifdef HAVE_PTRACE_GETREGS > > + > > +/* Fetch all general-purpose registers from process/thread TID and > > + store their values in GDB's register array. */ > > + > > +static void > > +fetch_regs (int tid) > > +{ > > + elf_gregset_t regs; > > + > > > > This code in #ifdef HAVE_PTRACE_GETREGS can be simplified considerably > > if you assume that PTRACE_GETREGS works. Move the code to > > fetch_inferior_registers() and store_inferior_registers() below. > > > > +/* Transferring arbitrary registers between GDB and inferior. */ > > + > > +/* Check if register REGNO in the child process is accessible. > > + If we are accessing registers directly via the U area, only the > > + general-purpose registers are available. > > + All registers should be accessible if we have GETREGS support. */ > > + > > +int > > +cannot_fetch_register (int regno) > > +{ > > + gdb_assert (regno >= 0 && regno < NUM_REGS); > > + return (!have_ptrace_getregs && regmap[regno] == -1); > > +} > > + > > +int > > +cannot_store_register (int regno) > > +{ > > + gdb_assert (regno >= 0 && regno < NUM_REGS); > > + return (!have_ptrace_getregs && regmap[regno] == -1); > > +} > > > > These functions should no longer be necessary. > > > > +/* Accessing registers through the U area, one at a time. */ > > + > > +/* Fetch one register. */ > > + > > +static void > > +fetch_register (int regno) > > +{ > > + int tid; > > + int val; > > + > > + gdb_assert (!have_ptrace_getregs); > > + if (cannot_fetch_register (regno)) > > + { > > + regcache_raw_supply (current_regcache, regno, NULL); > > + return; > > + }= > > > > This can go too; no U area anymore :-). > > > > diff -N config/m32r/linux.mh > > --- /dev/null 1 Jan 1970 00:00:00 -0000 > > +++ config/m32r/linux.mh 5 Aug 2004 04:48:34 -0000 > > @@ -0,0 +1,9 @@ > > +# Host: M32R based machine running GNU/Linux > > + > > +NAT_FILE= nm-linux.h > > +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \ > > + core-aout.o m32r-linux-nat.o linux-proc.o gcore.o \ > > + proc-service.o thread-db.o lin-lwp.o linux-nat.o > > + > > +LOADLIBES=3D -ldl -rdynamic > > > > core-aout.o shouldn't be necessary. > > > > diff -N config/m32r/m32r.mh > > > > Please remove this file. > > > > diff -u -r1.7 m32r.mt > > --- config/m32r/m32r.mt 16 Oct 2003 02:36:39 -0000 1.7 > > +++ config/m32r/m32r.mt 5 Aug 2004 04:48:34 -0000 > > @@ -1,4 +1,5 @@ > > # Target: Renesas m32r processor > > TDEPFILES= m32r-tdep.o monitor.o m32r-rom.o dsrec.o remote-m32r-sdi.o > > +TM_FILE= tm-m32r.h > > SIM_OBS = remote-sim.o > > SIM = ../sim/m32r/libsim.a > > > > This shouldn't be necessary. See below. > > > > diff -N config/m32r/nm-linux.h > > --- /dev/null 1 Jan 1970 00:00:00 -0000 > > +++ config/m32r/nm-linux.h 5 Aug 2004 04:48:34 -0000 > > > > [snip] > > > > +/* Support for the user area. */ > > + > > +/* Return the size of the user struct. */ > > +extern int kernel_u_size (void); > > +#define KERNEL_U_SIZE kernel_u_size() > > + > > +/* This is the amount to subtract from u.u_ar0 > > + to get the offset in the core file of the register values. */ > > +#define KERNEL_U_ADDR 0x0 > > + > > +/* Offset of the registers within the user area. */ > > +#define U_REGS_OFFSET 0 > > + > > +extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum); > > +#define REGISTER_U_ADDR(addr, blockend, regnum) \ > > + (addr) = register_u_addr (blockend, regnum) > > > > This user area stuff can go too. > > > > diff -N config/m32r/tm-m32r.h > > > > This file contains nothing useful. Please remove and adjust tm-linux.h. > > > > I hope you can make the changes. The simplifications will make > > maintaining the code much easier. ------=_NextPart_000_008F_01C486C8.73A37590 Content-Type: application/octet-stream; name="m32r-linux.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="m32r-linux.patch" Content-length: 30568 Index: Makefile.in=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/Makefile.in,v=0A= retrieving revision 1.608=0A= diff -u -r1.608 Makefile.in=0A= --- Makefile.in 14 Aug 2004 20:40:14 -0000 1.608=0A= +++ Makefile.in 20 Aug 2004 05:54:29 -0000=0A= @@ -1373,6 +1373,8 @@=0A= infptrace.c inftarg.c irix4-nat.c irix5-nat.c \=0A= libunwind-frame.c \=0A= lynx-nat.c m3-nat.c \=0A= + m32r-tdep.c \=0A= + m32r-linux-tdep.c m32r-linux-nat.c \=0A= m68hc11-tdep.c \=0A= m68k-tdep.c \=0A= m68kbsd-nat.c m68kbsd-tdep.c \=0A= @@ -2114,6 +2116,11 @@=0A= $(expression_h) $(value_h) $(gdbcore_h) $(target_h) $(m2_lang_h)=0A= m2-valprint.o: m2-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \=0A= $(m2_lang_h)=0A= +m32r-linux-nat.o: m32r-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \= =0A= + $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h)=0A= +m32r-linux-tdep.o: m32r-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \= =0A= + $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \=0A= + $(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h)=0A= m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \= =0A= $(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \=0A= $(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h)=0A= Index: configure.tgt=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/configure.tgt,v=0A= retrieving revision 1.146=0A= diff -u -r1.146 configure.tgt=0A= --- configure.tgt 12 Aug 2004 22:29:56 -0000 1.146=0A= +++ configure.tgt 20 Aug 2004 05:54:29 -0000=0A= @@ -106,7 +106,8 @@=0A= ;;=0A= ia64*-*-*) gdb_target=3Dia64 ;;=0A= =20=0A= -m32r-*-*) gdb_target=3Dm32r ;;=0A= +m32r*-*-linux*) gdb_target=3Dlinux ;;=0A= +m32r*-*-*) gdb_target=3Dm32r ;;=0A= =20=0A= m68hc11*-*-*|m6811*-*-*) gdb_target=3Dm68hc11 ;;=0A= =20=0A= Index: m32r-linux-nat.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: m32r-linux-nat.c=0A= diff -N m32r-linux-nat.c=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ m32r-linux-nat.c 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,345 @@=0A= +/* Native-dependent code for GNU/Linux m32r.=0A= +=0A= + Copyright 2004 Free Software Foundation, Inc.=0A= +=0A= + This file is part of GDB.=0A= +=0A= + This program is free software; you can redistribute it and/or modify=0A= + it under the terms of the GNU General Public License as published by=0A= + the Free Software Foundation; either version 2 of the License, or=0A= + (at your option) any later version.=0A= +=0A= + This program is distributed in the hope that it will be useful,=0A= + but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= + GNU General Public License for more details.=0A= +=0A= + You should have received a copy of the GNU General Public License=0A= + along with this program; if not, write to the Free Software=0A= + Foundation, Inc., 59 Temple Place - Suite 330,=0A= + Boston, MA 02111-1307, USA. */=0A= +=0A= +#include "defs.h"=0A= +#include "inferior.h"=0A= +#include "gdbcore.h"=0A= +#include "regcache.h"=0A= +#include "linux-nat.h"=0A= +=0A= +#include "gdb_assert.h"=0A= +#include "gdb_string.h"=0A= +#include =0A= +#include =0A= +#include =0A= +=0A= +/* Prototypes for supply_gregset etc. */=0A= +#include "gregset.h"=0A= +=0C=0A= +=0A= +=0A= +/* The register sets used in GNU/Linux ELF core-dumps are identical to=0A= + the register sets in `struct user' that is used by `ptrace'. The=0A= + corresponding types are `elf_gregset_t' for the general-purpose=0A= + registers (with `elf_greg_t' the type of a single GP register) and=0A= + `elf_fpregset_t' for the floating-point registers.=0A= +=0A= + Those types used to be available under the names `gregset_t' and=0A= + `fpregset_t' too, and this file used those names in the past. But=0A= + those names are now used for the register sets used in the=0A= + `mcontext_t' type, and have a different size and layout. */=0A= +=0A= +/* Mapping between the general-purpose registers in `struct user'=0A= + format and GDB's register array layout. */=0A= +static int regmap[] =3D {=0A= + 4, 5, 6, 7, 0, 1, 2, 8,=0A= + 9, 10, 11, 12, 13, 24, 25, 23,=0A= + 19, 31, 26, 23, 20, 30, 16, 15,=0A= + 32=0A= +};=0A= +=0A= +/* Doee apply to the corresponding SET requests as well. */=0A= +#define GETREGS_SUPPLIES(regno) (0 <=3D (regno) && (regno) <=3D NUM_REGS)= =0A= +=0A= +/* Does the current host support the GETREGS request? */=0A= +int have_ptrace_getregs =3D=0A= +#ifdef HAVE_PTRACE_GETREGS=0A= + 1=0A= +#else=0A= + 0=0A= +#endif=0A= + ;=0A= +=0C=0A= +=0A= +/* Transfering the general-purpose registers between GDB, inferiors=0A= + and core files. */=0A= +=0A= +/* Fill GDB's register array with the general-purpose register values=0A= + in *GREGSETP. */=0A= +=0A= +void=0A= +supply_gregset (elf_gregset_t * gregsetp)=0A= +{=0A= + elf_greg_t *regp =3D (elf_greg_t *) gregsetp;=0A= + int i;=0A= +=0A= + for (i =3D 0; i < NUM_REGS; i++)=0A= + regcache_raw_supply (current_regcache, i, regp + regmap[i]);=0A= +}=0A= +=0A= +/* Fill register REGNO (if it is a general-purpose register) in=0A= + *GREGSETPS with the value in GDB's register array. If REGNO is -1,=0A= + do this for all registers. */=0A= +=0A= +void=0A= +fill_gregset (elf_gregset_t * gregsetp, int regno)=0A= +{=0A= + elf_greg_t *regp =3D (elf_greg_t *) gregsetp;=0A= + int i;=0A= +=0A= + for (i =3D 0; i < NUM_REGS; i++)=0A= + if (regno =3D=3D -1 || regno =3D=3D i)=0A= + regcache_raw_collect (current_regcache, i, regp + regmap[i]);=0A= +}=0A= +=0A= +#ifdef HAVE_PTRACE_GETREGS=0A= +=0A= +/* Fetch all general-purpose registers from process/thread TID and=0A= + store their values in GDB's register array. */=0A= +=0A= +static void=0A= +fetch_regs (int tid)=0A= +{=0A= + elf_gregset_t regs;=0A= +=0A= + if (ptrace (PTRACE_GETREGS, tid, 0, (int) ®s) < 0)=0A= + {=0A= + if (errno =3D=3D EIO)=0A= + {=0A= + /* The kernel we're running on doesn't support the GETREGS=0A= + request. Reset `have_ptrace_getregs'. */=0A= + have_ptrace_getregs =3D 0;=0A= + return;=0A= + }=0A= +=0A= + perror_with_name ("Couldn't get registers");=0A= + }=0A= +=0A= + supply_gregset (®s);=0A= +}=0A= +=0A= +/* Store all valid general-purpose registers in GDB's register array=0A= + into the process/thread specified by TID. */=0A= +=0A= +static void=0A= +store_regs (int tid, int regno)=0A= +{=0A= + elf_gregset_t regs;=0A= +=0A= + if (ptrace (PTRACE_GETREGS, tid, 0, (int) ®s) < 0)=0A= + perror_with_name ("Couldn't get registers");=0A= +=0A= + fill_gregset (®s, regno);=0A= +=0A= + if (ptrace (PTRACE_SETREGS, tid, 0, (int) ®s) < 0)=0A= + perror_with_name ("Couldn't write registers");=0A= +}=0A= +=0A= +#else=0A= +=0A= +static void=0A= +fetch_regs (int tid)=0A= +{=0A= +}=0A= +static void=0A= +store_regs (int tid, int regno)=0A= +{=0A= +}=0A= +=0A= +#endif=0A= +=0C=0A= +=0A= +/* Transfering floating-point registers between GDB, inferiors and cores. = */=0A= +=0A= +/* Fill GDB's register array with the floating-point register values in=0A= + *FPREGSETP. */=0A= +=0A= +void=0A= +supply_fpregset (elf_fpregset_t * fpregsetp)=0A= +{=0A= +}=0A= +=0A= +/* Fill register REGNO (if it is a floating-point register) in=0A= + *FPREGSETP with the value in GDB's register array. If REGNO is -1,=0A= + do this for all registers. */=0A= +=0A= +void=0A= +fill_fpregset (elf_fpregset_t * fpregsetp, int regno)=0A= +{=0A= +}=0A= +=0A= +=0C=0A= +=0A= +/* Transferring arbitrary registers between GDB and inferior. */=0A= +=0A= +/* Check if register REGNO in the child process is accessible.=0A= + If we are accessing registers directly via the U area, only the=0A= + general-purpose registers are available.=0A= + All registers should be accessible if we have GETREGS support. */=0A= +=0A= +int=0A= +cannot_fetch_register (int regno)=0A= +{=0A= + gdb_assert (regno >=3D 0 && regno < NUM_REGS);=0A= + return (!have_ptrace_getregs && regmap[regno] =3D=3D -1);=0A= +}=0A= +=0A= +int=0A= +cannot_store_register (int regno)=0A= +{=0A= + gdb_assert (regno >=3D 0 && regno < NUM_REGS);=0A= + return (!have_ptrace_getregs && regmap[regno] =3D=3D -1);=0A= +}=0A= +=0A= +/* Accessing registers through the U area, one at a time. */=0A= +=0A= +/* Fetch one register. */=0A= +=0A= +static void=0A= +fetch_register (int regno)=0A= +{=0A= + int tid;=0A= + int val;=0A= +=0A= + gdb_assert (!have_ptrace_getregs);=0A= + if (cannot_fetch_register (regno))=0A= + {=0A= + regcache_raw_supply (current_regcache, regno, NULL);=0A= + return;=0A= + }=0A= +=0A= + /* GNU/Linux LWP ID's are process ID's. */=0A= + tid =3D TIDGET (inferior_ptid);=0A= + if (tid =3D=3D 0)=0A= + tid =3D PIDGET (inferior_ptid); /* Not a threaded program. */=0A= +=0A= + errno =3D 0;=0A= + val =3D ptrace (PTRACE_PEEKUSER, tid, 4 * regmap[regno], 0);=0A= + if (errno !=3D 0)=0A= + error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno),= =0A= + regno, safe_strerror (errno));=0A= +=0A= + regcache_raw_supply (current_regcache, regno, &val);=0A= +}=0A= +=0A= +/* Store one register. */=0A= +=0A= +static void=0A= +store_register (int regno)=0A= +{=0A= + int tid;=0A= + int val;=0A= +=0A= + gdb_assert (!have_ptrace_getregs);=0A= + if (cannot_store_register (regno))=0A= + return;=0A= +=0A= + /* GNU/Linux LWP ID's are process ID's. */=0A= + tid =3D TIDGET (inferior_ptid);=0A= + if (tid =3D=3D 0)=0A= + tid =3D PIDGET (inferior_ptid); /* Not a threaded program. */=0A= +=0A= + errno =3D 0;=0A= + regcache_raw_collect (current_regcache, regno, &val);=0A= + ptrace (PTRACE_POKEUSER, tid, 4 * regmap[regno], val);=0A= + if (errno !=3D 0)=0A= + error ("Couldn't write register %s (#%d): %s.", REGISTER_NAME (regno),= =0A= + regno, safe_strerror (errno));=0A= +}=0A= +=0A= +/* Fetch register REGNO from the child process. If REGNO is -1, do=0A= + this for all registers (including the floating point and SSE=0A= + registers). */=0A= +=0A= +void=0A= +fetch_inferior_registers (int regno)=0A= +{=0A= + int tid;=0A= +=0A= + /* Use the old method of peeking around in `struct user' if the=0A= + GETREGS request isn't available. */=0A= + if (!have_ptrace_getregs)=0A= + {=0A= + int i;=0A= +=0A= + for (i =3D 0; i < NUM_REGS; i++)=0A= + if (regno =3D=3D -1 || regno =3D=3D i)=0A= + fetch_register (i);=0A= +=0A= + return;=0A= + }=0A= +=0A= + /* GNU/Linux LWP ID's are process ID's. */=0A= + tid =3D TIDGET (inferior_ptid);=0A= + if (tid =3D=3D 0)=0A= + tid =3D PIDGET (inferior_ptid); /* Not a threaded program. */=0A= +=0A= + /* Use the PTRACE_GETFPXREGS request whenever possible, since it=0A= + transfers more registers in one system call, and we'll cache the=0A= + results. */=0A= + if (regno =3D=3D -1)=0A= + {=0A= + fetch_regs (tid);=0A= +=0A= + /* The call above might reset `have_ptrace_getregs'. */=0A= + if (!have_ptrace_getregs)=0A= + {=0A= + fetch_inferior_registers (regno);=0A= + return;=0A= + }=0A= +=0A= + return;=0A= + }=0A= +=0A= + if (GETREGS_SUPPLIES (regno))=0A= + {=0A= + fetch_regs (tid);=0A= + return;=0A= + }=0A= +=0A= + internal_error (__FILE__, __LINE__,=0A= + "Got request for bad register number %d.", regno);=0A= +}=0A= +=0A= +/* Store register REGNO back into the child process. If REGNO is -1,=0A= + do this for all registers (including the floating point and SSE=0A= + registers). */=0A= +void=0A= +store_inferior_registers (int regno)=0A= +{=0A= + int tid;=0A= +=0A= + /* Use the old method of poking around in `struct user' if the=0A= + SETREGS request isn't available. */=0A= + if (!have_ptrace_getregs)=0A= + {=0A= + int i;=0A= +=0A= + for (i =3D 0; i < NUM_REGS; i++)=0A= + if (regno =3D=3D -1 || regno =3D=3D i)=0A= + store_register (i);=0A= +=0A= + return;=0A= + }=0A= +=0A= + /* GNU/Linux LWP ID's are process ID's. */=0A= + if ((tid =3D TIDGET (inferior_ptid)) =3D=3D 0)=0A= + tid =3D PIDGET (inferior_ptid); /* Not a threaded program. */=0A= +=0A= + if (regno =3D=3D -1 || GETREGS_SUPPLIES (regno))=0A= + {=0A= + store_regs (tid, regno);=0A= + return;=0A= + }=0A= +=0A= + internal_error (__FILE__, __LINE__,=0A= + "Got request to store bad register number %d.", regno);=0A= +}=0A= Index: m32r-linux-tdep.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: m32r-linux-tdep.c=0A= diff -N m32r-linux-tdep.c=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ m32r-linux-tdep.c 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,334 @@=0A= +/* Target-dependent code for GNU/Linux m32r.=0A= +=0A= + Copyright 2004 Free Software Foundation, Inc.=0A= +=0A= + This file is part of GDB.=0A= +=0A= + This program is free software; you can redistribute it and/or modify=0A= + it under the terms of the GNU General Public License as published by=0A= + the Free Software Foundation; either version 2 of the License, or=0A= + (at your option) any later version.=0A= +=0A= + This program is distributed in the hope that it will be useful,=0A= + but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= + GNU General Public License for more details.=0A= +=0A= + You should have received a copy of the GNU General Public License=0A= + along with this program; if not, write to the Free Software=0A= + Foundation, Inc., 59 Temple Place - Suite 330,=0A= + Boston, MA 02111-1307, USA. */=0A= +=0A= +#include "defs.h"=0A= +#include "gdbcore.h"=0A= +#include "frame.h"=0A= +#include "value.h"=0A= +#include "regcache.h"=0A= +#include "inferior.h"=0A= +#include "osabi.h"=0A= +#include "reggroups.h"=0A= +=0A= +#include "gdb_string.h"=0A= +=0A= +#include "glibc-tdep.h"=0A= +#include "solib-svr4.h"=0A= +=0A= +#include "trad-frame.h"=0A= +#include "frame-unwind.h"=0A= +=0C=0A= +=0A= +/* Recognizing signal handler frames. */=0A= +=0A= +/* GNU/Linux has two flavors of signals. Normal signal handlers, and=0A= + "realtime" (RT) signals. The RT signals can provide additional=0A= + information to the signal handler if the SA_SIGINFO flag is set=0A= + when establishing a signal handler using `sigaction'. It is not=0A= + unlikely that future versions of GNU/Linux will support SA_SIGINFO=0A= + for normal signals too. */=0A= +=0A= +/* When the m32r Linux kernel calls a signal handler and the=0A= + SA_RESTORER flag isn't set, the return address points to a bit of=0A= + code on the stack. This function returns whether the PC appears to=0A= + be within this bit of code.=0A= +=0A= + The instruction sequence for normal signals is=0A= + ldi r7, #__NR_sigreturn=0A= + trap #2=0A= + or 0x67 0x77 0x10 0xf2.=0A= +=0A= + Checking for the code sequence should be somewhat reliable, because=0A= + the effect is to call the system call sigreturn. This is unlikely=0A= + to occur anywhere other than in a signal trampoline.=0A= +=0A= + It kind of sucks that we have to read memory from the process in=0A= + order to identify a signal trampoline, but there doesn't seem to be=0A= + any other way. Therefore we only do the memory reads if no=0A= + function name could be identified, which should be the case since=0A= + the code is on the stack.=0A= +=0A= + Detection of signal trampolines for handlers that set the=0A= + SA_RESTORER flag is in general not possible. Unfortunately this is=0A= + what the GNU C Library has been doing for quite some time now.=0A= + However, as of version 2.1.2, the GNU C Library uses signal=0A= + trampolines (named __restore and __restore_rt) that are identical=0A= + to the ones used by the kernel. Therefore, these trampolines are=0A= + supported too. */=0A= +=0A= +/* If PC is in a sigtramp routine, return the address of the start of=0A= + the routine. Otherwise, return 0. */=0A= +=0A= +static CORE_ADDR=0A= +m32r_linux_sigtramp_start (CORE_ADDR pc)=0A= +{=0A= + /* We only recognize a signal trampoline if PC is at the start of=0A= + one of the instructions. We optimize for finding the PC at the=0A= + start of the instruction sequence, as will be the case when the=0A= + trampoline is not the first frame on the stack. We assume that=0A= + in the case where the PC is not at the start of the instruction=0A= + sequence, there will be a few trailing readable bytes on the=0A= + stack. */=0A= +=0A= + if (pc % 2 !=3D 0)=0A= + {=0A= + if (read_memory_unsigned_integer (pc, 2) =3D=3D 0x10f2)=0A= + pc -=3D 2;=0A= + else=0A= + return 0;=0A= + }=0A= +=0A= + if (read_memory_unsigned_integer (pc, 4) !=3D 0x677710f2)=0A= + return 0;=0A= +=0A= + return pc;=0A= +}=0A= +=0A= +/* This function does the same for RT signals. Here the instruction=0A= + sequence is=0A= + ldi r7, #__NR_rt_sigreturn=0A= + trap #2=0A= + or 0x97 0xf0 0x00 0xad 0x10 0xf2 0xf0 0x00.=0A= +=0A= + The effect is to call the system call rt_sigreturn. */=0A= +=0A= +/* If PC is in a RT sigtramp routine, return the address of the start=0A= + of the routine. Otherwise, return 0. */=0A= +=0A= +static CORE_ADDR=0A= +m32r_linux_rt_sigtramp_start (CORE_ADDR pc)=0A= +{=0A= + /* We only recognize a signal trampoline if PC is at the start of=0A= + one of the instructions. We optimize for finding the PC at the=0A= + start of the instruction sequence, as will be the case when the=0A= + trampoline is not the first frame on the stack. We assume that=0A= + in the case where the PC is not at the start of the instruction=0A= + sequence, there will be a few trailing readable bytes on the=0A= + stack. */=0A= +=0A= + if (pc % 2 !=3D 0)=0A= + return 0;=0A= +=0A= + switch (read_memory_unsigned_integer (pc, 4))=0A= + {=0A= + case 0x97f000ad:=0A= + if (read_memory_unsigned_integer (pc + 4, 4) =3D=3D 0x10f2f000)=0A= + return pc;=0A= + break;=0A= + case 0x10f2f000:=0A= + if (read_memory_unsigned_integer (pc - 4, 4) =3D=3D 0x97f000ad)=0A= + return pc - 4;=0A= + break;=0A= + }=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +m32r_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)=0A= +{=0A= + /* If we have NAME, we can optimize the search. The trampolines are=0A= + named __restore and __restore_rt. However, they aren't dynamically= =0A= + exported from the shared C library, so the trampoline may appear to= =0A= + be part of the preceding function. This should always be sigaction,= =0A= + __sigaction, or __libc_sigaction (all aliases to the same function). = */=0A= + if (name =3D=3D NULL || strstr (name, "sigaction") !=3D NULL)=0A= + return (m32r_linux_sigtramp_start (pc) !=3D 0=0A= + || m32r_linux_rt_sigtramp_start (pc) !=3D 0);=0A= +=0A= + return (strcmp ("__restore", name) =3D=3D 0=0A= + || strcmp ("__restore_rt", name) =3D=3D 0);=0A= +}=0A= +=0A= +/* From . */=0A= +static int m32r_linux_sc_reg_offset[] =3D {=0A= + 4 * 4, /* r0 */=0A= + 5 * 4, /* r1 */=0A= + 6 * 4, /* r2 */=0A= + 7 * 4, /* r3 */=0A= + 0 * 4, /* r4 */=0A= + 1 * 4, /* r5 */=0A= + 2 * 4, /* r6 */=0A= + 8 * 4, /* r7 */=0A= + 9 * 4, /* r8 */=0A= + 10 * 4, /* r9 */=0A= + 11 * 4, /* r10 */=0A= + 12 * 4, /* r11 */=0A= + 13 * 4, /* r12 */=0A= + 21 * 4, /* fp */=0A= + 22 * 4, /* lr */=0A= + -1 * 4, /* sp */=0A= + 16 * 4, /* psw */=0A= + -1 * 4, /* cbr */=0A= + 23 * 4, /* spi */=0A= + 20 * 4, /* spu */=0A= + 19 * 4, /* bpc */=0A= + 17 * 4, /* pc */=0A= + 15 * 4, /* accl */=0A= + 14 * 4 /* acch */=0A= +};=0A= +=0A= +#define M32R_SP_REGNUM 15=0A= +=0A= +struct m32r_frame_cache=0A= +{=0A= + CORE_ADDR base, pc;=0A= + struct trad_frame_saved_reg *saved_regs;=0A= +};=0A= +=0A= +static struct m32r_frame_cache *=0A= +m32r_linux_sigtramp_frame_cache (struct frame_info *next_frame,=0A= + void **this_cache)=0A= +{=0A= + struct m32r_frame_cache *cache;=0A= + CORE_ADDR sigcontext_addr, addr;=0A= + int regnum;=0A= +=0A= + if ((*this_cache) !=3D NULL)=0A= + return (*this_cache);=0A= + cache =3D FRAME_OBSTACK_ZALLOC (struct m32r_frame_cache);=0A= + (*this_cache) =3D cache;=0A= + cache->saved_regs =3D trad_frame_alloc_saved_regs (next_frame);=0A= +=0A= + cache->base =3D frame_unwind_register_unsigned (next_frame, M32R_SP_REGN= UM);=0A= + sigcontext_addr =3D cache->base + 4;=0A= +=0A= + cache->pc =3D frame_pc_unwind (next_frame);=0A= + addr =3D m32r_linux_sigtramp_start (cache->pc);=0A= + if (addr =3D=3D 0)=0A= + {=0A= + /* If this is a RT signal trampoline, adjust SIGCONTEXT_ADDR=0A= + accordingly. */=0A= + addr =3D m32r_linux_rt_sigtramp_start (cache->pc);=0A= + if (addr)=0A= + sigcontext_addr +=3D 128;=0A= + else=0A= + addr =3D frame_func_unwind (next_frame);=0A= + }=0A= + cache->pc =3D addr;=0A= +=0A= + cache->saved_regs =3D trad_frame_alloc_saved_regs (next_frame);=0A= +=0A= + for (regnum =3D 0; regnum < sizeof (m32r_linux_sc_reg_offset) / 4; regnu= m++)=0A= + {=0A= + if (m32r_linux_sc_reg_offset[regnum] >=3D 0)=0A= + cache->saved_regs[regnum].addr =3D=0A= + sigcontext_addr + m32r_linux_sc_reg_offset[regnum];=0A= + }=0A= +=0A= + return cache;=0A= +}=0A= +=0A= +static void=0A= +m32r_linux_sigtramp_frame_this_id (struct frame_info *next_frame,=0A= + void **this_cache,=0A= + struct frame_id *this_id)=0A= +{=0A= + struct m32r_frame_cache *cache =3D=0A= + m32r_linux_sigtramp_frame_cache (next_frame, this_cache);=0A= +=0A= + (*this_id) =3D frame_id_build (cache->base, cache->pc);=0A= +}=0A= +=0A= +static void=0A= +m32r_linux_sigtramp_frame_prev_register (struct frame_info *next_frame,=0A= + void **this_cache,=0A= + int regnum, int *optimizedp,=0A= + enum lval_type *lvalp,=0A= + CORE_ADDR *addrp,=0A= + int *realnump, void *valuep)=0A= +{=0A= + struct m32r_frame_cache *cache =3D=0A= + m32r_linux_sigtramp_frame_cache (next_frame, this_cache);=0A= +=0A= + trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum,=0A= + optimizedp, lvalp, addrp, realnump, valuep);=0A= +}=0A= +=0A= +static const struct frame_unwind m32r_linux_sigtramp_frame_unwind =3D {=0A= + SIGTRAMP_FRAME,=0A= + m32r_linux_sigtramp_frame_this_id,=0A= + m32r_linux_sigtramp_frame_prev_register=0A= +};=0A= +=0A= +static const struct frame_unwind *=0A= +m32r_linux_sigtramp_frame_sniffer (struct frame_info *next_frame)=0A= +{=0A= + CORE_ADDR pc =3D frame_pc_unwind (next_frame);=0A= + char *name;=0A= +=0A= + find_pc_partial_function (pc, &name, NULL, NULL);=0A= + if (m32r_linux_pc_in_sigtramp (pc, name))=0A= + return &m32r_linux_sigtramp_frame_unwind;=0A= +=0A= + return NULL;=0A= +}=0A= +=0A= +static struct link_map_offsets *=0A= +m32r_linux_svr4_fetch_link_map_offsets (void)=0A= +{=0A= + static struct link_map_offsets lmo;=0A= + static struct link_map_offsets *lmp =3D NULL;=0A= +=0A= + if (lmp =3D=3D NULL)=0A= + {=0A= + lmp =3D &lmo;=0A= +=0A= + /* Everything we need is in the first 8 bytes. */=0A= + lmo.r_debug_size =3D 8;=0A= + lmo.r_map_offset =3D 4;=0A= + lmo.r_map_size =3D 4;=0A= +=0A= + /* Everything we need is in the first 20 bytes. */=0A= + lmo.link_map_size =3D 20;=0A= + lmo.l_addr_offset =3D 0;=0A= + lmo.l_addr_size =3D 4;=0A= + lmo.l_name_offset =3D 4;=0A= + lmo.l_name_size =3D 4;=0A= + lmo.l_next_offset =3D 12;=0A= + lmo.l_next_size =3D 4;=0A= + lmo.l_prev_offset =3D 16;=0A= + lmo.l_prev_size =3D 4;=0A= + }=0A= +=0A= + return lmp;=0A= +}=0A= +=0A= +static void=0A= +m32r_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)=0A= +{=0A= + struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch);=0A= +=0A= + frame_unwind_append_sniffer (gdbarch, m32r_linux_sigtramp_frame_sniffer)= ;=0A= +=0A= + set_solib_svr4_fetch_link_map_offsets=0A= + (gdbarch, m32r_linux_svr4_fetch_link_map_offsets);=0A= +}=0A= +=0A= +/* Provide a prototype to silence -Wmissing-prototypes. */=0A= +extern void _initialize_m32r_linux_tdep (void);=0A= +=0A= +void=0A= +_initialize_m32r_linux_tdep (void)=0A= +{=0A= + gdbarch_register_osabi (bfd_arch_m32r, 0, GDB_OSABI_LINUX,=0A= + m32r_linux_init_abi);=0A= +}=0A= Index: config/m32r/linux.mh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: config/m32r/linux.mh=0A= diff -N config/m32r/linux.mh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ config/m32r/linux.mh 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,8 @@=0A= +# Host: M32R based machine running GNU/Linux=0A= +=0A= +NAT_FILE=3D nm-linux.h=0A= +NATDEPFILES=3D infptrace.o inftarg.o fork-child.o corelow.o \=0A= + m32r-linux-nat.o linux-proc.o gcore.o \=0A= + proc-service.o thread-db.o lin-lwp.o linux-nat.o=0A= +=0A= +LOADLIBES=3D -ldl -rdynamic=0A= Index: config/m32r/linux.mt=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: config/m32r/linux.mt=0A= diff -N config/m32r/linux.mt=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ config/m32r/linux.mt 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,6 @@=0A= +# Target: Renesas M32R running GNU/Linux=0A= +TDEPFILES=3D m32r-tdep.o m32r-linux-tdep.o remote-m32r-sdi.o glibc-tdep.o = solib.o solib-svr4.o solib-legacy.o=0A= +TM_FILE=3D tm-linux.h=0A= +=0A= +SIM_OBS =3D remote-sim.o=0A= +SIM =3D ../sim/m32r/libsim.a=0A= Index: config/m32r/m32r.mh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: config/m32r/m32r.mh=0A= diff -N config/m32r/m32r.mh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ config/m32r/m32r.mh 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,8 @@=0A= +# Host: M32R running GNU/Linux=0A= +=0A= +NAT_FILE=3D nm-linux.h=0A= +NATDEPFILES=3D infptrace.o inftarg.o fork-child.o corelow.o \=0A= + core-regset.o linux-proc.o gcore.o \=0A= + proc-service.o thread-db.o lin-lwp.o=0A= +=0A= +LOADLIBES =3D -ldl -rdynamic=0A= Index: config/m32r/nm-linux.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: config/m32r/nm-linux.h=0A= diff -N config/m32r/nm-linux.h=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ config/m32r/nm-linux.h 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,29 @@=0A= +/* Definitions to make GDB run on an M32R based machine under GNU/Linux.= =0A= + Copyright 2004 Free Software Foundation, Inc.=0A= +=0A= + This file is part of GDB.=0A= +=0A= + This program is free software; you can redistribute it and/or modify=0A= + it under the terms of the GNU General Public License as published by=0A= + the Free Software Foundation; either version 2 of the License, or=0A= + (at your option) any later version.=0A= +=0A= + This program is distributed in the hope that it will be useful,=0A= + but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= + GNU General Public License for more details.=0A= +=0A= + You should have received a copy of the GNU General Public License=0A= + along with this program; if not, write to the Free Software=0A= + Foundation, Inc., 59 Temple Place - Suite 330,=0A= + Boston, MA 02111-1307, USA. */=0A= +=0A= +#ifndef NM_M32R_LINUX_H=0A= +#define NM_M32R_LINUX_H=0A= +=0A= +#include "config/nm-linux.h"=0A= +=0A= +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */= =0A= +#define FETCH_INFERIOR_REGISTERS=0A= +=0A= +#endif /* NM_M32R_LINUX_H */=0A= Index: config/m32r/tm-linux.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: config/m32r/tm-linux.h=0A= diff -N config/m32r/tm-linux.h=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ config/m32r/tm-linux.h 20 Aug 2004 05:54:29 -0000=0A= @@ -0,0 +1,29 @@=0A= +/* Target-specific definitions for GNU/Linux running on a Renesas=0A= + M32R.=20=0A= +=0A= + Copyright 2004 Free Software Foundation, Inc.=0A= +=0A= + This file is part of GDB.=0A= +=0A= + This program is free software; you can redistribute it and/or modify=0A= + it under the terms of the GNU General Public License as published by=0A= + the Free Software Foundation; either version 2 of the License, or=0A= + (at your option) any later version.=0A= +=0A= + This program is distributed in the hope that it will be useful,=0A= + but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= + GNU General Public License for more details.=0A= +=0A= + You should have received a copy of the GNU General Public License=0A= + along with this program; if not, write to the Free Software=0A= + Foundation, Inc., 59 Temple Place - Suite 330,=0A= + Boston, MA 02111-1307, USA. */=0A= +=0A= +#ifndef TM_LINUX_H=0A= +#define TM_LINUX_H=0A= +=0A= +/* Pull in GNU/Linux generic defs. */=0A= +#include "config/tm-linux.h"=0A= +=0A= +#endif /* #ifndef TM_LINUX_H */=0A= ------=_NextPart_000_008F_01C486C8.73A37590--