我有一个C++应用程序,有以下主要内容:CPP:
1: #include <stdio.h>
2: #include "HeatMap.h"
3: #include <iostream>
4:
5: int main (int argc, char * const argv[])
6: {
7: HeatMap heatMap();
8: printf("message");
9: return 0;
10: }
所有的编译都没有错误,我正在使用gdb(
GNU GDB 6.3.50-20050815(苹果版GDB-1346)(星期五9月18日20:40:51 UTC 2009)
,并用gcc编译了应用程序。(
GCC 4.2.1版(苹果公司5646版)(DOT 1)
)使用命令“-c-g”。
当我将断点添加到第7、8和9行,并运行gdb时,我得到以下内容…
(gdb) break main.cpp:7
Breakpoint 1 at 0x10000177f: file src/main.cpp, line 8.
(gdb) break main.cpp:8
Note: breakpoint 1 also set at pc 0x10000177f.
Breakpoint 2 at 0x10000177f: file src/main.cpp, line 8.
(gdb) break main.cpp:9
Breakpoint 3 at 0x100001790: file src/main.cpp, line 9.
(gdb) run
Starting program: /DevProjects/DataManager/build/DataManager
Reading symbols for shared libraries ++. done
Breakpoint 1, main (argc=1, argv=0x7fff5fbff960) at src/main.cpp:8
8 printf("message");
(gdb)
那么,为什么,有人知道,为什么我的应用程序没有在对象创建的断点上中断,而是在printf行中断?
Drew J. Sonne。
编辑
答:
GDB skips over my code!