From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8336 invoked by alias); 28 Oct 2009 05:07:41 -0000 Received: (qmail 8325 invoked by uid 22791); 28 Oct 2009 05:07:40 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ey-out-1920.google.com (HELO ey-out-1920.google.com) (74.125.78.144) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Oct 2009 05:07:35 +0000 Received: by ey-out-1920.google.com with SMTP id 5so123870eyb.42 for ; Tue, 27 Oct 2009 22:07:33 -0700 (PDT) Received: by 10.211.160.14 with SMTP id m14mr57976ebo.30.1256706453110; Tue, 27 Oct 2009 22:07:33 -0700 (PDT) Received: from ?192.168.10.10? ([93.174.86.85]) by mx.google.com with ESMTPS id 28sm57012eye.39.2009.10.27.22.07.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 22:07:32 -0700 (PDT) Message-ID: <4AE7D19A.70600@googlemail.com> Date: Wed, 28 Oct 2009 06:12:00 -0000 From: James Pandavan User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: gdb@sourceware.org Subject: gdb v7.0 - user defined command's document section - space prefixed end Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-10/txt/msg00403.txt.bz2 Hi, I noticed some of my user defined commands defined in '.gdbinit' file stopped working in gdb v7.0. They used to work in gdb v6.8. In trying to troubleshoot, I went through the gdb source code. In gdb v6.8, the init file processing logic was in cli/cli-script.c:read_next_line(). The following code ignores all leading (and trailing) spaces. 841 /* Strip leading and trailing whitespace. */ 842 while (*p == ' ' || *p == '\t') 843 p++; 844 845 p1 = p + strlen (p); 846 while (p1 != p && (p1[-1] == ' ' || p1[-1] == '\t')) 847 p1--; In gdb v7.0, the processing logic was in cli/cli-script.c:process_next_line(). Apparently, the leading spaces are ignored only for commands and not for comments. So, if I had a comment section with and 'end' having prefixed spaces, gdb did not treat it as end of comment section. 888 if (parse_commands) 889 { 890 /* Strip leading whitespace. */ 891 while (*p == ' ' || *p == '\t') 892 p++; 893 } So, removing all leading white spaces in line containing 'end' fixed my problem for v7.0. Assuming v7.0's has the correct and intended behavior (as it appears to be so), shouldn't the document mention it? (http://sourceware.org/gdb/current/onlinedocs/gdb_24.html#SEC249) Or am I referring to wrong document? Thanks, James Pandavan My gdbinit file------------------------------------------------------------------------------------------------------------ |define enable_only disable enable $arg0 end document enable_only enables only the given breakpoint end define sstep finish step end |