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

c++/1060: g++ -static and STL strings


>Number:         1060
>Category:       c++
>Synopsis:       g++ -static and STL strings
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 14 21:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     pholdaway@technocom-wireless.com
>Release:        gdb 5.2.1 and 5.3 and 5.3.0.90_20030213 and 20030214
>Organization:
>Environment:
SunOS ultra1 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-5_10
>Description:
On Sparc Solaris 8 using compilers 2.95.3 and 3.2.1 and 3.2.2

gdb reports Cannot access memory when printing string values.

This fails for any gdb version from 5.0 including the current build.

>How-To-Repeat:
The contents of the attatched files are

###################### a_bug.cc

#include <string>

std::string value1 = "This is a test" ;

int main ( int argc, char * argv[] )
{
    std::string value2 = "This is another test" ;
    return 0 ;
}

###################### a_bug.gdb
break main
run
print value1
print value2
n
print value1
print value2
quit
y
###################### a_bug.sh
#!/bin/sh

GDB=gdb
GDB=/opt/technocom/SOL_5_8_SPC/pkgs/insight-5.3/bin/gdb
GDB=/var/tmp/src-build/gdb-objdir/gdb/gdb

echo "#################################################################"
g++ -g -o a_bug a_bug.cc
$GDB -n -x a_bug.gdb a_bug

echo "static ##########################################################"
g++ -g -static -o a_bug-static a_bug.cc
$GDB -n -x a_bug.gdb a_bug-static

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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