【问题标题】:Unable to break on function name in gdb mingw无法打破 gdb mingw 中的函数名称
【发布时间】:2015-07-01 04:38:00
【问题描述】:

我的程序有多个文件,我用 g++ -g 编译。
当我尝试在 WinMain 上中断时,它说 Function not defined,但是当我显示列表时它就出现在那里。

(gdb) list Winmain.cpp:237
237     // WinMain
238     int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance
pCmdLine, int nCmdShow) {
239
240             //Debuging mode
(gdb)
241
242             // IO thread  ;;;; in charge of writing stuff to files
reak the mem thread
243             // /var/log/simulator.log
244             freopen ("debug.txt", "w", stdout);
245
246             // Strings
247             static TCHAR szWindowClass[] = TEXT("myWnd"); // std::s
indowClass = "myWnd";
248             static TCHAR szTitle[] = _T("Virtual Map");   // std::s
itle = "Virtual map";
249
250             // Windows Structure
(gdb) b Winmain.cpp:WinMain
Function "WinMain" not defined in "Winmain.cpp".
Make breakpoint pending on future shared library load? (y or [n]) n

我可以用 b Winmain.cpp:238 中断,但为什么它不能按名称工作?

windows7上的mingw32
GNU gdb (GDB) 7.6.1

【问题讨论】:

    标签: c++ gdb g++ mingw breakpoints


    【解决方案1】:

    WinMain() 是一个__stdcall 函数; (通过典型的 Microsoft 混淆,WINAPI 限定符传达了该知识)。因此,其公开可见的名称变为WinMain@16();你应该在这个限定名上设置你的gdb断点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多