Bug 8880

Summary: printing evaluation of string comparse causes gdb to seg fault
Product: gdb Reporter: grantschoep
Component: c++Assignee: Sami Wagiaalla <swagiaal>
Status: ASSIGNED ---    
Severity: normal CC: gdb-prs, swagiaal, tromey
Priority: P3    
Version: 6.2   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 16106    

Description grantschoep 2004-09-12 18:48:00 UTC
[Converted from Gnats 1775]

When printing an evaluation of a string with another, gdb core dumps.

To simply reproduce, basically just make an main, with one string definition/assinment in it. I can print the string just fine. But if I did something like "print mystring == "Yes" it core dumps.

   std::string mystring = "Yes"
And I type: print mystring == "Yes"

gdb segfaults.

Release:
6.2.1

Environment:
Redhat Enterprise 3.0
g++ 3.2.3

How-To-Repeat:
Create a main as follows

int main() {
   string myString("Yes");
   return 0;
}

In the above code, if you execute it through the gdb, if you do:
print myString == "Yes"
before it does the return, gdb core dumps.
Comment 1 Tom Tromey 2010-01-22 21:00:26 UTC
This no longer crashes, now I get:

(gdb) p x == "Yes"
Structure has no component named operator==.