Reputation:
In GDB I'd like to define a function that dispatches on type. Here is a simple example of something I have in mind:
define test
if (ptype(1) == int)
p 2
end
end
The above gives me a message saying that: No symbol "ptype" in current context. Can something like this be done without going to python?
Upvotes: 0
Views: 111
Reputation: 213829
Can something like this be done without going to python?
No.
Python scripting is exactly what you need here.
Upvotes: 1