我正在使用windbg进行远程调试,一切正常,我可以使用f10或f11进行单步调试。我的调试环境是win7,语言是c++。
有一个问题,我看不到函数中的局部变量,如下图所示。
为什么会出现这种情况呢?在我看来,如果我能看到进程的所有寄存器,我一定能看到bRet的局部变量。
有人可以帮助我吗?非常感谢。
这是代码
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)
}
最佳答案
程序经过优化编译。
摘自OP的评论:
If I disabled the optimization, WinDbg works and I can see the local variables in the window
关于c++ - Windbg源代码调试,在本地窗口中看不到本地变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051747/