File: gdb_service.py

package info (click to toggle)
rpyc 6.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,324 kB
  • sloc: python: 6,442; makefile: 122
file content (17 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gdb
import rpyc


class GDBService(rpyc.Service):
    def exposed_get(self):
        return gdb

    def exposed_quit(self):
        gdb.execute('quit')


if __name__ == "__main__":
    server = rpyc.ThreadedServer(GDBService, port=0, protocol_config={'allow_all_attrs': True})
    gdb.write('{}\n'.format(server.port))
    gdb.flush()
    server.start()