This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Remove unecessary checks for macros in target.h

  target.h header has lots of

#ifndef A_MACRO
#define A_MACRO default_implementation
  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).  */
    (*current_target.to_stopped_by_watchpoint) ()
 /* Non-zero if we have steppable watchpoints  */
 /* Non-zero if we have continuable watchpoints  */
 /* 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
    (including this one?).  OTHERTYPE is who knows what...  */
  (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
     (*current_target.to_region_ok_for_hw_watchpoint) (addr, len)
 /* 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)
-#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)
-#ifndef target_stopped_data_address
 #define target_stopped_data_address(target, x) \
     (*target.to_stopped_data_address) (target, x)
 #define target_watchpoint_addr_within_range(target, addr, start, length) \
   (*target.to_watchpoint_addr_within_range) (target, addr, start, length)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]