Bug 13544 - Error while converting numeric value to an object pointer: "A syntax error in expression, near"
Summary: Error while converting numeric value to an object pointer: "A syntax error in...
Status: RESOLVED DUPLICATE of bug 8888
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-29 02:06 UTC by yuri
Modified: 2012-11-21 21:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yuri 2011-12-29 02:06:58 UTC
I have the class XObject defined globally and application is built with the debug info.
However, attempting to cast some hex value to the pointer to this class gives me an error:

(gdb) p (XObject*)0x848cdd420
A syntax error in expression, near `)0x848cdd420'.

For some weird reason, casting to some subclass of XObject works fine.

gdb-7.3.1 on FreeBSD-8.2 (build from the source)
but this error was observed on several previous versions as well.
Comment 1 yuri 2011-12-29 02:12:42 UTC
Same happens when 0x848cdd420 is replaced with just 0.
Comment 2 yuri 2011-12-29 03:38:11 UTC
I would also like to point out that this error doesn't mean that the class isn't known, in case of unknown class the error says this explicitly:

(gdb) p (XObject1*)0
No symbol "XObject1" in current context.
Comment 3 Tom Tromey 2012-01-02 16:45:55 UTC
A test case would be helpful.
Comment 4 Tom Tromey 2012-02-22 15:41:06 UTC
My attempt at a simple test case didn't show the problem.
Comment 5 Tom Tromey 2012-11-21 21:47:03 UTC
I am going to guess this is a dup of PR 8888.

*** This bug has been marked as a duplicate of bug 8888 ***