Re: ptrace problem

Paul Mundt <[email protected]> Sun, 14 Nov 2004 20:53:03 +0200
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general
Message-ID <[email protected]>
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 10, 2004 at 02:45:43PM +0530, Gaurav Khurana wrote:
> linux-2.4.x/arch/sh/kernel/ptrace.c :-
> get_stack_long( ... ) {
> ...
> stack =3D (unsigned char *)task + THREAD_SIZE - sizeof(struct pt_regs);
> ...
> }
>=20
For starters, use a kernel that isn't years out of date, or at least check
against the current tree before reporting bugs.

> The debugger works correctly if I change the above line both in
> get_stack_long and put_stack_long (in arch/sh/kernel/ptrace.c) to :-
> stack =3D (unsigned char *)task + THREAD_SIZE - sizeof(struct pt_regs) -
> sizeof(struct pt_regs *);
>=20
The current tree has this changed to:

        stack =3D (unsigned char *)
                task->thread_info + THREAD_SIZE - sizeof(struct pt_regs)
#ifdef CONFIG_SH_DSP
                - sizeof(struct pt_dspregs)
#endif
                - sizeof(unsigned long);

in both cases. You can rip out the DSP bits, but you need the sizeof(unsign=
ed
long) for taking the EXPEVT slot into account.

Update your ptrace.c for those changes and see if it still behaves the same.
If you have any other weird issues, not using an out of date unsupported
tree would be adviseable..


--fUYQa+Pmc3FrFX/N
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBl6mOvfgmmv+NIDsRAqa4AJ9WV1N/0Tvw2FcKUF4FaF0FnY+lxACfZyV8
abPaKC5zqXgpm3EYNl4S3vo=
=DIHr
-----END PGP SIGNATURE-----

--fUYQa+Pmc3FrFX/N--


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8