8a510a99e91b833cbbef953aaacc40f3bdadd621
[goodfet] / client / goodfet
1 #!/usr/bin/env python
2 # GoodFET Debugger
3
4 # (C) 2009 Travis Goodspeed <travis at radiantmachines.com>
5 #
6 # This code is being rewritten and refactored.  You've been warned!
7
8 import sys, os, readline, code, binascii;
9 import rlcompleter;
10
11 from GoodFETConsole import GoodFETConsole;
12 from GoodFETCC import GoodFETCC;
13 from GoodFETMSP430 import GoodFETMSP430;
14 from GoodFET import GoodFET;
15
16 from intelhex import IntelHex;
17
18 if(len(sys.argv)==1):
19     print "Usage: %s driver\n" % sys.argv[0];
20     print "driver:= GoodFETCC GoodFETMSP430";
21     sys.exit(1);
22
23 driver=sys.argv[1];
24 print "Using driver %s" % driver;
25 client=eval("%s()" % driver);
26 console=GoodFETConsole(client);
27
28 while 1:
29     sys.stdout.write("gf% ");
30     sys.stdout.flush();
31     cmd=sys.stdin.readline();
32     console.handle(cmd);
33
34 sys.exit(0);