user1054186
user1054186

Reputation:

Using gdb's define to dispatch on type

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

Answers (1)

Employed Russian
Employed Russian

Reputation: 213829

Can something like this be done without going to python?

No.

Python scripting is exactly what you need here.

Upvotes: 1

Related Questions