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]

Re: [PATCH 10/11 v5] Remove GDBSERVER uses from i386-dregs.c


Gary Benson writes:
 > This commit makes nat/i386-dregs.c include common-defs.h rather than
 > defs.h or server.h.  A couple of minor changes were required in order
 > to support this change.
 > 
 > gdb/
 > 2014-08-01  Gary Benson  <gbenson@redhat.com>
 > 
 > 	* nat/i386-dregs.c: Include common-defs.h and break-common.h.
 > 	Don't include defs.h or server.h.
 > 	(debug_hw_points): Declare unconditionally.
 > ---
 >  gdb/ChangeLog        |    6 ++++++
 >  gdb/nat/i386-dregs.c |   10 ++--------
 >  2 files changed, 8 insertions(+), 8 deletions(-)
 > 
 > diff --git a/gdb/nat/i386-dregs.c b/gdb/nat/i386-dregs.c
 > index e3272cd..7905c44 100644
 > --- a/gdb/nat/i386-dregs.c
 > +++ b/gdb/nat/i386-dregs.c
 > @@ -17,13 +17,9 @@
 >     You should have received a copy of the GNU General Public License
 >     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 >  
 > -#ifdef GDBSERVER
 > -#include "server.h"
 > -#else
 > -#include "defs.h"
 > -#include "inferior.h"
 > -#endif
 > +#include "common-defs.h"
 >  #include "i386-dregs.h"
 > +#include "break-common.h"
 >  
 >  /* Support for hardware watchpoints and breakpoints using the i386
 >     debug registers.
 > @@ -175,10 +171,8 @@
 >  /* Types of operations supported by i386_handle_nonaligned_watchpoint.  */
 >  typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t;
 >  
 > -#ifndef GDBSERVER
 >  /* Whether or not to print the mirrored debug registers.  */
 >  extern int debug_hw_points;
 > -#endif

Since externs should live in headers, and since this is a cleanup patch,
can I impose on you a request to move debug_hw_points to a header.
Seems like i386-dregs.h is the best place.

The variable could even arguably be defined in i386-dregs.c,
though I'm not sure if/how people would want i386-nat.c to change.
Plus add x86 or some such to the variable's name.
I'd leave this part to another pass.

 >  
 >  /* Print the values of the mirrored debug registers.  */
 >  
 > -- 
 > 1.7.1
 > 


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