aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/macosx/debugserver-multimemread/main.c
blob: 44cdd475b55058e72315dab54bd7e5513b4a6205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}