diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:01:00 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:01:00 +0000 |
| commit | 23629167fefb8117a4d2cc9213c8a29d5b4a1197 (patch) | |
| tree | c410512ef1b5e0f0e81b7f333cafabc3ad716f5d /packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c | |
| parent | ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c')
| -rw-r--r-- | packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c b/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c new file mode 100644 index 000000000000..03c667417129 --- /dev/null +++ b/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c @@ -0,0 +1,11 @@ +#include <stdlib.h> +int main () +{ + const char *empty_string = ""; + const char *one_letter_string = "1"; + // This expects that lower 4k of memory will be mapped unreadable, which most + // OSs do (to catch null pointer dereferences). + const char *invalid_memory_string = (char*)0x100; + + return empty_string[0] + one_letter_string[0]; // breakpoint here +} |
