I find myself jumping into the python interpreter a lot to do very basic byte conversions, such as the following:
>>> ords = lambda s: [hex(ord(c)) for c in s]
>>> ords('Help')
['0x48', '0x65', '0x6c', '0x70']
Is there a way to add a python function into gdb so I can type ords('Help') and it will invoke the above? If so, how/where would I define the python function?
Related to: https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html