aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/bt-interrupt/main.c
blob: 14a9eb6ffc85670f0538c184b56a2d1ba47b3563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>

// This example is meant to recurse infinitely.
// The extra struct is just to make the frame dump
// more complicated.

struct Foo {
  int a;
  int b;
  char *c;
};

int
forgot_termination(int input, struct Foo my_foo) {
  char frame_increasing_buffer[0x1000]; // To blow the stack sooner.
  return forgot_termination(++input, my_foo);
}

int
main()
{
  struct Foo myFoo = {100, 300, "A string you will print a lot"}; // Set a breakpoint here
  return forgot_termination(1, myFoo);
}