Bug 8880 - printing evaluation of string comparse causes gdb to seg fault
Summary: printing evaluation of string comparse causes gdb to seg fault
Status: ASSIGNED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.2
: P3 normal
Target Milestone: ---
Assignee: Sami Wagiaalla
URL:
Keywords:
Depends on:
Blocks: 16106
  Show dependency treegraph
 
Reported: 2004-09-12 18:48 UTC by grantschoep
Modified: 2013-10-31 19:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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==.