From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25344 invoked by alias); 8 May 2009 13:50:55 -0000 Received: (qmail 24372 invoked by uid 22791); 8 May 2009 13:50:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 May 2009 13:50:08 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n48Do4EI007381 for ; Fri, 8 May 2009 15:50:04 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n48Do4PN063109 for ; Fri, 8 May 2009 15:50:04 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n48Do3i1061739 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 8 May 2009 15:50:04 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: Subject: [RFA] Remove unecessary checks for macros in target.h Date: Fri, 08 May 2009 13:50:00 -0000 Message-ID: <003301c9cfe3$e7547ed0$b5fd7c70$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2009-05/txt/msg00176.txt.bz2 target.h header has lots of #ifndef A_MACRO #define A_MACRO default_implementation #endif constructs. This patch simply removes all these unnecessary checks for macros that are not defined anymore in any config file, nor by configure script. (Unless the configure scripts might set macros without having them inside their sources, I checked all those macros by grep). Is this OK? Pierre Muller Pascal language support maintainer for GDB PS: STOPPED_BY_WATCHPOINT macro could probably also loose its unused parameter... Would this later patch be also welcome? 2009-05-08 Pierre Muller * src/gdb/target.h: Remove all tests for already defined macros. All macros defined here should not be set in config headers anymore. Index: src/gdb/target.h =================================================================== RCS file: /cvs/src/src/gdb/target.h,v retrieving revision 1.150 diff -u -p -r1.150 target.h --- src/gdb/target.h 30 Apr 2009 02:55:27 -0000 1.150 +++ src/gdb/target.h 8 May 2009 05:49:10 -0000 @@ -1053,24 +1053,18 @@ extern char *normal_pid_to_str (ptid_t p /* Returns non-zero if we were stopped by a hardware watchpoint (memory read or write). */ -#ifndef STOPPED_BY_WATCHPOINT #define STOPPED_BY_WATCHPOINT(w) \ (*current_target.to_stopped_by_watchpoint) () -#endif /* Non-zero if we have steppable watchpoints */ -#ifndef HAVE_STEPPABLE_WATCHPOINT #define HAVE_STEPPABLE_WATCHPOINT \ (current_target.to_have_steppable_watchpoint) -#endif /* Non-zero if we have continuable watchpoints */ -#ifndef HAVE_CONTINUABLE_WATCHPOINT #define HAVE_CONTINUABLE_WATCHPOINT \ (current_target.to_have_continuable_watchpoint) -#endif /* Provide defaults for hardware watchpoint functions. */ @@ -1082,41 +1076,31 @@ extern char *normal_pid_to_str (ptid_t p bp_hardware_breakpoint. CNT is the number of such watchpoints used so far (including this one?). OTHERTYPE is who knows what... */ -#ifndef TARGET_CAN_USE_HARDWARE_WATCHPOINT #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) \ (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE); -#endif -#ifndef TARGET_REGION_OK_FOR_HW_WATCHPOINT #define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, len) \ (*current_target.to_region_ok_for_hw_watchpoint) (addr, len) -#endif /* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes. TYPE is 0 for write, 1 for read, and 2 for read/write accesses. Returns 0 for success, non-zero for failure. */ -#ifndef target_insert_watchpoint #define target_insert_watchpoint(addr, len, type) \ (*current_target.to_insert_watchpoint) (addr, len, type) #define target_remove_watchpoint(addr, len, type) \ (*current_target.to_remove_watchpoint) (addr, len, type) -#endif -#ifndef target_insert_hw_breakpoint #define target_insert_hw_breakpoint(bp_tgt) \ (*current_target.to_insert_hw_breakpoint) (bp_tgt) #define target_remove_hw_breakpoint(bp_tgt) \ (*current_target.to_remove_hw_breakpoint) (bp_tgt) -#endif -#ifndef target_stopped_data_address #define target_stopped_data_address(target, x) \ (*target.to_stopped_data_address) (target, x) -#endif #define target_watchpoint_addr_within_range(target, addr, start, length) \ (*target.to_watchpoint_addr_within_range) (target, addr, start, length)