From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12960 invoked by alias); 29 May 2007 07:22:14 -0000 Received: (qmail 12848 invoked by uid 22791); 29 May 2007 07:22:13 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 May 2007 07:22:09 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id l4T7M6Pb116328 for ; Tue, 29 May 2007 07:22:06 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l4T7M6QS4014214 for ; Tue, 29 May 2007 09:22:06 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l4T7M6vd023444 for ; Tue, 29 May 2007 09:22:06 +0200 Received: from [9.152.248.39] (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l4T7M5Kp023418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 May 2007 09:22:06 +0200 Message-ID: <465BD44E.3060103@de.ibm.com> Date: Tue, 29 May 2007 07:22:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: GDB Patches CC: Ulrich Weigand Subject: [rfc] [5/6] Remove macro CANNOT_FETCH / STORE_REGISTERS Content-Type: multipart/mixed; boundary="------------060006010008010604040806" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00417.txt.bz2 This is a multi-part message in MIME format. --------------060006010008010604040806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 977 Hello, this patch removes both CANNOT_FETCH_REGISTERS and CANNOT_STORE_REGISTERS from gdbarch.sh. ChangeLog: * gdbarch.sh (CANNOT_FETCH_REGISTER): Replace by gdbarch_cannot_fetch_register. * alpha-nat.c (fetch_osf_core_registers): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. * m68klinux-nat.c (fetch_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_supply_reg,mipsnbsd_supply_fpreg): Likewise: * gdbarch.sh (CANNOT_STORE_REGISTER): Replace by gdbarch_cannot_store_register. * hppa-linux-nat.c (store_register): Likewise. * inf-ptrace.c (inf_ptrace_store_register): Likewise. * regcache.c (regcache_raw_write): Likewise. * m68klinux-nat.c (store_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_fill_reg, mipsnbsd_fill_fpreg): Likewise. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit? Regards, Markus -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------060006010008010604040806 Content-Type: text/plain; name="diff-remove-FETCHSTORE_REGS" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-FETCHSTORE_REGS" Content-length: 8184 diff -urN src/gdb/alpha-nat.c dev/gdb/alpha-nat.c --- src/gdb/alpha-nat.c 2007-05-14 05:45:00.000000000 +0200 +++ dev/gdb/alpha-nat.c 2007-05-18 12:34:55.000000000 +0200 @@ -89,7 +89,7 @@ for (regno = 0; regno < ALPHA_NUM_REGS; regno++) { - if (CANNOT_FETCH_REGISTER (regno)) + if (gdbarch_cannot_fetch_register (current_gdbarch, regno)) { regcache_raw_supply (regcache, regno, NULL); continue; diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-05-15 05:41:29.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-05-18 12:30:35.000000000 +0200 @@ -767,12 +767,6 @@ fprintf_unfiltered (file, "gdbarch_dump: call_dummy_location = %s\n", paddr_d (current_gdbarch->call_dummy_location)); -#ifdef CANNOT_FETCH_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CANNOT_FETCH_REGISTER(regnum)", - XSTRING (CANNOT_FETCH_REGISTER (regnum))); -#endif fprintf_unfiltered (file, "gdbarch_dump: cannot_fetch_register = <0x%lx>\n", (long) current_gdbarch->cannot_fetch_register); @@ -784,12 +778,6 @@ fprintf_unfiltered (file, "gdbarch_dump: cannot_step_breakpoint = %s\n", paddr_d (current_gdbarch->cannot_step_breakpoint)); -#ifdef CANNOT_STORE_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CANNOT_STORE_REGISTER(regnum)", - XSTRING (CANNOT_STORE_REGISTER (regnum))); -#endif fprintf_unfiltered (file, "gdbarch_dump: cannot_store_register = <0x%lx>\n", (long) current_gdbarch->cannot_store_register); diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-05-15 05:41:29.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-05-18 12:30:24.000000000 +0200 @@ -566,22 +566,10 @@ typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); -#if !defined (GDB_TM_FILE) && defined (CANNOT_FETCH_REGISTER) -#error "Non multi-arch definition of CANNOT_FETCH_REGISTER" -#endif -#if !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) -#endif typedef int (gdbarch_cannot_store_register_ftype) (int regnum); extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); -#if !defined (GDB_TM_FILE) && defined (CANNOT_STORE_REGISTER) -#error "Non multi-arch definition of CANNOT_STORE_REGISTER" -#endif -#if !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) -#endif /* setjmp/longjmp support. */ diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-05-15 05:41:29.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-05-18 12:30:11.000000000 +0200 @@ -480,8 +480,8 @@ # also include/...-sim.h. f:=:int:register_sim_regno:int reg_nr:reg_nr::legacy_register_sim_regno::0 F:=:int:register_bytes_ok:long nr_bytes:nr_bytes -f:=:int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0 -f:=:int:cannot_store_register:int regnum:regnum::cannot_register_not::0 +f::int:cannot_fetch_register:int regnum:regnum::cannot_register_not::0 +f::int:cannot_store_register:int regnum:regnum::cannot_register_not::0 # setjmp/longjmp support. F:=:int:get_longjmp_target:CORE_ADDR *pc:pc # diff -urN src/gdb/hppa-linux-nat.c dev/gdb/hppa-linux-nat.c --- src/gdb/hppa-linux-nat.c 2007-05-07 13:21:04.000000000 +0200 +++ dev/gdb/hppa-linux-nat.c 2007-05-18 12:40:40.000000000 +0200 @@ -221,7 +221,7 @@ int tid; int val; - if (CANNOT_FETCH_REGISTER (regno)) + if (gdbarch_cannot_fetch_register (current_gdbarch, regno)) { regcache_raw_supply (regcache, regno, NULL); return; @@ -249,7 +249,7 @@ int tid; int val; - if (CANNOT_STORE_REGISTER (regno)) + if (gdbarch_cannot_store_register (current_gdbarch, regno)) return; /* GNU/Linux LWP ID's are process ID's. */ diff -urN src/gdb/inf-ptrace.c dev/gdb/inf-ptrace.c --- src/gdb/inf-ptrace.c 2007-05-11 14:04:57.000000000 +0200 +++ dev/gdb/inf-ptrace.c 2007-05-18 12:41:38.000000000 +0200 @@ -626,7 +626,8 @@ /* This isn't really an address, but ptrace thinks of it as one. */ addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 0); - if (addr == (CORE_ADDR)-1 || CANNOT_FETCH_REGISTER (regnum)) + if (addr == (CORE_ADDR)-1 + || gdbarch_cannot_fetch_register (current_gdbarch ,regnum)) { regcache_raw_supply (regcache, regnum, NULL); return; @@ -681,7 +682,8 @@ /* This isn't really an address, but ptrace thinks of it as one. */ addr = inf_ptrace_register_u_offset (current_gdbarch, regnum, 1); - if (addr == (CORE_ADDR)-1 || CANNOT_STORE_REGISTER (regnum)) + if (addr == (CORE_ADDR)-1 + || gdbarch_cannot_store_register (current_gdbarch, regnum)) return; /* Cater for systems like GNU/Linux, that implement threads as diff -urN src/gdb/m68klinux-nat.c dev/gdb/m68klinux-nat.c --- src/gdb/m68klinux-nat.c 2007-05-07 13:21:04.000000000 +0200 +++ dev/gdb/m68klinux-nat.c 2007-05-18 12:43:16.000000000 +0200 @@ -123,7 +123,7 @@ char buf[MAX_REGISTER_SIZE]; int tid; - if (CANNOT_FETCH_REGISTER (regno)) + if (gdbarch_cannot_fetch_register (current_gdbarch, regno)) { memset (buf, '\0', register_size (current_gdbarch, regno)); /* Supply zeroes */ regcache_raw_supply (regcache, regno, buf); @@ -185,10 +185,8 @@ int tid; char buf[MAX_REGISTER_SIZE]; - if (CANNOT_STORE_REGISTER (regno)) - { - return; - } + if (gdbarch_cannot_store_register (current_gdbarch, regno)) + return; /* Overload thread id onto process id */ tid = TIDGET (inferior_ptid); diff -urN src/gdb/mipsnbsd-tdep.c dev/gdb/mipsnbsd-tdep.c --- src/gdb/mipsnbsd-tdep.c 2007-05-11 14:04:57.000000000 +0200 +++ dev/gdb/mipsnbsd-tdep.c 2007-05-18 12:44:58.000000000 +0200 @@ -150,7 +150,7 @@ { if (regno == i || regno == -1) { - if (CANNOT_FETCH_REGISTER (i)) + if (gdbarch_cannot_fetch_register (current_gdbarch, i)) regcache_raw_supply (regcache, i, NULL); else regcache_raw_supply (regcache, i, @@ -165,7 +165,8 @@ int i; for (i = 0; i <= PC_REGNUM; i++) - if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) + if ((regno == i || regno == -1) + && ! gdbarch_cannot_store_register (current_gdbarch, i)) regcache_raw_collect (regcache, i, regs + (i * mips_isa_regsize (current_gdbarch))); } @@ -181,7 +182,7 @@ { if (regno == i || regno == -1) { - if (CANNOT_FETCH_REGISTER (i)) + if (gdbarch_cannot_fetch_register (current_gdbarch, i)) regcache_raw_supply (regcache, i, NULL); else regcache_raw_supply (regcache, i, @@ -197,7 +198,8 @@ for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status; i++) - if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i)) + if ((regno == i || regno == -1) + && ! gdbarch_cannot_store_register (current_gdbarch, i)) regcache_raw_collect (regcache, i, fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch))); } diff -urN src/gdb/regcache.c dev/gdb/regcache.c --- src/gdb/regcache.c 2007-05-14 05:45:00.000000000 +0200 +++ dev/gdb/regcache.c 2007-05-18 12:42:23.000000000 +0200 @@ -616,7 +616,7 @@ /* On the sparc, writing %g0 is a no-op, so we don't even want to change the registers array if something writes to this register. */ - if (CANNOT_STORE_REGISTER (regnum)) + if (gdbarch_cannot_store_register (current_gdbarch, regnum)) return; /* Make certain that the correct cache is selected. */ --------------060006010008010604040806--