خرید بک لینک

Hi all!

This is a question regarding the gdb command 'info types', which can tell where a type is defined in source code.

For example, in gdb if I type 'info types mytype' in the following program:

Code:

 //main.cpp
 #include <iostream>
 

 struct mytype
 {
   const static bool value = false;
 };
     
 int
 main()
 {
     //mytype tip;    //if I remove this comment, it works
     std::cout << mytype::value << std::endl;
     retu 0;
 }

gdb does not find any matching in the source for type 'mytype'.

But if I remove comment in line 12, gdb finds the type definition and outputs this:

Code:

 All types matching regular expression "mytype": 
  
 File main.cpp: 
 mytype;

It seems to me that in order to gdb to find where a type is defined, you have to declare a variable of that type.

Is it possible to find where a type is defined in gdb without declaring a variable of that type?

Thanks a lot!

برچسب: نویسنده: استخدام کار تاريخ: جمعه 11 تير 1395 ساعت: 16:12

صفحه بندی