This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB can't parse variables named "memory" or "array"?
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Paul Smith <paul at mad-scientist dot net>
- Cc: "gdb\@sourceware.org" <gdb at sourceware dot org>
- Date: Fri, 29 Sep 2017 14:57:36 -0400
- Subject: Re: GDB can't parse variables named "memory" or "array"?
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 796B2C0587D1
- References: <1506705739.6352.95.camel@mad-scientist.net>
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/