mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Jurriaan on Alpha <thunder7@xs4all.nl>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Richard Henderson <rth@twiddle.net>,
	linux-kernel@vger.kernel.org
Subject: [patch] Re: gdb stopped working in 2.5.10 - works fine in 2.4.x
Date: Fri, 26 Apr 2002 18:07:04 +0400	[thread overview]
Message-ID: <20020426180704.A22338@jurassic.park.msu.ru> (raw)
In-Reply-To: <20020426125736.GA6775@alpha.of.nowhere>

On Fri, Apr 26, 2002 at 02:57:36PM +0200, Jurriaan on Alpha wrote:
> the breakpoint with a negative number, followed by the message 'Cannot
> access memory at ...' happens on any executable I try with gdb.
> 
> This didn't happen with the 2.4.x kernels, so I suspect something in
> 2.5.x. Any ideas?

Yes, gdb and strace are broken since 2.5.6, IIRC.
Some necessary 'thread_info' changes still are missing in ptrace.c.
Fix appended. 

Ivan.

--- 2.5.9/arch/alpha/kernel/ptrace.c	Sun Apr 14 23:18:55 2002
+++ linux/arch/alpha/kernel/ptrace.c	Mon Apr 15 18:36:43 2002
@@ -106,7 +106,7 @@ get_reg_addr(struct task_struct * task, 
 		zero = 0;
 		addr = &zero;
 	} else {
-		addr = (long *)((long)task + regoff[regno]);
+		addr = (long *)((long)task->thread_info + regoff[regno]);
 	}
 	return addr;
 }
@@ -340,9 +340,9 @@ sys_ptrace(long request, long pid, long 
 		if ((unsigned long) data > _NSIG)
 			goto out;
 		if (request == PTRACE_SYSCALL)
-			set_thread_flag(TIF_SYSCALL_TRACE);
+			set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		else
-			clear_thread_flag(TIF_SYSCALL_TRACE);
+			clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		child->exit_code = data;
 		wake_up_process(child);
 		/* make sure single-step breakpoint is gone. */
@@ -371,7 +371,7 @@ sys_ptrace(long request, long pid, long 
 			goto out;
 		/* Mark single stepping.  */
 		child->thread_info->bpt_nsaved = -1;
-		clear_thread_flag(TIF_SYSCALL_TRACE);
+		clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		wake_up_process(child);
 		child->exit_code = data;
 		/* give it a chance to run. */

      reply	other threads:[~2002-04-26 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 12:57 Jurriaan on Alpha
2002-04-26 14:07 ` Ivan Kokshaysky [this message]

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=20020426180704.A22338@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --cc=thunder7@xs4all.nl \
    --cc=torvalds@transmeta.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

all inboxes | Powered by JetHome®