From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28641 invoked by alias); 14 Nov 2009 00:10:37 -0000 Received: (qmail 28569 invoked by uid 22791); 14 Nov 2009 00:10:36 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Nov 2009 00:10:33 +0000 Received: from spaceape9.eur.corp.google.com (spaceape9.eur.corp.google.com [172.28.16.143]) by smtp-out.google.com with ESMTP id nAE0AUJR027660 for ; Sat, 14 Nov 2009 00:10:30 GMT Received: from ppluzhnikov.mtv.corp.google.com (ppluzhnikov.mtv.corp.google.com [172.18.118.92]) by spaceape9.eur.corp.google.com with ESMTP id nAE0AN1V023499; Fri, 13 Nov 2009 16:10:24 -0800 Received: by ppluzhnikov.mtv.corp.google.com (Postfix, from userid 74925) id A0A0776CDD; Fri, 13 Nov 2009 16:10:22 -0800 (PST) To: gdb-patches@sourceware.org Cc: ppluzhnikov@google.com Subject: [patch] Allow "disassemble 'Foo::bar(char *)'" Message-Id: <20091114001022.A0A0776CDD@ppluzhnikov.mtv.corp.google.com> Date: Sat, 14 Nov 2009 00:10:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00324.txt.bz2 Greetings, Consider this test: struct Foo { void bar(const char *s) { } }; int main (void) { Foo().bar("hello"); return 0; } And the following GDB behavior: (gdb) disas 'Foo::b ## completes to: (gdb) disas 'Foo::bar(char const*)' Unmatched single quote. This (IMHO very confusing behavior) is happening because disassemble_command unconditionally splits the argument on the first space, and then tries to parse "'Foo::bar(char" as the start address. Attached patch fixes that (no regressions on Linux/x86_64). Thanks, -- Paul Pluzhnikov 2009-11-13 Paul Pluzhnikov * cli/cli-cmds.c (disassemble_command): Respect quotes. Index: cli/cli-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v retrieving revision 1.93 diff -u -p -u -r1.93 cli-cmds.c --- cli/cli-cmds.c 23 Oct 2009 00:49:33 -0000 1.93 +++ cli/cli-cmds.c 13 Nov 2009 23:59:08 -0000 @@ -1025,7 +1025,8 @@ disassemble_command (char *arg, int from /* FIXME: 'twould be nice to allow spaces in the expression for the first arg. Allow comma separater too? */ - if (!(space_index = (char *) strchr (arg, ' '))) + space_index = skip_quoted (arg); + if (!(space_index = (char *) strchr (space_index, ' '))) { /* One argument. */ pc = parse_and_eval_address (arg);