How do I look up overloaded methods in GDB using the python interface?
I have a class which has several methods called 'el', one of which takes two int
s. GDB is stopped at a breakpoint, with a member variable called _Dr
in scope in the inferior process. I do this to get a Python gdb.Value
object representing _Dr
:
(gdb) python _Dr = gdb.parse_and_eval('_Dr')
Now I want to get the el(int,int)
method:
(gdb) python el = _Dr['el']
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: cannot resolve overloaded method `el': no arguments supplied
Error while executing Python code.
How do I tell it the types of the arguments to resolve the overload?
I've tried this:
(gdb) python el = _Dr['el(int,int)']
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: There is no member or method named el(int,int).
Error while executing Python code.
and this:
(gdb) python el = _Dr['el', 'int', 'int']
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: Could not convert Python object: ('el', 'int', 'int').
Error while executing Python code.
and this:
(gdb) python el = _Dr['el(1,1)']
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: There is no member or method named el(1,1).
Error while executing Python code.
What's the right way of doing this?