]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/process/main.cpp
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / process / main.cpp
1 //===-- main.c --------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include <stdio.h>
10 #include <stdint.h>
11
12 // This simple program is to test the lldb Python API related to process.
13
14 char my_char = 'u';
15 char my_cstring[] = "lldb.SBProcess.ReadCStringFromMemory() works!";
16 char *my_char_ptr = (char *)"Does it work?";
17 uint32_t my_uint32 = 12345;
18 int my_int = 0;
19
20 int main (int argc, char const *argv[])
21 {
22     for (int i = 0; i < 3; ++i) {
23         printf("my_char='%c'\n", my_char);
24         ++my_char;
25     }
26
27     printf("after the loop: my_char='%c'\n", my_char); // 'my_char' should print out as 'x'.
28
29     return 0; // Set break point at this line and check variable 'my_char'.
30               // Use lldb Python API to set memory content for my_int and check the result.
31 }