From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11103 invoked by alias); 16 Dec 2006 09:58:02 -0000 Received: (qmail 11091 invoked by uid 22791); 16 Dec 2006 09:58:00 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.224) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 16 Dec 2006 09:57:55 +0000 Received: by wx-out-0506.google.com with SMTP id h26so1112299wxd for ; Sat, 16 Dec 2006 01:57:53 -0800 (PST) Received: by 10.70.9.4 with SMTP id 4mr2948095wxi.1166263073528; Sat, 16 Dec 2006 01:57:53 -0800 (PST) Received: by 10.70.59.8 with HTTP; Sat, 16 Dec 2006 01:57:53 -0800 (PST) Message-ID: <6e2feee40612160157x2c893c26m91b1a6e46f851a88@mail.gmail.com> Date: Sat, 16 Dec 2006 09:58:00 -0000 From: "Kiran Pradeep" To: gdb@sourceware.org Subject: Re: editing source files in gdb In-Reply-To: <17795.43881.874312.195558@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6e2feee40612160009v6cc314efk86888be0c2413d37@mail.gmail.com> <17795.43881.874312.195558@kahikatea.snap.net.nz> 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: 2006-12/txt/msg00147.txt.bz2 On 12/16/06, Nick Roberts wrote: > > The problem is that when i give 'edit' from inside gdb to edit the > > current source file, gdb is opening a new file in the editor under a > > different name. The funny thing is that the new file has the name of > > the absolute path of the file with a slash between directory and file > > missing. For eg: if file 'test.cpp' is in directory '/home/kiran' then > > gdb is opening the file as /home/kirantest.cpp. Could any one help me > > in this ? > > You don't say what version of GDB this is. I see what you do for 6.3 but > not GDB in CVS (6.6.50.20061210-cvs). Perhaps updating to a newer GDB will > solve your problem. > > > This feature (coupled with make from inside gdb) would be useful to me > > as dont have to exit from gdb for editing the source file if i find a > > mistake in my code. > > As a side note, the mode that I'm writing for Emacs tries to achieve this too. > > -- > Nick http://www.inet.net.nz/~nickrob > Thanks a lot. That helped an i can now edit the file from vi from inside gdb itself. But is there any thing is gdb that prevents 'vi' from loading my favourite "vimrc" (vi startup customization file). I have one more doubt. I have defined a string like typedef std::basic_string< unsigned short, unsigned_short_traits > utf16string; utf16string myString; //dont worry about the traits Is there any thing in gdb that will help me view the string as i view a ordinary std::string. As of now i use [x/100s myString.c_str()] or [p /c *myString.c_str()@100] to examine the data in the string. Could i use any thing better to view it like an ordinary string ?