Program Counter - VMS

This is a discussion on Program Counter - VMS ; Hello, just a courisity :-) given the program counter there is a way to know wich routine/code is executing a process? OpenVMS V7.1-1H2 I get the PC from SHOW PROC/cont/id=xxxx thank you ciao! GIo...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Program Counter

  1. Program Counter

    Hello,

    just a courisity :-)
    given the program counter there is a way to know wich routine/code is
    executing a process?

    OpenVMS V7.1-1H2

    I get the PC from SHOW PROC/cont/id=xxxx

    thank you
    ciao!
    GIo


  2. Re: Program Counter

    In article <1188930882.090734.310090@50g2000hsm.googlegroups.c om>, giotac writes:
    >
    >
    >Hello,
    >
    >just a courisity :-)
    >given the program counter there is a way to know wich routine/code is
    >executing a process?
    >
    >OpenVMS V7.1-1H2
    >
    >I get the PC from SHOW PROC/cont/id=xxxx


    Yes.

    If you have the source listings and linker maps.

    I have some callable code which exploits the traceback mechanism that will
    do this if your code has been compiled (preferably with debug) and linked
    /TRACEBACK.

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    "Well my son, life is like a beanstalk, isn't it?"

    http://tmesis.com/drat.html

  3. Re: Program Counter

    giotac wrote:
    > Hello,
    >
    > just a courisity :-)
    > given the program counter there is a way to know wich routine/code is
    > executing a process?
    >
    > OpenVMS V7.1-1H2
    >
    > I get the PC from SHOW PROC/cont/id=xxxx
    >


    A worked example of following a traceback dump is available at
    http://www.eight-cubed.com/articles/traceback.html

    Although this is aimed at reading a traceback, the principle of reading
    the linker map and listing files is exactly the same for a PC captured
    from SHOW PROCESS/CONT

    HTH,
    Jim.
    --
    www.eight-cubed.com

  4. Re: Program Counter

    In article <1188930882.090734.310090@50g2000hsm.googlegroups.c om>, giotac writes:
    > Hello,
    >
    > just a courisity :-)
    > given the program counter there is a way to know wich routine/code is
    > executing a process?


    Sure is. A little thing called the LINK map will tell you. You can
    take the offset into the routine and look that up in a compiler
    listing showing machine code and find the line that's executing and
    the instruction in the line.


  5. Re: Program Counter

    hello guys

    too easy! :-)

    I do not have the the linker map nor listing of any kid... unless I
    become HP employee I guess ;-)
    the pc start with 800.... isn't referred to OS's code/area/space?

    To me is engouth to know the name of the last routine called.

    Doing some googleizing I saw ANA/SYS... then EXAMINE , it's
    wrong?

    ciao!
    GIo


    On 4 Set, 22:30, Jim wrote:
    > giotac wrote:
    > > Hello,

    >
    > > just a courisity :-)
    > > given the program counter there is a way to know wich routine/code is
    > > executing a process?

    >
    > > OpenVMS V7.1-1H2

    >
    > > I get the PC from SHOW PROC/cont/id=xxxx

    >
    > A worked example of following a traceback dump is available athttp://www.eight-cubed.com/articles/traceback.html
    >
    > Although this is aimed at reading a traceback, the principle of reading
    > the linker map and listing files is exactly the same for a PC captured
    > from SHOW PROCESS/CONT
    >
    > HTH,
    > Jim.
    > --www.eight-cubed.com




  6. Re: Program Counter

    giotac wrote:
    > Hello,
    >
    > just a courisity :-)
    > given the program counter there is a way to know wich routine/code is
    > executing a process?
    >
    > OpenVMS V7.1-1H2
    >
    > I get the PC from SHOW PROC/cont/id=xxxx
    >
    > thank you
    > ciao!
    > GIo
    >


    $ LINK /MAP
    will generate linker map that shows the memory occupied by each PSECT.


  7. Re: Program Counter

    In article <1188940208.235767.108780@k79g2000hse.googlegroups. com>, giotac writes:
    >
    >
    >hello guys
    >
    >too easy! :-)
    >
    >I do not have the the linker map nor listing of any kid... unless I
    >become HP employee I guess ;-)
    >the pc start with 800.... isn't referred to OS's code/area/space?
    >
    >To me is engouth to know the name of the last routine called.
    >
    >Doing some googleizing I saw ANA/SYS... then EXAMINE , it's
    >wrong?


    If you know how to properly use SDA, you don't need the listings to
    figure out where your particular PC is executing.

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    "Well my son, life is like a beanstalk, isn't it?"

    http://tmesis.com/drat.html

  8. Re: Program Counter

    giotac wrote:
    >
    > hello guys
    >
    > too easy! :-)
    >
    > I do not have the the linker map nor listing of any kid... unless I
    > become HP employee I guess ;-)
    > the pc start with 800.... isn't referred to OS's code/area/space?
    >
    > To me is engouth to know the name of the last routine called.


    Perhaps you should explain what you're doing, how it's failing and whether this
    is a new situation or has been an issue for while.

    What HP software are you dealing with?

    What are you trying to do with it?

    What kinds of failures are you seeing?

    Is it easy to duplicate the failure?

    Can you attempt this on a newer VMS to see if it's fixed in a later release of
    VMS, the RTLs, etc.

    --
    David J Dachtera
    dba DJE Systems
    http://www.djesys.com/

    Unofficial OpenVMS Marketing Home Page
    http://www.djesys.com/vms/market/

    Unofficial Affordable OpenVMS Home Page:
    http://www.djesys.com/vms/soho/

    Unofficial OpenVMS-IA32 Home Page:
    http://www.djesys.com/vms/ia32/

    Unofficial OpenVMS Hobbyist Support Page:
    http://www.djesys.com/vms/support/

  9. Re: Program Counter

    In article <1188940208.235767.108780@k79g2000hse.googlegroups. com>, giotac writes:
    > hello guys
    >
    > too easy! :-)
    >
    > I do not have the the linker map nor listing of any kid... unless I
    > become HP employee I guess ;-)
    > the pc start with 800.... isn't referred to OS's code/area/space?
    >
    > To me is engouth to know the name of the last routine called.
    >
    > Doing some googleizing I saw ANA/SYS... then EXAMINE , it's
    > wrong?
    >
    > ciao!
    > GIo


    If you really need them the VMS source listings are not terribly
    expensive, and they include maps.

    What you probably need to to is track down what routine called the
    system routine. Generally by watching the PC you can see what that
    is. If the process is in a wait state then you're likely in $SYNC
    or $WAITFR or one of the other event flag routines, but look at the
    process state to give you a better hint.

    Knowing that your in $SYNC, $WAITFR, $HIBER, ... wouldn't be nearly
    as usefull as knowing how you got there. In the past I have been
    able to figure this out using "show process/continuous" and watching
    for P0 space addresses just before going into system space.


  10. Re: Program Counter

    On Wed, 05 Sep 2007 05:36:34 -0700, Bob Koehler
    wrote:

    > If you really need them the VMS source listings are not terribly
    > expensive, and they include maps.


    You also need to be certain that executables and listings correspond,
    which isn't always
    the case, as we have discovered.

    --
    PL/I for OpenVMS
    www.kednos.com

+ Reply to Thread