From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31640 invoked by alias); 8 Mar 2009 13:12:44 -0000 Received: (qmail 31631 invoked by uid 22791); 8 Mar 2009 13:12:43 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f179.google.com (HELO mail-bw0-f179.google.com) (209.85.218.179) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Mar 2009 13:12:38 +0000 Received: by bwz27 with SMTP id 27so901778bwz.24 for ; Sun, 08 Mar 2009 06:12:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.221.5 with SMTP id y5mr2085174muq.66.1236517955158; Sun, 08 Mar 2009 06:12:35 -0700 (PDT) Date: Sun, 08 Mar 2009 13:12:00 -0000 Message-ID: Subject: why so From: Uladzislau Rezki To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00060.txt.bz2 Hello gdb list, I am stuck with debugging C++ application that uses STL. So, i have a simple code: #include static int test(std::string s) { std::cout << s << std::endl; return 0; } int main(int argc, char **argv) { std::string a = "hello"; test(a); return 0; } while debugging *test* function, i try to print s variable and i see following stauff, thought i expect to see "hello": (gdb) print s.c_str() $2 = 0xbf9486d8 "\024pR\b" gdb version is: demon >>> gdb -v GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". demon >>> thanks in advance. -- Uladzislau Rezki