gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdbserver / target.cc
CommitLineData
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 30process_stratum_target *the_target;
ce3a066d 31
f0db101d 32int
f557a88a 33set_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. */
45static ptid_t prev_general_thread;
46
47/* See target.h. */
48
49int
50prepare_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
112void
113done_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 124int
f450004a 125read_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
135int
136target_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
143int
144target_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 151int
4196ab2a
TT
152target_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
PA
162ptid_t
163mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
bd99dc85 164 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
203void
03f4463b 204target_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
SDJ
222ptid_t
223target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
224{
52405d85 225 return the_target->wait (ptid, status, options);
f2b9e3df
SDJ
226}
227
228/* See target/target.h. */
229
bc1e6c81
SDJ
230void
231target_mourn_inferior (ptid_t ptid)
232{
52405d85 233 the_target->mourn (find_process_pid (ptid.pid ()));
bc1e6c81
SDJ
234}
235
236/* See target/target.h. */
237
f8c1d06b 238void
03f4463b 239target_continue_no_signal (ptid_t ptid)
f8c1d06b
GB
240{
241 struct thread_resume resume_info;
242
243 resume_info.thread = ptid;
244 resume_info.kind = resume_continue;
245 resume_info.sig = GDB_SIGNAL_0;
52405d85 246 the_target->resume (&resume_info, 1);
f8c1d06b
GB
247}
248
049a8570
SDJ
249/* See target/target.h. */
250
251void
252target_continue (ptid_t ptid, enum gdb_signal signal)
253{
254 struct thread_resume resume_info;
255
256 resume_info.thread = ptid;
257 resume_info.kind = resume_continue;
258 resume_info.sig = gdb_signal_to_host (signal);
52405d85 259 the_target->resume (&resume_info, 1);
049a8570
SDJ
260}
261
1fb77080
SDJ
262/* See target/target.h. */
263
264int
265target_supports_multi_process (void)
266{
52405d85 267 return the_target->supports_multi_process ();
1fb77080
SDJ
268}
269
ce3a066d 270void
5b6d1e4f 271set_target_ops (process_stratum_target *target)
ce3a066d 272{
478f9adf 273 the_target = target;
ce3a066d 274}
95954743
PA
275
276/* Convert pid to printable format. */
277
278const char *
279target_pid_to_str (ptid_t ptid)
280{
281 static char buf[80];
282
d7e15655 283 if (ptid == minus_one_ptid)
6cebaf6e 284 xsnprintf (buf, sizeof (buf), "<all threads>");
d7e15655 285 else if (ptid == null_ptid)
6cebaf6e 286 xsnprintf (buf, sizeof (buf), "<null thread>");
cc6bcb54 287 else if (ptid.tid () != 0)
6cebaf6e 288 xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx",
cc6bcb54 289 ptid.pid (), ptid.tid ());
e38504b3 290 else if (ptid.lwp () != 0)
6cebaf6e 291 xsnprintf (buf, sizeof (buf), "LWP %d.%ld",
e38504b3 292 ptid.pid (), ptid.lwp ());
95954743 293 else
6cebaf6e 294 xsnprintf (buf, sizeof (buf), "Process %d",
e99b03dc 295 ptid.pid ());
95954743
PA
296
297 return buf;
298}
8336d594 299
7255706c 300int
a780ef4f 301kill_inferior (process_info *proc)
7255706c 302{
a780ef4f 303 gdb_agent_about_to_close (proc->pid);
7255706c 304
52405d85 305 return the_target->kill (proc);
7255706c 306}
70b90b91 307
223ffa71
TT
308/* Define it. */
309
e671cd59
PA
310target_terminal_state target_terminal::m_terminal_state
311 = target_terminal_state::is_ours;
223ffa71 312
2090129c
SDJ
313/* See target/target.h. */
314
315void
223ffa71 316target_terminal::init ()
2090129c
SDJ
317{
318 /* Placeholder needed because of fork_inferior. Not necessary on
319 GDBserver. */
320}
321
322/* See target/target.h. */
323
324void
223ffa71 325target_terminal::inferior ()
2090129c
SDJ
326{
327 /* Placeholder needed because of fork_inferior. Not necessary on
328 GDBserver. */
329}
330
331/* See target/target.h. */
332
333void
223ffa71 334target_terminal::ours ()
2090129c
SDJ
335{
336 /* Placeholder needed because of fork_inferior. Not necessary on
337 GDBserver. */
338}
223ffa71
TT
339
340/* See target/target.h. */
341
342void
343target_terminal::ours_for_output (void)
344{
345 /* Placeholder. */
346}
347
348/* See target/target.h. */
349
350void
351target_terminal::info (const char *arg, int from_tty)
352{
353 /* Placeholder. */
354}
6dee9afb
TBA
355
356/* Default implementations of target ops.
357 See target.h for definitions. */
358
359void
52405d85 360process_stratum_target::post_create_inferior ()
6dee9afb
TBA
361{
362 /* Nop. */
363}
79b44087
TBA
364
365int
52405d85 366process_stratum_target::prepare_to_access_memory ()
79b44087
TBA
367{
368 return 0;
369}
370
371void
52405d85 372process_stratum_target::done_accessing_memory ()
79b44087
TBA
373{
374 /* Nop. */
375}
2a31c7aa
TBA
376
377void
52405d85 378process_stratum_target::look_up_symbols ()
2a31c7aa
TBA
379{
380 /* Nop. */
381}
eac215cc
TBA
382
383bool
52405d85 384process_stratum_target::supports_read_auxv ()
eac215cc
TBA
385{
386 return false;
387}
388
389int
52405d85
TBA
390process_stratum_target::read_auxv (CORE_ADDR offset, unsigned char *myaddr,
391 unsigned int len)
eac215cc
TBA
392{
393 gdb_assert_not_reached ("target op read_auxv not supported");
394}
a2b2297a
TBA
395
396bool
52405d85 397process_stratum_target::supports_z_point_type (char z_type)
a2b2297a
TBA
398{
399 return false;
400}
7e0bde70
TBA
401
402int
52405d85
TBA
403process_stratum_target::insert_point (enum raw_bkpt_type type,
404 CORE_ADDR addr,
405 int size, raw_breakpoint *bp)
7e0bde70
TBA
406{
407 return 1;
408}
409
410int
52405d85
TBA
411process_stratum_target::remove_point (enum raw_bkpt_type type,
412 CORE_ADDR addr,
413 int size, raw_breakpoint *bp)
7e0bde70
TBA
414{
415 return 1;
416}
84320c4e
TBA
417
418bool
52405d85 419process_stratum_target::stopped_by_sw_breakpoint ()
84320c4e
TBA
420{
421 return false;
422}
423
424bool
52405d85 425process_stratum_target::supports_stopped_by_sw_breakpoint ()
84320c4e
TBA
426{
427 return false;
428}
93fe88b2
TBA
429
430bool
52405d85 431process_stratum_target::stopped_by_hw_breakpoint ()
93fe88b2
TBA
432{
433 return false;
434}
435
436bool
52405d85 437process_stratum_target::supports_stopped_by_hw_breakpoint ()
93fe88b2
TBA
438{
439 return false;
440}
22aa6223
TBA
441
442bool
52405d85 443process_stratum_target::supports_hardware_single_step ()
22aa6223
TBA
444{
445 return false;
446}
6eeb5c55
TBA
447
448bool
52405d85 449process_stratum_target::stopped_by_watchpoint ()
6eeb5c55
TBA
450{
451 return false;
452}
453
454CORE_ADDR
52405d85 455process_stratum_target::stopped_data_address ()
6eeb5c55
TBA
456{
457 return 0;
458}
5203ae1e
TBA
459
460bool
52405d85 461process_stratum_target::supports_read_offsets ()
5203ae1e
TBA
462{
463 return false;
464}
465
466int
52405d85 467process_stratum_target::read_offsets (CORE_ADDR *text, CORE_ADDR *data)
5203ae1e
TBA
468{
469 gdb_assert_not_reached ("target op read_offsets not supported");
470}
6e3fd7e9
TBA
471
472bool
52405d85 473process_stratum_target::supports_get_tls_address ()
6e3fd7e9
TBA
474{
475 return false;
476}
477
478int
52405d85
TBA
479process_stratum_target::get_tls_address (thread_info *thread,
480 CORE_ADDR offset,
481 CORE_ADDR load_module,
482 CORE_ADDR *address)
6e3fd7e9
TBA
483{
484 gdb_assert_not_reached ("target op get_tls_address not supported");
485}
ea06bbaa
TBA
486
487void
52405d85 488process_stratum_target::hostio_last_error (char *buf)
ea06bbaa
TBA
489{
490 hostio_last_error_from_errno (buf);
491}
2d0795ee
TBA
492
493bool
52405d85 494process_stratum_target::supports_qxfer_osdata ()
2d0795ee
TBA
495{
496 return false;
497}
498
499int
52405d85
TBA
500process_stratum_target::qxfer_osdata (const char *annex,
501 unsigned char *readbuf,
502 unsigned const char *writebuf,
503 CORE_ADDR offset, int len)
2d0795ee
TBA
504{
505 gdb_assert_not_reached ("target op qxfer_osdata not supported");
506}
d7abedf7
TBA
507
508bool
52405d85 509process_stratum_target::supports_qxfer_siginfo ()
d7abedf7
TBA
510{
511 return false;
512}
513
514int
52405d85
TBA
515process_stratum_target::qxfer_siginfo (const char *annex,
516 unsigned char *readbuf,
517 unsigned const char *writebuf,
518 CORE_ADDR offset, int len)
d7abedf7
TBA
519{
520 gdb_assert_not_reached ("target op qxfer_siginfo not supported");
521}
0dc587d4
TBA
522
523bool
52405d85 524process_stratum_target::supports_non_stop ()
0dc587d4
TBA
525{
526 return false;
527}
528
529bool
52405d85 530process_stratum_target::async (bool enable)
0dc587d4
TBA
531{
532 return false;
533}
534
535int
52405d85 536process_stratum_target::start_non_stop (bool enable)
0dc587d4
TBA
537{
538 if (enable)
539 return -1;
540 else
541 return 0;
542}
652aef77
TBA
543
544bool
52405d85 545process_stratum_target::supports_multi_process ()
652aef77
TBA
546{
547 return false;
548}
9690a72a
TBA
549
550bool
52405d85 551process_stratum_target::supports_fork_events ()
9690a72a
TBA
552{
553 return false;
554}
555
556bool
52405d85 557process_stratum_target::supports_vfork_events ()
9690a72a
TBA
558{
559 return false;
560}
561
562bool
52405d85 563process_stratum_target::supports_exec_events ()
9690a72a
TBA
564{
565 return false;
566}
fb00dfce
TBA
567
568void
52405d85 569process_stratum_target::handle_new_gdb_connection ()
fb00dfce
TBA
570{
571 /* Nop. */
572}
55cf3021
TBA
573
574int
52405d85 575process_stratum_target::handle_monitor_command (char *mon)
55cf3021
TBA
576{
577 return 0;
578}
95a45fc1
TBA
579
580int
52405d85 581process_stratum_target::core_of_thread (ptid_t ptid)
95a45fc1
TBA
582{
583 return -1;
584}
9da41fda
TBA
585
586bool
52405d85 587process_stratum_target::supports_read_loadmap ()
9da41fda
TBA
588{
589 return false;
590}
591
592int
52405d85
TBA
593process_stratum_target::read_loadmap (const char *annex,
594 CORE_ADDR offset,
595 unsigned char *myaddr,
596 unsigned int len)
9da41fda
TBA
597{
598 gdb_assert_not_reached ("target op read_loadmap not supported");
599}
0df28b1b
TBA
600
601void
52405d85 602process_stratum_target::process_qsupported (char **features, int count)
0df28b1b
TBA
603{
604 /* Nop. */
605}
290732bf
TBA
606
607bool
52405d85 608process_stratum_target::supports_tracepoints ()
290732bf
TBA
609{
610 return false;
611}
770d8f6a
TBA
612
613CORE_ADDR
52405d85 614process_stratum_target::read_pc (regcache *regcache)
770d8f6a
TBA
615{
616 gdb_assert_not_reached ("process_target::read_pc: Unable to find PC");
617}
618
619void
52405d85 620process_stratum_target::write_pc (regcache *regcache, CORE_ADDR pc)
770d8f6a
TBA
621{
622 gdb_assert_not_reached ("process_target::write_pc: Unable to update PC");
623}
68119632
TBA
624
625bool
52405d85 626process_stratum_target::supports_thread_stopped ()
68119632
TBA
627{
628 return false;
629}
630
631bool
52405d85 632process_stratum_target::thread_stopped (thread_info *thread)
68119632
TBA
633{
634 gdb_assert_not_reached ("target op thread_stopped not supported");
635}
4e2e869c
TBA
636
637bool
52405d85 638process_stratum_target::supports_get_tib_address ()
4e2e869c
TBA
639{
640 return false;
641}
642
643int
52405d85 644process_stratum_target::get_tib_address (ptid_t ptid, CORE_ADDR *address)
4e2e869c
TBA
645{
646 gdb_assert_not_reached ("target op get_tib_address not supported");
647}
29e8dc09
TBA
648
649void
52405d85 650process_stratum_target::pause_all (bool freeze)
29e8dc09
TBA
651{
652 /* Nop. */
653}
654
655void
52405d85 656process_stratum_target::unpause_all (bool unfreeze)
29e8dc09
TBA
657{
658 /* Nop. */
659}
5c9eb2f2
TBA
660
661void
52405d85 662process_stratum_target::stabilize_threads ()
5c9eb2f2
TBA
663{
664 /* Nop. */
665}
c23c9391
TBA
666
667bool
52405d85 668process_stratum_target::supports_fast_tracepoints ()
c23c9391
TBA
669{
670 return false;
671}
672
673int
52405d85 674process_stratum_target::install_fast_tracepoint_jump_pad
c23c9391
TBA
675 (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
676 CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
677 CORE_ADDR *trampoline, ULONGEST *trampoline_size,
678 unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
679 CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
680 char *err)
681{
682 gdb_assert_not_reached ("target op install_fast_tracepoint_jump_pad "
683 "not supported");
684}
685
686int
52405d85 687process_stratum_target::get_min_fast_tracepoint_insn_len ()
c23c9391
TBA
688{
689 return 0;
690}
345dafad
TBA
691
692struct emit_ops *
52405d85 693process_stratum_target::emit_ops ()
345dafad
TBA
694{
695 return nullptr;
696}
c756403b
TBA
697
698bool
52405d85 699process_stratum_target::supports_disable_randomization ()
c756403b
TBA
700{
701 return false;
702}
974387bb
TBA
703
704bool
52405d85 705process_stratum_target::supports_qxfer_libraries_svr4 ()
974387bb
TBA
706{
707 return false;
708}
709
710int
52405d85
TBA
711process_stratum_target::qxfer_libraries_svr4 (const char *annex,
712 unsigned char *readbuf,
713 unsigned const char *writebuf,
714 CORE_ADDR offset, int len)
974387bb
TBA
715{
716 gdb_assert_not_reached ("target op qxfer_libraries_svr4 not supported");
717}
c0245cb9
TBA
718
719bool
52405d85 720process_stratum_target::supports_agent ()
c0245cb9
TBA
721{
722 return false;
723}
79597bdd
TBA
724
725btrace_target_info *
52405d85 726process_stratum_target::enable_btrace (ptid_t ptid, const btrace_config *conf)
79597bdd
TBA
727{
728 error (_("Target does not support branch tracing."));
729}
730
731int
52405d85 732process_stratum_target::disable_btrace (btrace_target_info *tinfo)
79597bdd
TBA
733{
734 error (_("Target does not support branch tracing."));
735}
736
737int
52405d85 738process_stratum_target::read_btrace (btrace_target_info *tinfo,
79597bdd
TBA
739 buffer *buffer,
740 enum btrace_read_type type)
741{
742 error (_("Target does not support branch tracing."));
743}
744
745int
52405d85
TBA
746process_stratum_target::read_btrace_conf (const btrace_target_info *tinfo,
747 buffer *buffer)
79597bdd
TBA
748{
749 error (_("Target does not support branch tracing."));
750}
2526e0cd
TBA
751
752bool
52405d85 753process_stratum_target::supports_range_stepping ()
2526e0cd
TBA
754{
755 return false;
756}
8247b823
TBA
757
758bool
52405d85 759process_stratum_target::supports_pid_to_exec_file ()
8247b823
TBA
760{
761 return false;
762}
763
764char *
52405d85 765process_stratum_target::pid_to_exec_file (int pid)
8247b823
TBA
766{
767 gdb_assert_not_reached ("target op pid_to_exec_file not supported");
768}
c9b7b804
TBA
769
770bool
52405d85 771process_stratum_target::supports_multifs ()
c9b7b804
TBA
772{
773 return false;
774}
775
776int
52405d85
TBA
777process_stratum_target::multifs_open (int pid, const char *filename,
778 int flags, mode_t mode)
c9b7b804
TBA
779{
780 return open (filename, flags, mode);
781}
782
783int
52405d85 784process_stratum_target::multifs_unlink (int pid, const char *filename)
c9b7b804
TBA
785{
786 return unlink (filename);
787}
788
789ssize_t
52405d85
TBA
790process_stratum_target::multifs_readlink (int pid, const char *filename,
791 char *buf, size_t bufsiz)
c9b7b804
TBA
792{
793 return readlink (filename, buf, bufsiz);
794}
d367006f
TBA
795
796int
52405d85 797process_stratum_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr)
d367006f
TBA
798{
799 /* The default behavior is to use the size of a breakpoint as the
800 kind. */
801 int size = 0;
802 sw_breakpoint_from_kind (0, &size);
803 return size;
804}
805
806int
52405d85 807process_stratum_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr)
d367006f
TBA
808{
809 return breakpoint_kind_from_pc (pcptr);
810}
7f63b89b
TBA
811
812const char *
52405d85 813process_stratum_target::thread_name (ptid_t thread)
7f63b89b
TBA
814{
815 return nullptr;
816}
817
818bool
52405d85
TBA
819process_stratum_target::thread_handle (ptid_t ptid, gdb_byte **handle,
820 int *handle_len)
7f63b89b
TBA
821{
822 return false;
823}
5303a34f
TBA
824
825bool
52405d85 826process_stratum_target::supports_software_single_step ()
5303a34f
TBA
827{
828 return false;
829}
bc8d3ae4
TBA
830
831bool
52405d85 832process_stratum_target::supports_catch_syscall ()
bc8d3ae4
TBA
833{
834 return false;
835}
d633e831
TBA
836
837int
52405d85 838process_stratum_target::get_ipa_tdesc_idx ()
d633e831
TBA
839{
840 return 0;
841}
This page took 1.504468 seconds and 4 git commands to generate.