KHacker
KHacker

Reputation: 31

windbg source code debug ,can not see local variable in locals window

I am using windbg to process a remote debug, everything is ok, i can use f10 or f11 to step debug. My debug eviroment is win7,language is c++.
there's one problem ,i can not see the local varialbe in function , it shows as the following picture.

why is this situation happened? in my opinion , if i can see all registers of the process , i must can see the local variables of bRet.

can some one help me? thanks a lot.

Here is the code

bool CNBAGFxFont::Init() 
{ 
    bool bret = true;
    m_pFontlib = *new GFxFontLib(); 
    if (m_pFontlib) 
    { 
        bret = m_pFontlib->Init(); 
    }
    if (!bret) 
    {
          m_pFontlib = NULL;
          m_pGFxLoader->SetFontProvider(NULL); 
          return bret; 
    } 
    //m_pFontMC = *m_pGFxLoader->CreateMovie("gfxfontlib.swf");
    //m_pFontlib->AddFontsFrom(m_pFontMC, true)
  }

here is the screen shot when debuging

Upvotes: 2

Views: 1036

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59564

The program was compiled with optimization.

From OP's comment:

If I disabled the optimization, WinDbg works and I can see the local variables in the window

Upvotes: 2

Related Questions