(root)/
glibc-2.38/
sysdeps/
generic/
framestate.c
       1  /* __frame_state_for unwinder helper function wrapper.
       2     Copyright (C) 2001-2023 Free Software Foundation, Inc.
       3     This file is part of the GNU C Library.
       4  
       5     The GNU C Library is free software; you can redistribute it and/or
       6     modify it under the terms of the GNU Lesser General Public
       7     License as published by the Free Software Foundation; either
       8     version 2.1 of the License, or (at your option) any later version.
       9  
      10     The GNU C Library is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13     Lesser General Public License for more details.
      14  
      15     You should have received a copy of the GNU Lesser General Public
      16     License along with the GNU C Library; if not, see
      17     <https://www.gnu.org/licenses/>.  */
      18  
      19  #include <stdlib.h>
      20  #define STATIC static
      21  #define __frame_state_for fallback_frame_state_for
      22  #include <unwind-dw2.c>
      23  #undef __frame_state_for
      24  #include <gnu/lib-names.h>
      25  
      26  #include <unwind-link.h>
      27  
      28  typedef struct frame_state * (*framesf)(void *pc, struct frame_state *);
      29  struct frame_state *__frame_state_for (void *pc,
      30  				       struct frame_state *frame_state);
      31  
      32  struct frame_state *
      33  __frame_state_for (void *pc, struct frame_state *frame_state)
      34  {
      35    struct unwind_link *unwind_link = __libc_unwind_link_get ();
      36    if (unwind_link != NULL)
      37      return UNWIND_LINK_PTR (unwind_link, __frame_state_for) (pc, frame_state);
      38    else
      39      {
      40  #ifndef __USING_SJLJ_EXCEPTIONS__
      41        return fallback_frame_state_for (pc, frame_state);
      42  #else
      43        abort ();
      44  #endif
      45      }
      46  }