github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/include/jit/jit-unwind.h (about)

     1  /*
     2   * jit-unwind.h - Routines for performing stack unwinding.
     3   *
     4   * Copyright (C) 2008  Southern Storm Software, Pty Ltd.
     5   *
     6   * This file is part of the libjit library.
     7   *
     8   * The libjit library is free software: you can redistribute it and/or
     9   * modify it under the terms of the GNU Lesser General Public License
    10   * as published by the Free Software Foundation, either version 2.1 of
    11   * the License, or (at your option) any later version.
    12   *
    13   * The libjit library is distributed in the hope that it will be useful,
    14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    16   * Lesser General Public License for more details.
    17   *
    18   * You should have received a copy of the GNU Lesser General Public
    19   * License along with the libjit library.  If not, see
    20   * <http://www.gnu.org/licenses/>.
    21   */
    22  
    23  #ifndef	_JIT_UNWIND_H
    24  #define	_JIT_UNWIND_H
    25  
    26  #include <jit/jit-common.h>
    27  #include <jit/jit-arch.h>
    28  
    29  #ifdef	__cplusplus
    30  extern	"C" {
    31  #endif
    32  
    33  typedef struct
    34  {
    35  	void *frame;
    36  	void *cache;
    37  	jit_context_t context;
    38  #ifdef _JIT_ARCH_UNWIND_DATA
    39  	_JIT_ARCH_UNWIND_DATA
    40  #endif
    41  } jit_unwind_context_t;
    42  
    43  int jit_unwind_init(jit_unwind_context_t *unwind, jit_context_t context);
    44  void jit_unwind_free(jit_unwind_context_t *unwind);
    45  
    46  int jit_unwind_next(jit_unwind_context_t *unwind);
    47  int jit_unwind_next_pc(jit_unwind_context_t *unwind);
    48  void *jit_unwind_get_pc(jit_unwind_context_t *unwind);
    49  
    50  int jit_unwind_jump(jit_unwind_context_t *unwind, void *pc);
    51  
    52  jit_function_t jit_unwind_get_function(jit_unwind_context_t *unwind);
    53  unsigned int jit_unwind_get_offset(jit_unwind_context_t *unwind);
    54  
    55  #ifdef	__cplusplus
    56  };
    57  #endif
    58  
    59  #endif /* _JIT_UNWIND_H */