[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::debug

Title:DEBUG
Notice:Updated locations for reporting QARs -- see note 834.1
Moderator:LOWFAT::DIETER
Created:Fri Jan 24 1986
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1868
Total number of notes:8200

1832.0. "dbg> examine differs from DEC C assignment" by XDELTA::HOFFMAN (Steve, OpenVMS Engineering) Fri Jan 31 1997 15:11

/*
//  The compiler and the debugger disagree on the contents of
//  some variables...  Quietly.
//
//  The following -- see the comments just above the bottom of
//  the module -- provide an example of this odd behaviour.
//
//  DEC C V5.3-006 on OpenVMS Alpha V7.0.  "Stock" debugger.
*/
#include <chfdef.h>
unsigned int main()
    {
    int RetStat, Trash, i;
    char *Garbage;
    struct chf$signal_array SignalArrayBuf, *SignalArrayPtr;

    /*
    //  fill the signal array with some meaningless data,
    //	just so that we have something we can look at...
    */
    Garbage = (void *) &SignalArrayBuf;
    for ( i = 0; i < sizeof( struct chf$signal_array ); i++ )
        Garbage[i] = i;

    /* set up the pointer to the array */
    SignalArrayPtr = (void *) &SignalArrayBuf;

    Trash = SignalArrayPtr->chf$is_sig_name;

    /*
    //  now perform the debug commands:
    //
    //    dbg> examine/hex Trash
    //    dbg> examine/hex SignalArrayPtr->chf$is_sig_name
    //
    //	the displayed values will be quite different...
    //
    //  I *think* the difference is due to a pre-processor
    //  definition over in chfdef.h, but I'm not sure if
    //  this is a DEC C, debug, or OpenVMS (we own the
    //  header file in question) issue...
    */

    return 1;
    }

T.RTitleUserPersonal
Name
DateLines
1832.1SSPADE::ARSENAULTMon Feb 03 1997 10:185
I tried it out.  It works ok for me.  

I'm using DEC C T5.2-006 on OpenVMS Alpha V7.0 with the V7.0 debugger.

The difference is either the compiler or the include files.
1832.2SSPADE::ARSENAULTMon Feb 03 1997 10:277
I tried it on SAREKS, using DEC C V5.5-002 on OpenVMS Alpha V7.0 and apparently
different include files.  

It works find there too.  


Mail me your image.
1832.3SSPADE::ARSENAULTMon Feb 03 1997 15:2839
You've run into the problem described in note 1799.

The field chf$is_sig_name is a member of a nested union

#ifdef __NEW_STARLET
typedef struct _chfdef1 {
    __union  {
        int chf$is_sig_args;            /*NUMBER OF SIGNAL ARGUMENTS        */
        int chf$l_sig_args;             /*obsolete def                      */
        } chf$r_sig_args_desc;
    __union  {
        int chf$is_sig_name;            /*SIGNAL NAME                       */
        int chf$l_sig_name;             /*obsolete def                      */
        } chf$r_sig_name_desc;
    __union  {
        int chf$is_sig_arg1;            /*FIRST SIGNAL SPECIFIC ARGUMENT    */
        int chf$l_sig_arg1;             /*obsolete def                      */
        } chf$r_sig_arg1_desc;
    } CHFDEF1;
 
#if !defined(__VAXC)
#define chf$is_sig_args chf$r_sig_args_desc.chf$is_sig_args
#define chf$l_sig_args chf$r_sig_args_desc.chf$l_sig_args
#define chf$is_sig_name chf$r_sig_name_desc.chf$is_sig_name
#define chf$l_sig_name chf$r_sig_name_desc.chf$l_sig_name
#define chf$is_sig_arg1 chf$r_sig_arg1_desc.chf$is_sig_arg1
#define chf$l_sig_arg1 chf$r_sig_arg1_desc.chf$l_sig_arg1
#endif		/* #if !defined(__VAXC) */


It turns out that you're using the command

	$ cc/decc/deb/noopt x

and I'm using the command

	$ cc/decc/deb/noopt x /stand=vaxc

which, at least in this case, produces better DSTs.