summaryrefslogtreecommitdiff
path: root/gdb/arm-linux-nat.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-07-06 16:49:42 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-07-06 16:49:42 +0000
commit52fc103f248ffc9d32b17b22974d565cd042acd9 (patch)
treef569c2e818ce333c9811b8950e263a855a7a9945 /gdb/arm-linux-nat.c
parent7eb23e0811b14d0b8f5c08c87ab4b5d1ef913581 (diff)
downloadgdb-52fc103f248ffc9d32b17b22974d565cd042acd9.tar.gz
gdb/
Code cleanup for the next patch. * arm-linux-nat.c (arm_linux_stopped_data_address): Change variable siginfo_p to siginfo, update its users incl. the linux_nat_get_siginfo call for it. * ia64-linux-nat.c (ia64_linux_stopped_data_address): Likewise. (ia64_linux_stopped_data_address): * linux-nat.c (linux_nat_get_siginfo): Add parameter siginfo, change the return value. * linux-nat.h (linux_nat_get_siginfo): Likewise. * ppc-linux-nat.c (ppc_linux_stopped_data_address): Change variable siginfo_p to siginfo, update its users incl. the linux_nat_get_siginfo call for it.
Diffstat (limited to 'gdb/arm-linux-nat.c')
-rw-r--r--gdb/arm-linux-nat.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index f9f6ba5ea1c..2485a84e3a7 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -1137,24 +1137,29 @@ arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
static int
arm_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
{
- siginfo_t *siginfo_p = linux_nat_get_siginfo (inferior_ptid);
- int slot = siginfo_p->si_errno;
+ siginfo_t siginfo;
+ int slot;
+
+ if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
+ return 0;
/* This must be a hardware breakpoint. */
- if (siginfo_p->si_signo != SIGTRAP
- || (siginfo_p->si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
+ if (siginfo.si_signo != SIGTRAP
+ || (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0;
/* We must be able to set hardware watchpoints. */
if (arm_linux_get_hw_watchpoint_count () == 0)
return 0;
+ slot = siginfo.si_errno;
+
/* If we are in a positive slot then we're looking at a breakpoint and not
a watchpoint. */
if (slot >= 0)
return 0;
- *addr_p = (CORE_ADDR) (uintptr_t) siginfo_p->si_addr;
+ *addr_p = (CORE_ADDR) (uintptr_t) siginfo.si_addr;
return 1;
}