mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] FRV debugging fixes
Date: Tue, 14 Dec 2004 16:11:39 +0000	[thread overview]
Message-ID: <9348.1103040699@redhat.com> (raw)


The attached patch fixes three debugging problems in the frv arch:

 (1) Single-stepping in userspace steps through into the kernel-mode interrupt
     handler when a hardware interrupt happens, and sometimes it gets past
     where the debug-mode handler would normally catch it. This patch extends
     the range of detected PC values.

 (2) When setting up the kernel-mode exception frame from the debug-mode
     handler for a userspace debugging event, we weren't setting the LR
     register to generate a return to the exception handler epilogue.

 (3) sys_ptrace() now needs to "put" the inferior task_struct not "free" it as
     was done in 2.4.

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat frv-debug-2610rc3.diff 
 break.S  |    7 +++++++
 ptrace.c |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff -uNr linux-2.6.10-rc3-mm1-mmcleanup/arch/frv/kernel/break.S linux-2.6.10-rc3-mm1-misc/arch/frv/kernel/break.S
--- linux-2.6.10-rc3-mm1-mmcleanup/arch/frv/kernel/break.S	2004-12-13 17:33:50.000000000 +0000
+++ linux-2.6.10-rc3-mm1-misc/arch/frv/kernel/break.S	2004-12-13 19:28:04.000000000 +0000
@@ -202,6 +202,10 @@
 	setlo		%lo(__entry_kernel_external_interrupt),gr3
 	subcc		gr2,gr3,gr0,icc0
 	beq		icc0,#2,__break_step_kernel_external_interrupt
+	sethi.p		%hi(__entry_uspace_external_interrupt),gr3
+	setlo		%lo(__entry_uspace_external_interrupt),gr3
+	subcc		gr2,gr3,gr0,icc0
+	beq		icc0,#2,__break_step_uspace_external_interrupt
 
 	LEDS		0x2007,gr2
 
@@ -483,6 +487,9 @@
 	movgs		gr2,bpsr
 
 	# return through remainder of the exception prologue
+	# - need to load gr23 with return handler address
+	sethi.p		%hi(__entry_return_from_user_exception),gr23
+	setlo		%lo(__entry_return_from_user_exception),gr23
 	sethi.p		%hi(__entry_common),gr3
 	setlo		%lo(__entry_common),gr3
 	movgs		gr3,bpcsr
diff -uNr linux-2.6.10-rc3-mm1-mmcleanup/arch/frv/kernel/ptrace.c linux-2.6.10-rc3-mm1-misc/arch/frv/kernel/ptrace.c
--- linux-2.6.10-rc3-mm1-mmcleanup/arch/frv/kernel/ptrace.c	2004-12-13 17:33:50.000000000 +0000
+++ linux-2.6.10-rc3-mm1-misc/arch/frv/kernel/ptrace.c	2004-12-13 19:28:11.000000000 +0000
@@ -358,7 +358,7 @@
 		break;
 	}
 out_tsk:
-	free_task_struct(child);
+	put_task_struct(child);
 out:
 	unlock_kernel();
 	return ret;

                 reply	other threads:[~2004-12-14 16:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9348.1103040699@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome