1 /* GNU/Linux on ARM native support.
2 Copyright (C) 1999-2015 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #include "linux-nat.h"
25 #include "target-descriptions.h"
28 #include "gdbthread.h"
31 #include "arm-linux-tdep.h"
33 #include <elf/common.h>
35 #include <sys/ptrace.h>
36 #include <sys/utsname.h>
37 #include <sys/procfs.h>
39 /* Prototypes for supply_gregset etc. */
42 /* Defines ps_err_e, struct ps_prochandle. */
43 #include "gdb_proc_service.h"
45 #ifndef PTRACE_GET_THREAD_AREA
46 #define PTRACE_GET_THREAD_AREA 22
49 #ifndef PTRACE_GETWMMXREGS
50 #define PTRACE_GETWMMXREGS 18
51 #define PTRACE_SETWMMXREGS 19
54 #ifndef PTRACE_GETVFPREGS
55 #define PTRACE_GETVFPREGS 27
56 #define PTRACE_SETVFPREGS 28
59 #ifndef PTRACE_GETHBPREGS
60 #define PTRACE_GETHBPREGS 29
61 #define PTRACE_SETHBPREGS 30
64 extern int arm_apcs_32
;
66 /* On GNU/Linux, threads are implemented as pseudo-processes, in which
67 case we may be tracing more than one process at a time. In that
68 case, inferior_ptid will contain the main process ID and the
69 individual thread (process) ID. get_thread_id () is used to get
70 the thread id if it's available, and the process id otherwise. */
73 get_thread_id (ptid_t ptid
)
75 int tid
= ptid_get_lwp (ptid
);
77 tid
= ptid_get_pid (ptid
);
81 #define GET_THREAD_ID(PTID) get_thread_id (PTID)
83 /* Get the value of a particular register from the floating point
84 state of the process and store it into regcache. */
87 fetch_fpregister (struct regcache
*regcache
, int regno
)
90 gdb_byte fp
[ARM_LINUX_SIZEOF_NWFPE
];
92 /* Get the thread id for the ptrace call. */
93 tid
= GET_THREAD_ID (inferior_ptid
);
95 /* Read the floating point state. */
96 if (have_ptrace_getregset
)
101 iov
.iov_len
= ARM_LINUX_SIZEOF_NWFPE
;
103 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_FPREGSET
, &iov
);
106 ret
= ptrace (PT_GETFPREGS
, tid
, 0, fp
);
110 warning (_("Unable to fetch floating point register."));
115 if (ARM_FPS_REGNUM
== regno
)
116 regcache_raw_supply (regcache
, ARM_FPS_REGNUM
,
117 fp
+ NWFPE_FPSR_OFFSET
);
119 /* Fetch the floating point register. */
120 if (regno
>= ARM_F0_REGNUM
&& regno
<= ARM_F7_REGNUM
)
121 supply_nwfpe_register (regcache
, regno
, fp
);
124 /* Get the whole floating point state of the process and store it
128 fetch_fpregs (struct regcache
*regcache
)
131 gdb_byte fp
[ARM_LINUX_SIZEOF_NWFPE
];
133 /* Get the thread id for the ptrace call. */
134 tid
= GET_THREAD_ID (inferior_ptid
);
136 /* Read the floating point state. */
137 if (have_ptrace_getregset
)
142 iov
.iov_len
= ARM_LINUX_SIZEOF_NWFPE
;
144 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_FPREGSET
, &iov
);
147 ret
= ptrace (PT_GETFPREGS
, tid
, 0, fp
);
151 warning (_("Unable to fetch the floating point registers."));
156 regcache_raw_supply (regcache
, ARM_FPS_REGNUM
,
157 fp
+ NWFPE_FPSR_OFFSET
);
159 /* Fetch the floating point registers. */
160 for (regno
= ARM_F0_REGNUM
; regno
<= ARM_F7_REGNUM
; regno
++)
161 supply_nwfpe_register (regcache
, regno
, fp
);
164 /* Save a particular register into the floating point state of the
165 process using the contents from regcache. */
168 store_fpregister (const struct regcache
*regcache
, int regno
)
171 gdb_byte fp
[ARM_LINUX_SIZEOF_NWFPE
];
173 /* Get the thread id for the ptrace call. */
174 tid
= GET_THREAD_ID (inferior_ptid
);
176 /* Read the floating point state. */
177 if (have_ptrace_getregset
)
182 iov
.iov_len
= ARM_LINUX_SIZEOF_NWFPE
;
184 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_FPREGSET
, &iov
);
187 ret
= ptrace (PT_GETFPREGS
, tid
, 0, fp
);
191 warning (_("Unable to fetch the floating point registers."));
196 if (ARM_FPS_REGNUM
== regno
197 && REG_VALID
== regcache_register_status (regcache
, ARM_FPS_REGNUM
))
198 regcache_raw_collect (regcache
, ARM_FPS_REGNUM
, fp
+ NWFPE_FPSR_OFFSET
);
200 /* Store the floating point register. */
201 if (regno
>= ARM_F0_REGNUM
&& regno
<= ARM_F7_REGNUM
)
202 collect_nwfpe_register (regcache
, regno
, fp
);
204 if (have_ptrace_getregset
)
209 iov
.iov_len
= ARM_LINUX_SIZEOF_NWFPE
;
211 ret
= ptrace (PTRACE_SETREGSET
, tid
, NT_FPREGSET
, &iov
);
214 ret
= ptrace (PTRACE_SETFPREGS
, tid
, 0, fp
);
218 warning (_("Unable to store floating point register."));
223 /* Save the whole floating point state of the process using
224 the contents from regcache. */
227 store_fpregs (const struct regcache
*regcache
)
230 gdb_byte fp
[ARM_LINUX_SIZEOF_NWFPE
];
232 /* Get the thread id for the ptrace call. */
233 tid
= GET_THREAD_ID (inferior_ptid
);
235 /* Read the floating point state. */
236 if (have_ptrace_getregset
)
238 elf_fpregset_t fpregs
;
241 iov
.iov_base
= &fpregs
;
242 iov
.iov_len
= sizeof (fpregs
);
244 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_FPREGSET
, &iov
);
247 ret
= ptrace (PT_GETFPREGS
, tid
, 0, fp
);
251 warning (_("Unable to fetch the floating point registers."));
256 if (REG_VALID
== regcache_register_status (regcache
, ARM_FPS_REGNUM
))
257 regcache_raw_collect (regcache
, ARM_FPS_REGNUM
, fp
+ NWFPE_FPSR_OFFSET
);
259 /* Store the floating point registers. */
260 for (regno
= ARM_F0_REGNUM
; regno
<= ARM_F7_REGNUM
; regno
++)
261 if (REG_VALID
== regcache_register_status (regcache
, regno
))
262 collect_nwfpe_register (regcache
, regno
, fp
);
264 if (have_ptrace_getregset
)
269 iov
.iov_len
= ARM_LINUX_SIZEOF_NWFPE
;
271 ret
= ptrace (PTRACE_SETREGSET
, tid
, NT_FPREGSET
, &iov
);
274 ret
= ptrace (PTRACE_SETFPREGS
, tid
, 0, fp
);
278 warning (_("Unable to store floating point registers."));
283 /* Fetch a general register of the process and store into
287 fetch_register (struct regcache
*regcache
, int regno
)
292 /* Get the thread id for the ptrace call. */
293 tid
= GET_THREAD_ID (inferior_ptid
);
295 if (have_ptrace_getregset
)
299 iov
.iov_base
= ®s
;
300 iov
.iov_len
= sizeof (regs
);
302 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_PRSTATUS
, &iov
);
305 ret
= ptrace (PTRACE_GETREGS
, tid
, 0, ®s
);
309 warning (_("Unable to fetch general register."));
313 if (regno
>= ARM_A1_REGNUM
&& regno
< ARM_PC_REGNUM
)
314 regcache_raw_supply (regcache
, regno
, (char *) ®s
[regno
]);
316 if (ARM_PS_REGNUM
== regno
)
319 regcache_raw_supply (regcache
, ARM_PS_REGNUM
,
320 (char *) ®s
[ARM_CPSR_GREGNUM
]);
322 regcache_raw_supply (regcache
, ARM_PS_REGNUM
,
323 (char *) ®s
[ARM_PC_REGNUM
]);
326 if (ARM_PC_REGNUM
== regno
)
328 regs
[ARM_PC_REGNUM
] = gdbarch_addr_bits_remove
329 (get_regcache_arch (regcache
),
330 regs
[ARM_PC_REGNUM
]);
331 regcache_raw_supply (regcache
, ARM_PC_REGNUM
,
332 (char *) ®s
[ARM_PC_REGNUM
]);
336 /* Fetch all general registers of the process and store into
340 fetch_regs (struct regcache
*regcache
)
345 /* Get the thread id for the ptrace call. */
346 tid
= GET_THREAD_ID (inferior_ptid
);
348 if (have_ptrace_getregset
)
352 iov
.iov_base
= ®s
;
353 iov
.iov_len
= sizeof (regs
);
355 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_PRSTATUS
, &iov
);
358 ret
= ptrace (PTRACE_GETREGS
, tid
, 0, ®s
);
362 warning (_("Unable to fetch general registers."));
366 for (regno
= ARM_A1_REGNUM
; regno
< ARM_PC_REGNUM
; regno
++)
367 regcache_raw_supply (regcache
, regno
, (char *) ®s
[regno
]);
370 regcache_raw_supply (regcache
, ARM_PS_REGNUM
,
371 (char *) ®s
[ARM_CPSR_GREGNUM
]);
373 regcache_raw_supply (regcache
, ARM_PS_REGNUM
,
374 (char *) ®s
[ARM_PC_REGNUM
]);
376 regs
[ARM_PC_REGNUM
] = gdbarch_addr_bits_remove
377 (get_regcache_arch (regcache
), regs
[ARM_PC_REGNUM
]);
378 regcache_raw_supply (regcache
, ARM_PC_REGNUM
,
379 (char *) ®s
[ARM_PC_REGNUM
]);
382 /* Store all general registers of the process from the values in
386 store_register (const struct regcache
*regcache
, int regno
)
391 if (REG_VALID
!= regcache_register_status (regcache
, regno
))
394 /* Get the thread id for the ptrace call. */
395 tid
= GET_THREAD_ID (inferior_ptid
);
397 /* Get the general registers from the process. */
398 if (have_ptrace_getregset
)
402 iov
.iov_base
= ®s
;
403 iov
.iov_len
= sizeof (regs
);
405 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_PRSTATUS
, &iov
);
408 ret
= ptrace (PTRACE_GETREGS
, tid
, 0, ®s
);
412 warning (_("Unable to fetch general registers."));
416 if (regno
>= ARM_A1_REGNUM
&& regno
<= ARM_PC_REGNUM
)
417 regcache_raw_collect (regcache
, regno
, (char *) ®s
[regno
]);
418 else if (arm_apcs_32
&& regno
== ARM_PS_REGNUM
)
419 regcache_raw_collect (regcache
, regno
,
420 (char *) ®s
[ARM_CPSR_GREGNUM
]);
421 else if (!arm_apcs_32
&& regno
== ARM_PS_REGNUM
)
422 regcache_raw_collect (regcache
, ARM_PC_REGNUM
,
423 (char *) ®s
[ARM_PC_REGNUM
]);
425 if (have_ptrace_getregset
)
429 iov
.iov_base
= ®s
;
430 iov
.iov_len
= sizeof (regs
);
432 ret
= ptrace (PTRACE_SETREGSET
, tid
, NT_PRSTATUS
, &iov
);
435 ret
= ptrace (PTRACE_SETREGS
, tid
, 0, ®s
);
439 warning (_("Unable to store general register."));
445 store_regs (const struct regcache
*regcache
)
450 /* Get the thread id for the ptrace call. */
451 tid
= GET_THREAD_ID (inferior_ptid
);
453 /* Fetch the general registers. */
454 if (have_ptrace_getregset
)
458 iov
.iov_base
= ®s
;
459 iov
.iov_len
= sizeof (regs
);
461 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_PRSTATUS
, &iov
);
464 ret
= ptrace (PTRACE_GETREGS
, tid
, 0, ®s
);
468 warning (_("Unable to fetch general registers."));
472 for (regno
= ARM_A1_REGNUM
; regno
<= ARM_PC_REGNUM
; regno
++)
474 if (REG_VALID
== regcache_register_status (regcache
, regno
))
475 regcache_raw_collect (regcache
, regno
, (char *) ®s
[regno
]);
478 if (arm_apcs_32
&& REG_VALID
== regcache_register_status (regcache
, ARM_PS_REGNUM
))
479 regcache_raw_collect (regcache
, ARM_PS_REGNUM
,
480 (char *) ®s
[ARM_CPSR_GREGNUM
]);
482 if (have_ptrace_getregset
)
486 iov
.iov_base
= ®s
;
487 iov
.iov_len
= sizeof (regs
);
489 ret
= ptrace (PTRACE_SETREGSET
, tid
, NT_PRSTATUS
, &iov
);
492 ret
= ptrace (PTRACE_SETREGS
, tid
, 0, ®s
);
496 warning (_("Unable to store general registers."));
501 /* Fetch all WMMX registers of the process and store into
504 #define IWMMXT_REGS_SIZE (16 * 8 + 6 * 4)
507 fetch_wmmx_regs (struct regcache
*regcache
)
509 char regbuf
[IWMMXT_REGS_SIZE
];
512 /* Get the thread id for the ptrace call. */
513 tid
= GET_THREAD_ID (inferior_ptid
);
515 ret
= ptrace (PTRACE_GETWMMXREGS
, tid
, 0, regbuf
);
518 warning (_("Unable to fetch WMMX registers."));
522 for (regno
= 0; regno
< 16; regno
++)
523 regcache_raw_supply (regcache
, regno
+ ARM_WR0_REGNUM
,
526 for (regno
= 0; regno
< 2; regno
++)
527 regcache_raw_supply (regcache
, regno
+ ARM_WCSSF_REGNUM
,
528 ®buf
[16 * 8 + regno
* 4]);
530 for (regno
= 0; regno
< 4; regno
++)
531 regcache_raw_supply (regcache
, regno
+ ARM_WCGR0_REGNUM
,
532 ®buf
[16 * 8 + 2 * 4 + regno
* 4]);
536 store_wmmx_regs (const struct regcache
*regcache
)
538 char regbuf
[IWMMXT_REGS_SIZE
];
541 /* Get the thread id for the ptrace call. */
542 tid
= GET_THREAD_ID (inferior_ptid
);
544 ret
= ptrace (PTRACE_GETWMMXREGS
, tid
, 0, regbuf
);
547 warning (_("Unable to fetch WMMX registers."));
551 for (regno
= 0; regno
< 16; regno
++)
552 if (REG_VALID
== regcache_register_status (regcache
,
553 regno
+ ARM_WR0_REGNUM
))
554 regcache_raw_collect (regcache
, regno
+ ARM_WR0_REGNUM
,
557 for (regno
= 0; regno
< 2; regno
++)
558 if (REG_VALID
== regcache_register_status (regcache
,
559 regno
+ ARM_WCSSF_REGNUM
))
560 regcache_raw_collect (regcache
, regno
+ ARM_WCSSF_REGNUM
,
561 ®buf
[16 * 8 + regno
* 4]);
563 for (regno
= 0; regno
< 4; regno
++)
564 if (REG_VALID
== regcache_register_status (regcache
,
565 regno
+ ARM_WCGR0_REGNUM
))
566 regcache_raw_collect (regcache
, regno
+ ARM_WCGR0_REGNUM
,
567 ®buf
[16 * 8 + 2 * 4 + regno
* 4]);
569 ret
= ptrace (PTRACE_SETWMMXREGS
, tid
, 0, regbuf
);
573 warning (_("Unable to store WMMX registers."));
578 /* Fetch and store VFP Registers. The kernel object has space for 32
579 64-bit registers, and the FPSCR. This is even when on a VFPv2 or
581 #define VFP_REGS_SIZE (32 * 8 + 4)
584 fetch_vfp_regs (struct regcache
*regcache
)
586 char regbuf
[VFP_REGS_SIZE
];
588 struct gdbarch
*gdbarch
= get_regcache_arch (regcache
);
589 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
591 /* Get the thread id for the ptrace call. */
592 tid
= GET_THREAD_ID (inferior_ptid
);
594 if (have_ptrace_getregset
)
598 iov
.iov_base
= regbuf
;
599 iov
.iov_len
= VFP_REGS_SIZE
;
600 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_ARM_VFP
, &iov
);
603 ret
= ptrace (PTRACE_GETVFPREGS
, tid
, 0, regbuf
);
607 warning (_("Unable to fetch VFP registers."));
611 for (regno
= 0; regno
< tdep
->vfp_register_count
; regno
++)
612 regcache_raw_supply (regcache
, regno
+ ARM_D0_REGNUM
,
613 (char *) regbuf
+ regno
* 8);
615 regcache_raw_supply (regcache
, ARM_FPSCR_REGNUM
,
616 (char *) regbuf
+ 32 * 8);
620 store_vfp_regs (const struct regcache
*regcache
)
622 char regbuf
[VFP_REGS_SIZE
];
624 struct gdbarch
*gdbarch
= get_regcache_arch (regcache
);
625 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
627 /* Get the thread id for the ptrace call. */
628 tid
= GET_THREAD_ID (inferior_ptid
);
630 if (have_ptrace_getregset
)
634 iov
.iov_base
= regbuf
;
635 iov
.iov_len
= VFP_REGS_SIZE
;
636 ret
= ptrace (PTRACE_GETREGSET
, tid
, NT_ARM_VFP
, &iov
);
639 ret
= ptrace (PTRACE_GETVFPREGS
, tid
, 0, regbuf
);
643 warning (_("Unable to fetch VFP registers (for update)."));
647 for (regno
= 0; regno
< tdep
->vfp_register_count
; regno
++)
648 regcache_raw_collect (regcache
, regno
+ ARM_D0_REGNUM
,
649 (char *) regbuf
+ regno
* 8);
651 regcache_raw_collect (regcache
, ARM_FPSCR_REGNUM
,
652 (char *) regbuf
+ 32 * 8);
654 if (have_ptrace_getregset
)
658 iov
.iov_base
= regbuf
;
659 iov
.iov_len
= VFP_REGS_SIZE
;
660 ret
= ptrace (PTRACE_SETREGSET
, tid
, NT_ARM_VFP
, &iov
);
663 ret
= ptrace (PTRACE_SETVFPREGS
, tid
, 0, regbuf
);
667 warning (_("Unable to store VFP registers."));
672 /* Fetch registers from the child process. Fetch all registers if
673 regno == -1, otherwise fetch all general registers or all floating
674 point registers depending upon the value of regno. */
677 arm_linux_fetch_inferior_registers (struct target_ops
*ops
,
678 struct regcache
*regcache
, int regno
)
680 struct gdbarch
*gdbarch
= get_regcache_arch (regcache
);
681 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
685 fetch_regs (regcache
);
686 fetch_fpregs (regcache
);
687 if (tdep
->have_wmmx_registers
)
688 fetch_wmmx_regs (regcache
);
689 if (tdep
->vfp_register_count
> 0)
690 fetch_vfp_regs (regcache
);
694 if (regno
< ARM_F0_REGNUM
|| regno
== ARM_PS_REGNUM
)
695 fetch_register (regcache
, regno
);
696 else if (regno
>= ARM_F0_REGNUM
&& regno
<= ARM_FPS_REGNUM
)
697 fetch_fpregister (regcache
, regno
);
698 else if (tdep
->have_wmmx_registers
699 && regno
>= ARM_WR0_REGNUM
&& regno
<= ARM_WCGR7_REGNUM
)
700 fetch_wmmx_regs (regcache
);
701 else if (tdep
->vfp_register_count
> 0
702 && regno
>= ARM_D0_REGNUM
703 && regno
<= ARM_D0_REGNUM
+ tdep
->vfp_register_count
)
704 fetch_vfp_regs (regcache
);
708 /* Store registers back into the inferior. Store all registers if
709 regno == -1, otherwise store all general registers or all floating
710 point registers depending upon the value of regno. */
713 arm_linux_store_inferior_registers (struct target_ops
*ops
,
714 struct regcache
*regcache
, int regno
)
716 struct gdbarch
*gdbarch
= get_regcache_arch (regcache
);
717 struct gdbarch_tdep
*tdep
= gdbarch_tdep (gdbarch
);
721 store_regs (regcache
);
722 store_fpregs (regcache
);
723 if (tdep
->have_wmmx_registers
)
724 store_wmmx_regs (regcache
);
725 if (tdep
->vfp_register_count
> 0)
726 store_vfp_regs (regcache
);
730 if (regno
< ARM_F0_REGNUM
|| regno
== ARM_PS_REGNUM
)
731 store_register (regcache
, regno
);
732 else if ((regno
>= ARM_F0_REGNUM
) && (regno
<= ARM_FPS_REGNUM
))
733 store_fpregister (regcache
, regno
);
734 else if (tdep
->have_wmmx_registers
735 && regno
>= ARM_WR0_REGNUM
&& regno
<= ARM_WCGR7_REGNUM
)
736 store_wmmx_regs (regcache
);
737 else if (tdep
->vfp_register_count
> 0
738 && regno
>= ARM_D0_REGNUM
739 && regno
<= ARM_D0_REGNUM
+ tdep
->vfp_register_count
)
740 store_vfp_regs (regcache
);
744 /* Wrapper functions for the standard regset handling, used by
748 fill_gregset (const struct regcache
*regcache
,
749 gdb_gregset_t
*gregsetp
, int regno
)
751 arm_linux_collect_gregset (NULL
, regcache
, regno
, gregsetp
, 0);
755 supply_gregset (struct regcache
*regcache
, const gdb_gregset_t
*gregsetp
)
757 arm_linux_supply_gregset (NULL
, regcache
, -1, gregsetp
, 0);
761 fill_fpregset (const struct regcache
*regcache
,
762 gdb_fpregset_t
*fpregsetp
, int regno
)
764 arm_linux_collect_nwfpe (NULL
, regcache
, regno
, fpregsetp
, 0);
767 /* Fill GDB's register array with the floating-point register values
771 supply_fpregset (struct regcache
*regcache
, const gdb_fpregset_t
*fpregsetp
)
773 arm_linux_supply_nwfpe (NULL
, regcache
, -1, fpregsetp
, 0);
776 /* Fetch the thread-local storage pointer for libthread_db. */
779 ps_get_thread_area (const struct ps_prochandle
*ph
,
780 lwpid_t lwpid
, int idx
, void **base
)
782 if (ptrace (PTRACE_GET_THREAD_AREA
, lwpid
, NULL
, base
) != 0)
785 /* IDX is the bias from the thread pointer to the beginning of the
786 thread descriptor. It has to be subtracted due to implementation
787 quirks in libthread_db. */
788 *base
= (void *) ((char *)*base
- idx
);
793 static const struct target_desc
*
794 arm_linux_read_description (struct target_ops
*ops
)
796 CORE_ADDR arm_hwcap
= 0;
798 if (have_ptrace_getregset
== -1)
800 elf_gregset_t gpregs
;
802 int tid
= GET_THREAD_ID (inferior_ptid
);
804 iov
.iov_base
= &gpregs
;
805 iov
.iov_len
= sizeof (gpregs
);
807 /* Check if PTRACE_GETREGSET works. */
808 if (ptrace (PTRACE_GETREGSET
, tid
, NT_PRSTATUS
, &iov
) < 0)
809 have_ptrace_getregset
= 0;
811 have_ptrace_getregset
= 1;
814 if (target_auxv_search (ops
, AT_HWCAP
, &arm_hwcap
) != 1)
816 return ops
->beneath
->to_read_description (ops
->beneath
);
819 if (arm_hwcap
& HWCAP_IWMMXT
)
820 return tdesc_arm_with_iwmmxt
;
822 if (arm_hwcap
& HWCAP_VFP
)
826 const struct target_desc
* result
= NULL
;
828 /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support
829 Neon with VFPv3-D32. */
830 if (arm_hwcap
& HWCAP_NEON
)
831 result
= tdesc_arm_with_neon
;
832 else if ((arm_hwcap
& (HWCAP_VFPv3
| HWCAP_VFPv3D16
)) == HWCAP_VFPv3
)
833 result
= tdesc_arm_with_vfpv3
;
835 result
= tdesc_arm_with_vfpv2
;
837 /* Now make sure that the kernel supports reading these
838 registers. Support was added in 2.6.30. */
839 pid
= ptid_get_lwp (inferior_ptid
);
841 buf
= alloca (VFP_REGS_SIZE
);
842 if (ptrace (PTRACE_GETVFPREGS
, pid
, 0, buf
) < 0
849 return ops
->beneath
->to_read_description (ops
->beneath
);
852 /* Information describing the hardware breakpoint capabilities. */
853 struct arm_linux_hwbp_cap
856 gdb_byte max_wp_length
;
861 /* Since we cannot dynamically allocate subfields of arm_linux_process_info,
862 assume a maximum number of supported break-/watchpoints. */
866 /* Get hold of the Hardware Breakpoint information for the target we are
867 attached to. Returns NULL if the kernel doesn't support Hardware
868 breakpoints at all, or a pointer to the information structure. */
869 static const struct arm_linux_hwbp_cap
*
870 arm_linux_get_hwbp_cap (void)
872 /* The info structure we return. */
873 static struct arm_linux_hwbp_cap info
;
875 /* Is INFO in a good state? -1 means that no attempt has been made to
876 initialize INFO; 0 means an attempt has been made, but it failed; 1
877 means INFO is in an initialized state. */
878 static int available
= -1;
885 tid
= GET_THREAD_ID (inferior_ptid
);
886 if (ptrace (PTRACE_GETHBPREGS
, tid
, 0, &val
) < 0)
890 info
.arch
= (gdb_byte
)((val
>> 24) & 0xff);
891 info
.max_wp_length
= (gdb_byte
)((val
>> 16) & 0xff);
892 info
.wp_count
= (gdb_byte
)((val
>> 8) & 0xff);
893 info
.bp_count
= (gdb_byte
)(val
& 0xff);
895 if (info
.wp_count
> MAX_WPTS
)
897 warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
898 supports %d"), MAX_WPTS
, info
.wp_count
);
899 info
.wp_count
= MAX_WPTS
;
902 if (info
.bp_count
> MAX_BPTS
)
904 warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
905 supports %d"), MAX_BPTS
, info
.bp_count
);
906 info
.bp_count
= MAX_BPTS
;
908 available
= (info
.arch
!= 0);
912 return available
== 1 ? &info
: NULL
;
915 /* How many hardware breakpoints are available? */
917 arm_linux_get_hw_breakpoint_count (void)
919 const struct arm_linux_hwbp_cap
*cap
= arm_linux_get_hwbp_cap ();
920 return cap
!= NULL
? cap
->bp_count
: 0;
923 /* How many hardware watchpoints are available? */
925 arm_linux_get_hw_watchpoint_count (void)
927 const struct arm_linux_hwbp_cap
*cap
= arm_linux_get_hwbp_cap ();
928 return cap
!= NULL
? cap
->wp_count
: 0;
931 /* Have we got a free break-/watch-point available for use? Returns -1 if
932 there is not an appropriate resource available, otherwise returns 1. */
934 arm_linux_can_use_hw_breakpoint (struct target_ops
*self
,
935 int type
, int cnt
, int ot
)
937 if (type
== bp_hardware_watchpoint
|| type
== bp_read_watchpoint
938 || type
== bp_access_watchpoint
|| type
== bp_watchpoint
)
940 int count
= arm_linux_get_hw_watchpoint_count ();
944 else if (cnt
+ ot
> count
)
947 else if (type
== bp_hardware_breakpoint
)
949 int count
= arm_linux_get_hw_breakpoint_count ();
953 else if (cnt
> count
)
962 /* Enum describing the different types of ARM hardware break-/watch-points. */
971 /* Type describing an ARM Hardware Breakpoint Control register value. */
972 typedef unsigned int arm_hwbp_control_t
;
974 /* Structure used to keep track of hardware break-/watch-points. */
975 struct arm_linux_hw_breakpoint
977 /* Address to break on, or being watched. */
978 unsigned int address
;
979 /* Control register for break-/watch- point. */
980 arm_hwbp_control_t control
;
983 /* Structure containing arrays of per process hardware break-/watchpoints
984 for caching address and control information.
986 The Linux ptrace interface to hardware break-/watch-points presents the
987 values in a vector centred around 0 (which is used fo generic information).
988 Positive indicies refer to breakpoint addresses/control registers, negative
989 indices to watchpoint addresses/control registers.
991 The Linux vector is indexed as follows:
992 -((i << 1) + 2): Control register for watchpoint i.
993 -((i << 1) + 1): Address register for watchpoint i.
994 0: Information register.
995 ((i << 1) + 1): Address register for breakpoint i.
996 ((i << 1) + 2): Control register for breakpoint i.
998 This structure is used as a per-thread cache of the state stored by the
999 kernel, so that we don't need to keep calling into the kernel to find a
1002 We treat break-/watch-points with their enable bit clear as being deleted.
1004 struct arm_linux_debug_reg_state
1006 /* Hardware breakpoints for this process. */
1007 struct arm_linux_hw_breakpoint bpts
[MAX_BPTS
];
1008 /* Hardware watchpoints for this process. */
1009 struct arm_linux_hw_breakpoint wpts
[MAX_WPTS
];
1012 /* Per-process arch-specific data we want to keep. */
1013 struct arm_linux_process_info
1016 struct arm_linux_process_info
*next
;
1017 /* The process identifier. */
1019 /* Hardware break-/watchpoints state information. */
1020 struct arm_linux_debug_reg_state state
;
1024 /* Per-thread arch-specific data we want to keep. */
1025 struct arch_lwp_info
1027 /* Non-zero if our copy differs from what's recorded in the thread. */
1028 char bpts_changed
[MAX_BPTS
];
1029 char wpts_changed
[MAX_WPTS
];
1032 static struct arm_linux_process_info
*arm_linux_process_list
= NULL
;
1034 /* Find process data for process PID. */
1036 static struct arm_linux_process_info
*
1037 arm_linux_find_process_pid (pid_t pid
)
1039 struct arm_linux_process_info
*proc
;
1041 for (proc
= arm_linux_process_list
; proc
; proc
= proc
->next
)
1042 if (proc
->pid
== pid
)
1048 /* Add process data for process PID. Returns newly allocated info
1051 static struct arm_linux_process_info
*
1052 arm_linux_add_process (pid_t pid
)
1054 struct arm_linux_process_info
*proc
;
1056 proc
= xcalloc (1, sizeof (*proc
));
1059 proc
->next
= arm_linux_process_list
;
1060 arm_linux_process_list
= proc
;
1065 /* Get data specific info for process PID, creating it if necessary.
1066 Never returns NULL. */
1068 static struct arm_linux_process_info
*
1069 arm_linux_process_info_get (pid_t pid
)
1071 struct arm_linux_process_info
*proc
;
1073 proc
= arm_linux_find_process_pid (pid
);
1075 proc
= arm_linux_add_process (pid
);
1080 /* Called whenever GDB is no longer debugging process PID. It deletes
1081 data structures that keep track of debug register state. */
1084 arm_linux_forget_process (pid_t pid
)
1086 struct arm_linux_process_info
*proc
, **proc_link
;
1088 proc
= arm_linux_process_list
;
1089 proc_link
= &arm_linux_process_list
;
1091 while (proc
!= NULL
)
1093 if (proc
->pid
== pid
)
1095 *proc_link
= proc
->next
;
1101 proc_link
= &proc
->next
;
1106 /* Get hardware break-/watchpoint state for process PID. */
1108 static struct arm_linux_debug_reg_state
*
1109 arm_linux_get_debug_reg_state (pid_t pid
)
1111 return &arm_linux_process_info_get (pid
)->state
;
1114 /* Initialize an ARM hardware break-/watch-point control register value.
1115 BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the
1116 type of break-/watch-point; ENABLE indicates whether the point is enabled.
1118 static arm_hwbp_control_t
1119 arm_hwbp_control_initialize (unsigned byte_address_select
,
1120 arm_hwbp_type hwbp_type
,
1123 gdb_assert ((byte_address_select
& ~0xffU
) == 0);
1124 gdb_assert (hwbp_type
!= arm_hwbp_break
1125 || ((byte_address_select
& 0xfU
) != 0));
1127 return (byte_address_select
<< 5) | (hwbp_type
<< 3) | (3 << 1) | enable
;
1130 /* Does the breakpoint control value CONTROL have the enable bit set? */
1132 arm_hwbp_control_is_enabled (arm_hwbp_control_t control
)
1134 return control
& 0x1;
1137 /* Change a breakpoint control word so that it is in the disabled state. */
1138 static arm_hwbp_control_t
1139 arm_hwbp_control_disable (arm_hwbp_control_t control
)
1141 return control
& ~0x1;
1144 /* Initialise the hardware breakpoint structure P. The breakpoint will be
1145 enabled, and will point to the placed address of BP_TGT. */
1147 arm_linux_hw_breakpoint_initialize (struct gdbarch
*gdbarch
,
1148 struct bp_target_info
*bp_tgt
,
1149 struct arm_linux_hw_breakpoint
*p
)
1152 CORE_ADDR address
= bp_tgt
->placed_address
= bp_tgt
->reqstd_address
;
1154 /* We have to create a mask for the control register which says which bits
1155 of the word pointed to by address to break on. */
1156 if (arm_pc_is_thumb (gdbarch
, address
))
1167 p
->address
= (unsigned int) address
;
1168 p
->control
= arm_hwbp_control_initialize (mask
, arm_hwbp_break
, 1);
1171 /* Get the ARM hardware breakpoint type from the RW value we're given when
1172 asked to set a watchpoint. */
1173 static arm_hwbp_type
1174 arm_linux_get_hwbp_type (int rw
)
1177 return arm_hwbp_load
;
1178 else if (rw
== hw_write
)
1179 return arm_hwbp_store
;
1181 return arm_hwbp_access
;
1184 /* Initialize the hardware breakpoint structure P for a watchpoint at ADDR
1185 to LEN. The type of watchpoint is given in RW. */
1187 arm_linux_hw_watchpoint_initialize (CORE_ADDR addr
, int len
, int rw
,
1188 struct arm_linux_hw_breakpoint
*p
)
1190 const struct arm_linux_hwbp_cap
*cap
= arm_linux_get_hwbp_cap ();
1193 gdb_assert (cap
!= NULL
);
1194 gdb_assert (cap
->max_wp_length
!= 0);
1196 mask
= (1 << len
) - 1;
1198 p
->address
= (unsigned int) addr
;
1199 p
->control
= arm_hwbp_control_initialize (mask
,
1200 arm_linux_get_hwbp_type (rw
), 1);
1203 /* Are two break-/watch-points equal? */
1205 arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint
*p1
,
1206 const struct arm_linux_hw_breakpoint
*p2
)
1208 return p1
->address
== p2
->address
&& p1
->control
== p2
->control
;
1211 /* Callback to mark a watch-/breakpoint to be updated in all threads of
1212 the current process. */
1214 struct update_registers_data
1221 update_registers_callback (struct lwp_info
*lwp
, void *arg
)
1223 struct update_registers_data
*data
= (struct update_registers_data
*) arg
;
1225 if (lwp
->arch_private
== NULL
)
1226 lwp
->arch_private
= XCNEW (struct arch_lwp_info
);
1228 /* The actual update is done later just before resuming the lwp,
1229 we just mark that the registers need updating. */
1231 lwp
->arch_private
->wpts_changed
[data
->index
] = 1;
1233 lwp
->arch_private
->bpts_changed
[data
->index
] = 1;
1235 /* If the lwp isn't stopped, force it to momentarily pause, so
1236 we can update its breakpoint registers. */
1238 linux_stop_lwp (lwp
);
1243 /* Insert the hardware breakpoint (WATCHPOINT = 0) or watchpoint (WATCHPOINT
1244 =1) BPT for thread TID. */
1246 arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint
* bpt
,
1252 struct arm_linux_hw_breakpoint
* bpts
;
1253 struct update_registers_data data
;
1255 pid
= ptid_get_pid (inferior_ptid
);
1256 pid_ptid
= pid_to_ptid (pid
);
1260 count
= arm_linux_get_hw_watchpoint_count ();
1261 bpts
= arm_linux_get_debug_reg_state (pid
)->wpts
;
1265 count
= arm_linux_get_hw_breakpoint_count ();
1266 bpts
= arm_linux_get_debug_reg_state (pid
)->bpts
;
1269 for (i
= 0; i
< count
; ++i
)
1270 if (!arm_hwbp_control_is_enabled (bpts
[i
].control
))
1272 data
.watch
= watchpoint
;
1275 iterate_over_lwps (pid_ptid
, update_registers_callback
, &data
);
1279 gdb_assert (i
!= count
);
1282 /* Remove the hardware breakpoint (WATCHPOINT = 0) or watchpoint
1283 (WATCHPOINT = 1) BPT for thread TID. */
1285 arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint
*bpt
,
1291 struct arm_linux_hw_breakpoint
* bpts
;
1292 struct update_registers_data data
;
1294 pid
= ptid_get_pid (inferior_ptid
);
1295 pid_ptid
= pid_to_ptid (pid
);
1299 count
= arm_linux_get_hw_watchpoint_count ();
1300 bpts
= arm_linux_get_debug_reg_state (pid
)->wpts
;
1304 count
= arm_linux_get_hw_breakpoint_count ();
1305 bpts
= arm_linux_get_debug_reg_state (pid
)->bpts
;
1308 for (i
= 0; i
< count
; ++i
)
1309 if (arm_linux_hw_breakpoint_equal (bpt
, bpts
+ i
))
1311 data
.watch
= watchpoint
;
1313 bpts
[i
].control
= arm_hwbp_control_disable (bpts
[i
].control
);
1314 iterate_over_lwps (pid_ptid
, update_registers_callback
, &data
);
1318 gdb_assert (i
!= count
);
1321 /* Insert a Hardware breakpoint. */
1323 arm_linux_insert_hw_breakpoint (struct target_ops
*self
,
1324 struct gdbarch
*gdbarch
,
1325 struct bp_target_info
*bp_tgt
)
1327 struct lwp_info
*lp
;
1328 struct arm_linux_hw_breakpoint p
;
1330 if (arm_linux_get_hw_breakpoint_count () == 0)
1333 arm_linux_hw_breakpoint_initialize (gdbarch
, bp_tgt
, &p
);
1335 arm_linux_insert_hw_breakpoint1 (&p
, 0);
1340 /* Remove a hardware breakpoint. */
1342 arm_linux_remove_hw_breakpoint (struct target_ops
*self
,
1343 struct gdbarch
*gdbarch
,
1344 struct bp_target_info
*bp_tgt
)
1346 struct lwp_info
*lp
;
1347 struct arm_linux_hw_breakpoint p
;
1349 if (arm_linux_get_hw_breakpoint_count () == 0)
1352 arm_linux_hw_breakpoint_initialize (gdbarch
, bp_tgt
, &p
);
1354 arm_linux_remove_hw_breakpoint1 (&p
, 0);
1359 /* Are we able to use a hardware watchpoint for the LEN bytes starting at
1362 arm_linux_region_ok_for_hw_watchpoint (struct target_ops
*self
,
1363 CORE_ADDR addr
, int len
)
1365 const struct arm_linux_hwbp_cap
*cap
= arm_linux_get_hwbp_cap ();
1366 CORE_ADDR max_wp_length
, aligned_addr
;
1368 /* Can not set watchpoints for zero or negative lengths. */
1372 /* Need to be able to use the ptrace interface. */
1373 if (cap
== NULL
|| cap
->wp_count
== 0)
1376 /* Test that the range [ADDR, ADDR + LEN) fits into the largest address
1377 range covered by a watchpoint. */
1378 max_wp_length
= (CORE_ADDR
)cap
->max_wp_length
;
1379 aligned_addr
= addr
& ~(max_wp_length
- 1);
1381 if (aligned_addr
+ max_wp_length
< addr
+ len
)
1384 /* The current ptrace interface can only handle watchpoints that are a
1386 if ((len
& (len
- 1)) != 0)
1389 /* All tests passed so we must be able to set a watchpoint. */
1393 /* Insert a Hardware breakpoint. */
1395 arm_linux_insert_watchpoint (struct target_ops
*self
,
1396 CORE_ADDR addr
, int len
, int rw
,
1397 struct expression
*cond
)
1399 struct lwp_info
*lp
;
1400 struct arm_linux_hw_breakpoint p
;
1402 if (arm_linux_get_hw_watchpoint_count () == 0)
1405 arm_linux_hw_watchpoint_initialize (addr
, len
, rw
, &p
);
1407 arm_linux_insert_hw_breakpoint1 (&p
, 1);
1412 /* Remove a hardware breakpoint. */
1414 arm_linux_remove_watchpoint (struct target_ops
*self
,
1415 CORE_ADDR addr
, int len
, int rw
,
1416 struct expression
*cond
)
1418 struct lwp_info
*lp
;
1419 struct arm_linux_hw_breakpoint p
;
1421 if (arm_linux_get_hw_watchpoint_count () == 0)
1424 arm_linux_hw_watchpoint_initialize (addr
, len
, rw
, &p
);
1426 arm_linux_remove_hw_breakpoint1 (&p
, 1);
1431 /* What was the data address the target was stopped on accessing. */
1433 arm_linux_stopped_data_address (struct target_ops
*target
, CORE_ADDR
*addr_p
)
1438 if (!linux_nat_get_siginfo (inferior_ptid
, &siginfo
))
1441 /* This must be a hardware breakpoint. */
1442 if (siginfo
.si_signo
!= SIGTRAP
1443 || (siginfo
.si_code
& 0xffff) != 0x0004 /* TRAP_HWBKPT */)
1446 /* We must be able to set hardware watchpoints. */
1447 if (arm_linux_get_hw_watchpoint_count () == 0)
1450 slot
= siginfo
.si_errno
;
1452 /* If we are in a positive slot then we're looking at a breakpoint and not
1457 *addr_p
= (CORE_ADDR
) (uintptr_t) siginfo
.si_addr
;
1461 /* Has the target been stopped by hitting a watchpoint? */
1463 arm_linux_stopped_by_watchpoint (struct target_ops
*ops
)
1466 return arm_linux_stopped_data_address (ops
, &addr
);
1470 arm_linux_watchpoint_addr_within_range (struct target_ops
*target
,
1472 CORE_ADDR start
, int length
)
1474 return start
<= addr
&& start
+ length
- 1 >= addr
;
1477 /* Handle thread creation. We need to copy the breakpoints and watchpoints
1478 in the parent thread to the child thread. */
1480 arm_linux_new_thread (struct lwp_info
*lp
)
1483 struct arch_lwp_info
*info
= XCNEW (struct arch_lwp_info
);
1485 /* Mark that all the hardware breakpoint/watchpoint register pairs
1486 for this thread need to be initialized. */
1488 for (i
= 0; i
< MAX_BPTS
; i
++)
1490 info
->bpts_changed
[i
] = 1;
1491 info
->wpts_changed
[i
] = 1;
1494 lp
->arch_private
= info
;
1497 /* Called when resuming a thread.
1498 The hardware debug registers are updated when there is any change. */
1501 arm_linux_prepare_to_resume (struct lwp_info
*lwp
)
1504 struct arm_linux_hw_breakpoint
*bpts
, *wpts
;
1505 struct arch_lwp_info
*arm_lwp_info
= lwp
->arch_private
;
1507 pid
= ptid_get_lwp (lwp
->ptid
);
1508 bpts
= arm_linux_get_debug_reg_state (ptid_get_pid (lwp
->ptid
))->bpts
;
1509 wpts
= arm_linux_get_debug_reg_state (ptid_get_pid (lwp
->ptid
))->wpts
;
1511 /* NULL means this is the main thread still going through the shell,
1512 or, no watchpoint has been set yet. In that case, there's
1514 if (arm_lwp_info
== NULL
)
1517 for (i
= 0; i
< arm_linux_get_hw_breakpoint_count (); i
++)
1518 if (arm_lwp_info
->bpts_changed
[i
])
1521 if (arm_hwbp_control_is_enabled (bpts
[i
].control
))
1522 if (ptrace (PTRACE_SETHBPREGS
, pid
,
1523 (PTRACE_TYPE_ARG3
) ((i
<< 1) + 1), &bpts
[i
].address
) < 0)
1524 perror_with_name (_("Unexpected error setting breakpoint"));
1526 if (bpts
[i
].control
!= 0)
1527 if (ptrace (PTRACE_SETHBPREGS
, pid
,
1528 (PTRACE_TYPE_ARG3
) ((i
<< 1) + 2), &bpts
[i
].control
) < 0)
1529 perror_with_name (_("Unexpected error setting breakpoint"));
1531 arm_lwp_info
->bpts_changed
[i
] = 0;
1534 for (i
= 0; i
< arm_linux_get_hw_watchpoint_count (); i
++)
1535 if (arm_lwp_info
->wpts_changed
[i
])
1538 if (arm_hwbp_control_is_enabled (wpts
[i
].control
))
1539 if (ptrace (PTRACE_SETHBPREGS
, pid
,
1540 (PTRACE_TYPE_ARG3
) -((i
<< 1) + 1), &wpts
[i
].address
) < 0)
1541 perror_with_name (_("Unexpected error setting watchpoint"));
1543 if (wpts
[i
].control
!= 0)
1544 if (ptrace (PTRACE_SETHBPREGS
, pid
,
1545 (PTRACE_TYPE_ARG3
) -((i
<< 1) + 2), &wpts
[i
].control
) < 0)
1546 perror_with_name (_("Unexpected error setting watchpoint"));
1548 arm_lwp_info
->wpts_changed
[i
] = 0;
1552 /* linux_nat_new_fork hook. */
1555 arm_linux_new_fork (struct lwp_info
*parent
, pid_t child_pid
)
1558 struct arm_linux_debug_reg_state
*parent_state
;
1559 struct arm_linux_debug_reg_state
*child_state
;
1561 /* NULL means no watchpoint has ever been set in the parent. In
1562 that case, there's nothing to do. */
1563 if (parent
->arch_private
== NULL
)
1566 /* GDB core assumes the child inherits the watchpoints/hw
1567 breakpoints of the parent, and will remove them all from the
1568 forked off process. Copy the debug registers mirrors into the
1569 new process so that all breakpoints and watchpoints can be
1570 removed together. */
1572 parent_pid
= ptid_get_pid (parent
->ptid
);
1573 parent_state
= arm_linux_get_debug_reg_state (parent_pid
);
1574 child_state
= arm_linux_get_debug_reg_state (child_pid
);
1575 *child_state
= *parent_state
;
1578 void _initialize_arm_linux_nat (void);
1581 _initialize_arm_linux_nat (void)
1583 struct target_ops
*t
;
1585 /* Fill in the generic GNU/Linux methods. */
1586 t
= linux_target ();
1588 /* Add our register access methods. */
1589 t
->to_fetch_registers
= arm_linux_fetch_inferior_registers
;
1590 t
->to_store_registers
= arm_linux_store_inferior_registers
;
1592 /* Add our hardware breakpoint and watchpoint implementation. */
1593 t
->to_can_use_hw_breakpoint
= arm_linux_can_use_hw_breakpoint
;
1594 t
->to_insert_hw_breakpoint
= arm_linux_insert_hw_breakpoint
;
1595 t
->to_remove_hw_breakpoint
= arm_linux_remove_hw_breakpoint
;
1596 t
->to_region_ok_for_hw_watchpoint
= arm_linux_region_ok_for_hw_watchpoint
;
1597 t
->to_insert_watchpoint
= arm_linux_insert_watchpoint
;
1598 t
->to_remove_watchpoint
= arm_linux_remove_watchpoint
;
1599 t
->to_stopped_by_watchpoint
= arm_linux_stopped_by_watchpoint
;
1600 t
->to_stopped_data_address
= arm_linux_stopped_data_address
;
1601 t
->to_watchpoint_addr_within_range
= arm_linux_watchpoint_addr_within_range
;
1603 t
->to_read_description
= arm_linux_read_description
;
1605 /* Register the target. */
1606 linux_nat_add_target (t
);
1608 /* Handle thread creation and exit. */
1609 linux_nat_set_new_thread (t
, arm_linux_new_thread
);
1610 linux_nat_set_prepare_to_resume (t
, arm_linux_prepare_to_resume
);
1612 /* Handle process creation and exit. */
1613 linux_nat_set_new_fork (t
, arm_linux_new_fork
);
1614 linux_nat_set_forget_process (t
, arm_linux_forget_process
);