gitlab.com/Raven-IO/raven-delve@v1.22.4/_fixtures/cgostacktest/hello.c (about)

     1  #include <stdio.h>
     2  
     3  #include "_cgo_export.h"
     4  
     5  #ifdef __amd64__
     6  #define BREAKPOINT asm("int3;")
     7  #elif __i386__
     8  #define BREAKPOINT asm("int3;")
     9  #elif __PPC64__
    10  #define BREAKPOINT asm("tw 31,0,0;")
    11  #elif __aarch64__
    12  #ifdef WIN32
    13  #define BREAKPOINT asm("brk 0xF000;")
    14  #else
    15  #define BREAKPOINT asm("brk 0;")
    16  #endif
    17  #endif
    18  
    19  void helloworld_pt2(int x) {
    20  	BREAKPOINT;
    21  	helloWorld(x+1);
    22  }
    23  
    24  void helloworld(int x) {
    25  	helloworld_pt2(x+1);
    26  }
    27  
    28  void helloworld_pt4(int x) {
    29  	BREAKPOINT;
    30  	helloWorld2(x+1);
    31  }
    32  
    33  void helloworld_pt3(int x) {
    34  	helloworld_pt4(x+1);
    35  }