This is the mail archive of the gdb-patches@sourceware.org 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]

[RFC] Set I386_USE_GENERIC_WATCHPOINTS in configure


  To get fully functional multi-arch,
we should try to remove all nm files.
  
  I tried to write a patch that completely removes
the need of 
I386_USE_GENERIC_WATCHPOINTS in config/i386/nm-*.h
headers.
  Instead 
I386_USE_GENERIC_WATCHPOINTS and TARGET_HAS_DR_LEN_8
are set in configure.

  This allows to almost completely empty
the config/i386/nm*.h files.

  I used four function variables to replace
the I386_DR_LOW_* macros, and set those variables
close to where i386_use_watchpoints function
is called.
  I am not sure that this is the best solution,
but I was afraid of the idea of implementing the 
same function in different sources, with a possible
conflict if two of these native files get compiled into
the same executable. 

I am not really confident in the configure.ac part,
as this is the first time I try to modify this
file and I have no knowledge of autoconf :(

All remarks are welcome.


Pierre Muller
Pascal language support maintainer for GDB


ChangeLog entry:

2009-03-13  Pierre Muller  <muller@ics.u-strasbg.fr>

	* configure.host: Set gdb_use_i386_dr to 4 or 8
	on hosts supporting generic watchpoints.
	* configure.ac: Set I386_USE_GENERIC_WATCHPOINTS
	and TARGET_HAS_DR_LEN_8.
	* config.in: Regenerate.
	* configure: Ditto.
	* i386-dr-nat.h: New file.
	Exports some functions from i386-nat.c.
	(i386_dr_low_set_control): New function variable.
	(i386_dr_low_set_addr): Ditto.
	(i386_dr_low_reset_addr):Ditto.
	(i386_dr_low_get_status):Ditto.
	* i386-nat.c: Include i386-dr-nat.h.
	(I386_DR_LOW_SET_CONTROL): Remove macro.
	(I386_DR_LOW_SET_ADDR): Remove macro.
	(I386_DR_LOW_RESET_ADDR): Remove macro.
	(I386_DR_LOW_GET_STATUS): Remove macro.
	(i386_insert_aligned_watchpoint, i386_remove_aligned_watchpoint)
	(i386_stopped_data_address, i386_stopped_by_hwbp): Replace
	macros by function variables.
	
	* go32-nat.c: Include i386-dr-nat.h.
	(init_go32_ops): Set i386-dr-nat function variables.	
	* i386-linux-nat.c: Include i386-dr-nat.h.
	(_initialize_i386_linux_nat): Set i386-dr-nat function variables.

	* amd64-linux-nat.c: Include i386-dr-nat.h.
	(amd64_linux_dr_set_control): Change argument type to unsigned.
	(amd64_linux_dr_get_status): Change return type to unsigned.
	(_initialize_amd64_linux_nat): Set i386-dr-nat function variables.

	* i386fbsd-nat.c: Include i386-dr-nat.h.
	(_initialize_i386fbsd_nat): Set i386-dr-nat function variables.	
	* windows-nat.c: Include i386-dr-nat.h.
	(cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): Add forward
declarations.
	(init_windows_ops): Set i386-dr-nat function variables.	

	* config/i386/nm-i386.h: Remove all debug register related code.
	* config/i386/nm-cygwin.h: Ditto.
	* config/i386/nm-cygwin64.h: Ditto.
	* config/i386/nm-fbsd.h: Ditto.
	* config/i386/nm-go32.h: Ditto.
	* config/i386/nm-linux.h: Ditto.
	* config/i386/nm-linux64.h: Ditto.

Attachment: i386-dr2.patch
Description: Binary data


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