mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 00:50:42 +08:00
22 lines
523 B
Python
22 lines
523 B
Python
|
|
class MIEcho(gdb.MICommand):
|
|
"""Echo arguments passed to the command."""
|
|
|
|
def __init__(self, name, mode):
|
|
self._mode = mode
|
|
super(MIEcho, self).__init__(name)
|
|
|
|
def invoke(self, argv):
|
|
if self._mode == 'dict':
|
|
return { 'dict': { 'argv' : argv } }
|
|
elif self._mode == 'list':
|
|
return { 'list': argv }
|
|
else:
|
|
return { 'string': ", ".join(argv) }
|
|
|
|
|
|
MIEcho("-echo-dict", "dict")
|
|
MIEcho("-echo-list", "list")
|
|
MIEcho("-echo-string", "string")
|
|
|