|
35 | 35 | /* Accessor macros for low-level function vector. */ |
36 | 36 |
|
37 | 37 | /* Can we update the inferior's debug registers? */ |
38 | | -#define x86_dr_low_can_set_addr() (x86_dr_low.set_addr != NULL) |
| 38 | + |
| 39 | +static bool |
| 40 | +x86_dr_low_can_set_addr () |
| 41 | +{ |
| 42 | + return x86_dr_low.set_addr != nullptr; |
| 43 | +} |
39 | 44 |
|
40 | 45 | /* Update the inferior's debug register REGNUM from STATE. */ |
41 | | -#define x86_dr_low_set_addr(new_state, i) \ |
42 | | - (x86_dr_low.set_addr ((i), (new_state)->dr_mirror[(i)])) |
| 46 | + |
| 47 | +static void |
| 48 | +x86_dr_low_set_addr (struct x86_debug_reg_state *new_state, int i) |
| 49 | +{ |
| 50 | + x86_dr_low.set_addr (i, new_state->dr_mirror[i]); |
| 51 | +} |
43 | 52 |
|
44 | 53 | /* Return the inferior's debug register REGNUM. */ |
45 | | -#define x86_dr_low_get_addr(i) (x86_dr_low.get_addr ((i))) |
| 54 | + |
| 55 | +static unsigned long |
| 56 | +x86_dr_low_get_addr (int i) |
| 57 | +{ |
| 58 | + return x86_dr_low.get_addr (i); |
| 59 | +} |
46 | 60 |
|
47 | 61 | /* Can we update the inferior's DR7 control register? */ |
48 | | -#define x86_dr_low_can_set_control() (x86_dr_low.set_control != NULL) |
| 62 | + |
| 63 | +static bool |
| 64 | +x86_dr_low_can_set_control () |
| 65 | +{ |
| 66 | + return x86_dr_low.set_control != nullptr; |
| 67 | +} |
49 | 68 |
|
50 | 69 | /* Update the inferior's DR7 debug control register from STATE. */ |
51 | | -#define x86_dr_low_set_control(new_state) \ |
52 | | - (x86_dr_low.set_control ((new_state)->dr_control_mirror)) |
| 70 | + |
| 71 | +static void |
| 72 | +x86_dr_low_set_control (struct x86_debug_reg_state *new_state) |
| 73 | +{ |
| 74 | + x86_dr_low.set_control (new_state->dr_control_mirror); |
| 75 | +} |
53 | 76 |
|
54 | 77 | /* Return the value of the inferior's DR7 debug control register. */ |
55 | | -#define x86_dr_low_get_control() (x86_dr_low.get_control ()) |
| 78 | + |
| 79 | +static unsigned long |
| 80 | +x86_dr_low_get_control () |
| 81 | +{ |
| 82 | + return x86_dr_low.get_control (); |
| 83 | +} |
56 | 84 |
|
57 | 85 | /* Return the value of the inferior's DR6 debug status register. */ |
58 | | -#define x86_dr_low_get_status() (x86_dr_low.get_status ()) |
| 86 | + |
| 87 | +static unsigned long |
| 88 | +x86_dr_low_get_status () |
| 89 | +{ |
| 90 | + return x86_dr_low.get_status (); |
| 91 | +} |
59 | 92 |
|
60 | 93 | /* Return the debug register size, in bytes. */ |
61 | | -#define x86_get_debug_register_length() \ |
62 | | - (x86_dr_low.debug_register_length) |
| 94 | + |
| 95 | +static int |
| 96 | +x86_get_debug_register_length () |
| 97 | +{ |
| 98 | + return x86_dr_low.debug_register_length; |
| 99 | +} |
63 | 100 |
|
64 | 101 | /* Support for 8-byte wide hw watchpoints. */ |
65 | 102 | #define TARGET_HAS_DR_LEN_8 (x86_get_debug_register_length () == 8) |
|
0 commit comments