gdb: small howto debug generated code
authorBernhard Urban <lewurm@gmail.com>
Mon, 16 Apr 2012 20:01:41 +0000 (22:01 +0200)
committerBernhard Urban <lewurm@gmail.com>
Mon, 16 Apr 2012 20:01:41 +0000 (22:01 +0200)
not very convenient yet, but hey, better than nothing!

Mate/MethodPool.hs

index 0d089ca2d97cc7ec556f988600676583c8048936..d7faa88e331c1a476db5ccdd4bf5d43b71c52bfc 100644 (file)
@@ -84,6 +84,12 @@ compileBB hmap cls name = do
 
   printf "disasm:\n"
   mapM_ (putStrLn . showAtt) disasm
+  -- UNCOMMENT NEXT LINE FOR GDB FUN
+  -- _ <- getLine
+  -- (1) start it with `gdb ./mate' and then `run <classfile>'
+  -- (2) on getLine, press ctrl+c
+  -- (3) `br *0x<addr>'; obtain the address from the disasm above
+  -- (4) `cont' and press enter
   return entry