aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/macosx/debugserver-multimemread/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/macosx/debugserver-multimemread/main.c')
-rw-r--r--lldb/test/API/macosx/debugserver-multimemread/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/test/API/macosx/debugserver-multimemread/main.c b/lldb/test/API/macosx/debugserver-multimemread/main.c
new file mode 100644
index 0000000..44cdd47
--- /dev/null
+++ b/lldb/test/API/macosx/debugserver-multimemread/main.c
@@ -0,0 +1,14 @@
+#include <stdlib.h>
+#include <string.h>
+
+int main(int argc, char **argv) {
+ char *memory = malloc(1024);
+ memset(memory, '-', 1024);
+ // Write "interesting" characters at an offset from the memory filled with
+ // `-`. This way, if we read outside the range in either direction, we should
+ // find `-`s`.
+ int offset = 42;
+ for (int i = offset; i < offset + 14; i++)
+ memory[i] = 'a' + (i - offset);
+ return 0; // break here
+}