Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Sep 2004 11:04:15 +0300
From:      Alexey Zelkin <phantom@FreeBSD.org.ua>
To:        Kurt Miller <truk@optonline.net>
Cc:        freebsd-java@freebsd.org
Subject:   Re: debugging 1.4 and execve
Message-ID:  <20040909080415.GA49910@phantom.cris.net>
In-Reply-To: <033d01c495e6$09de3230$1d0110ac@focus>
References:  <033d01c495e6$09de3230$1d0110ac@focus>

next in thread | previous in thread | raw e-mail | index | archive | help
hi,

Hehe.  It was funny expirience.  The only way (I did not have
much time to look in this issue at  the begining) to avoid it --
to avoid calling execve().  java_md.c has function named
SetLibraryPath() IIRC, so you need to debug this function and
find which LD_LIBRARY_PATH it wants to have.  Next you need
to exit debuger, set LD_LIBRARY_PATH to exactly this value, and
re-execute debuger.  java will look up for new library path, compare
with already set one, and if they are equal (internally it means
what execve() is called already) execution will be continued without
execve(), and as result without any gdb traps.

ps: one more trick, as result of not having of any gdb traps, you'll be
having working 'thread*' command functionality.  I do not know about
OpenBSD, but it should be easy to port simple patch for gdb (it
should be in old ports tree) from FreeBSD, which support user threads
listings and switching from inside gdb.  Very useful thing while debuging
of heavy threaded applications (like, jvm) ;-)

On Wed, Sep 08, 2004 at 04:54:31PM -0400, Kurt Miller wrote:
> I'm working on the 1.4 port for OpenBSD and need to
> debug the jdk. gdb becomes mostly useless after an
> execve call in java_md.c
> 
> 777           execve(newexec, argv, newenvp);
> (gdb) 
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> Cannot remove breakpoints because program is no longer writable.
> It might be running in another process.
> Further execution is probably impossible.
> 0x019ef160 in ?? ()
> (gdb) bt
> #0  0x03235160 in ?? ()
> 
> Does anyone have a suggestion on how to keep gdb
> working after the execve?
> 
> Thanks,
> -Kurt
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040909080415.GA49910>