ブレークポイントに到達するたびにファイルに出力する GDB 用の単純な python 拡張機能を作成しようとしています。ドキュメントによると、「gdb.Breakpoint クラスはサブクラス化できます」( http://sourceware.org/gdb/onlinedocs/gdb/Breakpoints-In-Python.htmlを参照)
ただし、次のコードを試すと、「TypeError: メタクラスのベースを呼び出すときにエラーが発生しました。タイプ 'gdb.Breakpoint' は受け入れ可能なベース タイプではありません」というエラーが表示されます。
class MyBreakpoint(gdb.Breakpoint):
def stop (self):
print "break"
return False
Ubuntu 11.04 と gdb 7.2 を実行しています。より良いドキュメントへのヘルプやリンクをいただければ幸いです。ありがとう!
私の正確な手順:
$ gdb
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) source t.py
Traceback (most recent call last):
File "t.py", line 3, in <module>
class MyBreakpoint(gdb.Breakpoint):
TypeError: Error when calling the metaclass bases
type 'gdb.Breakpoint' is not an acceptable base type
(gdb)