From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24033 invoked by alias); 29 Sep 2017 17:23:52 -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 24014 invoked by uid 89); 29 Sep 2017 17:23:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*R:D*net X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Sep 2017 17:23:50 +0000 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id D9A2B1AB891 for ; Fri, 29 Sep 2017 11:22:23 -0600 (MDT) Received: from box5008.bluehost.com ([50.116.64.19]) by cmgw2 with id FVNL1w03K0QvKlu01VNPYE; Fri, 29 Sep 2017 11:22:23 -0600 X-Authority-Analysis: v=2.2 cv=dZfw5Tfe c=1 sm=1 tr=0 a=gch/BGY/Gm5DEW28s2kmlQ==:117 a=gch/BGY/Gm5DEW28s2kmlQ==:17 a=IkcTkHD0fZMA:10 a=2JCJgTwv5E4A:10 a=lHDlZWxkOsi97h8sKycA:9 a=QEXdDO2ut3YA:10 Received: from [50.226.24.42] (port=42080 helo=pdsdesk) by box5008.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dxyzU-000R9w-5W for gdb@sourceware.org; Fri, 29 Sep 2017 11:22:20 -0600 Message-ID: <1506705739.6352.95.camel@mad-scientist.net> Subject: GDB can't parse variables named "memory" or "array"? From: Paul Smith Reply-To: paul@mad-scientist.net To: "gdb@sourceware.org" Date: Fri, 29 Sep 2017 17:23:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BWhitelist: no X-Exim-ID: 1dxyzU-000R9w-5W X-Source-Sender: (pdsdesk) [50.226.24.42]:42080 X-Source-Auth: paul@mad-scientist.us X-Email-Count: 1 X-Source-Cap: bWFkc2NpZTE7bWFkc2NpZTE7Ym94NTAwOC5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2017-09/txt/msg00139.txt.bz2 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 `'. Note I don't even have to start the program to see this (but of course it always happens, when debugging live processes, cores, etc.) It's only "array" and "memory" (as far as I can tell); other variables work fine. Also, it fails even for class members named "array" or "memory", not just simple variables (e.g., "p obj.array" fails as well). I'm starting GDB with -n to avoid any init files being loaded etc. Nothing I can do will let this work; I tried things like: (gdb) p/r array A syntax error in expression, near `'. (gdb) set $a = array A syntax error in expression, near `'. However, I've tried to create simple repro cases and even when compiled with identical flags, those work fine so it's something about my program(s), or maybe some library I'm linking. If I rename the variable to something else, then GDB will print it just fine. Any ideas about what can I do to try to figure out what's happening here?