From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15798 invoked by alias); 29 Sep 2017 18:57:40 -0000 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 Received: (qmail 15782 invoked by uid 89); 29 Sep 2017 18:57:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=smith, Smith, faulty, HTo:U*paul X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Sep 2017 18:57:38 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 796B2C0587D1; Fri, 29 Sep 2017 18:57:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 796B2C0587D1 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj@redhat.com Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1508184CEB; Fri, 29 Sep 2017 18:57:37 +0000 (UTC) From: Sergio Durigan Junior To: Paul Smith Cc: "gdb\@sourceware.org" Subject: Re: GDB can't parse variables named "memory" or "array"? References: <1506705739.6352.95.camel@mad-scientist.net> Date: Fri, 29 Sep 2017 18:57:00 -0000 In-Reply-To: <1506705739.6352.95.camel@mad-scientist.net> (Paul Smith's message of "Fri, 29 Sep 2017 13:22:19 -0400") Message-ID: <87h8vle3j3.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00141.txt.bz2 On Friday, September 29 2017, Paul Smith wrote: > I've tried this with lots of different versions of GDB (7.7.1, 7.11, > 7.12, etc.), and none of them work when debugging my programs (not just > my main program but all my unit tests as well): > > (gdb) p memory > A syntax error in expression, near `'. > > (gdb) p array > A syntax error in expression, near `'. Without a reproducer it's really hard to tell what's happening. > Any ideas about what can I do to try to figure out what's happening > here? If you're not willing to share your code, you could debug GDB and see what's happening. Compile it with debugging symbols (CFLAGS='-g3 -O0' CXXFLAGS='-g3 -O0'), put a breakpoint on the "print_command" function, and follow from there. You can also enable "set debug parser on" and/or "set debug expression 1" inside your "faulty" GDB and see if it helps with anything. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/