1

Python インターフェイスを使用して GDB でオーバーロードされたメソッドを検索するにはどうすればよいですか?

「el」と呼ばれるいくつかのメソッドを持つクラスがあり、そのうちの 1 つは 2 つintの s を取ります。GDB はブレークポイントで停止し_Dr、下位プロセスのスコープ内でメンバー変数が呼び出されます。を表す Pythongdb.Valueオブジェクトを取得するためにこれを行い_Drます。

(gdb) python _Dr = gdb.parse_and_eval('_Dr')

今、私はメソッドを取得したいel(int,int):

(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.

オーバーロードを解決するために引数の型をどのように伝えるのですか?

私はこれを試しました:

(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.

この:

(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.

この:

(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.

これを行う正しい方法は何ですか?

4

1 に答える 1