Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH/AARCH64] Fix hardware break points
@ 2013-07-27 20:13 Andrew Pinski
  2013-07-27 21:34 ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Pinski @ 2013-07-27 20:13 UTC (permalink / raw)
  To: gdb-patches

[-- 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 (&regs, 0, size(regs));
   iov.iov_base = &regs;
   iov.iov_len = sizeof (regs);
   count = watchpoint ? aarch64_num_wp_regs : aarch64_num_bp_regs;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-09-16 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-27 20:13 [PATCH/AARCH64] Fix hardware break points Andrew Pinski
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox