You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Geir Magnusson Jr." <ge...@pobox.com> on 2006/11/13 10:10:22 UTC

[drlvm] drlvm and gdb and shared libraries

I have a dumb question - I was playing today with a toy launcher for 
DRLVM working out some embedding issues, and for the life of me, I 
couldn't get dgb to ever let me break on anything in a shared library.

I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But 
even build in debug, I couldn't ever specify a breakpoint in a  shared 
lib even after it was loaded.

has anyone run across this?

geir

Re: [drlvm] drlvm and gdb and shared libraries

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
If that was incorrectly set, they wouldn't load.. that's not the problem

Alexei Fedotov wrote:
> Let me point out the second section of Egor's manual - LD_LIBRARY_PATH
> is the only thing which should be additionally configured.
> 
> On 13 Nov 2006 15:46:44 +0600, Egor Pasko <eg...@gmail.com> wrote:
>> On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
>> > I have a dumb question - I was playing today with a toy launcher for
>> > DRLVM working out some embedding issues, and for the life of me, I
>> > couldn't get dgb to ever let me break on anything in a shared library.
>> >
>> > I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
>> > even build in debug, I couldn't ever specify a breakpoint in a  shared
>> > lib even after it was loaded.
>> >
>> > has anyone run across this?
>>
>> you cannot enable a breakpoint until the library is loaded. Just wait
>> until it is loaded. I wrote [1] to help with that. Hope it helps :)
>>
>> [1]
>> http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux 
>>
>>
>> -- 
>> Egor Pasko
>>
>>
> 
> 


Re: [drlvm] drlvm and gdb and shared libraries

Posted by Alexei Fedotov <al...@gmail.com>.
Let me point out the second section of Egor's manual - LD_LIBRARY_PATH
is the only thing which should be additionally configured.

On 13 Nov 2006 15:46:44 +0600, Egor Pasko <eg...@gmail.com> wrote:
> On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
> > I have a dumb question - I was playing today with a toy launcher for
> > DRLVM working out some embedding issues, and for the life of me, I
> > couldn't get dgb to ever let me break on anything in a shared library.
> >
> > I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
> > even build in debug, I couldn't ever specify a breakpoint in a  shared
> > lib even after it was loaded.
> >
> > has anyone run across this?
>
> you cannot enable a breakpoint until the library is loaded. Just wait
> until it is loaded. I wrote [1] to help with that. Hope it helps :)
>
> [1]
> http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux
>
> --
> Egor Pasko
>
>


-- 
Thank you,
Alexei

Re: [drlvm] drlvm and gdb and shared libraries

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x221 day of Apache Harmony Egor Pasko wrote:
> On the 0x220 day of Apache Harmony Ivan Volosyuk wrote:
> > Well, I was able to use breakpoints for the libraries still not loaded.
> > 
> > Just type: 'br <func>' and it will inform you that the library is not
> > loaded yet and will suggest to "make it pending on future shared
> > library load". When the library will be loaded the breakpoint will be
> > automatically enabled.
> 
> hm, that misteriously did not work for me one day, so I invented a lot
> of garbage, now it works... You can even type 'br <file>:<line>'.
> 
> Ivan, maybe, you know how to make it with cpp. For example:
> (gdb) br 'Jitrino::JavaByteCodeTranslator::ldc'
> Can't find member of namespace, class, struct, or union named "Jitrino::JavaByteCodeTranslator::ldc"
> Hint: try 'Jitrino::JavaByteCodeTranslator::ldc'<TAB> or 'Jitrino::JavaByteCodeTranslator::ldc'<ESC-?>
> (Note leading single quote.)

OK, I found the recipe (Thanks 2 Evgeny Brevnov helping in
private). Need to type method name with signature. If the library is
loaded, pressing <TAB> helps (but need to remove the last quote before
pressing), but in case the library is not loaded, you will have to
type the full signature. (nm, c++filt and grep are friends:)
 
> > --
> > Ivan
> > 
> > On 13 Nov 2006 15:46:44 +0600, Egor Pasko <eg...@gmail.com> wrote:
> > > On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
> > > > I have a dumb question - I was playing today with a toy launcher for
> > > > DRLVM working out some embedding issues, and for the life of me, I
> > > > couldn't get dgb to ever let me break on anything in a shared library.
> > > >
> > > > I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
> > > > even build in debug, I couldn't ever specify a breakpoint in a  shared
> > > > lib even after it was loaded.
> > > >
> > > > has anyone run across this?
> > >
> > > you cannot enable a breakpoint until the library is loaded. Just wait
> > > until it is loaded. I wrote [1] to help with that. Hope it helps :)
> > >
> > > [1]
> > > http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux
> > >
> > > --
> > > Egor Pasko
> > >
> > >
> > 
> > 
> > -- 
> > Ivan
> > Intel Enterprise Solutions Software Division
> > 
> 
> -- 
> Egor Pasko
> 
> 

