This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug exp/10940] New: Cannot cast to function pointer pointer, (void(**)(void))


To inspect an array of function pointers, I would expect to be able to do

(gdb) p *(void(**)(void))$ops@8

but this gives

A syntax error in expression, near `*)(void))$ops@4'

This can be worked around using the more obtuse cast

p (void(*)(void))*(void**)$ops@8

The need for such shenanigans is more with C++ since x/8a $ops does not pretty-
print the addresses, but the cast should work.

Arch Linux x86_64, kernel 2.6.31, gcc-4.4.2, gdb 7.0

-- 
           Summary: Cannot cast to function pointer pointer,
                    (void(**)(void))
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: exp
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jed at 59a2 dot org
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10940

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]