我发现自己经常跳入 python 解释器来执行非常基本的字节转换,例如以下内容:
>>> ords = lambda s: [hex(ord(c)) for c in s]
>>> ords('Help')
['0x48', '0x65', '0x6c', '0x70']
有没有办法添加一个 python 函数,gdb这样我就可以输入ords('Help')它并调用上面的函数?如果是这样,我将如何/在哪里定义 python 函数?
相关于:https ://sourceware.org/gdb/onlinedocs/gdb/Python-API.html
一只斗牛犬
相关分类