This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Formatting of function pointer value
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb at sources dot redhat dot com
- Date: Fri, 08 Jul 2005 12:00:44 +0400
- Subject: Formatting of function pointer value
Hello,
consider the following snippet:
B* p2 = (B*)0x12345678;
int (*p3)(int) = (fp)0x000000AE;
the value of p2 is printed like this:
(gdb)info local
....
p2 = (B *) 0xb8000540
the value of *p3 is printed like this:
(gdb) print *p3
$1 = {int (int)} 0xb7ee6e9c <__DTOR_END__+4>
I have a couple of questions:
1. Why in both cases the type of value is printed? There's already 'whatis'
command. I've checked that code and it's printed unconditionally. As the
result, a GDB frontend must strip the type.
2. Why the type is enclosed in parenthesis in the first case, and in braces
in the second case? This entails additonal problems for GUI frontend, for
example, at the moment KDevelop thinks that the opening brace in the second
case starts a composite.
- Volodya