Xun,
Check with "i thr" how many threads exist in your app at the begining
of.execution of main.
I believe this thread is the first thread of application. No surprise then
that it is started and switched to right before hitting your breakpoint...
WBR,
Pavel.
On 10/26/07, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
>
> Xun,
>
> The problem is caused by self-relauching of the launcher if
> LD_LIBRARY_PATH does not contain needed entries. I believe this
> question is put somewhere in FAQ, at first attempt I found this link
> [1], please see there for details.
>
> [1] http://wiki.apache.org/harmony/Debugging_DRLVM_with_GDB_on_Linux
>
> --
> Alexey
>
> 2007/10/26, Xiao-Feng Li <[EMAIL PROTECTED]>:
> > Xun, in my understranding, the cmain.c has the exact main trance to
> > Harmony: main(). It's the launcher program to start the virtual
> > machine module. Harmony launcher can start user-specified JVM if
> > command line option is provided or the current default one: DRLVM.
> >
> > Just following main() you will find DRLVM will be launched. If you
> > don't care about the launcher, you can set breakpoint in the position
> > you are interested in, such as vm_init1() that initializes DRLVM.
> >
> > Thanks,
> > xiaofeng
> >
> > On 10/26/07, Zhou. Xun <[EMAIL PROTECTED]> wrote:
> > > I was debugging the jre/bin/java of Harmony using gdb,
> > > I made a break point at main();
> > > But when I run this program, gdb told me a new thread was created,
> then it
> > > swith to this thread and stopped at the first line of main();
> > > I was wondering what does this thread came from? and what does it do
> before
> > > main()?
> > > The console is like this
> > >
> > > (gdb) file java
> > > Reading symbols from /home/zhouxun/hdk/jdk/jre/bin/java...done.
> > > Using host libthread_db library
> "/lib/tls/i686/cmov/libthread_db.so.1".
> > > (gdb) b main
> > > Breakpoint 1 at 0x804b62e: file ../shared/cmain.c, line 102.
> > > (gdb) r Hello
> > > Starting program: /home/zhouxun/hdk/jdk/jre/bin/java Hello
> > > [Thread debugging using libthread_db enabled]
> > > [New Thread -1213589808 (LWP 7100)]
> > > [Switching to Thread -1213589808 (LWP 7100)]
> > >
> > > Breakpoint 1, main (argc=2, argv=0xbfc88004, envp=0xbfc88010) at
> > > ../shared/cmain.c:102
> > > 102 int rc = 257;
> > > (gdb)
> > >
> > > --
> > > From: ZhouXun, Software School of Fudan University
> > >
> >
> >
> > --
> > http://xiao-feng.blogspot.com
> >
>
--
Pavel Pervov,
Intel Enterprise Solutions Software Division