Subject: Re: bin/30756
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Rui Paulo <rpaulo@NetBSD.org>
List: netbsd-bugs
Date: 08/17/2005 01:55:10
--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2005.08.16 18:07:15 +0000, Nathan J. Williams wrote:
| That happens to work but it's not right at all. nbsd_thread_resume()
| is being called with a ptid argument of {<pid>, 1, 0}; that is, the
| upper levels are trying to single-step an LWP rather than a thread (we
| don't currently have a mechanism for that in the ptrace
| interface). This causes thread_resume_suspend_cb() to try to suspend
| the only thread in the program... which is a bad enough idea, but it
| happens early enough that the idle queue isn't even set up, and so
| there's no thread to replace the suspended thread in the register
| set. This causes td_thr_suspend() to bail out with the error seen
| above.
|=20
| However, this does point out a partial solution, which I've gone ahead
| and committed:

I've tested it and while it works for simple cases, it doesn't work for
debugging large programs, like jvm.

proton> ./gdb -q ~/java/jdk/bin/java_g                      [usr.bin/gdb53/=
gdb]
(gdb) run -jar ~/java/jdk/demo/jfc/Java2D/Java2Demo.jar
Starting program: /home/rpaulo/java/jdk-1_5_0/control/build/bsd-i586/bin/ja=
va_g -jar ~/java/jdk/demo/jfc/Java2D/Java2Demo.jar

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to LWP 1]
0xbdbf5530 in .rtld_start () from /usr/libexec/ld.elf_so
(gdb)=20

If you need more information, please tell me.
I don't know if you are already aware of this since you pointed out that
it is a "partial solution".

		-- Rui Paulo

--+QahgC5+KEYLbs62
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFDAoruZPqyxs9FH4QRAoumAJ9oGuJHLtqSYuKWtFcuRHaWxsJa/gCfQ53p
EJJNUeA/PvH+fh+0+ycMtHI=
=iz5l
-----END PGP SIGNATURE-----

--+QahgC5+KEYLbs62--