当前位置: 技术问答>linux和unix
gdb调试时next命令为什么不走return语句?
来源: 互联网 发布时间:2016-12-06
本文导语: (gdb) n 85 m_pTE->GetTciTMRequired()->TciRootModule(moduleId); (gdb) s Breakpoint 3, CTEImpl::GetTciTMRequired (this=0x805cab8) at /home/hunk/LoongTesting/source/TTE/TEImpl.cpp:183 183 if (m_pTciTMRequired == NULL) (gdb) n 189 } 代码: 183 i...
(gdb) n
85 m_pTE->GetTciTMRequired()->TciRootModule(moduleId);
(gdb) s
Breakpoint 3, CTEImpl::GetTciTMRequired (this=0x805cab8) at /home/hunk/LoongTesting/source/TTE/TEImpl.cpp:183
183 if (m_pTciTMRequired == NULL)
(gdb) n
189 }
代码:
183 if (m_pTciTMRequired == NULL)
184 {
185 m_pTciTMRequired = new CTciTMRequiredImpl();
186 }
187
188 return m_pTciTMRequired;
189 }
190
从183行判断失败之后next一下就直接到189行了,这是为什么?
85 m_pTE->GetTciTMRequired()->TciRootModule(moduleId);
(gdb) s
Breakpoint 3, CTEImpl::GetTciTMRequired (this=0x805cab8) at /home/hunk/LoongTesting/source/TTE/TEImpl.cpp:183
183 if (m_pTciTMRequired == NULL)
(gdb) n
189 }
代码:
183 if (m_pTciTMRequired == NULL)
184 {
185 m_pTciTMRequired = new CTciTMRequiredImpl();
186 }
187
188 return m_pTciTMRequired;
189 }
190
从183行判断失败之后next一下就直接到189行了,这是为什么?
|
代码版本和调试对象版本不一致,重新编译再试。
|
楼上的说法有可能,也有可能编译器优化了