tests: peek.c
authorRonald G. Minnich <rminnich@google.com>
Wed, 30 Jul 2014 00:43:36 +0000 (00:43 +0000)
committerRonald G. Minnich <rminnich@google.com>
Wed, 30 Jul 2014 00:43:36 +0000 (00:43 +0000)
peek will peek at bytes, as many as you specify in the command line, e.g.
peek 0xff00 0x400000
will peek at those addresses as a byte pointer.

It succeeds on 0xff00 and it should not.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
tests/peek.c [new file with mode: 0644]

diff --git a/tests/peek.c b/tests/peek.c
new file mode 100644 (file)
index 0000000..2554c43
--- /dev/null
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+main(int argc, char *argv[])
+{
+       argc--,argv++;
+       while (argc > 0) {
+               unsigned char *p = (void *)strtoul(argv[0], 0, 0);
+               printf("%p shows %02x\n", p, *p);
+               argc--,argv++;
+       }
+}