c++ - Windbg源代码调试,在本地窗口中看不到本地变量

标签 c++ debugging local windbg

我正在使用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)
  }

here is the screen shot when debuging

最佳答案

程序经过优化编译。

摘自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/

相关文章:

c++ - SQLSTATE 24000 - 无效游标状态 ODBC VS c++

python - 如何调试基于 PyQt4 的应用程序?

linux - gcc 本地在主文件夹中本地安装 gcc 7.1

c++ - 使用模运算符 C++

c# - 在 C# 中调用 C++ DLL 库中的导出函数

linux - 如何在不降低设备速度的情况下调试 gstreamer

C++:在函数中使用调用者的局部变量是否安全?

php - MAMP PHP fatal error : Allowed memory size exhausted

c++ - 我可以让三元运算符将我的类视为 bool 类吗?

ios - ionic cordova run ios - 导出失败,代码为 65