Rewrite an inline test as an API test, to be a little easier to debug, and add some additional checks that we're in the inlined test1, then step and we are now in the inlined test2 functions.
25 lines
501 B
C
25 lines
501 B
C
#include <stdio.h>
|
|
|
|
inline void test1(int) __attribute__ ((always_inline));
|
|
inline void test2(int) __attribute__ ((always_inline));
|
|
|
|
// Called once from main with b==42 then called from test1 with b==24.
|
|
void test2(int b) {
|
|
printf("test2(%d)\n", b); // first breakpoint
|
|
{
|
|
int c = b * 2;
|
|
printf("c=%d\n", c); // second breakpoint
|
|
}
|
|
}
|
|
|
|
void test1(int a) {
|
|
printf("test1(%d)\n", a);
|
|
test2(a + 1); // third breakpoint
|
|
}
|
|
|
|
int main(int argc) {
|
|
test2(42);
|
|
test1(23);
|
|
return 0;
|
|
}
|