aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/i386-low.h
blob: bad03b9bbc35d4e79b2402965f42229b2eb84862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Misc. low level support for i386.

   Copyright (C) 2009-2014 Free Software Foundation, Inc.

   This file is part of GDB.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */


#include "nat/i386-dregs.h"

/* Initialize STATE.  */
extern void i386_low_init_dregs (struct i386_debug_reg_state *state);


/* Each target needs to provide several low-level functions
   that will be called to insert watchpoints and hardware breakpoints
   into the inferior, remove them, and check their status.  These
   functions are:

      i386_dr_low_set_control  -- set the debug control (DR7)
				  register to a given value

      i386_dr_low_set_addr     -- put an address into one debug register

      i386_dr_low_get_status   -- return the value of the debug
				  status (DR6) register.
*/

/* Can we update the inferior's debug registers?  */
#define i386_dr_low_can_set_addr() 1

/* Update the inferior's debug register REGNUM from STATE.  */
extern void i386_dr_low_set_addr (const struct i386_debug_reg_state *state,
				  int regnum);

/* Return the inferior's debug register REGNUM.  */
extern CORE_ADDR i386_dr_low_get_addr (int regnum);

/* Can we update the inferior's DR7 control register?  */
#define i386_dr_low_can_set_control() 1

/* Update the inferior's DR7 debug control register from STATE.  */
extern void i386_dr_low_set_control (const struct i386_debug_reg_state *state);

/* Return the value of the inferior's DR7 debug control register.  */
extern unsigned i386_dr_low_get_control (void);

/* Return the value of the inferior's DR6 debug status register.  */
extern unsigned i386_dr_low_get_status (void);

/* Return the debug register size, in bytes.  */
/* Note that sizeof (long) == 4 on win64.  */
#define i386_get_debug_register_length() (sizeof (void *))