Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: gdb/arm-linux-nat.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/arch-utils.c ('k') | gdb/arm-linux-tdep.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/arm-linux-nat.c
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 411f7f46faa90548a2205207e4a3b7fc28fd0a12..bf81c032a9bb38bb1a754e25eefe794e25f38116 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -77,7 +77,7 @@ extern int arm_apcs_32;
individual thread (process) ID. get_thread_id () is used to get
the thread id if it's available, and the process id otherwise. */
-int
+static int
get_thread_id (ptid_t ptid)
{
int tid = TIDGET (ptid);
@@ -896,11 +896,17 @@ arm_linux_hw_breakpoint_initialize (struct gdbarch *gdbarch,
/* We have to create a mask for the control register which says which bits
of the word pointed to by address to break on. */
if (arm_pc_is_thumb (gdbarch, address))
- mask = 0x3 << (address & 2);
+ {
+ mask = 0x3;
+ address &= ~1;
+ }
else
- mask = 0xf;
+ {
+ mask = 0xf;
+ address &= ~3;
+ }
- p->address = (unsigned int) (address & ~3);
+ p->address = (unsigned int) address;
p->control = arm_hwbp_control_initialize (mask, arm_hwbp_break, 1);
}
@@ -1137,24 +1143,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)
{
- struct siginfo *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;
}
@@ -1177,9 +1188,9 @@ arm_linux_watchpoint_addr_within_range (struct target_ops *target,
/* Handle thread creation. We need to copy the breakpoints and watchpoints
in the parent thread to the child thread. */
static void
-arm_linux_new_thread (ptid_t ptid)
+arm_linux_new_thread (struct lwp_info *lp)
{
- int tid = TIDGET (ptid);
+ int tid = TIDGET (lp->ptid);
const struct arm_linux_hwbp_cap *info = arm_linux_get_hwbp_cap ();
if (info != NULL)
« no previous file with comments | « gdb/arch-utils.c ('k') | gdb/arm-linux-tdep.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698