mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-22 07:37:38 +01:00
Add copyright header.
(Test_Class): New dummy class so we can define a constructor. (backtrace): New function. }(Logical change 1.70)
This commit is contained in:
parent
337c0ad989
commit
294a1e55cc
1 changed files with 0 additions and 36 deletions
|
@ -1,36 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern int backtrace (void **, int);
|
||||
|
||||
static void
|
||||
b (void)
|
||||
{
|
||||
void *v[20];
|
||||
int i, n;
|
||||
|
||||
n = backtrace(v, 20);
|
||||
for (i = 0; i < n; ++i)
|
||||
printf ("[%d] %p\n", i, v[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
a (void)
|
||||
{
|
||||
b();
|
||||
}
|
||||
|
||||
static void c (void) __attribute__((constructor));
|
||||
|
||||
static void
|
||||
c (void)
|
||||
{
|
||||
b();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return atexit (a);
|
||||
}
|
Loading…
Reference in a new issue