From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21530 invoked by alias); 12 Jun 2007 16:06:39 -0000 Received: (qmail 21504 invoked by uid 22791); 12 Jun 2007 16:06:36 -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, 12 Jun 2007 16:06:28 +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 l5CG6PPL102134 for ; Tue, 12 Jun 2007 16:06:25 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 l5CG6PSG4006056 for ; Tue, 12 Jun 2007 18:06:25 +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 l5CG6PIL032371 for ; Tue, 12 Jun 2007 18:06:25 +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 l5CG6OOM032341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Jun 2007 18:06:25 +0200 Message-ID: <466EC42F.8010700@de.ibm.com> Date: Tue, 12 Jun 2007 16:06: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] [3/6] Remove macros CONVERT_REGISTER_P, REGISTER_TO_VALUE and VALUE_TO_REGISTER Content-Type: multipart/mixed; boundary="------------050502000103090608070305" 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-06/txt/msg00193.txt.bz2 This is a multi-part message in MIME format. --------------050502000103090608070305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 655 Hello, this patch removes CONVERT_REGISTER_P, REGISTER_TO_VALUE and VALUE_TO_REGISTER macros from gdbarch.sh ChangeLog: * gdbarch.sh (REGISTER_TO_VALUE): Replace by gdbarch_register_to_value. * findvar.c (value_from_register): Likewise. * gdbarch.sh (VALUE_TO_REGISTER): Replace by gdbarch_value_to_register. * valops.c (value_assign): Likewise. * gdbarch.sh (CONVERT_REGISTER_P): Replace by gdbarch_convert_register_p. * findvar.c (value_from_register): Likewise. * valops.c (value_assign): Likewise. * gdbarch.c, gdbarch.h: Regenerate. Is this ok to commit? -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------050502000103090608070305 Content-Type: text/plain; name="diff-remove-REGISTER_CONV" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-remove-REGISTER_CONV" Content-length: 7445 diff -urN src/gdb/findvar.c dev/gdb/findvar.c --- src/gdb/findvar.c 2007-06-11 11:31:56.000000000 +0200 +++ dev/gdb/findvar.c 2007-06-11 20:11:39.000000000 +0200 @@ -624,20 +624,21 @@ struct type *type1 = check_typedef (type); struct value *v; - if (CONVERT_REGISTER_P (regnum, type1)) + if (gdbarch_convert_register_p (current_gdbarch, regnum, type1)) { /* The ISA/ABI need to something weird when obtaining the specified value from this register. It might need to re-order non-adjacent, starting with REGNUM (see MIPS and i386). It might need to convert the [float] register into the corresponding [integer] type (see Alpha). The assumption - is that REGISTER_TO_VALUE populates the entire value + is that gdbarch_register_to_value populates the entire value including the location. */ v = allocate_value (type); VALUE_LVAL (v) = lval_register; VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; - REGISTER_TO_VALUE (frame, regnum, type1, value_contents_raw (v)); + gdbarch_register_to_value (current_gdbarch, + frame, regnum, type1, value_contents_raw (v)); } else { diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c --- src/gdb/gdbarch.c 2007-06-11 11:31:56.000000000 +0200 +++ dev/gdb/gdbarch.c 2007-06-11 20:11:39.000000000 +0200 @@ -751,12 +751,6 @@ fprintf_unfiltered (file, "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n", (long) current_gdbarch->convert_from_func_ptr_addr); -#ifdef CONVERT_REGISTER_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CONVERT_REGISTER_P(regnum, type)", - XSTRING (CONVERT_REGISTER_P (regnum, type))); -#endif fprintf_unfiltered (file, "gdbarch_dump: convert_register_p = <0x%lx>\n", (long) current_gdbarch->convert_register_p); @@ -1155,12 +1149,6 @@ fprintf_unfiltered (file, "gdbarch_dump: register_sim_regno = <0x%lx>\n", (long) current_gdbarch->register_sim_regno); -#ifdef REGISTER_TO_VALUE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REGISTER_TO_VALUE(frame, regnum, type, buf)", - XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf))); -#endif fprintf_unfiltered (file, "gdbarch_dump: register_to_value = <0x%lx>\n", (long) current_gdbarch->register_to_value); @@ -1303,12 +1291,6 @@ fprintf_unfiltered (file, "gdbarch_dump: value_from_register = <0x%lx>\n", (long) current_gdbarch->value_from_register); -#ifdef VALUE_TO_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "VALUE_TO_REGISTER(frame, regnum, type, buf)", - XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf))); -#endif fprintf_unfiltered (file, "gdbarch_dump: value_to_register = <0x%lx>\n", (long) current_gdbarch->value_to_register); diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h --- src/gdb/gdbarch.h 2007-06-11 11:31:56.000000000 +0200 +++ dev/gdb/gdbarch.h 2007-06-11 20:11:39.000000000 +0200 @@ -525,32 +525,14 @@ typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type); extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type); extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); -#if !defined (GDB_TM_FILE) && defined (CONVERT_REGISTER_P) -#error "Non multi-arch definition of CONVERT_REGISTER_P" -#endif -#if !defined (CONVERT_REGISTER_P) -#define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type)) -#endif typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf); extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf); extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); -#if !defined (GDB_TM_FILE) && defined (REGISTER_TO_VALUE) -#error "Non multi-arch definition of REGISTER_TO_VALUE" -#endif -#if !defined (REGISTER_TO_VALUE) -#define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf)) -#endif typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf); extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf); extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); -#if !defined (GDB_TM_FILE) && defined (VALUE_TO_REGISTER) -#error "Non multi-arch definition of VALUE_TO_REGISTER" -#endif -#if !defined (VALUE_TO_REGISTER) -#define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf)) -#endif /* Construct a value representing the contents of register REGNUM in frame FRAME, interpreted as type TYPE. The routine needs to diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh --- src/gdb/gdbarch.sh 2007-06-11 11:31:56.000000000 +0200 +++ dev/gdb/gdbarch.sh 2007-06-11 20:11:39.000000000 +0200 @@ -487,9 +487,9 @@ # v:=:int:believe_pcc_promotion::::::: # -f:=:int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0 -f:=:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0 -f:=:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf:frame, regnum, type, buf:0 +f::int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0 +f::void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0 +f::void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf:frame, regnum, type, buf:0 # Construct a value representing the contents of register REGNUM in # frame FRAME, interpreted as type TYPE. The routine needs to # allocate and return a struct value with all value attributes diff -urN src/gdb/valops.c dev/gdb/valops.c --- src/gdb/valops.c 2007-06-11 11:31:58.000000000 +0200 +++ dev/gdb/valops.c 2007-06-11 20:11:39.000000000 +0200 @@ -636,12 +636,14 @@ if (!frame) error (_("Value being assigned to is no longer active.")); - if (CONVERT_REGISTER_P (VALUE_REGNUM (toval), type)) + if (gdbarch_convert_register_p + (current_gdbarch, VALUE_REGNUM (toval), type)) { /* If TOVAL is a special machine register requiring conversion of program values to a special raw format. */ - VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval), - type, value_contents (fromval)); + gdbarch_value_to_register (current_gdbarch, + frame, VALUE_REGNUM (toval), + type, value_contents (fromval)); } else { --------------050502000103090608070305--