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