HP OpenVMS Systems

ask the wizard
Content starts here

C, externals, and debugging?

» close window

The Question is:

How do you examine externally defined structures in the debugger. I have a C
 program that has an externally declared structure. When I examine a variable
 in the structure it's always 0 though in the program it is set to -1 and a
 printf statement in the pr
ogram prints -1.
Is there some sort of switch I need or am I linking it incorrectly?

The Answer is :

  When posing questions, you will want to provide a short example of
  the particular problem -- this so the OpenVMS Wizard can be assured
  of answering the particular question.
  This could appear to be a problem in the debugger, or a problem in
  the particular debugger syntax used, or a compiler-related problem,
  or a problem in the particular syntax used for the external variable
  declaration.  (Compaq C (and DEC C) have specific requirements around
  the proper declaration of the external model to be used -- please see
  discussions of /EXTERN_MODEL in the OpenVMS FAQ and in the Compaq C
  (or DEC C) documentation as a starting point.)
  Obvious approaches for examining the contents of variables in the
  structure include the use of EXAMINE/TYPE, as well as declaring the
  particular structure as part of the declaration, as well as casting
  the function to a local (pointer) variable for examination.

answer written or last revised on ( 3-APR-2000 )

» close window