From: Andrew Pinski <pinskia@gmail.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH/AARCH64] Fix hardware break points
Date: Sat, 27 Jul 2013 20:13:00 -0000 [thread overview]
Message-ID: <CA+=Sn1mFs3=aY70af9xWomP-t6-kfsgzXr83xRBuXdofoZVMsQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
I noticed after a fork, gdb would fail with the following message:
Unexpected error setting hardware debug registers
This is because it was trying to setup hardware breakpoint debug
registers but it was passing to ptrace garbage for the registers as
they were not zero'd out.
This fixes the problem by zeroing out the regs variable and now
debugging after a fork works on aarch64.
OK? Built and tested on aarch64-linux-gnu with no regressions.
Thanks,
Andrew Pinski
ChangeLog:
* aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Zero out regs.
[-- Attachment #2: fixfork.diff.txt --]
[-- Type: text/plain, Size: 614 bytes --]
? .aarch64-linux-nat.c.swp
Index: aarch64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/aarch64-linux-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 aarch64-linux-nat.c
--- aarch64-linux-nat.c 14 Feb 2013 13:50:30 -0000 1.4
+++ aarch64-linux-nat.c 27 Jul 2013 20:12:39 -0000
@@ -312,6 +312,7 @@ aarch64_linux_set_debug_regs (const stru
const CORE_ADDR *addr;
const unsigned int *ctrl;
+ memset (®s, 0, size(regs));
iov.iov_base = ®s;
iov.iov_len = sizeof (regs);
count = watchpoint ? aarch64_num_wp_regs : aarch64_num_bp_regs;
next reply other threads:[~2013-07-27 20:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-27 20:13 Andrew Pinski [this message]
2013-07-27 21:34 ` Andreas Schwab
2013-07-27 22:42 ` Andrew Pinski
2013-07-29 17:56 ` Tom Tromey
2013-09-10 14:38 ` Will Newton
2013-09-12 7:15 ` Andrew Pinski
2013-09-16 12:44 ` Pedro Alves
2013-09-16 12:53 ` Will Newton
2013-09-16 13:38 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+=Sn1mFs3=aY70af9xWomP-t6-kfsgzXr83xRBuXdofoZVMsQ@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox