@@ -0,0 +1,477 @@
+import gdb%0Aimport sys%0Aimport json%0Aimport re%0A%0A%0Aclass SearchCommand(BaseCommand):%0A    %22%22%22Search for source files using regex.%22%22%22%0A%0A    def __init__(self):%0A        super(SearchCommand, self).__init__(%22search%22)%0A        info = gdb.execute('info sources', False, True)%0A        self.files = info.split('%5Cn%5Cn')%5B1%5D.split(', ')%0A%0A    def action(self, arg, from_tty):%0A        files = %5Bf for f in self.files if re.search(arg, f)%5D%0A        sys.stdout.write(json.dumps(files))%0A%0ASearchCommand()%0A

add search command