1 //===-- main.c --------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #include <stdio.h> 9 #include <stdint.h> 10 11 int32_t global = 10; // Watchpoint variable declaration. 12 13 int main(int argc, char** argv) { 14 int local = 0; 15 printf("&global=%p\n", &global); 16 printf("about to write to 'global'...\n"); // Set break point at this line. 17 // When stopped, watch 'global' for read&write. 18 global = 20; 19 local += argc; 20 ++local; 21 printf("local: %d\n", local); 22 printf("global=%d\n", global); 23 } 24