changeset 263:c352dec19299

Added gcc arm runner
author Windel Bouwman
date Fri, 09 Aug 2013 16:28:50 +0200
parents ed14e077124c
children f8b5da5784b8
files python/serve_arm_as.py
diffstat 1 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/serve_arm_as.py	Fri Aug 09 16:28:50 2013 +0200
@@ -0,0 +1,31 @@
+
+import subprocess
+import tornado.web
+
+
+def mangle(inp):
+    p_as = subprocess.Popen(['arm-elf-as', '-mthumb'], stdin=subprocess.PIPE)
+    p_as.communicate(input=inp.encode('ascii'))
+
+    p_objdump = subprocess.Popen(['arm-elf-objdump', '-d'], stdout=subprocess.PIPE)
+    output = p_objdump.communicate()[0].decode('ascii')
+    print(output)
+
+    p_objdump = subprocess.Popen(['arm-elf-objdump', '-s'], stdout=subprocess.PIPE)
+    output = p_objdump.communicate()[0].decode('ascii')
+    print(output)
+
+class MainHandler(tornado.web.RequestHandler):
+    def get(self):
+        self.write('Hello')
+
+if __name__ == '__main__':
+    inp = """add r1, r2, r3
+    """
+    inp2 = """blt henkie
+    bgt henkie
+    henkie:
+    """
+    mangle(inp2)
+    
+