Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

unwind.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Unwinder backends interface.
  3. *
  4. * Copyright (c) 2013 Luca Clementi <luca.clementi@gmail.com>
  5. * Copyright (c) 2013-2018 The strace developers.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. */
  9. #ifndef STRACE_UNWIND_H
  10. # define STRACE_UNWIND_H
  11. # include "defs.h"
  12. /*
  13. * Type used in stacktrace walker.
  14. */
  15. /* This storage be enough large to store unw_word_t. */
  16. typedef unsigned long unwind_function_offset_t;
  17. typedef void (*unwind_call_action_fn)(void *data,
  18. const char *binary_filename,
  19. const char *symbol_name,
  20. unwind_function_offset_t function_offset,
  21. unsigned long true_offset);
  22. typedef void (*unwind_error_action_fn)(void *data,
  23. const char *error,
  24. unsigned long true_offset);
  25. struct unwind_unwinder_t {
  26. const char *name;
  27. /* Initialize the unwinder. */
  28. void (*init)(void);
  29. /* Make/destroy the context data attached to tcb. */
  30. void * (*tcb_init)(struct tcb *);
  31. void (*tcb_fin)(struct tcb *);
  32. /* Walk the stack. */
  33. void (*tcb_walk)(struct tcb *,
  34. unwind_call_action_fn,
  35. unwind_error_action_fn,
  36. void *);
  37. };
  38. extern const struct unwind_unwinder_t unwinder;
  39. #endif /* !STRACE_UNWIND_H */