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