gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:14:54 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com