Question: debugging a program run via CLD - VMS

This is a discussion on Question: debugging a program run via CLD - VMS ; I haven't had to do this before and haven't found the magic switch yet. BASIC program designed to run with a CLD file defining two mandatory parameters, no qualifiers. Compiled and linked /debug and running it works as expected. But ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Question: debugging a program run via CLD

  1. Question: debugging a program run via CLD

    I haven't had to do this before and haven't found the magic switch
    yet. BASIC program designed to run with a CLD file defining two
    mandatory parameters, no qualifiers. Compiled and linked /debug and
    running it works as expected. But running it via the CLD (ie

    "$ program parameter1 parameter2"

    doesn't start the debugger.

    I imagine its simple to do this; info is not in the CLD utility
    manual, and I'll delve into DEBUG tomorrow but if anyone knows off the
    top I'd appreciate a pointer.

    Thanks

    Rich

  2. Re: Question: debugging a program run via CLD

    On May 5, 7:18*pm, Rich Jordan wrote:
    > I haven't had to do this before and haven't found the magic switch
    > yet. *BASIC program designed to run with a CLD file defining two
    > mandatory parameters, no qualifiers. *Compiled and linked /debug and
    > running it works as expected. *But running it via the CLD (ie
    >
    > "$ program parameter1 parameter2"
    >
    > doesn't start the debugger.
    >
    > I imagine its simple to do this; info is not in the CLD utility
    > manual, and I'll delve into DEBUG tomorrow but if anyone knows off the
    > top I'd appreciate a pointer.
    >
    > Thanks
    >
    > Rich


    Perhaps you're not running the version of the program built with
    debug? Is the executable's location defined in the CLD or defaulting
    to SYS$SYSTEM? Is the there a logical name defining the executable
    image? Is this image INSTALLed?

  3. Re: Question: debugging a program run via CLD

    In article , Rich Jordan writes:
    > I haven't had to do this before and haven't found the magic switch
    > yet. BASIC program designed to run with a CLD file defining two
    > mandatory parameters, no qualifiers. Compiled and linked /debug and
    > running it works as expected. But running it via the CLD (ie
    >
    > "$ program parameter1 parameter2"
    >
    > doesn't start the debugger.


    If you link the image /debug, the debugger will start. If you
    don't link the image /debug, there's nothing CLD can do about it.


  4. Re: Question: debugging a program run via CLD

    On May 5, 8:04 pm, Jim wrote:
    > On May 5, 7:18 pm, Rich Jordan wrote:
    >
    >
    >
    > > I haven't had to do this before and haven't found the magic switch
    > > yet. BASIC program designed to run with a CLD file defining two
    > > mandatory parameters, no qualifiers. Compiled and linked /debug and
    > > running it works as expected. But running it via the CLD (ie

    >
    > > "$ program parameter1 parameter2"

    >
    > > doesn't start the debugger.

    >
    > > I imagine its simple to do this; info is not in the CLD utility
    > > manual, and I'll delve into DEBUG tomorrow but if anyone knows off the
    > > top I'd appreciate a pointer.

    >
    > > Thanks

    >
    > > Rich

    >
    > Perhaps you're not running the version of the program built with
    > debug? Is the executable's location defined in the CLD or defaulting
    > to SYS$SYSTEM? Is the there a logical name defining the executable
    > image? Is this image INSTALLed?


    Jim
    operator headspacing error. That was the problem; I'm building in
    the test tree but the CLD file is looking for the image in the
    production tree. No wonder I couldn't find anything in a quick and
    dirty google search.

    Thwap (adding to sloping forehead).

    Rich

  5. Re: Question: debugging a program run via CLD

    koehler@eisner.nospam.encompasserve.org (Bob Koehler) wrote in
    news:vjIuN7qa9Jlw@eisner.encompasserve.org:

    > In article
    > ,
    > Rich Jordan writes:
    >> I haven't had to do this before and haven't found the magic switch
    >> yet. BASIC program designed to run with a CLD file defining two
    >> mandatory parameters, no qualifiers. Compiled and linked /debug and
    >> running it works as expected. But running it via the CLD (ie
    >>
    >> "$ program parameter1 parameter2"
    >>
    >> doesn't start the debugger.

    >
    > If you link the image /debug, the debugger will start. If you
    > don't link the image /debug, there's nothing CLD can do about it.


    If it's VAX you can patch the image header!

    I expect that something similar can be done on
    Alpha but I never wanted to figure out the
    God-mode password on any games there, so I'm
    not absolutely sure :-)

    Antonio

  6. Re: Question: debugging a program run via CLD

    On May 7, 3:10 pm, Antonio Carlini wrote:
    > koeh...@eisner.nospam.encompasserve.org (Bob Koehler) wrote innews:vjIuN7qa9Jlw@eisner.encompasserve.org:
    >
    > > In article
    > > ,
    > > Rich Jordan writes:
    > >> I haven't had to do this before and haven't found the magic switch
    > >> yet. BASIC program designed to run with a CLD file defining two
    > >> mandatory parameters, no qualifiers. Compiled and linked /debug and
    > >> running it works as expected. But running it via the CLD (ie

    >
    > >> "$ program parameter1 parameter2"

    >
    > >> doesn't start the debugger.

    >
    > > If you link the image /debug, the debugger will start. If you
    > > don't link the image /debug, there's nothing CLD can do about it.

    >
    > If it's VAX you can patch the image header!
    >
    > I expect that something similar can be done on
    > Alpha but I never wanted to figure out the
    > God-mode password on any games there, so I'm
    > not absolutely sure :-)
    >
    > Antonio


    Antonio,
    no patches, no passwords, no magic secrets, just have the CLD file
    IMAGE parameter aimed at the image file you actually want to run, NOT
    the one in the production directory that hasn't been updated yet.

  7. Re: Question: debugging a program run via CLD

    > I expect that something similar can be done on
    > Alpha but I never wanted to figure out the


    Sure you can.

    Cheers,

    Jur.

    $ if p1 .eqs. "" then inquire p1 "Filename"
    $ on error then goto end
    $ open/read/write file 'p1'
    $ read file data
    $ if f$cvsi(0,32,f$extract(112,4,data)) .ne. %x340 then goto move
    $ if f$cvsi(0,32,f$extract(116,4,data)) .eq. %xffffffff then goto update
    $! No previous entry for debugger in vector, insert one
    $move:
    $ data[8*132,32] = f$cvsi(0,32,f$extract(124,4,data))
    $ data[8*128,32] = f$cvsi(0,32,f$extract(120,4,data))
    $ data[8*124,32] = f$cvsi(0,32,f$extract(116,4,data))
    $ data[8*120,32] = f$cvsi(0,32,f$extract(112,4,data))
    $ data[8*116,32] = %xffffffff
    $ data[8*112,32] = %x340
    $update:
    $ flags = f$cvsi(0,8,f$extract(80,1,data)) ! Get Link flags longword
    $ data[8*80,8] = (flags/2) * 2 + 1 ! Set the LNKDEBUG bit
    $ write/symbol/update file data
    $end:
    $ if f$logical("file") .nes. "" then close file
    $ exit


    Antonio Carlini wrote, On 7-5-2008 22:10:
    > koehler@eisner.nospam.encompasserve.org (Bob Koehler) wrote in
    > news:vjIuN7qa9Jlw@eisner.encompasserve.org:
    >
    >> In article
    >> ,
    >> Rich Jordan writes:
    >>> I haven't had to do this before and haven't found the magic switch
    >>> yet. BASIC program designed to run with a CLD file defining two
    >>> mandatory parameters, no qualifiers. Compiled and linked /debug and
    >>> running it works as expected. But running it via the CLD (ie
    >>>
    >>> "$ program parameter1 parameter2"
    >>>
    >>> doesn't start the debugger.

    >> If you link the image /debug, the debugger will start. If you
    >> don't link the image /debug, there's nothing CLD can do about it.

    >
    > If it's VAX you can patch the image header!
    >
    > I expect that something similar can be done on
    > Alpha but I never wanted to figure out the
    > God-mode password on any games there, so I'm
    > not absolutely sure :-)
    >
    > Antonio


  8. Re: Question: debugging a program run via CLD

    Jur van der Burg wrote:
    > > I expect that something similar can be done on
    > > Alpha but I never wanted to figure out the

    >
    > Sure you can.
    >
    > Cheers,
    >
    > Jur.
    >


    And for I64, there is the SET IMAGE DCL command.

    What we do for debugging compilers (which are started with a DCL
    command) is:

    - link them /DEBUG
    - patch off the debug flag (VAX & Alpha) or use SET IMAGE (I64)
    - we have an undocumented qualifier in our .CLD (/GEMDEBUG) which causes
    the compiler to do a LIB$SIGNAL(SS$_DEBUG) to bring up the debugger.

    This way, we can use the same image with or without debug.

    --
    John Reagan
    OpenVMS Pascal/Macro-32/COBOL Project Leader
    Hewlett-Packard Company

+ Reply to Thread