GDB (xrefs)

/tmp/gdb-8.1/gdb/mips-linux-nat.c
Go to the documentation of this file.
1 /* Native-dependent code for GNU/Linux on MIPS processors.
2
3 Copyright (C) 2001-2018 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 #include "defs.h"
21 #include "command.h"
22 #include "gdbcmd.h"
23 #include "inferior.h"
24 #include "mips-tdep.h"
25 #include "target.h"
26 #include "regcache.h"
27 #include "linux-nat.h"
28 #include "mips-linux-tdep.h"
29 #include "target-descriptions.h"
30
31 #include "gdb_proc_service.h"
32 #include "gregset.h"
33
34 #include <sgidefs.h>
35 #include "nat/gdb_ptrace.h"
36 #include <asm/ptrace.h>
37 #include "inf-ptrace.h"
38
39 #include "nat/mips-linux-watch.h"
40
41 #ifndef PTRACE_GET_THREAD_AREA
42 #define PTRACE_GET_THREAD_AREA 25
43 #endif
44
45 /* Assume that we have PTRACE_GETREGS et al. support. If we do not,
46 we'll clear this and use PTRACE_PEEKUSER instead. */
47 static int have_ptrace_regsets = 1;
48
49 /* Saved function pointers to fetch and store a single register using
50 PTRACE_PEEKUSER and PTRACE_POKEUSER. */
51
52 static void (*super_fetch_registers) (struct target_ops *,
53 struct regcache *, int);
54 static void (*super_store_registers) (struct target_ops *,
55 struct regcache *, int);
56
57 static void (*super_close) (struct target_ops *);
58
59 /* Map gdb internal register number to ptrace ``address''.
60 These ``addresses'' are normally defined in <asm/ptrace.h>.
61
62 ptrace does not provide a way to read (or set) MIPS_PS_REGNUM,
63 and there's no point in reading or setting MIPS_ZERO_REGNUM.
64 We also can not set BADVADDR, CAUSE, or FCRIR via ptrace(). */
65
66 static CORE_ADDR
67 mips_linux_register_addr (struct gdbarch *gdbarch, int regno, int store)
68 {
69 CORE_ADDR regaddr;
70
71 if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))
72 error (_("Bogon register number %d."), regno);
73
74 if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
75 regaddr = regno;
76 else if ((regno >= mips_regnum (gdbarch)->fp0)
77 && (regno < mips_regnum (gdbarch)->fp0 + 32))
78 regaddr = FPR_BASE + (regno - mips_regnum (gdbarch)->fp0);
79 else if (regno == mips_regnum (gdbarch)->pc)
80 regaddr = PC;
81 else if (regno == mips_regnum (gdbarch)->cause)
82 regaddr = store? (CORE_ADDR) -1 : CAUSE;
83 else if (regno == mips_regnum (gdbarch)->badvaddr)
84 regaddr = store? (CORE_ADDR) -1 : BADVADDR;
85 else if (regno == mips_regnum (gdbarch)->lo)
86 regaddr = MMLO;
87 else if (regno == mips_regnum (gdbarch)->hi)
88 regaddr = MMHI;
89 else if (regno == mips_regnum (gdbarch)->fp_control_status)
90 regaddr = FPC_CSR;
91 else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
92 regaddr = store? (CORE_ADDR) -1 : FPC_EIR;
93 else if (mips_regnum (gdbarch)->dspacc != -1
94 && regno >= mips_regnum (gdbarch)->dspacc
95 && regno < mips_regnum (gdbarch)->dspacc + 6)
96 regaddr = DSP_BASE + (regno - mips_regnum (gdbarch)->dspacc);
97 else if (regno == mips_regnum (gdbarch)->dspctl)
98 regaddr = DSP_CONTROL;
99 else if (mips_linux_restart_reg_p (gdbarch) && regno == MIPS_RESTART_REGNUM)
100 regaddr = 0;
101 else
102 regaddr = (CORE_ADDR) -1;
103
104 return regaddr;
105 }
106
107 static CORE_ADDR
108 mips64_linux_register_addr (struct gdbarch *gdbarch, int regno, int store)
109 {
110 CORE_ADDR regaddr;
111
112 if (regno < 0 || regno >= gdbarch_num_regs (gdbarch))
113 error (_("Bogon register number %d."), regno);
114
115 if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
116 regaddr = regno;
117 else if ((regno >= mips_regnum (gdbarch)->fp0)
118 && (regno < mips_regnum (gdbarch)->fp0 + 32))
119 regaddr = MIPS64_FPR_BASE + (regno - gdbarch_fp0_regnum (gdbarch));
120 else if (regno == mips_regnum (gdbarch)->pc)
121 regaddr = MIPS64_PC;
122 else if (regno == mips_regnum (gdbarch)->cause)
123 regaddr = store? (CORE_ADDR) -1 : MIPS64_CAUSE;
124 else if (regno == mips_regnum (gdbarch)->badvaddr)
125 regaddr = store? (CORE_ADDR) -1 : MIPS64_BADVADDR;
126 else if (regno == mips_regnum (gdbarch)->lo)
127 regaddr = MIPS64_MMLO;
128 else if (regno == mips_regnum (gdbarch)->hi)
129 regaddr = MIPS64_MMHI;
130 else if (regno == mips_regnum (gdbarch)->fp_control_status)
131 regaddr = MIPS64_FPC_CSR;
132 else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
133 regaddr = store? (CORE_ADDR) -1 : MIPS64_FPC_EIR;
134 else if (mips_regnum (gdbarch)->dspacc != -1
135 && regno >= mips_regnum (gdbarch)->dspacc
136 && regno < mips_regnum (gdbarch)->dspacc + 6)
137 regaddr = DSP_BASE + (regno - mips_regnum (gdbarch)->dspacc);
138 else if (regno == mips_regnum (gdbarch)->dspctl)
139 regaddr = DSP_CONTROL;
140 else if (mips_linux_restart_reg_p (gdbarch) && regno == MIPS_RESTART_REGNUM)
141 regaddr = 0;
142 else
143 regaddr = (CORE_ADDR) -1;
144
145 return regaddr;
146 }
147
148 /* Fetch the thread-local storage pointer for libthread_db. */
149
150 ps_err_e
151 ps_get_thread_area (struct ps_prochandle *ph,
152 lwpid_t lwpid, int idx, void **base)
153 {
154 if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
155 return PS_ERR;
156
157 /* IDX is the bias from the thread pointer to the beginning of the
158 thread descriptor. It has to be subtracted due to implementation
159 quirks in libthread_db. */
160 *base = (void *) ((char *)*base - idx);
161
162 return PS_OK;
163 }
164
165 /* Wrapper functions. These are only used by libthread_db. */
166
167 void
168 supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
169 {
170 if (mips_isa_regsize (regcache->arch ()) == 4)
171 mips_supply_gregset (regcache, (const mips_elf_gregset_t *) gregsetp);
172 else
173 mips64_supply_gregset (regcache, (const mips64_elf_gregset_t *) gregsetp);
174 }
175
176 void
177 fill_gregset (const struct regcache *regcache,
178 gdb_gregset_t *gregsetp, int regno)
179 {
180 if (mips_isa_regsize (regcache->arch ()) == 4)
181 mips_fill_gregset (regcache, (mips_elf_gregset_t *) gregsetp, regno);
182 else
183 mips64_fill_gregset (regcache, (mips64_elf_gregset_t *) gregsetp, regno);
184 }
185
186 void
187 supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
188 {
189 if (mips_isa_regsize (regcache->arch ()) == 4)
190 mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *) fpregsetp);
191 else
192 mips64_supply_fpregset (regcache,
193 (const mips64_elf_fpregset_t *) fpregsetp);
194 }
195
196 void
197 fill_fpregset (const struct regcache *regcache,
198 gdb_fpregset_t *fpregsetp, int regno)
199 {
200 if (mips_isa_regsize (regcache->arch ()) == 4)
201 mips_fill_fpregset (regcache, (mips_elf_fpregset_t *) fpregsetp, regno);
202 else
203 mips64_fill_fpregset (regcache,
204 (mips64_elf_fpregset_t *) fpregsetp, regno);
205 }
206
207
208 /* Fetch REGNO (or all registers if REGNO == -1) from the target
209 using PTRACE_GETREGS et al. */
210
211 static void
212 mips64_linux_regsets_fetch_registers (struct target_ops *ops,
213 struct regcache *regcache, int regno)
214 {
215 struct gdbarch *gdbarch = regcache->arch ();
216 int is_fp, is_dsp;
217 int have_dsp;
218 int regi;
219 int tid;
220
221 if (regno >= mips_regnum (gdbarch)->fp0
222 && regno <= mips_regnum (gdbarch)->fp0 + 32)
223 is_fp = 1;
224 else if (regno == mips_regnum (gdbarch)->fp_control_status)
225 is_fp = 1;
226 else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
227 is_fp = 1;
228 else
229 is_fp = 0;
230
231 /* DSP registers are optional and not a part of any set. */
232 have_dsp = mips_regnum (gdbarch)->dspctl != -1;
233 if (!have_dsp)
234 is_dsp = 0;
235 else if (regno >= mips_regnum (gdbarch)->dspacc
236 && regno < mips_regnum (gdbarch)->dspacc + 6)
237 is_dsp = 1;
238 else if (regno == mips_regnum (gdbarch)->dspctl)
239 is_dsp = 1;
240 else
241 is_dsp = 0;
242
243 tid = get_ptrace_pid (regcache_get_ptid (regcache));
244
245 if (regno == -1 || (!is_fp && !is_dsp))
246 {
247 mips64_elf_gregset_t regs;
248
249 if (ptrace (PTRACE_GETREGS, tid, 0L, (PTRACE_TYPE_ARG3) &regs) == -1)
250 {
251 if (errno == EIO)
252 {
253 have_ptrace_regsets = 0;
254 return;
255 }
256 perror_with_name (_("Couldn't get registers"));
257 }
258
259 mips64_supply_gregset (regcache,
260 (const mips64_elf_gregset_t *) &regs);
261 }
262
263 if (regno == -1 || is_fp)
264 {
265 mips64_elf_fpregset_t fp_regs;
266
267 if (ptrace (PTRACE_GETFPREGS, tid, 0L,
268 (PTRACE_TYPE_ARG3) &fp_regs) == -1)
269 {
270 if (errno == EIO)
271 {
272 have_ptrace_regsets = 0;
273 return;
274 }
275 perror_with_name (_("Couldn't get FP registers"));
276 }
277
278 mips64_supply_fpregset (regcache,
279 (const mips64_elf_fpregset_t *) &fp_regs);
280 }
281
282 if (is_dsp)
283 super_fetch_registers (ops, regcache, regno);
284 else if (regno == -1 && have_dsp)
285 {
286 for (regi = mips_regnum (gdbarch)->dspacc;
287 regi < mips_regnum (gdbarch)->dspacc + 6;
288 regi++)
289 super_fetch_registers (ops, regcache, regi);
290 super_fetch_registers (ops, regcache, mips_regnum (gdbarch)->dspctl);
291 }
292 }
293
294 /* Store REGNO (or all registers if REGNO == -1) to the target
295 using PTRACE_SETREGS et al. */
296
297 static void
298 mips64_linux_regsets_store_registers (struct target_ops *ops,
299 struct regcache *regcache, int regno)
300 {
301 struct gdbarch *gdbarch = regcache->arch ();
302 int is_fp, is_dsp;
303 int have_dsp;
304 int regi;
305 int tid;
306
307 if (regno >= mips_regnum (gdbarch)->fp0
308 && regno <= mips_regnum (gdbarch)->fp0 + 32)
309 is_fp = 1;
310 else if (regno == mips_regnum (gdbarch)->fp_control_status)
311 is_fp = 1;
312 else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
313 is_fp = 1;
314 else
315 is_fp = 0;
316
317 /* DSP registers are optional and not a part of any set. */
318 have_dsp = mips_regnum (gdbarch)->dspctl != -1;
319 if (!have_dsp)
320 is_dsp = 0;
321 else if (regno >= mips_regnum (gdbarch)->dspacc
322 && regno < mips_regnum (gdbarch)->dspacc + 6)
323 is_dsp = 1;
324 else if (regno == mips_regnum (gdbarch)->dspctl)
325 is_dsp = 1;
326 else
327 is_dsp = 0;
328
329 tid = get_ptrace_pid (regcache_get_ptid (regcache));
330
331 if (regno == -1 || (!is_fp && !is_dsp))
332 {
333 mips64_elf_gregset_t regs;
334
335 if (ptrace (PTRACE_GETREGS, tid, 0L, (PTRACE_TYPE_ARG3) &regs) == -1)
336 perror_with_name (_("Couldn't get registers"));
337
338 mips64_fill_gregset (regcache, &regs, regno);
339
340 if (ptrace (PTRACE_SETREGS, tid, 0L, (PTRACE_TYPE_ARG3) &regs) == -1)
341 perror_with_name (_("Couldn't set registers"));
342 }
343
344 if (regno == -1 || is_fp)
345 {
346 mips64_elf_fpregset_t fp_regs;
347
348 if (ptrace (PTRACE_GETFPREGS, tid, 0L,
349 (PTRACE_TYPE_ARG3) &fp_regs) == -1)
350 perror_with_name (_("Couldn't get FP registers"));
351
352 mips64_fill_fpregset (regcache, &fp_regs, regno);
353
354 if (ptrace (PTRACE_SETFPREGS, tid, 0L,
355 (PTRACE_TYPE_ARG3) &fp_regs) == -1)
356 perror_with_name (_("Couldn't set FP registers"));
357 }
358
359 if (is_dsp)
360 super_store_registers (ops, regcache, regno);
361 else if (regno == -1 && have_dsp)
362 {
363 for (regi = mips_regnum (gdbarch)->dspacc;
364 regi < mips_regnum (gdbarch)->dspacc + 6;
365 regi++)
366 super_store_registers (ops, regcache, regi);
367 super_store_registers (ops, regcache, mips_regnum (gdbarch)->dspctl);
368 }
369 }
370
371 /* Fetch REGNO (or all registers if REGNO == -1) from the target
372 using any working method. */
373
374 static void
375 mips64_linux_fetch_registers (struct target_ops *ops,
376 struct regcache *regcache, int regnum)
377 {
378 /* Unless we already know that PTRACE_GETREGS does not work, try it. */
379 if (have_ptrace_regsets)
380 mips64_linux_regsets_fetch_registers (ops, regcache, regnum);
381
382 /* If we know, or just found out, that PTRACE_GETREGS does not work, fall
383 back to PTRACE_PEEKUSER. */
384 if (!have_ptrace_regsets)
385 super_fetch_registers (ops, regcache, regnum);
386 }
387
388 /* Store REGNO (or all registers if REGNO == -1) to the target
389 using any working method. */
390
391 static void
392 mips64_linux_store_registers (struct target_ops *ops,
393 struct regcache *regcache, int regnum)
394 {
395 /* Unless we already know that PTRACE_GETREGS does not work, try it. */
396 if (have_ptrace_regsets)
397 mips64_linux_regsets_store_registers (ops, regcache, regnum);
398
399 /* If we know, or just found out, that PTRACE_GETREGS does not work, fall
400 back to PTRACE_PEEKUSER. */
401 if (!have_ptrace_regsets)
402 super_store_registers (ops, regcache, regnum);
403 }
404
405 /* Return the address in the core dump or inferior of register
406 REGNO. */
407
408 static CORE_ADDR
409 mips_linux_register_u_offset (struct gdbarch *gdbarch, int regno, int store_p)
410 {
411 if (mips_abi_regsize (gdbarch) == 8)
412 return mips64_linux_register_addr (gdbarch, regno, store_p);
413 else
414 return mips_linux_register_addr (gdbarch, regno, store_p);
415 }
416
417 static const struct target_desc *
418 mips_linux_read_description (struct target_ops *ops)
419 {
420 static int have_dsp = -1;
421
422 if (have_dsp < 0)
423 {
424 int tid;
425
426 tid = ptid_get_lwp (inferior_ptid);
427 if (tid == 0)
428 tid = ptid_get_pid (inferior_ptid);
429
430 errno = 0;
431 ptrace (PTRACE_PEEKUSER, tid, DSP_CONTROL, 0);
432 switch (errno)
433 {
434 case 0:
435 have_dsp = 1;
436 break;
437 case EIO:
438 have_dsp = 0;
439 break;
440 default:
441 perror_with_name (_("Couldn't check DSP support"));
442 break;
443 }
444 }
445
446 /* Report that target registers are a size we know for sure
447 that we can get from ptrace. */
448 if (_MIPS_SIM == _ABIO32)
449 return have_dsp ? tdesc_mips_dsp_linux : tdesc_mips_linux;
450 else
451 return have_dsp ? tdesc_mips64_dsp_linux : tdesc_mips64_linux;
452 }
453
454 /* -1 if the kernel and/or CPU do not support watch registers.
455 1 if watch_readback is valid and we can read style, num_valid
456 and the masks.
457 0 if we need to read the watch_readback. */
458
459 static int watch_readback_valid;
460
461 /* Cached watch register read values. */
462
463 static struct pt_watch_regs watch_readback;
464
465 static struct mips_watchpoint *current_watches;
466
467 /* The current set of watch register values for writing the
468 registers. */
469
470 static struct pt_watch_regs watch_mirror;
471
472 static void
473 mips_show_dr (const char *func, CORE_ADDR addr,
474 int len, enum target_hw_bp_type type)
475 {
476 int i;
477
478 puts_unfiltered (func);
479 if (addr || len)
480 printf_unfiltered (" (addr=%s, len=%d, type=%s)",
481 paddress (target_gdbarch (), addr), len,
482 type == hw_write ? "data-write"
483 : (type == hw_read ? "data-read"
484 : (type == hw_access ? "data-read/write"
485 : (type == hw_execute ? "instruction-execute"
486 : "??unknown??"))));
487 puts_unfiltered (":\n");
488
489 for (i = 0; i < MAX_DEBUG_REGISTER; i++)
490 printf_unfiltered ("\tDR%d: lo=%s, hi=%s\n", i,
491 paddress (target_gdbarch (),
492 mips_linux_watch_get_watchlo (&watch_mirror,
493 i)),
494 paddress (target_gdbarch (),
495 mips_linux_watch_get_watchhi (&watch_mirror,
496 i)));
497 }
498
499 /* Target to_can_use_hw_breakpoint implementation. Return 1 if we can
500 handle the specified watch type. */
501
502 static int
503 mips_linux_can_use_hw_breakpoint (struct target_ops *self,
504 enum bptype type,
505 int cnt, int ot)
506 {
507 int i;
508 uint32_t wanted_mask, irw_mask;
509
510 if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
511 &watch_readback,
512 &watch_readback_valid, 0))
513 return 0;
514
515 switch (type)
516 {
517 case bp_hardware_watchpoint:
518 wanted_mask = W_MASK;
519 break;
520 case bp_read_watchpoint:
521 wanted_mask = R_MASK;
522 break;
523 case bp_access_watchpoint:
524 wanted_mask = R_MASK | W_MASK;
525 break;
526 default:
527 return 0;
528 }
529
530 for (i = 0;
531 i < mips_linux_watch_get_num_valid (&watch_readback) && cnt;
532 i++)
533 {
534 irw_mask = mips_linux_watch_get_irw_mask (&watch_readback, i);
535 if ((irw_mask & wanted_mask) == wanted_mask)
536 cnt--;
537 }
538 return (cnt == 0) ? 1 : 0;
539 }
540
541 /* Target to_stopped_by_watchpoint implementation. Return 1 if
542 stopped by watchpoint. The watchhi R and W bits indicate the watch
543 register triggered. */
544
545 static int
546 mips_linux_stopped_by_watchpoint (struct target_ops *ops)
547 {
548 int n;
549 int num_valid;
550
551 if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
552 &watch_readback,
553 &watch_readback_valid, 1))
554 return 0;
555
556 num_valid = mips_linux_watch_get_num_valid (&watch_readback);
557
558 for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
559 if (mips_linux_watch_get_watchhi (&watch_readback, n) & (R_MASK | W_MASK))
560 return 1;
561
562 return 0;
563 }
564
565 /* Target to_stopped_data_address implementation. Set the address
566 where the watch triggered (if known). Return 1 if the address was
567 known. */
568
569 static int
570 mips_linux_stopped_data_address (struct target_ops *t, CORE_ADDR *paddr)
571 {
572 /* On mips we don't know the low order 3 bits of the data address,
573 so we must return false. */
574 return 0;
575 }
576
577 /* Target to_region_ok_for_hw_watchpoint implementation. Return 1 if
578 the specified region can be covered by the watch registers. */
579
580 static int
581 mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
582 CORE_ADDR addr, int len)
583 {
584 struct pt_watch_regs dummy_regs;
585 int i;
586
587 if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
588 &watch_readback,
589 &watch_readback_valid, 0))
590 return 0;
591
592 dummy_regs = watch_readback;
593 /* Clear them out. */
594 for (i = 0; i < mips_linux_watch_get_num_valid (&dummy_regs); i++)
595 mips_linux_watch_set_watchlo (&dummy_regs, i, 0);
596 return mips_linux_watch_try_one_watch (&dummy_regs, addr, len, 0);
597 }
598
599 /* Write the mirrored watch register values for each thread. */
600
601 static int
602 write_watchpoint_regs (void)
603 {
604 struct lwp_info *lp;
605 int tid;
606
607 ALL_LWPS (lp)
608 {
609 tid = ptid_get_lwp (lp->ptid);
610 if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1)
611 perror_with_name (_("Couldn't write debug register"));
612 }
613 return 0;
614 }
615
616 /* linux_nat new_thread implementation. Write the mirrored watch
617 register values for the new thread. */
618
619 static void
620 mips_linux_new_thread (struct lwp_info *lp)
621 {
622 long tid = lp->ptid.lwp ();
623
624 if (!mips_linux_read_watch_registers (tid,
625 &watch_readback,
626 &watch_readback_valid, 0))
627 return;
628
629 if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1)
630 perror_with_name (_("Couldn't write debug register"));
631 }
632
633 /* Target to_insert_watchpoint implementation. Try to insert a new
634 watch. Return zero on success. */
635
636 static int
637 mips_linux_insert_watchpoint (struct target_ops *self,
638 CORE_ADDR addr, int len,
639 enum target_hw_bp_type type,
640 struct expression *cond)
641 {
642 struct pt_watch_regs regs;
643 struct mips_watchpoint *new_watch;
644 struct mips_watchpoint **pw;
645
646 int i;
647 int retval;
648
649 if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
650 &watch_readback,
651 &watch_readback_valid, 0))
652 return -1;
653
654 if (len <= 0)
655 return -1;
656
657 regs = watch_readback;
658 /* Add the current watches. */
659 mips_linux_watch_populate_regs (current_watches, &regs);
660
661 /* Now try to add the new watch. */
662 if (!mips_linux_watch_try_one_watch (&regs, addr, len,
663 mips_linux_watch_type_to_irw (type)))
664 return -1;
665
666 /* It fit. Stick it on the end of the list. */
667 new_watch = XNEW (struct mips_watchpoint);
668 new_watch->addr = addr;
669 new_watch->len = len;
670 new_watch->type = type;
671 new_watch->next = NULL;
672
673 pw = &current_watches;
674 while (*pw != NULL)
675 pw = &(*pw)->next;
676 *pw = new_watch;
677
678 watch_mirror = regs;
679 retval = write_watchpoint_regs ();
680
681 if (show_debug_regs)
682 mips_show_dr ("insert_watchpoint", addr, len, type);
683
684 return retval;
685 }
686
687 /* Target to_remove_watchpoint implementation. Try to remove a watch.
688 Return zero on success. */
689
690 static int
691 mips_linux_remove_watchpoint (struct target_ops *self,
692 CORE_ADDR addr, int len,
693 enum target_hw_bp_type type,
694 struct expression *cond)
695 {
696 int retval;
697 int deleted_one;
698
699 struct mips_watchpoint **pw;
700 struct mips_watchpoint *w;
701
702 /* Search for a known watch that matches. Then unlink and free
703 it. */
704 deleted_one = 0;
705 pw = &current_watches;
706 while ((w = *pw))
707 {
708 if (w->addr == addr && w->len == len && w->type == type)
709 {
710 *pw = w->next;
711 xfree (w);
712 deleted_one = 1;
713 break;
714 }
715 pw = &(w->next);
716 }
717
718 if (!deleted_one)
719 return -1; /* We don't know about it, fail doing nothing. */
720
721 /* At this point watch_readback is known to be valid because we
722 could not have added the watch without reading it. */
723 gdb_assert (watch_readback_valid == 1);
724
725 watch_mirror = watch_readback;
726 mips_linux_watch_populate_regs (current_watches, &watch_mirror);
727
728 retval = write_watchpoint_regs ();
729
730 if (show_debug_regs)
731 mips_show_dr ("remove_watchpoint", addr, len, type);
732
733 return retval;
734 }
735
736 /* Target to_close implementation. Free any watches and call the
737 super implementation. */
738
739 static void
740 mips_linux_close (struct target_ops *self)
741 {
742 struct mips_watchpoint *w;
743 struct mips_watchpoint *nw;
744
745 /* Clean out the current_watches list. */
746 w = current_watches;
747 while (w)
748 {
749 nw = w->next;
750 xfree (w);
751 w = nw;
752 }
753 current_watches = NULL;
754
755 if (super_close)
756 super_close (self);
757 }
758
759 void
760 _initialize_mips_linux_nat (void)
761 {
762 struct target_ops *t;
763
764 add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
765 &show_debug_regs, _("\
766 Set whether to show variables that mirror the mips debug registers."), _("\
767 Show whether to show variables that mirror the mips debug registers."), _("\
768 Use \"on\" to enable, \"off\" to disable.\n\
769 If enabled, the debug registers values are shown when GDB inserts\n\
770 or removes a hardware breakpoint or watchpoint, and when the inferior\n\
771 triggers a breakpoint or watchpoint."),
772 NULL,
773 NULL,
774 &maintenance_set_cmdlist,
775 &maintenance_show_cmdlist);
776
777 t = linux_trad_target (mips_linux_register_u_offset);
778
779 super_close = t->to_close;
780 t->to_close = mips_linux_close;
781
782 super_fetch_registers = t->to_fetch_registers;
783 super_store_registers = t->to_store_registers;
784
785 t->to_fetch_registers = mips64_linux_fetch_registers;
786 t->to_store_registers = mips64_linux_store_registers;
787
788 t->to_can_use_hw_breakpoint = mips_linux_can_use_hw_breakpoint;
789 t->to_remove_watchpoint = mips_linux_remove_watchpoint;
790 t->to_insert_watchpoint = mips_linux_insert_watchpoint;
791 t->to_stopped_by_watchpoint = mips_linux_stopped_by_watchpoint;
792 t->to_stopped_data_address = mips_linux_stopped_data_address;
793 t->to_region_ok_for_hw_watchpoint = mips_linux_region_ok_for_hw_watchpoint;
794
795 t->to_read_description = mips_linux_read_description;
796
797 linux_nat_add_target (t);
798 linux_nat_set_new_thread (t, mips_linux_new_thread);
799 }
lwpid_t
unsigned int lwpid_t
Definition: gdb_proc_service.h:80
target_gdbarch
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5467
mips_watchpoint::len
int len
Definition: mips-linux-watch.h:96
gdbarch
Definition: gdbarch.c:127
ptid_t::lwp
constexpr long lwp() const
Definition: ptid.h:63
selftests::ptid::tid
static constexpr ptid_t tid
Definition: ptid-selftests.c:43
PC
#define PC
Definition: mips-linux-tdep.h:32
target_ops::to_read_description
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
Definition: target.h:790
mips64_linux_regsets_fetch_registers
static void mips64_linux_regsets_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regno)
Definition: mips-linux-nat.c:212
mips_watchpoint::addr
CORE_ADDR addr
Definition: mips-linux-watch.h:95
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
_initialize_mips_linux_nat
void _initialize_mips_linux_nat(void)
Definition: mips-linux-nat.c:760
MMLO
#define MMLO
Definition: mips-linux-tdep.h:36
ptid_get_pid
int ptid_get_pid(const ptid_t &ptid)
Definition: ptid.c:47
command.h
xfree
void xfree(void *)
lwp_info
Definition: linux-nat.h:30
W_MASK
#define W_MASK
Definition: mips-linux-watch.h:83
mips_watchpoint::type
enum target_hw_bp_type type
Definition: mips-linux-watch.h:97
BADVADDR
#define BADVADDR
Definition: mips-linux-tdep.h:34
ALL_LWPS
#define ALL_LWPS(LP)
Definition: linux-nat.h:119
MIPS64_FPC_CSR
#define MIPS64_FPC_CSR
Definition: mips-linux-tdep.h:77
func
void(* func)(char *)
Definition: remote-fileio.c:1104
linux_nat_set_new_thread
void linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
Definition: linux-nat.c:4873
mips_watchpoint::next
struct mips_watchpoint * next
Definition: mips-linux-watch.h:98
tdesc_mips_linux
struct target_desc * tdesc_mips_linux
Definition: mips-linux.c:8
mips_linux_stopped_by_watchpoint
static int mips_linux_stopped_by_watchpoint(struct target_ops *ops)
Definition: mips-linux-nat.c:546
mips_linux_watch_get_watchlo
CORE_ADDR mips_linux_watch_get_watchlo(struct pt_watch_regs *regs, int n)
Definition: mips-linux-watch.c:79
lwp_info::ptid
ptid_t ptid
Definition: linux-nat.h:34
mips64_linux_register_addr
static CORE_ADDR mips64_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
Definition: mips-linux-nat.c:108
ps_prochandle
Definition: gdb_proc_service.h:179
regcache_get_ptid
ptid_t regcache_get_ptid(const struct regcache *regcache)
Definition: regcache.c:229
mips_isa_regsize
int mips_isa_regsize(struct gdbarch *gdbarch)
Definition: mips-tdep.c:261
super_store_registers
static void(* super_store_registers)(struct target_ops *, struct regcache *, int)
Definition: mips-linux-nat.c:54
mips_linux_watch_try_one_watch
int mips_linux_watch_try_one_watch(struct pt_watch_regs *regs, CORE_ADDR addr, int len, uint32_t irw)
Definition: mips-linux-watch.c:236
target_ops::to_close
void(* to_close)(struct target_ops *)
Definition: target.h:431
mips_linux_close
static void mips_linux_close(struct target_ops *self)
Definition: mips-linux-nat.c:740
MIPS64_CAUSE
#define MIPS64_CAUSE
Definition: mips-linux-tdep.h:73
fill_gregset
void fill_gregset(const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno)
Definition: mips-linux-nat.c:177
ps_err_e
ps_err_e
Definition: gdb_proc_service.h:68
hw_execute
Definition: break-common.h:27
mips64_fill_gregset
void mips64_fill_gregset(const struct regcache *regcache, mips64_elf_gregset_t *gregsetp, int regno)
Definition: mips-linux-tdep.c:415
DSP_CONTROL
#define DSP_CONTROL
Definition: mips-linux-tdep.h:40
target_ops::to_remove_watchpoint
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:516
target_ops::to_region_ok_for_hw_watchpoint
int(* to_region_ok_for_hw_watchpoint)(struct target_ops *, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
Definition: target.h:543
gdbarch_num_regs
int gdbarch_num_regs(struct gdbarch *gdbarch)
Definition: gdbarch.c:2039
PTRACE_SETFPREGS
#define PTRACE_SETFPREGS
Definition: ppc-linux-nat.c:145
mips-linux-watch.h
target_ops::to_can_use_hw_breakpoint
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
Definition: target.h:502
_
#define _(String)
Definition: gdb_locale.h:35
mips_linux_watch_type_to_irw
uint32_t mips_linux_watch_type_to_irw(enum target_hw_bp_type type)
Definition: mips-linux-watch.c:201
mips_linux_can_use_hw_breakpoint
static int mips_linux_can_use_hw_breakpoint(struct target_ops *self, enum bptype type, int cnt, int ot)
Definition: mips-linux-nat.c:503
DSP_BASE
#define DSP_BASE
Definition: mips-linux-tdep.h:39
defs.h
R_MASK
#define R_MASK
Definition: mips-linux-watch.h:84
mips_regnum
const struct mips_regnum * mips_regnum(struct gdbarch *gdbarch)
Definition: mips-tdep.c:218
current_watches
static struct mips_watchpoint * current_watches
Definition: mips-linux-nat.c:465
PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA
Definition: mips-linux-nat.c:42
gdb_proc_service.h
maintenance_set_cmdlist
struct cmd_list_element * maintenance_set_cmdlist
Definition: maint.c:634
mips-linux-tdep.h
ptrace
PTRACE_TYPE_RET ptrace()
tdesc_mips64_dsp_linux
struct target_desc * tdesc_mips64_dsp_linux
Definition: mips64-dsp-linux.c:8
hw_write
Definition: break-common.h:24
paddress
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition: utils.c:2745
XNEW
#define XNEW(T)
Definition: poison.h:109
mips_abi_regsize
unsigned int mips_abi_regsize(struct gdbarch *gdbarch)
Definition: mips-tdep.c:280
mips_linux_read_description
static const struct target_desc * mips_linux_read_description(struct target_ops *ops)
Definition: mips-linux-nat.c:418
MIPS64_PC
#define MIPS64_PC
Definition: mips-linux-tdep.h:72
mips64_linux_store_registers
static void mips64_linux_store_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
Definition: mips-linux-nat.c:392
mips_fill_gregset
void mips_fill_gregset(const struct regcache *regcache, mips_elf_gregset_t *gregsetp, int regno)
Definition: mips-linux-tdep.c:171
mips_linux_stopped_data_address
static int mips_linux_stopped_data_address(struct target_ops *t, CORE_ADDR *paddr)
Definition: mips-linux-nat.c:570
have_ptrace_regsets
static int have_ptrace_regsets
Definition: mips-linux-nat.c:47
PTRACE_GETFPREGS
#define PTRACE_GETFPREGS
Definition: ppc-linux-nat.c:142
inf-ptrace.h
mips64_elf_gregset_t
mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG]
Definition: mips-linux-tdep.h:65
MIPS64_BADVADDR
#define MIPS64_BADVADDR
Definition: mips-linux-tdep.h:74
mips_linux_watch_get_irw_mask
uint32_t mips_linux_watch_get_irw_mask(struct pt_watch_regs *regs, int n)
Definition: mips-linux-watch.c:26
target_ops
Definition: target.h:412
tdesc_mips_dsp_linux
struct target_desc * tdesc_mips_dsp_linux
Definition: mips-dsp-linux.c:8
gdb_gregset_t
GDB_GREGSET_T gdb_gregset_t
Definition: gregset.h:34
regcache.h
MMHI
#define MMHI
Definition: mips-linux-tdep.h:35
MIPS64_MMLO
#define MIPS64_MMLO
Definition: mips-linux-tdep.h:76
expression
Definition: expression.h:78
show_debug_regs
int show_debug_regs
Definition: common-debug.c:25
gdb_fpregset_t
GDB_FPREGSET_T gdb_fpregset_t
Definition: gregset.h:35
mips_watchpoint
Definition: mips-linux-watch.h:93
inferior.h
mips_linux_register_u_offset
static CORE_ADDR mips_linux_register_u_offset(struct gdbarch *gdbarch, int regno, int store_p)
Definition: mips-linux-nat.c:409
mips_regnum::badvaddr
int badvaddr
Definition: mips-tdep.h:66
hw_read
Definition: break-common.h:25
type
Definition: gdbtypes.h:749
mips_linux_restart_reg_p
int mips_linux_restart_reg_p(struct gdbarch *gdbarch)
Definition: mips-linux-tdep.c:1366
watch_readback_valid
static int watch_readback_valid
Definition: mips-linux-nat.c:459
supply_gregset
void supply_gregset(struct regcache *regcache, const gdb_gregset_t *gregsetp)
Definition: mips-linux-nat.c:168
type
static const char * type
Definition: language.c:113
mips64_supply_gregset
void mips64_supply_gregset(struct regcache *regcache, const mips64_elf_gregset_t *gregsetp)
Definition: mips-linux-tdep.c:369
linux_nat_add_target
void linux_nat_add_target(struct target_ops *t)
Definition: linux-nat.c:4804
target_ops::to_insert_watchpoint
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:519
mips_linux_new_thread
static void mips_linux_new_thread(struct lwp_info *lp)
Definition: mips-linux-nat.c:620
mips_linux_region_ok_for_hw_watchpoint
static int mips_linux_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
Definition: mips-linux-nat.c:581
pt_watch_regs
Definition: mips-linux-watch.h:67
MIPS64_FPC_EIR
#define MIPS64_FPC_EIR
Definition: mips-linux-tdep.h:78
MIPS_RESTART_REGNUM
Definition: mips-linux-tdep.h:102
mips_regnum::fp_implementation_revision
int fp_implementation_revision
Definition: mips-tdep.h:64
regnum
int regnum
Definition: aarch64-tdep.c:77
printf_unfiltered
void printf_unfiltered(const char *format,...)
Definition: utils.c:2056
num_valid
uint32_t num_valid
Definition: mips-linux-watch.h:337
bp_read_watchpoint
Definition: breakpoint.h:77
FPC_CSR
#define FPC_CSR
Definition: mips-linux-tdep.h:37
mips_linux_read_watch_registers
int mips_linux_read_watch_registers(long lwpid, struct pt_watch_regs *watch_readback, int *watch_readback_valid, int force)
Definition: mips-linux-watch.c:161
ptid_get_lwp
long ptid_get_lwp(const ptid_t &ptid)
Definition: ptid.c:55
PS_ERR
Definition: gdb_proc_service.h:71
gregset.h
mips64_fill_fpregset
void mips64_fill_fpregset(const struct regcache *regcache, mips64_elf_fpregset_t *fpregsetp, int regno)
Definition: mips-linux-tdep.c:529
ps_get_thread_area
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
Definition: mips-linux-nat.c:151
bptype
bptype
Definition: breakpoint.h:67
gdb_assert
#define gdb_assert(expr)
Definition: gdb_assert.h:32
mips_show_dr
static void mips_show_dr(const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type)
Definition: mips-linux-nat.c:473
write_watchpoint_regs
static int write_watchpoint_regs(void)
Definition: mips-linux-nat.c:602
watch_mirror
static struct pt_watch_regs watch_mirror
Definition: mips-linux-nat.c:470
mips_linux_insert_watchpoint
static int mips_linux_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
Definition: mips-linux-nat.c:637
FPC_EIR
#define FPC_EIR
Definition: mips-linux-tdep.h:38
MIPS_ZERO_REGNUM
Definition: mips-tdep.h:125
FPR_BASE
#define FPR_BASE
Definition: mips-linux-tdep.h:31
target_ops::to_fetch_registers
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
Definition: target.h:457
puts_unfiltered
void puts_unfiltered(const char *string)
Definition: utils.c:2091
tdesc_mips64_linux
struct target_desc * tdesc_mips64_linux
Definition: mips64-linux.c:8
perror_with_name
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
Definition: utils.c:692
fill_fpregset
void fill_fpregset(const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regno)
Definition: mips-linux-nat.c:197
gdbarch_fp0_regnum
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2197
mips_linux_register_addr
static CORE_ADDR mips_linux_register_addr(struct gdbarch *gdbarch, int regno, int store)
Definition: mips-linux-nat.c:67
mips_linux_watch_get_watchhi
uint32_t mips_linux_watch_get_watchhi(struct pt_watch_regs *regs, int n)
Definition: mips-linux-watch.c:120
MAX_DEBUG_REGISTER
#define MAX_DEBUG_REGISTER
Definition: mips-linux-watch.h:24
target_desc
Definition: target-descriptions.c:591
inferior_ptid
ptid_t inferior_ptid
Definition: infcmd.c:94
mips_elf_fpregset_t
mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG]
Definition: mips-linux-tdep.h:28
mips_regnum
Definition: mips-tdep.h:60
mips_supply_fpregset
void mips_supply_fpregset(struct regcache *regcache, const mips_elf_fpregset_t *fpregsetp)
Definition: mips-linux-tdep.c:239
mips_regnum::dspctl
int dspctl
Definition: mips-tdep.h:71
mips_linux_remove_watchpoint
static int mips_linux_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
Definition: mips-linux-nat.c:691
add_setshow_boolean_cmd
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:569
target-descriptions.h
mips64_linux_regsets_store_registers
static void mips64_linux_regsets_store_registers(struct target_ops *ops, struct regcache *regcache, int regno)
Definition: mips-linux-nat.c:298
PTRACE_SET_WATCH_REGS
#define PTRACE_SET_WATCH_REGS
Definition: mips-linux-watch.h:31
regcache::arch
gdbarch * arch() const
Definition: regcache.c:221
PTRACE_SETREGS
#define PTRACE_SETREGS
Definition: ppc-linux-nat.c:139
CAUSE
#define CAUSE
Definition: mips-linux-tdep.h:33
mips_linux_watch_set_watchlo
void mips_linux_watch_set_watchlo(struct pt_watch_regs *regs, int n, CORE_ADDR value)
Definition: mips-linux-watch.c:97
target.h
target_ops::to_stopped_by_watchpoint
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
Definition: target.h:531
mips_supply_gregset
void mips_supply_gregset(struct regcache *regcache, const mips_elf_gregset_t *gregsetp)
Definition: mips-linux-tdep.c:130
mips_regnum::fp0
int fp0
Definition: mips-tdep.h:63
mips-tdep.h
target_hw_bp_type
target_hw_bp_type
Definition: break-common.h:22
super_fetch_registers
static void(* super_fetch_registers)(struct target_ops *, struct regcache *, int)
Definition: mips-linux-nat.c:52
MIPS64_FPR_BASE
#define MIPS64_FPR_BASE
Definition: mips-linux-tdep.h:71
mips_linux_watch_populate_regs
void mips_linux_watch_populate_regs(struct mips_watchpoint *current_watches, struct pt_watch_regs *regs)
Definition: mips-linux-watch.c:325
PS_OK
Definition: gdb_proc_service.h:70
mips64_supply_fpregset
void mips64_supply_fpregset(struct regcache *regcache, const mips64_elf_fpregset_t *fpregsetp)
Definition: mips-linux-tdep.c:479
regcache
Definition: regcache.h:232
MIPS64_MMHI
#define MIPS64_MMHI
Definition: mips-linux-tdep.h:75
L
Definition: ia64-tdep.c:84
super_close
static void(* super_close)(struct target_ops *)
Definition: mips-linux-nat.c:57
gdb_ptrace.h
bp_hardware_watchpoint
Definition: breakpoint.h:76
PTRACE_TYPE_ARG3
#define PTRACE_TYPE_ARG3
Definition: config.h:642
mips_linux_watch_get_num_valid
uint32_t mips_linux_watch_get_num_valid(struct pt_watch_regs *regs)
Definition: mips-linux-watch.c:61
hw_access
Definition: break-common.h:26
get_ptrace_pid
pid_t get_ptrace_pid(ptid_t ptid)
Definition: inf-ptrace.c:320
mips_regnum::pc
int pc
Definition: mips-tdep.h:62
class_maintenance
Definition: command.h:43
mips_fill_fpregset
void mips_fill_fpregset(const struct regcache *regcache, mips_elf_fpregset_t *fpregsetp, int regno)
Definition: mips-linux-tdep.c:273
mips_elf_gregset_t
mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG]
Definition: mips-linux-tdep.h:25
target_ops::to_stopped_data_address
int(* to_stopped_data_address)(struct target_ops *, CORE_ADDR *) TARGET_DEFAULT_RETURN(0)
Definition: target.h:535
mips_regnum::fp_control_status
int fp_control_status
Definition: mips-tdep.h:65
mips_regnum::cause
int cause
Definition: mips-tdep.h:67
target_ops::to_store_registers
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
Definition: target.h:459
mips64_elf_fpregset_t
mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG]
Definition: mips-linux-tdep.h:68
maintenance_show_cmdlist
struct cmd_list_element * maintenance_show_cmdlist
Definition: maint.c:635
gdbcmd.h
mips_regnum::dspacc
int dspacc
Definition: mips-tdep.h:70
error
void error(const char *fmt,...)
Definition: errors.c:38
bp_access_watchpoint
Definition: breakpoint.h:78
mips_regnum::lo
int lo
Definition: mips-tdep.h:69
watch_readback
static struct pt_watch_regs watch_readback
Definition: mips-linux-nat.c:463
supply_fpregset
void supply_fpregset(struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
Definition: mips-linux-nat.c:187
mips64_linux_fetch_registers
static void mips64_linux_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
Definition: mips-linux-nat.c:375
PTRACE_GETREGS
#define PTRACE_GETREGS
Definition: ppc-linux-nat.c:136
linux_trad_target
struct target_ops * linux_trad_target(CORE_ADDR(*register_u_offset)(struct gdbarch *, int, int))
Definition: linux-nat.c:4388
linux-nat.h
mips_regnum::hi
int hi
Definition: mips-tdep.h:68