Let me clarify a bit. main.c looks like this:
#include "testicmo.h"
int main( int nargs, char * argv[] {
foo();
X *xp = calloc( 1, sizeof( X ) );
where testicmo.h looks like this:
#ifndef X_DEFINED
typedef struct _X {
int armi_index ; /* ARM index# - offset in the icmo_vindex_info[] array */
} X ;
#define X_DEFINED
#endif
so according to the definition, I should see armi_index in the debugger.
But I have another C file (call it foo.c and I'll link to the object) that looks like this:
#include "testcmo.h"
void foo() {
X *xp = (X *)calloc( 1, sizeof( X ) );
}
and testcmo.h has
/* Should be defined before include icmo.h : */
#define armi_index armi_index_external
#include "testicmo.h"
/* Should be redefined after include icmo.h : */
#undef armi_index
#define armi_index armi_index_internal
#endif /* CMO_H_INCLUDED */
So when I compile foo.c, the field name is getting redefined but when I compile the main.c, it does not.
How does the debugger know what field name to use for the structure X?
Thanks, Ted