When you type the object name of an object that is located at a fixed address in the Watch window in the Visual Studio Debugger, you receive a message that resembles the following:
identifier object_name is undefined
For example, this issue can be reproduced by compiling and running the following code on an x86-based system:
Relocate.asm .586 .MODEL FLAT PUBLIC _fixed_struct _fixed_struct = 04000000h END Main.cpp #include <Windows.h> #define SHM_ADDRESS 0x04000000 #define SHM_SIZE_BYTES 1024 #define SHM_NAME L"TEST_NAME" extern "C" { extern struct fixed_struct_type { int a; int b; int c; } fixed_struct; } void AttachShm() { HANDLE mapfile = CreateFileMapping( INVALID_HANDLE_VALUE, // current file handle (use System page file) NULL, // default security (not inheritable) PAGE_READWRITE, // read/write permission 0, // size of File (high-order doubleword) SHM_SIZE_BYTES, // size of File (low-order doubleword) SHM_NAME); // name of mapping object MapViewOfFileEx( mapfile, // handle to mapping object FILE_MAP_ALL_ACCESS, // read/write permission 0, // address offset (high-order doubleword) 0, // address offset (low-order doubleword) SHM_SIZE_BYTES, // size of common block (LPVOID)SHM_ADDRESS); // suggested starting address } int main(int argc, char* argv[]) { AttachShm(); fixed_struct.a = 30; // Put a breakpoint on the next line, view fixed_struct.a in watch window return 0; }