This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

std::string and MI



Hi all.

For the following code

    #include <string>
    
    struct string {};
    
    namespace foo { struct string {}; }
    
    
    int main()
    {
        std::string s;
        foo::string f;
        string t;
    }

I get after issuing a  "-stack-list-locals 2" the response

   ^done,locals=[{name="s",type="string"},{name="f",type="foo::string"},
    {name="t",type="string"}]

Similarily,  "-var-create s * s" followed by "-var-info-type s" produces  

   ^done,type="string"

In both cases the 'std::' namespace is missing from the type.

As the "namespace foo" example above shows, this can't be the general
problem with namespaces, as "foo::string" is reported as I expected.

Does anybody know how to tweak gdb's settings so that it produces the
std:: namespace, too?  [Getting back the "real"  "std::basic_string<char...>"
would be fine for me as well]

Incidentally: Would it be possible to extend the MI commands that output
types to also produce the mangled types? (This could be restricted to the
cases where these actually differs from the unmangled ones, but I really 
don't mind duplicated output)

Regards,
Andre'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]