GDB (xrefs)
Loading...
Searching...
No Matches
x86-linux-nat.h
Go to the documentation of this file.
1/* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
2
3 Copyright (C) 1999-2023 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#ifndef X86_LINUX_NAT_H
21#define X86_LINUX_NAT_H 1
22
23#include "gdb_proc_service.h"
24#include "linux-nat.h"
25#include "gdbsupport/x86-xstate.h"
26#include "x86-nat.h"
27#include "nat/x86-linux.h"
28
29struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
30{
31 virtual ~x86_linux_nat_target () override = 0;
32
33 /* Add the description reader. */
34 const struct target_desc *read_description () override;
35
36 struct btrace_target_info *enable_btrace (thread_info *tp,
37 const struct btrace_config *conf) override;
38 void disable_btrace (struct btrace_target_info *tinfo) override;
39 void teardown_btrace (struct btrace_target_info *tinfo) override;
40 enum btrace_error read_btrace (struct btrace_data *data,
41 struct btrace_target_info *btinfo,
42 enum btrace_read_type type) override;
43 const struct btrace_config *btrace_conf (const struct btrace_target_info *) override;
44
45 x86_xsave_layout fetch_x86_xsave_layout () override
46 { return m_xsave_layout; }
47
48 /* These two are rewired to low_ versions. linux-nat.c queries
49 stopped-by-watchpoint info as soon as an lwp stops (via the low_
50 methods) and caches the result, to be returned via the normal
51 non-low methods. */
54
55 bool stopped_data_address (CORE_ADDR *addr_p) override
57
60
61 bool low_stopped_data_address (CORE_ADDR *addr_p) override
62 { return x86_nat_target::stopped_data_address (addr_p); }
63
64 void low_new_fork (struct lwp_info *parent, pid_t child_pid) override;
65
66 void low_forget_process (pid_t pid) override
68
69 void low_prepare_to_resume (struct lwp_info *lwp) override
71
72 void low_new_thread (struct lwp_info *lwp) override
73 { x86_linux_new_thread (lwp); }
74
75 void low_delete_thread (struct arch_lwp_info *lwp) override
77
78protected:
79 /* Override the GNU/Linux inferior startup hook. */
80 void post_startup_inferior (ptid_t) override;
81
82private:
83 x86_xsave_layout m_xsave_layout;
84};
85
86
87
88/* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to
89 the thread local storage (or its descriptor) and returns PS_OK
90 on success. Returns PS_ERR on failure. */
91
92extern ps_err_e x86_linux_get_thread_area (pid_t pid, void *addr,
93 unsigned int *base_addr);
94
95#endif
bool stopped_by_watchpoint() override
Definition linux-nat.c:2320
bool stopped_data_address(CORE_ADDR *) override
Definition linux-nat.c:2330
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
Definition gnu-nat.c:1791
void low_delete_thread(struct arch_lwp_info *lwp) override
x86_xsave_layout m_xsave_layout
const struct target_desc * read_description() override
void low_new_thread(struct lwp_info *lwp) override
void teardown_btrace(struct btrace_target_info *tinfo) override
void low_prepare_to_resume(struct lwp_info *lwp) override
void low_new_fork(struct lwp_info *parent, pid_t child_pid) override
bool stopped_data_address(CORE_ADDR *addr_p) override
bool stopped_by_watchpoint() override
struct btrace_target_info * enable_btrace(thread_info *tp, const struct btrace_config *conf) override
const struct btrace_config * btrace_conf(const struct btrace_target_info *) override
enum btrace_error read_btrace(struct btrace_data *data, struct btrace_target_info *btinfo, enum btrace_read_type type) override
bool low_stopped_by_watchpoint() override
bool low_stopped_data_address(CORE_ADDR *addr_p) override
x86_xsave_layout fetch_x86_xsave_layout() override
virtual ~x86_linux_nat_target() override=0
void disable_btrace(struct btrace_target_info *tinfo) override
void post_startup_inferior(ptid_t) override
void low_forget_process(pid_t pid) override
bool stopped_data_address(CORE_ADDR *addr_p) override
Definition x86-nat.h:107
bool stopped_by_watchpoint() override
Definition x86-nat.h:104
ps_err_e x86_linux_get_thread_area(pid_t pid, void *addr, unsigned int *base_addr)
void x86_linux_new_thread(struct lwp_info *lwp)
Definition x86-linux.c:63
void x86_linux_delete_thread(struct arch_lwp_info *arch_lwp)
Definition x86-linux.c:71
void x86_linux_prepare_to_resume(struct lwp_info *lwp)
Definition x86-linux.c:79
void x86_forget_process(pid_t pid)
Definition x86-nat.c:72