Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, Pedro Alves <palves@redhat.com>
Subject: [PATCH 5/7 v2] Comment and whitespace changes
Date: Fri, 27 Jun 2014 14:40:00 -0000	[thread overview]
Message-ID: <1403878351-22974-6-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1403878351-22974-1-git-send-email-gbenson@redhat.com>

This commit merges the comments and whitespace in the common
parts of i386-linux-nat.c and amd64-linux-nat.c.

This patch is unchanged from the original version in this series.

gdb/
2014-06-27  Gary Benson  <gbenson@redhat.com>

	* amd64-linux-nat.c: Comment and whitespace changes.
	* i386-linux-nat.c: Comment and whitespace changes.
---
 gdb/ChangeLog         |    5 +++++
 gdb/amd64-linux-nat.c |    3 +++
 gdb/i386-linux-nat.c  |   15 ++++++++++++---
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 2a291df..f29f8c7 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -277,8 +277,11 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
     }
 }
 \f
+
 /* Support for debug registers.  */
 
+/* Get debug register REGNUM value from only the one LWP of PTID.  */
+
 static unsigned long
 x86_linux_dr_get (ptid_t ptid, int regnum)
 {
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 5ef69ff..51b3338 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -732,7 +732,7 @@ update_debug_registers_callback (struct lwp_info *lwp, void *arg)
   return 0;
 }
 
-/* Set DR_CONTROL to ADDR in all LWPs of the current inferior.  */
+/* Set DR_CONTROL to CONTROL in all LWPs of the current inferior.  */
 
 static void
 x86_linux_dr_set_control (unsigned long control)
@@ -775,9 +775,16 @@ x86_linux_prepare_to_resume (struct lwp_info *lwp)
 	= i386_debug_reg_state (ptid_get_pid (lwp->ptid));
       int i;
 
-      /* See amd64_linux_prepare_to_resume for Linux kernel note on
-	 i386_linux_dr_set calls ordering.  */
+      /* On Linux kernel before 2.6.33 commit
+	 72f674d203cd230426437cdcf7dd6f681dad8b0d
+	 if you enable a breakpoint by the DR_CONTROL bits you need to have
+	 already written the corresponding DR_FIRSTADDR...DR_LASTADDR registers.
 
+	 Ensure DR_CONTROL gets written as the very last register here.  */
+
+      /* Clear DR_CONTROL first.  In some cases, setting DR0-3 to a
+	 value that doesn't match what is enabled in DR_CONTROL
+	 results in EINVAL.  */
       x86_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
 
       for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
@@ -792,6 +799,8 @@ x86_linux_prepare_to_resume (struct lwp_info *lwp)
 	    clear_status = 1;
 	  }
 
+      /* If DR_CONTROL is supposed to be zero, we've already set it
+	 above.  */
       if (state->dr_control_mirror != 0)
 	x86_linux_dr_set (lwp->ptid, DR_CONTROL, state->dr_control_mirror);
 
-- 
1.7.1


  parent reply	other threads:[~2014-06-27 14:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 14:12 [PATCH 0/7 v2] Refactor shared code in {i386,amd64}-linux-nat.c Gary Benson
2014-06-27 14:12 ` [PATCH 1/7 v2] Rename identical functions Gary Benson
2014-07-09 13:04   ` Pedro Alves
2014-06-27 14:12 ` [PATCH 2/7 v2] Merge {i386,amd64}_linux_read_description Gary Benson
2014-07-09 13:07   ` Pedro Alves
2014-06-27 14:12 ` [PATCH 3/7 v2] Merge ps_get_thread_area Gary Benson
2014-07-09 13:08   ` Pedro Alves
2014-07-09 13:08   ` Pedro Alves
2014-06-27 14:28 ` [PATCH 6/7 v2] Move duplicated code into new files Gary Benson
2014-07-09 13:12   ` Pedro Alves
2014-06-27 14:40 ` Gary Benson [this message]
2014-07-09 13:11   ` [PATCH 5/7 v2] Comment and whitespace changes Pedro Alves
2014-06-27 14:52 ` [PATCH 7/7 v2] Tidy #include lists Gary Benson
2014-07-09 13:13   ` Pedro Alves
2014-08-06  9:36   ` Yao Qi
2014-08-06 10:19     ` Gary Benson
2014-08-06 11:16       ` Yao Qi
2014-09-09 15:09   ` [pushed] Fix missing "struct iovec" definition on some x86-linux. (was: "[PATCH 7/7 v2] Tidy #include lists") Joel Brobecker
2014-09-10 10:59     ` Gary Benson
2014-09-10 13:14       ` Joel Brobecker
2014-06-27 14:53 ` [PATCH 4/7 v2] Pull out common parts of _initialize_{i386,amd64}_linux_nat Gary Benson
2014-07-09 13:09   ` Pedro Alves
2014-07-09 13:17 ` [PATCH 0/7 v2] Refactor shared code in {i386,amd64}-linux-nat.c Pedro Alves
2014-07-11 12:34   ` Gary Benson

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=1403878351-22974-6-git-send-email-gbenson@redhat.com \
    --to=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=palves@redhat.com \
    /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