From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7897 invoked by alias); 9 Mar 2009 09:24:28 -0000 Received: (qmail 7887 invoked by uid 22791); 9 Mar 2009 09:24:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,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; Mon, 09 Mar 2009 09:24:22 +0000 Received: by bwz27 with SMTP id 27so1102483bwz.24 for ; Mon, 09 Mar 2009 02:24:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.198.20 with SMTP id a20mr2522021muq.63.1236590659352; Mon, 09 Mar 2009 02:24:19 -0700 (PDT) In-Reply-To: <8ac60eac0903081021j6eef006ckcb2458d27ed60c02@mail.gmail.com> References: <8ac60eac0903081021j6eef006ckcb2458d27ed60c02@mail.gmail.com> Date: Mon, 09 Mar 2009 09:24:00 -0000 Message-ID: Subject: Re: why so From: Uladzislau Rezki To: Paul Pluzhnikov Cc: 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/msg00064.txt.bz2 On Sun, Mar 8, 2009 at 7:21 PM, Paul Pluzhnikov wrote: > On Sun, Mar 8, 2009 at 6:12 AM, Uladzislau Rezki wrote: > >> I am stuck with debugging C++ application that uses STL. >> So, i have a simple code: >> >> #include >> >> static int >> test(std::string s) > > Note that passing strings by value is very inefficient. > You should probably pass 'const string &' instead, and this will > also cure the glitch you are observing. > If i pass "std::string &s', everything will work in my case and i see normal string, this issue happens just in case 'std::string s'. Thanks for your answer. -- Uladzislau Rezki