Commit | Line | Data |
---|---|---|
58caa3dc | 1 | /* Internal interfaces for the GNU/Linux specific target code for gdbserver. |
6f0f660e | 2 | Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. |
58caa3dc DJ |
3 | |
4 | This file is part of GDB. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
6f0f660e EZ |
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. */ | |
58caa3dc | 20 | |
58caa3dc | 21 | #ifdef HAVE_LINUX_REGSETS |
0d62e5e8 DJ |
22 | typedef void (*regset_fill_func) (void *); |
23 | typedef void (*regset_store_func) (const void *); | |
24 | enum regset_type { | |
25 | GENERAL_REGS, | |
26 | FP_REGS, | |
27 | EXTENDED_REGS, | |
28 | }; | |
29 | ||
58caa3dc DJ |
30 | struct regset_info |
31 | { | |
32 | int get_request, set_request; | |
33 | int size; | |
0d62e5e8 DJ |
34 | enum regset_type type; |
35 | regset_fill_func fill_function; | |
36 | regset_store_func store_function; | |
58caa3dc DJ |
37 | }; |
38 | extern struct regset_info target_regsets[]; | |
39 | #endif | |
2ec06d2e DJ |
40 | |
41 | struct linux_target_ops | |
42 | { | |
43 | int num_regs; | |
44 | int *regmap; | |
45 | int (*cannot_fetch_register) (int); | |
bc1e36ca DJ |
46 | |
47 | /* Returns 0 if we can store the register, 1 if we can not | |
48 | store the register, and 2 if failure to store the register | |
49 | is acceptable. */ | |
2ec06d2e | 50 | int (*cannot_store_register) (int); |
0d62e5e8 | 51 | CORE_ADDR (*get_pc) (void); |
611cb4a5 | 52 | void (*set_pc) (CORE_ADDR newpc); |
f450004a | 53 | const unsigned char *breakpoint; |
611cb4a5 DJ |
54 | int breakpoint_len; |
55 | CORE_ADDR (*breakpoint_reinsert_addr) (void); | |
0d62e5e8 DJ |
56 | |
57 | ||
58 | int decr_pc_after_break; | |
59 | int (*breakpoint_at) (CORE_ADDR pc); | |
e013ee27 OF |
60 | |
61 | /* Watchpoint related functions. See target.h for comments. */ | |
62 | int (*insert_watchpoint) (char type, CORE_ADDR addr, int len); | |
63 | int (*remove_watchpoint) (char type, CORE_ADDR addr, int len); | |
64 | int (*stopped_by_watchpoint) (void); | |
65 | CORE_ADDR (*stopped_data_address) (void); | |
66 | ||
5a1f5858 DJ |
67 | /* Whether to left-pad registers for PEEKUSR/POKEUSR if they are smaller |
68 | than an xfer unit. */ | |
69 | int left_pad_xfer; | |
2ec06d2e DJ |
70 | }; |
71 | ||
72 | extern struct linux_target_ops the_low_target; | |
0d62e5e8 DJ |
73 | |
74 | #define get_process(inf) ((struct process_info *)(inf)) | |
75 | #define get_thread_process(thr) (get_process (inferior_target_data (thr))) | |
76 | #define get_process_thread(proc) ((struct thread_info *) \ | |
77 | find_inferior_id (&all_threads, \ | |
78 | get_process (proc)->tid)) | |
79 | ||
80 | struct process_info | |
81 | { | |
82 | struct inferior_list_entry head; | |
83 | int thread_known; | |
a1928bad DJ |
84 | unsigned long lwpid; |
85 | unsigned long tid; | |
0d62e5e8 DJ |
86 | |
87 | /* If this flag is set, the next SIGSTOP will be ignored (the process will | |
88 | be immediately resumed). */ | |
89 | int stop_expected; | |
90 | ||
91 | /* If this flag is set, the process is known to be stopped right now (stop | |
92 | event already received in a wait()). */ | |
93 | int stopped; | |
94 | ||
95 | /* If this flag is set, we have sent a SIGSTOP to this process and are | |
96 | waiting for it to stop. */ | |
97 | int sigstop_sent; | |
98 | ||
99 | /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet | |
100 | been reported. */ | |
101 | int status_pending_p; | |
102 | int status_pending; | |
103 | ||
104 | /* If this flag is set, the pending status is a (GDB-placed) breakpoint. */ | |
105 | int pending_is_breakpoint; | |
106 | CORE_ADDR pending_stop_pc; | |
107 | ||
108 | /* If this is non-zero, it is a breakpoint to be reinserted at our next | |
109 | stop (SIGTRAP stops only). */ | |
110 | CORE_ADDR bp_reinsert; | |
111 | ||
112 | /* If this flag is set, the last continue operation on this process | |
113 | was a single-step. */ | |
114 | int stepping; | |
115 | ||
116 | /* If this is non-zero, it points to a chain of signals which need to | |
117 | be delivered to this process. */ | |
118 | struct pending_signals *pending_signals; | |
5544ad89 DJ |
119 | |
120 | /* A link used when resuming. It is initialized from the resume request, | |
121 | and then processed and cleared in linux_resume_one_process. */ | |
122 | ||
123 | struct thread_resume *resume; | |
0d62e5e8 | 124 | }; |
5544ad89 | 125 | |
0d62e5e8 DJ |
126 | extern struct inferior_list all_processes; |
127 | ||
a1928bad | 128 | void linux_attach_lwp (unsigned long pid, unsigned long tid); |
0d62e5e8 DJ |
129 | |
130 | int thread_db_init (void); |