This is the mail archive of the gdb-prs@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]

[Bug c++/17124] New: GDB incorrectly says that std::string::npos is of type string


https://sourceware.org/bugzilla/show_bug.cgi?id=17124

            Bug ID: 17124
           Summary: GDB incorrectly says that std::string::npos is of type
                    string
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: dodji at seketeli dot org

Created attachment 7683
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7683&action=edit
Debug info of the test program

with gdb version "GNU gdb (GDB) Fedora 7.7.90.20140627-8.fc21" and gcc version
"gcc (GCC) 4.9.0 20140604 (Red Hat 4.9.0-8)" (these are from Rawhide), please
consider this little test program in a file named test.cc:

--------------->8<-----------------------
#include <string>

int
main()
{
  std::string s = "hah";
  return 0;
}
--------------->8<-----------------------

Then compile by typing:
g++ -g -o test test.cc

Then run gdb on it by up to the line containing the "return 0;" statement by
doing:

gdb test
break main
run
next

Then inspect the type of std::string::npos by doing:

ptype std::string::npos

This is what I am getting:

(gdb) ptype std::string::npos
type = std::string
(gdb)

Find attached the debug info of the program "test", that I got by running
eu-readelf --debug-dump=info test > test.debug

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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