1 //===-- main.c --------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // This simple program is to demonstrate the capability of the lldb command
12 // "breakpoint command add" to add a set of commands to a breakpoint to be
13 // executed when the breakpoint is hit.
15 // In particular, we want to break within c(), but only if the immediate caller
27 return c(val); // Find the line number where c's parent frame is a here.
42 int main (int argc, char const *argv[])
44 int A1 = a(1); // a(1) -> b(1) -> c(1)
45 printf("a(1) returns %d\n", A1);
47 int B2 = b(2); // b(2) -> c(2)
48 printf("b(2) returns %d\n", B2);
50 int A3 = a(3); // a(3) -> c(3)
51 printf("a(3) returns %d\n", A3);