]>
Commit | Line | Data |
---|---|---|
ce3a066d | 1 | /* Target operations for the remote server for GDB. |
1d506c26 | 2 | Copyright (C) 2002-2024 Free Software Foundation, Inc. |
ce3a066d DJ |
3 | |
4 | Contributed by MontaVista Software. | |
5 | ||
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
ce3a066d DJ |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
ce3a066d DJ |
20 | |
21 | #include "server.h" | |
c144c7a0 | 22 | #include "tracepoint.h" |
d59b55f0 | 23 | #include "gdbsupport/byte-vector.h" |
ea06bbaa | 24 | #include "hostio.h" |
c9b7b804 TBA |
25 | #include <fcntl.h> |
26 | #include <unistd.h> | |
27 | #include <sys/types.h> | |
28 | #include <sys/stat.h> | |
ce3a066d | 29 | |
5b6d1e4f | 30 | process_stratum_target *the_target; |
ce3a066d | 31 | |
7f8acede PA |
32 | /* See target.h. */ |
33 | ||
34 | bool | |
f557a88a | 35 | set_desired_thread () |
0d62e5e8 | 36 | { |
c12a5089 SC |
37 | client_state &cs = get_client_state (); |
38 | thread_info *found = find_thread_ptid (cs.general_thread); | |
0d62e5e8 | 39 | |
7f8acede PA |
40 | if (found == nullptr) |
41 | { | |
42 | process_info *proc = find_process_pid (cs.general_thread.pid ()); | |
43 | if (proc == nullptr) | |
44 | { | |
45 | threads_debug_printf | |
46 | ("did not find thread nor process for general_thread %s", | |
47 | cs.general_thread.to_string ().c_str ()); | |
48 | } | |
49 | else | |
50 | { | |
51 | threads_debug_printf | |
52 | ("did not find thread for general_thread %s, but found process", | |
53 | cs.general_thread.to_string ().c_str ()); | |
54 | } | |
55 | switch_to_process (proc); | |
56 | } | |
57 | else | |
58 | switch_to_thread (found); | |
59 | ||
f0db101d | 60 | return (current_thread != NULL); |
0d62e5e8 DJ |
61 | } |
62 | ||
7f8acede PA |
63 | /* See target.h. */ |
64 | ||
65 | bool | |
66 | set_desired_process () | |
67 | { | |
68 | client_state &cs = get_client_state (); | |
69 | ||
70 | process_info *proc = find_process_pid (cs.general_thread.pid ()); | |
71 | if (proc == nullptr) | |
72 | { | |
73 | threads_debug_printf | |
74 | ("did not find process for general_thread %s", | |
75 | cs.general_thread.to_string ().c_str ()); | |
76 | } | |
77 | switch_to_process (proc); | |
78 | ||
79 | return proc != nullptr; | |
80 | } | |
81 | ||
027d8f78 AB |
82 | /* See target.h. */ |
83 | ||
c3e735a6 | 84 | int |
f450004a | 85 | read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) |
611cb4a5 | 86 | { |
366e3746 PA |
87 | /* At the time of writing, GDB only sends write packets with LEN==0, |
88 | not read packets (see comment in target_write_memory), but it | |
89 | doesn't hurt to prevent problems if it ever does, or we're | |
90 | connected to some client other than GDB that does. */ | |
91 | if (len == 0) | |
92 | return 0; | |
93 | ||
94 | int res = the_target->read_memory (memaddr, myaddr, len); | |
611cb4a5 | 95 | check_mem_read (memaddr, myaddr, len); |
c3e735a6 | 96 | return res; |
611cb4a5 DJ |
97 | } |
98 | ||
721ec300 GB |
99 | /* See target/target.h. */ |
100 | ||
101 | int | |
102 | target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) | |
103 | { | |
104 | return read_inferior_memory (memaddr, myaddr, len); | |
105 | } | |
106 | ||
107 | /* See target/target.h. */ | |
108 | ||
109 | int | |
110 | target_read_uint32 (CORE_ADDR memaddr, uint32_t *result) | |
111 | { | |
112 | return read_inferior_memory (memaddr, (gdb_byte *) result, sizeof (*result)); | |
113 | } | |
114 | ||
4196ab2a TT |
115 | /* See target/target.h. */ |
116 | ||
611cb4a5 | 117 | int |
4196ab2a TT |
118 | target_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, |
119 | ssize_t len) | |
0d62e5e8 | 120 | { |
366e3746 PA |
121 | /* GDB may send X packets with LEN==0, for probing packet support. |
122 | If we let such a request go through, then buffer.data() below may | |
123 | return NULL, which may confuse target implementations. Handle it | |
124 | here to avoid lower levels having to care about this case. */ | |
125 | if (len == 0) | |
126 | return 0; | |
127 | ||
c6778d00 TT |
128 | /* Make a copy of the data because check_mem_write may need to |
129 | update it. */ | |
d59b55f0 | 130 | gdb::byte_vector buffer (myaddr, myaddr + len); |
c6778d00 | 131 | check_mem_write (memaddr, buffer.data (), myaddr, len); |
52405d85 | 132 | return the_target->write_memory (memaddr, buffer.data (), len); |
0d62e5e8 DJ |
133 | } |
134 | ||
95954743 | 135 | ptid_t |
b60cea74 TT |
136 | mywait (ptid_t ptid, struct target_waitstatus *ourstatus, |
137 | target_wait_flags options, int connected_wait) | |
611cb4a5 | 138 | { |
95954743 | 139 | ptid_t ret; |
0d62e5e8 DJ |
140 | |
141 | if (connected_wait) | |
142 | server_waiting = 1; | |
143 | ||
f2b9e3df | 144 | ret = target_wait (ptid, ourstatus, options); |
bd99dc85 | 145 | |
4210d83e PA |
146 | /* We don't expose _LOADED events to gdbserver core. See the |
147 | `dlls_changed' global. */ | |
183be222 SM |
148 | if (ourstatus->kind () == TARGET_WAITKIND_LOADED) |
149 | ourstatus->set_stopped (GDB_SIGNAL_0); | |
4210d83e | 150 | |
1a3d890b PA |
151 | /* If GDB is connected through TCP/serial, then GDBserver will most |
152 | probably be running on its own terminal/console, so it's nice to | |
153 | print there why is GDBserver exiting. If however, GDB is | |
154 | connected through stdio, then there's no need to spam the GDB | |
155 | console with this -- the user will already see the exit through | |
156 | regular GDB output, in that same terminal. */ | |
157 | if (!remote_connection_is_stdio ()) | |
158 | { | |
183be222 | 159 | if (ourstatus->kind () == TARGET_WAITKIND_EXITED) |
1a3d890b | 160 | fprintf (stderr, |
183be222 SM |
161 | "\nChild exited with status %d\n", ourstatus->exit_status ()); |
162 | else if (ourstatus->kind () == TARGET_WAITKIND_SIGNALLED) | |
1a3d890b | 163 | fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n", |
183be222 SM |
164 | gdb_signal_to_host (ourstatus->sig ()), |
165 | gdb_signal_to_name (ourstatus->sig ())); | |
1a3d890b | 166 | } |
0d62e5e8 DJ |
167 | |
168 | if (connected_wait) | |
169 | server_waiting = 0; | |
170 | ||
171 | return ret; | |
611cb4a5 DJ |
172 | } |
173 | ||
f8c1d06b GB |
174 | /* See target/target.h. */ |
175 | ||
176 | void | |
03f4463b | 177 | target_stop_and_wait (ptid_t ptid) |
f8c1d06b GB |
178 | { |
179 | struct target_waitstatus status; | |
3e6ec53a | 180 | bool was_non_stop = non_stop; |
17e16485 | 181 | struct thread_resume resume_info; |
f8c1d06b | 182 | |
17e16485 YQ |
183 | resume_info.thread = ptid; |
184 | resume_info.kind = resume_stop; | |
185 | resume_info.sig = GDB_SIGNAL_0; | |
52405d85 | 186 | the_target->resume (&resume_info, 1); |
f8c1d06b | 187 | |
3e6ec53a | 188 | non_stop = true; |
f8c1d06b GB |
189 | mywait (ptid, &status, 0, 0); |
190 | non_stop = was_non_stop; | |
191 | } | |
192 | ||
193 | /* See target/target.h. */ | |
194 | ||
f2b9e3df | 195 | ptid_t |
b60cea74 TT |
196 | target_wait (ptid_t ptid, struct target_waitstatus *status, |
197 | target_wait_flags options) | |
f2b9e3df | 198 | { |
52405d85 | 199 | return the_target->wait (ptid, status, options); |
f2b9e3df SDJ |
200 | } |
201 | ||
202 | /* See target/target.h. */ | |
203 | ||
bc1e6c81 SDJ |
204 | void |
205 | target_mourn_inferior (ptid_t ptid) | |
206 | { | |
52405d85 | 207 | the_target->mourn (find_process_pid (ptid.pid ())); |
bc1e6c81 SDJ |
208 | } |
209 | ||
210 | /* See target/target.h. */ | |
211 | ||
f8c1d06b | 212 | void |
03f4463b | 213 | target_continue_no_signal (ptid_t ptid) |
f8c1d06b GB |
214 | { |
215 | struct thread_resume resume_info; | |
216 | ||
217 | resume_info.thread = ptid; | |
218 | resume_info.kind = resume_continue; | |
219 | resume_info.sig = GDB_SIGNAL_0; | |
52405d85 | 220 | the_target->resume (&resume_info, 1); |
f8c1d06b GB |
221 | } |
222 | ||
049a8570 SDJ |
223 | /* See target/target.h. */ |
224 | ||
225 | void | |
226 | target_continue (ptid_t ptid, enum gdb_signal signal) | |
227 | { | |
228 | struct thread_resume resume_info; | |
229 | ||
230 | resume_info.thread = ptid; | |
231 | resume_info.kind = resume_continue; | |
232 | resume_info.sig = gdb_signal_to_host (signal); | |
52405d85 | 233 | the_target->resume (&resume_info, 1); |
049a8570 SDJ |
234 | } |
235 | ||
1fb77080 SDJ |
236 | /* See target/target.h. */ |
237 | ||
238 | int | |
239 | target_supports_multi_process (void) | |
240 | { | |
52405d85 | 241 | return the_target->supports_multi_process (); |
1fb77080 SDJ |
242 | } |
243 | ||
ce3a066d | 244 | void |
5b6d1e4f | 245 | set_target_ops (process_stratum_target *target) |
ce3a066d | 246 | { |
478f9adf | 247 | the_target = target; |
ce3a066d | 248 | } |
95954743 PA |
249 | |
250 | /* Convert pid to printable format. */ | |
251 | ||
61d7f128 | 252 | std::string |
95954743 PA |
253 | target_pid_to_str (ptid_t ptid) |
254 | { | |
d7e15655 | 255 | if (ptid == minus_one_ptid) |
61d7f128 | 256 | return string_printf("<all threads>"); |
d7e15655 | 257 | else if (ptid == null_ptid) |
61d7f128 | 258 | return string_printf("<null thread>"); |
cc6bcb54 | 259 | else if (ptid.tid () != 0) |
61d7f128 SM |
260 | return string_printf("Thread %d.0x%s", |
261 | ptid.pid (), | |
262 | phex_nz (ptid.tid (), sizeof (ULONGEST))); | |
e38504b3 | 263 | else if (ptid.lwp () != 0) |
61d7f128 SM |
264 | return string_printf("LWP %d.%ld", |
265 | ptid.pid (), ptid.lwp ()); | |
95954743 | 266 | else |
61d7f128 SM |
267 | return string_printf("Process %d", |
268 | ptid.pid ()); | |
95954743 | 269 | } |
8336d594 | 270 | |
7255706c | 271 | int |
a780ef4f | 272 | kill_inferior (process_info *proc) |
7255706c | 273 | { |
a780ef4f | 274 | gdb_agent_about_to_close (proc->pid); |
7255706c | 275 | |
52405d85 | 276 | return the_target->kill (proc); |
7255706c | 277 | } |
70b90b91 | 278 | |
223ffa71 TT |
279 | /* Define it. */ |
280 | ||
e671cd59 PA |
281 | target_terminal_state target_terminal::m_terminal_state |
282 | = target_terminal_state::is_ours; | |
223ffa71 | 283 | |
2090129c SDJ |
284 | /* See target/target.h. */ |
285 | ||
286 | void | |
223ffa71 | 287 | target_terminal::init () |
2090129c SDJ |
288 | { |
289 | /* Placeholder needed because of fork_inferior. Not necessary on | |
290 | GDBserver. */ | |
291 | } | |
292 | ||
293 | /* See target/target.h. */ | |
294 | ||
295 | void | |
223ffa71 | 296 | target_terminal::inferior () |
2090129c SDJ |
297 | { |
298 | /* Placeholder needed because of fork_inferior. Not necessary on | |
299 | GDBserver. */ | |
300 | } | |
301 | ||
302 | /* See target/target.h. */ | |
303 | ||
304 | void | |
223ffa71 | 305 | target_terminal::ours () |
2090129c SDJ |
306 | { |
307 | /* Placeholder needed because of fork_inferior. Not necessary on | |
308 | GDBserver. */ | |
309 | } | |
223ffa71 TT |
310 | |
311 | /* See target/target.h. */ | |
312 | ||
313 | void | |
314 | target_terminal::ours_for_output (void) | |
315 | { | |
316 | /* Placeholder. */ | |
317 | } | |
318 | ||
319 | /* See target/target.h. */ | |
320 | ||
321 | void | |
322 | target_terminal::info (const char *arg, int from_tty) | |
323 | { | |
324 | /* Placeholder. */ | |
325 | } | |
6dee9afb TBA |
326 | |
327 | /* Default implementations of target ops. | |
328 | See target.h for definitions. */ | |
329 | ||
330 | void | |
52405d85 | 331 | process_stratum_target::post_create_inferior () |
6dee9afb TBA |
332 | { |
333 | /* Nop. */ | |
334 | } | |
79b44087 | 335 | |
2a31c7aa | 336 | void |
52405d85 | 337 | process_stratum_target::look_up_symbols () |
2a31c7aa TBA |
338 | { |
339 | /* Nop. */ | |
340 | } | |
eac215cc TBA |
341 | |
342 | bool | |
52405d85 | 343 | process_stratum_target::supports_read_auxv () |
eac215cc TBA |
344 | { |
345 | return false; | |
346 | } | |
347 | ||
348 | int | |
43e5fbd8 TJB |
349 | process_stratum_target::read_auxv (int pid, CORE_ADDR offset, |
350 | unsigned char *myaddr, unsigned int len) | |
eac215cc TBA |
351 | { |
352 | gdb_assert_not_reached ("target op read_auxv not supported"); | |
353 | } | |
a2b2297a TBA |
354 | |
355 | bool | |
52405d85 | 356 | process_stratum_target::supports_z_point_type (char z_type) |
a2b2297a TBA |
357 | { |
358 | return false; | |
359 | } | |
7e0bde70 TBA |
360 | |
361 | int | |
52405d85 TBA |
362 | process_stratum_target::insert_point (enum raw_bkpt_type type, |
363 | CORE_ADDR addr, | |
364 | int size, raw_breakpoint *bp) | |
7e0bde70 TBA |
365 | { |
366 | return 1; | |
367 | } | |
368 | ||
369 | int | |
52405d85 TBA |
370 | process_stratum_target::remove_point (enum raw_bkpt_type type, |
371 | CORE_ADDR addr, | |
372 | int size, raw_breakpoint *bp) | |
7e0bde70 TBA |
373 | { |
374 | return 1; | |
375 | } | |
84320c4e TBA |
376 | |
377 | bool | |
52405d85 | 378 | process_stratum_target::stopped_by_sw_breakpoint () |
84320c4e TBA |
379 | { |
380 | return false; | |
381 | } | |
382 | ||
383 | bool | |
52405d85 | 384 | process_stratum_target::supports_stopped_by_sw_breakpoint () |
84320c4e TBA |
385 | { |
386 | return false; | |
387 | } | |
93fe88b2 TBA |
388 | |
389 | bool | |
52405d85 | 390 | process_stratum_target::stopped_by_hw_breakpoint () |
93fe88b2 TBA |
391 | { |
392 | return false; | |
393 | } | |
394 | ||
395 | bool | |
52405d85 | 396 | process_stratum_target::supports_stopped_by_hw_breakpoint () |
93fe88b2 TBA |
397 | { |
398 | return false; | |
399 | } | |
22aa6223 TBA |
400 | |
401 | bool | |
52405d85 | 402 | process_stratum_target::supports_hardware_single_step () |
22aa6223 TBA |
403 | { |
404 | return false; | |
405 | } | |
6eeb5c55 TBA |
406 | |
407 | bool | |
52405d85 | 408 | process_stratum_target::stopped_by_watchpoint () |
6eeb5c55 TBA |
409 | { |
410 | return false; | |
411 | } | |
412 | ||
413 | CORE_ADDR | |
52405d85 | 414 | process_stratum_target::stopped_data_address () |
6eeb5c55 TBA |
415 | { |
416 | return 0; | |
417 | } | |
5203ae1e TBA |
418 | |
419 | bool | |
52405d85 | 420 | process_stratum_target::supports_read_offsets () |
5203ae1e TBA |
421 | { |
422 | return false; | |
423 | } | |
424 | ||
546b77fe LM |
425 | bool |
426 | process_stratum_target::supports_memory_tagging () | |
427 | { | |
428 | return false; | |
429 | } | |
430 | ||
431 | bool | |
432 | process_stratum_target::fetch_memtags (CORE_ADDR address, size_t len, | |
433 | gdb::byte_vector &tags, int type) | |
434 | { | |
435 | gdb_assert_not_reached ("target op fetch_memtags not supported"); | |
436 | } | |
437 | ||
438 | bool | |
439 | process_stratum_target::store_memtags (CORE_ADDR address, size_t len, | |
440 | const gdb::byte_vector &tags, int type) | |
441 | { | |
442 | gdb_assert_not_reached ("target op store_memtags not supported"); | |
443 | } | |
444 | ||
5203ae1e | 445 | int |
52405d85 | 446 | process_stratum_target::read_offsets (CORE_ADDR *text, CORE_ADDR *data) |
5203ae1e TBA |
447 | { |
448 | gdb_assert_not_reached ("target op read_offsets not supported"); | |
449 | } | |
6e3fd7e9 TBA |
450 | |
451 | bool | |
52405d85 | 452 | process_stratum_target::supports_get_tls_address () |
6e3fd7e9 TBA |
453 | { |
454 | return false; | |
455 | } | |
456 | ||
457 | int | |
52405d85 TBA |
458 | process_stratum_target::get_tls_address (thread_info *thread, |
459 | CORE_ADDR offset, | |
460 | CORE_ADDR load_module, | |
461 | CORE_ADDR *address) | |
6e3fd7e9 TBA |
462 | { |
463 | gdb_assert_not_reached ("target op get_tls_address not supported"); | |
464 | } | |
ea06bbaa | 465 | |
2d0795ee | 466 | bool |
52405d85 | 467 | process_stratum_target::supports_qxfer_osdata () |
2d0795ee TBA |
468 | { |
469 | return false; | |
470 | } | |
471 | ||
472 | int | |
52405d85 TBA |
473 | process_stratum_target::qxfer_osdata (const char *annex, |
474 | unsigned char *readbuf, | |
475 | unsigned const char *writebuf, | |
476 | CORE_ADDR offset, int len) | |
2d0795ee TBA |
477 | { |
478 | gdb_assert_not_reached ("target op qxfer_osdata not supported"); | |
479 | } | |
d7abedf7 TBA |
480 | |
481 | bool | |
52405d85 | 482 | process_stratum_target::supports_qxfer_siginfo () |
d7abedf7 TBA |
483 | { |
484 | return false; | |
485 | } | |
486 | ||
487 | int | |
52405d85 TBA |
488 | process_stratum_target::qxfer_siginfo (const char *annex, |
489 | unsigned char *readbuf, | |
490 | unsigned const char *writebuf, | |
491 | CORE_ADDR offset, int len) | |
d7abedf7 TBA |
492 | { |
493 | gdb_assert_not_reached ("target op qxfer_siginfo not supported"); | |
494 | } | |
0dc587d4 TBA |
495 | |
496 | bool | |
52405d85 | 497 | process_stratum_target::supports_non_stop () |
0dc587d4 TBA |
498 | { |
499 | return false; | |
500 | } | |
501 | ||
502 | bool | |
52405d85 | 503 | process_stratum_target::async (bool enable) |
0dc587d4 TBA |
504 | { |
505 | return false; | |
506 | } | |
507 | ||
508 | int | |
52405d85 | 509 | process_stratum_target::start_non_stop (bool enable) |
0dc587d4 TBA |
510 | { |
511 | if (enable) | |
512 | return -1; | |
513 | else | |
514 | return 0; | |
515 | } | |
652aef77 TBA |
516 | |
517 | bool | |
52405d85 | 518 | process_stratum_target::supports_multi_process () |
652aef77 TBA |
519 | { |
520 | return false; | |
521 | } | |
9690a72a TBA |
522 | |
523 | bool | |
52405d85 | 524 | process_stratum_target::supports_fork_events () |
9690a72a TBA |
525 | { |
526 | return false; | |
527 | } | |
528 | ||
529 | bool | |
52405d85 | 530 | process_stratum_target::supports_vfork_events () |
9690a72a TBA |
531 | { |
532 | return false; | |
533 | } | |
534 | ||
65c459ab PA |
535 | gdb_thread_options |
536 | process_stratum_target::supported_thread_options () | |
537 | { | |
538 | return 0; | |
539 | } | |
540 | ||
9690a72a | 541 | bool |
52405d85 | 542 | process_stratum_target::supports_exec_events () |
9690a72a TBA |
543 | { |
544 | return false; | |
545 | } | |
fb00dfce TBA |
546 | |
547 | void | |
52405d85 | 548 | process_stratum_target::handle_new_gdb_connection () |
fb00dfce TBA |
549 | { |
550 | /* Nop. */ | |
551 | } | |
55cf3021 TBA |
552 | |
553 | int | |
52405d85 | 554 | process_stratum_target::handle_monitor_command (char *mon) |
55cf3021 TBA |
555 | { |
556 | return 0; | |
557 | } | |
95a45fc1 TBA |
558 | |
559 | int | |
52405d85 | 560 | process_stratum_target::core_of_thread (ptid_t ptid) |
95a45fc1 TBA |
561 | { |
562 | return -1; | |
563 | } | |
9da41fda TBA |
564 | |
565 | bool | |
52405d85 | 566 | process_stratum_target::supports_read_loadmap () |
9da41fda TBA |
567 | { |
568 | return false; | |
569 | } | |
570 | ||
571 | int | |
52405d85 TBA |
572 | process_stratum_target::read_loadmap (const char *annex, |
573 | CORE_ADDR offset, | |
574 | unsigned char *myaddr, | |
575 | unsigned int len) | |
9da41fda TBA |
576 | { |
577 | gdb_assert_not_reached ("target op read_loadmap not supported"); | |
578 | } | |
0df28b1b TBA |
579 | |
580 | void | |
b315b67d SM |
581 | process_stratum_target::process_qsupported |
582 | (gdb::array_view<const char * const> features) | |
0df28b1b TBA |
583 | { |
584 | /* Nop. */ | |
585 | } | |
290732bf TBA |
586 | |
587 | bool | |
52405d85 | 588 | process_stratum_target::supports_tracepoints () |
290732bf TBA |
589 | { |
590 | return false; | |
591 | } | |
770d8f6a TBA |
592 | |
593 | CORE_ADDR | |
52405d85 | 594 | process_stratum_target::read_pc (regcache *regcache) |
770d8f6a TBA |
595 | { |
596 | gdb_assert_not_reached ("process_target::read_pc: Unable to find PC"); | |
597 | } | |
598 | ||
599 | void | |
52405d85 | 600 | process_stratum_target::write_pc (regcache *regcache, CORE_ADDR pc) |
770d8f6a TBA |
601 | { |
602 | gdb_assert_not_reached ("process_target::write_pc: Unable to update PC"); | |
603 | } | |
68119632 TBA |
604 | |
605 | bool | |
52405d85 | 606 | process_stratum_target::supports_thread_stopped () |
68119632 TBA |
607 | { |
608 | return false; | |
609 | } | |
610 | ||
611 | bool | |
52405d85 | 612 | process_stratum_target::thread_stopped (thread_info *thread) |
68119632 TBA |
613 | { |
614 | gdb_assert_not_reached ("target op thread_stopped not supported"); | |
615 | } | |
4e2e869c | 616 | |
ef980d65 PA |
617 | bool |
618 | process_stratum_target::any_resumed () | |
619 | { | |
620 | return true; | |
621 | } | |
622 | ||
4e2e869c | 623 | bool |
52405d85 | 624 | process_stratum_target::supports_get_tib_address () |
4e2e869c TBA |
625 | { |
626 | return false; | |
627 | } | |
628 | ||
629 | int | |
52405d85 | 630 | process_stratum_target::get_tib_address (ptid_t ptid, CORE_ADDR *address) |
4e2e869c TBA |
631 | { |
632 | gdb_assert_not_reached ("target op get_tib_address not supported"); | |
633 | } | |
29e8dc09 TBA |
634 | |
635 | void | |
52405d85 | 636 | process_stratum_target::pause_all (bool freeze) |
29e8dc09 TBA |
637 | { |
638 | /* Nop. */ | |
639 | } | |
640 | ||
641 | void | |
52405d85 | 642 | process_stratum_target::unpause_all (bool unfreeze) |
29e8dc09 TBA |
643 | { |
644 | /* Nop. */ | |
645 | } | |
5c9eb2f2 TBA |
646 | |
647 | void | |
52405d85 | 648 | process_stratum_target::stabilize_threads () |
5c9eb2f2 TBA |
649 | { |
650 | /* Nop. */ | |
651 | } | |
c23c9391 TBA |
652 | |
653 | bool | |
52405d85 | 654 | process_stratum_target::supports_fast_tracepoints () |
c23c9391 TBA |
655 | { |
656 | return false; | |
657 | } | |
658 | ||
659 | int | |
52405d85 | 660 | process_stratum_target::install_fast_tracepoint_jump_pad |
c23c9391 TBA |
661 | (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector, |
662 | CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry, | |
663 | CORE_ADDR *trampoline, ULONGEST *trampoline_size, | |
664 | unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size, | |
665 | CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end, | |
666 | char *err) | |
667 | { | |
668 | gdb_assert_not_reached ("target op install_fast_tracepoint_jump_pad " | |
669 | "not supported"); | |
670 | } | |
671 | ||
672 | int | |
52405d85 | 673 | process_stratum_target::get_min_fast_tracepoint_insn_len () |
c23c9391 TBA |
674 | { |
675 | return 0; | |
676 | } | |
345dafad TBA |
677 | |
678 | struct emit_ops * | |
52405d85 | 679 | process_stratum_target::emit_ops () |
345dafad TBA |
680 | { |
681 | return nullptr; | |
682 | } | |
c756403b TBA |
683 | |
684 | bool | |
52405d85 | 685 | process_stratum_target::supports_disable_randomization () |
c756403b TBA |
686 | { |
687 | return false; | |
688 | } | |
974387bb TBA |
689 | |
690 | bool | |
52405d85 | 691 | process_stratum_target::supports_qxfer_libraries_svr4 () |
974387bb TBA |
692 | { |
693 | return false; | |
694 | } | |
695 | ||
696 | int | |
52405d85 TBA |
697 | process_stratum_target::qxfer_libraries_svr4 (const char *annex, |
698 | unsigned char *readbuf, | |
699 | unsigned const char *writebuf, | |
700 | CORE_ADDR offset, int len) | |
974387bb TBA |
701 | { |
702 | gdb_assert_not_reached ("target op qxfer_libraries_svr4 not supported"); | |
703 | } | |
c0245cb9 TBA |
704 | |
705 | bool | |
52405d85 | 706 | process_stratum_target::supports_agent () |
c0245cb9 TBA |
707 | { |
708 | return false; | |
709 | } | |
79597bdd | 710 | |
8263b346 TBA |
711 | bool |
712 | process_stratum_target::supports_btrace () | |
713 | { | |
714 | return false; | |
715 | } | |
716 | ||
79597bdd | 717 | btrace_target_info * |
696c0d5e MM |
718 | process_stratum_target::enable_btrace (thread_info *tp, |
719 | const btrace_config *conf) | |
79597bdd TBA |
720 | { |
721 | error (_("Target does not support branch tracing.")); | |
722 | } | |
723 | ||
724 | int | |
52405d85 | 725 | process_stratum_target::disable_btrace (btrace_target_info *tinfo) |
79597bdd TBA |
726 | { |
727 | error (_("Target does not support branch tracing.")); | |
728 | } | |
729 | ||
730 | int | |
52405d85 | 731 | process_stratum_target::read_btrace (btrace_target_info *tinfo, |
873a185b TT |
732 | std::string *buffer, |
733 | enum btrace_read_type type) | |
79597bdd TBA |
734 | { |
735 | error (_("Target does not support branch tracing.")); | |
736 | } | |
737 | ||
738 | int | |
52405d85 | 739 | process_stratum_target::read_btrace_conf (const btrace_target_info *tinfo, |
873a185b | 740 | std::string *buffer) |
79597bdd TBA |
741 | { |
742 | error (_("Target does not support branch tracing.")); | |
743 | } | |
2526e0cd TBA |
744 | |
745 | bool | |
52405d85 | 746 | process_stratum_target::supports_range_stepping () |
2526e0cd TBA |
747 | { |
748 | return false; | |
749 | } | |
8247b823 TBA |
750 | |
751 | bool | |
52405d85 | 752 | process_stratum_target::supports_pid_to_exec_file () |
8247b823 TBA |
753 | { |
754 | return false; | |
755 | } | |
756 | ||
04977957 | 757 | const char * |
52405d85 | 758 | process_stratum_target::pid_to_exec_file (int pid) |
8247b823 TBA |
759 | { |
760 | gdb_assert_not_reached ("target op pid_to_exec_file not supported"); | |
761 | } | |
c9b7b804 TBA |
762 | |
763 | bool | |
52405d85 | 764 | process_stratum_target::supports_multifs () |
c9b7b804 TBA |
765 | { |
766 | return false; | |
767 | } | |
768 | ||
769 | int | |
52405d85 TBA |
770 | process_stratum_target::multifs_open (int pid, const char *filename, |
771 | int flags, mode_t mode) | |
c9b7b804 TBA |
772 | { |
773 | return open (filename, flags, mode); | |
774 | } | |
775 | ||
776 | int | |
52405d85 | 777 | process_stratum_target::multifs_unlink (int pid, const char *filename) |
c9b7b804 TBA |
778 | { |
779 | return unlink (filename); | |
780 | } | |
781 | ||
782 | ssize_t | |
52405d85 TBA |
783 | process_stratum_target::multifs_readlink (int pid, const char *filename, |
784 | char *buf, size_t bufsiz) | |
c9b7b804 TBA |
785 | { |
786 | return readlink (filename, buf, bufsiz); | |
787 | } | |
d367006f TBA |
788 | |
789 | int | |
52405d85 | 790 | process_stratum_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr) |
d367006f TBA |
791 | { |
792 | /* The default behavior is to use the size of a breakpoint as the | |
793 | kind. */ | |
794 | int size = 0; | |
795 | sw_breakpoint_from_kind (0, &size); | |
796 | return size; | |
797 | } | |
798 | ||
799 | int | |
52405d85 | 800 | process_stratum_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr) |
d367006f TBA |
801 | { |
802 | return breakpoint_kind_from_pc (pcptr); | |
803 | } | |
7f63b89b TBA |
804 | |
805 | const char * | |
52405d85 | 806 | process_stratum_target::thread_name (ptid_t thread) |
7f63b89b TBA |
807 | { |
808 | return nullptr; | |
809 | } | |
810 | ||
811 | bool | |
52405d85 TBA |
812 | process_stratum_target::thread_handle (ptid_t ptid, gdb_byte **handle, |
813 | int *handle_len) | |
7f63b89b TBA |
814 | { |
815 | return false; | |
816 | } | |
5303a34f | 817 | |
7b961964 SM |
818 | thread_info * |
819 | process_stratum_target::thread_pending_parent (thread_info *thread) | |
820 | { | |
821 | return nullptr; | |
822 | } | |
823 | ||
df5ad102 | 824 | thread_info * |
faf44a31 PA |
825 | process_stratum_target::thread_pending_child (thread_info *thread, |
826 | target_waitkind *kind) | |
df5ad102 SM |
827 | { |
828 | return nullptr; | |
829 | } | |
830 | ||
5303a34f | 831 | bool |
52405d85 | 832 | process_stratum_target::supports_software_single_step () |
5303a34f TBA |
833 | { |
834 | return false; | |
835 | } | |
bc8d3ae4 TBA |
836 | |
837 | bool | |
52405d85 | 838 | process_stratum_target::supports_catch_syscall () |
bc8d3ae4 TBA |
839 | { |
840 | return false; | |
841 | } | |
d633e831 TBA |
842 | |
843 | int | |
52405d85 | 844 | process_stratum_target::get_ipa_tdesc_idx () |
d633e831 TBA |
845 | { |
846 | return 0; | |
847 | } |