-- 
Egor Pasko


Re: [drlvm] drlvm and gdb and shared libraries

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x220 day of Apache Harmony Ivan Volosyuk wrote:
> Well, I was able to use breakpoints for the libraries still not loaded.
> 
> Just type: 'br <func>' and it will inform you that the library is not
> loaded yet and will suggest to "make it pending on future shared
> library load". When the library will be loaded the breakpoint will be
> automatically enabled.

hm, that misteriously did not work for me one day, so I invented a lot
of garbage, now it works... You can even type 'br <file>:<line>'.

Ivan, maybe, you know how to make it with cpp. For example:
(gdb) br 'Jitrino::JavaByteCodeTranslator::ldc'
Can't find member of namespace, class, struct, or union named "Jitrino::JavaByteCodeTranslator::ldc"
Hint: try 'Jitrino::JavaByteCodeTranslator::ldc'<TAB> or 'Jitrino::JavaByteCodeTranslator::ldc'<ESC-?>
(Note leading single quote.)


> --
> Ivan
> 
> On 13 Nov 2006 15:46:44 +0600, Egor Pasko <eg...@gmail.com> wrote:
> > On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
> > > I have a dumb question - I was playing today with a toy launcher for
> > > DRLVM working out some embedding issues, and for the life of me, I
> > > couldn't get dgb to ever let me break on anything in a shared library.
> > >
> > > I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
> > > even build in debug, I couldn't ever specify a breakpoint in a  shared
> > > lib even after it was loaded.
> > >
> > > has anyone run across this?
> >
> > you cannot enable a breakpoint until the library is loaded. Just wait
> > until it is loaded. I wrote [1] to help with that. Hope it helps :)
> >
> > [1]
> > http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux
> >
> > --
> > Egor Pasko
> >
> >
> 
> 
> -- 
> Ivan
> Intel Enterprise Solutions Software Division
> 

-- 
Egor Pasko


Re: [drlvm] drlvm and gdb and shared libraries

Posted by Ivan Volosyuk <iv...@gmail.com>.
Well, I was able to use breakpoints for the libraries still not loaded.

Just type: 'br <func>' and it will inform you that the library is not
loaded yet and will suggest to "make it pending on future shared
library load". When the library will be loaded the breakpoint will be
automatically enabled.
--
Ivan

On 13 Nov 2006 15:46:44 +0600, Egor Pasko <eg...@gmail.com> wrote:
> On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
> > I have a dumb question - I was playing today with a toy launcher for
> > DRLVM working out some embedding issues, and for the life of me, I
> > couldn't get dgb to ever let me break on anything in a shared library.
> >
> > I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
> > even build in debug, I couldn't ever specify a breakpoint in a  shared
> > lib even after it was loaded.
> >
> > has anyone run across this?
>
> you cannot enable a breakpoint until the library is loaded. Just wait
> until it is loaded. I wrote [1] to help with that. Hope it helps :)
>
> [1]
> http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux
>
> --
> Egor Pasko
>
>


-- 
Ivan
Intel Enterprise Solutions Software Division

Re: [drlvm] drlvm and gdb and shared libraries

Posted by Egor Pasko <eg...@gmail.com>.
On the 0x220 day of Apache Harmony Geir Magnusson, Jr. wrote:
> I have a dumb question - I was playing today with a toy launcher for
> DRLVM working out some embedding issues, and for the life of me, I
> couldn't get dgb to ever let me break on anything in a shared library.
> 
> I loaded the vm via dlopen() an dlsym(), and the code runs fine.  But
> even build in debug, I couldn't ever specify a breakpoint in a  shared
> lib even after it was loaded.
> 
> has anyone run across this?

you cannot enable a breakpoint until the library is loaded. Just wait
until it is loaded. I wrote [1] to help with that. Hope it helps :)

[1]
http://wiki.apache.org/harmony/Debugging%20DRLVM%20with%20GDB%20on%20Linux

-- 
Egor Pasko