JDK on HP-UX : Attaching shared libraries so that they are visible to gdb - HP UX

This is a discussion on JDK on HP-UX : Attaching shared libraries so that they are visible to gdb - HP UX ; Hi, I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a PA1.1 binary file. I am debugging using the following steps. invoke gdb with $gdb /java Then i get a message saying "could not load ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: JDK on HP-UX : Attaching shared libraries so that they are visible to gdb

  1. JDK on HP-UX : Attaching shared libraries so that they are visible to gdb

    Hi,
    I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a
    PA1.1 binary file.
    I am debugging using the following steps.
    invoke gdb with $gdb /java

    Then i get a message saying "could not load shared libraries"

    My questions are this:
    1.How do we attach shared libraries to a running process ,so that the
    core file produced
    *WILL* contain shared library information,which will be visible to
    gdb?

    2.Is there any utility/command within gdb to do this(grab the shared
    libraries into the process space while the process is running) - I have
    heard there is ,but don't seem to be able to spot it from gdb help.

    Appreciate any pointers to this information.
    Thanks in advance,
    bnswami


  2. Re: JDK on HP-UX : Attaching shared libraries so that they arevisible to gdb

    bnswami@gmail.com writes:

    > I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a
    > PA1.1 binary file.
    > I am debugging using the following steps.
    > invoke gdb with $gdb /java


    Depending on your version of java, /java
    may be an actual executable (I believe with Java 1.4 and above),
    or a shell script.

    In the latter case, actual (native) java binary is elsewhere,
    e.g. /opt/java1.3/bin/PA_RISC/native_threads/java and you must give
    gdb *that* path; not the path to the shell wrapper.

    > My questions are this:


    Both of your questions are answered with "this already supposed to
    happen automatically" (provided you invoked gdb correctly).

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.

  3. Re: JDK on HP-UX : Attaching shared libraries so that they are visible to gdb

    bnswami@gmail.com writes:

    > Hi,
    > I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a
    > PA1.1 binary file.
    > I am debugging using the following steps.
    > invoke gdb with $gdb /java
    >
    > Then i get a message saying "could not load shared libraries"
    >


    are those shared libraries actually present in the locations that you see
    from the "info sharedlibraries" listing ? unless they are in the same path
    or in some path specified through GDB_SHLIB_PATH, gdb cannot load them.

    > My questions are this:
    > 1.How do we attach shared libraries to a running process ,so that the
    > core file produced
    > *WILL* contain shared library information,which will be visible to
    > gdb?
    >


    if you see any thing at all through the "info sharedlibraries" command, you
    dont have to do anything, shared libraries were already loaded by the process
    at the time it terminated.

    if you dont see any shared library list, the process has probably terminated
    inside the dynamic loader, even before loading any shared library. gdb cannot
    help you here at all. you'll have to approach hp support.

    > 2.Is there any utility/command within gdb to do this(grab the shared
    > libraries into the process space while the process is running) - I have
    > heard there is ,but don't seem to be able to spot it from gdb help.
    >
    > Appreciate any pointers to this information.
    > Thanks in advance,
    > bnswami
    >


    --
    please dont reply by email

  4. Re: JDK on HP-UX : Attaching shared libraries so that they arevisibleto gdb

    Paul Pluzhnikov wrote:
    > bnswami@gmail.com writes:
    >
    >> I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a
    >> PA1.1 binary file.
    >> I am debugging using the following steps.
    >> invoke gdb with $gdb /java

    >
    > Depending on your version of java, /java
    > may be an actual executable (I believe with Java 1.4 and above),
    > or a shell script.
    >
    > In the latter case, actual (native) java binary is elsewhere,
    > e.g. /opt/java1.3/bin/PA_RISC/native_threads/java and you must give
    > gdb *that* path; not the path to the shell wrapper.


    This can even be the case if 'java' is a binary. This executable
    /opt/java/bin/java is mostly there to select which "real"
    java binary has to be launched, based on the platform and arguments
    (PA/Itanium, 32/64 bit, q3/q4, etc.)

    It is also my guess that the reported issue comes from pointing gdb
    to the wrong binary.

    If problems persist, please report the issue to the mailing list
    hpux-devtools@cxx.cup.hp.com .

    Eric

  5. Re: JDK on HP-UX : Attaching shared libraries so that they are visible to gdb

    Many thanks Eric and Ranganath for all your inputs.
    Looks like this core has got insufficient information.
    or was not generated properly.
    This is the process,I imagine,to debug this..
    start java and invoke the application ...

    invoke gdb and attach the java vm process (let pid be x)

    use some command to attach complete information (including shared libs)
    (I don't know which command - * need answer for this *)

    generate core on the application using a specific kill command (kill
    -11 ???- don't know for sure again)

    Please point out where I am going wrong....This is what I get.Thanks!!

    Core was generated by `java'.
    Program terminated with signal 6, Aborted.
    #0 0xc0214128 in ()
    (gdb) info sharedlibrary
    No shared libraries loaded at this time.
    (gdb)

    My objective is to generate a debuggable core with all the required
    information that I can
    put in to be debugged with a HP's java VM at my end.

    thanks
    bnswami

    ranganath ramachandra wrote:

    > bnswami@gmail.com writes:
    >
    > > Hi,
    > > I'm trying to debug a java core on HP-UX 11iv2 (PA-RISC) .The core is a
    > > PA1.1 binary file.
    > > I am debugging using the following steps.
    > > invoke gdb with $gdb /java
    > >
    > > Then i get a message saying "could not load shared libraries"
    > >

    >
    > are those shared libraries actually present in the locations that you see
    > from the "info sharedlibraries" listing ? unless they are in the same path
    > or in some path specified through GDB_SHLIB_PATH, gdb cannot load them.
    >
    > > My questions are this:
    > > 1.How do we attach shared libraries to a running process ,so that the
    > > core file produced
    > > *WILL* contain shared library information,which will be visible to
    > > gdb?
    > >

    >
    > if you see any thing at all through the "info sharedlibraries" command, you
    > dont have to do anything, shared libraries were already loaded by the process
    > at the time it terminated.
    >
    > if you dont see any shared library list, the process has probably terminated
    > inside the dynamic loader, even before loading any shared library. gdb cannot
    > help you here at all. you'll have to approach hp support.
    >
    > > 2.Is there any utility/command within gdb to do this(grab the shared
    > > libraries into the process space while the process is running) - I have
    > > heard there is ,but don't seem to be able to spot it from gdb help.
    > >
    > > Appreciate any pointers to this information.
    > > Thanks in advance,
    > > bnswami
    > >

    >
    > --
    > please dont reply by email



  6. Re: JDK on HP-UX : Attaching shared libraries so that they are visible to gdb

    bnswami@gmail.com writes:

    > Many thanks Eric and Ranganath for all your inputs.
    > Looks like this core has got insufficient information.
    > or was not generated properly.
    > This is the process,I imagine,to debug this..
    > start java and invoke the application ...


    as eric pointed out, you should first confirm that you are
    debugging with the correct executable.

    run 'file core' and see what it says. typically it would
    say something like "core from 'java'". then you need to
    try debugging with all the 'java' executables under your
    java installation directories until you succeed. you can
    limit your search based on whether you are running PA32
    (which i guess you are).

+ Reply to Thread