- 論壇徽章:
- 0
|
I typed "step", but gdb did not step into the specified function.
我輸入了“step”,gdb不會進入函數內部去調試
the code is:
- #include "file.h"
- #include "WordAnalyze.h"
- #include "OperatorPriorAnalyze.h"
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main(int argc, char** argv) {
- unsigned int size;
- char *mem;
- char* line;
- char tc[100];
- file f1;
- OperatorPriorAnalyze operator_analyze;
- WordAnalyze w1;
- size = f1.readfile("./test.txt", &mem );
- w1.setSource(mem);
- w1.setSize(size);
- while( !w1.atEnd() ){
- unsigned int i = w1.getLineSize();
- line = w1.getLine(); //gdb能進入getLine()函數內部
- operator_analyze.setSize(i); //但gdb不會進入getSize()內部
- operator_analyze.setSource(line); //同樣不會進入
- unsigned int k = 0;
- while(k<i){
- tc[k] = line[k];
- k++;
- }
- tc[k] = '\0';
- cout<< tc;
- operator_analyze.restart();
- if(operator_analyze.Judge() == 0 )
- cout<< "Right!" << endl;
- else
- cout<< "Wrong! " << operator_analyze.getError() << endl;
- delete line;
- }
- return 0;
- }
復制代碼 鍵入“step”,好像gdb不會進入 "operator_analyze"類內部的函數,能進入其它的函數。
Can anyone explain to me?
Thanks ! |
|