简体   繁体   中英

gdb jumping due to c++ destructor

I have function like:

      int ConfigConvTensors(LayerType layer_type, bool batch_processing = false) {
        /* Construct the convolution problem */
2=>     std::list<std::string> input_coupled_vars;
        std::list<std::string> weight_coupled_vars;
        std::list<std::string> output_coupled_vars;
        ...
1=>     someOtherFunction();
        return 1;
3=>   }

While debugging using gdb, the cursor moves from 1->2->3 . I think that's due to destructors. But is there a way to tell gdb: "don't care about destructor debugging and just do 1->3 "?

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49951 seems related but I am facing this issue with GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 .

The command line I used:

g++ -o cost-model/src/BASE_base-objects.o -c -O0 -g -std=c++17 $BunchOfLinkerAndIncludeFlags cost-model/src/BASE_base-objects.cpp

Take a look at the generated code, it could provide some insight into what's happening, could be optimization of some sort. https://visualgdb.com/gdbreference/commands/disassemble

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM