Commit | Line | Data |
---|---|---|
4b134ca1 GB |
1 | /* Native-dependent code for GNU/Linux x86 (i386 and x86-64). |
2 | ||
3 | Copyright (C) 1999-2015 Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GDB. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 3 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #include "common-defs.h" | |
21 | #include "x86-linux.h" | |
22 | ||
23 | /* Per-thread arch-specific data we want to keep. */ | |
24 | ||
25 | struct arch_lwp_info | |
26 | { | |
27 | /* Non-zero if our copy differs from what's recorded in the | |
28 | thread. */ | |
29 | int debug_registers_changed; | |
30 | }; | |
31 | ||
32 | /* See nat/x86-linux.h. */ | |
33 | ||
34 | void | |
35 | lwp_set_debug_registers_changed (struct lwp_info *lwp, int value) | |
36 | { | |
37 | if (lwp_arch_private_info (lwp) == NULL) | |
38 | lwp_set_arch_private_info (lwp, XCNEW (struct arch_lwp_info)); | |
39 | ||
40 | lwp_arch_private_info (lwp)->debug_registers_changed = value; | |
41 | } | |
42 | ||
43 | /* See nat/x86-linux.h. */ | |
44 | ||
45 | int | |
46 | lwp_debug_registers_changed (struct lwp_info *lwp) | |
47 | { | |
48 | struct arch_lwp_info *info = lwp_arch_private_info (lwp); | |
49 | ||
50 | /* NULL means either that this is the main thread still going | |
51 | through the shell, or that no watchpoint has been set yet. | |
52 | The debug registers are unchanged in either case. */ | |
53 | if (info == NULL) | |
54 | return 0; | |
55 | ||
56 | return info->debug_registers_changed; | |
57 | } |