Created
October 4, 2017 17:28
-
-
Save scottcarr/e9605a0b4c058f4e853b0ac11f1a3abe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define GDB-PROMPT #"(gdb) \n") | |
(define NEWLINE 10) | |
(define-values (proc o i e) (subprocess #f #f #f "/usr/bin/gdb" "--interpreter=mi2")) | |
(file-stream-buffer-mode o 'none) | |
(file-stream-buffer-mode i 'none) | |
(file-stream-buffer-mode e 'none) | |
; read menu (10 lines long) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
(read-bytes-line o) | |
; read (gdb) \n | |
(read-bytes-line o) | |
(write-bytes #"-exec-run\n" i) | |
(flush-output i) | |
(sleep 1) | |
(read-bytes-line o) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment