LCOV - code coverage report
Current view: top level - libdwfl - dwfl_frame.c (source / functions) Coverage Total Hit
Test: elfutils-0.193 Lines: 62.4 % 226 141
Test Date: 2025-08-30 14:31:09 Functions: 76.5 % 17 13
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 46.9 % 128 60

             Branch data     Line data    Source code
       1                 :             : /* Get Dwarf Frame state for target PID or core file.
       2                 :             :    Copyright (C) 2013, 2014, 2024-2025 Red Hat, Inc.
       3                 :             :    This file is part of elfutils.
       4                 :             : 
       5                 :             :    This file is free software; you can redistribute it and/or modify
       6                 :             :    it under the terms of either
       7                 :             : 
       8                 :             :      * the GNU Lesser General Public License as published by the Free
       9                 :             :        Software Foundation; either version 3 of the License, or (at
      10                 :             :        your option) any later version
      11                 :             : 
      12                 :             :    or
      13                 :             : 
      14                 :             :      * the GNU General Public License as published by the Free
      15                 :             :        Software Foundation; either version 2 of the License, or (at
      16                 :             :        your option) any later version
      17                 :             : 
      18                 :             :    or both in parallel, as here.
      19                 :             : 
      20                 :             :    elfutils is distributed in the hope that it will be useful, but
      21                 :             :    WITHOUT ANY WARRANTY; without even the implied warranty of
      22                 :             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      23                 :             :    General Public License for more details.
      24                 :             : 
      25                 :             :    You should have received copies of the GNU General Public License and
      26                 :             :    the GNU Lesser General Public License along with this program.  If
      27                 :             :    not, see <http://www.gnu.org/licenses/>.  */
      28                 :             : 
      29                 :             : #ifdef HAVE_CONFIG_H
      30                 :             : # include <config.h>
      31                 :             : #endif
      32                 :             : 
      33                 :             : #include <system.h>
      34                 :             : 
      35                 :             : #include "libdwflP.h"
      36                 :             : #include "libdwfl_stacktraceP.h"
      37                 :             : 
      38                 :             : /* Set STATE->pc_set from STATE->regs according to the backend.  Return true on
      39                 :             :    success, false on error.  */
      40                 :             : static bool
      41                 :          88 : state_fetch_pc (Dwfl_Frame *state)
      42                 :             : {
      43   [ -  +  -  + ]:          88 :   switch (state->pc_state)
      44                 :             :     {
      45                 :             :     case DWFL_FRAME_STATE_PC_SET:
      46                 :             :       return true;
      47                 :           0 :     case DWFL_FRAME_STATE_PC_UNDEFINED:
      48                 :           0 :       abort ();
      49                 :          56 :     case DWFL_FRAME_STATE_ERROR:
      50                 :             :       {
      51                 :          56 :         Ebl *ebl = state->thread->process->ebl;
      52                 :          56 :         Dwarf_CIE abi_info;
      53         [ -  + ]:          56 :         if (ebl_abi_cfi (ebl, &abi_info) != 0)
      54                 :             :           {
      55                 :           0 :             __libdwfl_seterrno (DWFL_E_LIBEBL);
      56                 :           0 :             return false;
      57                 :             :           }
      58                 :          56 :         unsigned ra = abi_info.return_address_register;
      59                 :             :         /* dwarf_frame_state_reg_is_set is not applied here.  */
      60         [ -  + ]:          56 :         if (ra >= ebl_frame_nregs (ebl))
      61                 :             :           {
      62                 :           0 :             __libdwfl_seterrno (DWFL_E_LIBEBL_BAD);
      63                 :           0 :             return false;
      64                 :             :           }
      65                 :          56 :         state->pc = state->regs[ra] + ebl_ra_offset (ebl);
      66                 :          56 :         state->pc_state = DWFL_FRAME_STATE_PC_SET;
      67                 :             :       }
      68                 :          56 :       return true;
      69                 :             :     }
      70                 :           0 :   abort ();
      71                 :             : }
      72                 :             : 
      73                 :             : /* Do not call it on your own, to be used by thread_* functions only.  */
      74                 :             : 
      75                 :             : static void
      76                 :           0 : free_states (Dwfl_Frame *state)
      77                 :             : {
      78   [ -  -  -  -  :         150 :   while (state)
          +  +  -  +  +  
                      + ]
      79                 :             :     {
      80                 :          64 :       Dwfl_Frame *next = state->unwound;
      81                 :          64 :       free(state);
      82                 :          64 :       state = next;
      83                 :             :     }
      84                 :             : }
      85                 :             : 
      86                 :             : static Dwfl_Frame *
      87                 :          88 : state_alloc (Dwfl_Thread *thread)
      88                 :             : {
      89         [ -  + ]:          88 :   assert (thread->unwound == NULL);
      90                 :          88 :   Ebl *ebl = thread->process->ebl;
      91                 :          88 :   size_t nregs = ebl_frame_nregs (ebl);
      92         [ -  + ]:          88 :   if (nregs == 0)
      93                 :             :     return NULL;
      94         [ -  + ]:          88 :   assert (nregs < sizeof (((Dwfl_Frame *) NULL)->regs_set) * 8);
      95                 :          88 :   Dwfl_Frame *state = malloc (sizeof (*state) + sizeof (*state->regs) * nregs);
      96         [ -  + ]:          88 :   if (state == NULL)
      97                 :             :     return NULL;
      98                 :          88 :   state->thread = thread;
      99                 :          88 :   state->signal_frame = false;
     100                 :          88 :   state->initial_frame = true;
     101                 :          88 :   state->pc_state = DWFL_FRAME_STATE_ERROR;
     102                 :          88 :   state->unwound_source = DWFL_UNWOUND_INITIAL_FRAME;
     103                 :          88 :   memset (state->regs_set, 0, sizeof (state->regs_set));
     104                 :          88 :   thread->unwound = state;
     105                 :          88 :   state->unwound = NULL;
     106                 :          88 :   return state;
     107                 :             : }
     108                 :             : 
     109                 :             : void
     110                 :             : internal_function
     111                 :         104 : __libdwfl_process_free (Dwfl_Process *process)
     112                 :             : {
     113                 :         104 :   Dwfl *dwfl = process->dwfl;
     114         [ +  + ]:         104 :   if (process->callbacks->detach != NULL)
     115                 :         102 :     process->callbacks->detach (dwfl, process->callbacks_arg);
     116         [ -  + ]:         104 :   assert (dwfl->process == process);
     117                 :         104 :   dwfl->process = NULL;
     118         [ +  + ]:         104 :   if (process->ebl_close)
     119                 :         102 :     ebl_closebackend (process->ebl);
     120                 :         104 :   free (process);
     121                 :         104 :   dwfl->attacherr = DWFL_E_NOERROR;
     122                 :         104 : }
     123                 :             : 
     124                 :             : /* Allocate new Dwfl_Process for DWFL.  */
     125                 :             : static void
     126                 :         106 : process_alloc (Dwfl *dwfl)
     127                 :             : {
     128                 :         106 :   Dwfl_Process *process = malloc (sizeof (*process));
     129         [ +  - ]:         106 :   if (process == NULL)
     130                 :             :     return;
     131                 :         106 :   process->dwfl = dwfl;
     132                 :         106 :   dwfl->process = process;
     133                 :             : }
     134                 :             : 
     135                 :             : bool
     136                 :         106 : dwfl_attach_state (Dwfl *dwfl, Elf *elf, pid_t pid,
     137                 :             :                    const Dwfl_Thread_Callbacks *thread_callbacks, void *arg)
     138                 :             : {
     139         [ -  + ]:         106 :   if (dwfl->process != NULL)
     140                 :             :     {
     141                 :           0 :       __libdwfl_seterrno (DWFL_E_ATTACH_STATE_CONFLICT);
     142                 :           0 :       return false;
     143                 :             :     }
     144                 :             : 
     145                 :             :   /* Reset any previous error, we are just going to try again.  */
     146                 :         106 :   dwfl->attacherr = DWFL_E_NOERROR;
     147                 :             :   /* thread_callbacks is declared NN */
     148         [ +  - ]:         106 :   if (thread_callbacks->next_thread == NULL
     149         [ -  + ]:         106 :       || thread_callbacks->set_initial_registers == NULL)
     150                 :             :     {
     151                 :           0 :       dwfl->attacherr = DWFL_E_INVALID_ARGUMENT;
     152                 :           0 :     fail:
     153                 :           0 :       dwfl->attacherr = __libdwfl_canon_error (dwfl->attacherr);
     154                 :           0 :       __libdwfl_seterrno (dwfl->attacherr);
     155                 :           0 :       return false;
     156                 :             :     }
     157                 :             : 
     158                 :         106 :   Ebl *ebl;
     159                 :         106 :   bool ebl_close;
     160         [ +  + ]:         106 :   if (elf != NULL)
     161                 :             :     {
     162                 :         104 :       ebl = ebl_openbackend (elf);
     163                 :         104 :       ebl_close = true;
     164                 :             :     }
     165                 :             :   else
     166                 :             :     {
     167                 :           2 :       ebl = NULL;
     168         [ +  - ]:           2 :       for (Dwfl_Module *mod = dwfl->modulelist; mod != NULL; mod = mod->next)
     169                 :             :         {
     170                 :             :           /* Reading of the vDSO or (deleted) modules may fail as
     171                 :             :              /proc/PID/mem is unreadable without PTRACE_ATTACH and
     172                 :             :              we may not be PTRACE_ATTACH-ed now.  MOD would not be
     173                 :             :              re-read later to unwind it when we are already
     174                 :             :              PTRACE_ATTACH-ed to PID.  This happens when this function
     175                 :             :              is called from dwfl_linux_proc_attach with elf == NULL.
     176                 :             :              __libdwfl_module_getebl will call __libdwfl_getelf which
     177                 :             :              will call the find_elf callback.  */
     178         [ +  - ]:           2 :           if (startswith (mod->name, "[vdso: ")
     179   [ +  -  -  + ]:           4 :               || strcmp (strrchr (mod->name, ' ') ?: "",
     180                 :             :                          " (deleted)") == 0)
     181                 :           0 :             continue;
     182                 :           2 :           Dwfl_Error error = __libdwfl_module_getebl (mod);
     183         [ -  + ]:           2 :           if (error != DWFL_E_NOERROR)
     184                 :           0 :             continue;
     185                 :           2 :           ebl = mod->ebl;
     186                 :           2 :           break;
     187                 :             :         }
     188                 :             :       ebl_close = false;
     189                 :             :     }
     190         [ -  + ]:         106 :   if (ebl == NULL)
     191                 :             :     {
     192                 :             :       /* Not identified EBL from any of the modules.  */
     193                 :           0 :       dwfl->attacherr = DWFL_E_PROCESS_NO_ARCH;
     194                 :           0 :       goto fail;
     195                 :             :     }
     196                 :         106 :   process_alloc (dwfl);
     197                 :         106 :   Dwfl_Process *process = dwfl->process;
     198         [ -  + ]:         106 :   if (process == NULL)
     199                 :             :     {
     200         [ #  # ]:           0 :       if (ebl_close)
     201                 :           0 :         ebl_closebackend (ebl);
     202                 :           0 :       dwfl->attacherr = DWFL_E_NOMEM;
     203                 :           0 :       goto fail;
     204                 :             :     }
     205                 :         106 :   process->ebl = ebl;
     206                 :         106 :   process->ebl_close = ebl_close;
     207                 :         106 :   process->pid = pid;
     208                 :         106 :   process->callbacks = thread_callbacks;
     209                 :         106 :   process->callbacks_arg = arg;
     210                 :             : 
     211         [ -  + ]:         106 :   if (dwfl->tracker != NULL)
     212                 :           0 :     __libdwfl_stacktrace_add_dwfl_to_tracker (dwfl);
     213                 :             : 
     214                 :             :   return true;
     215                 :             : }
     216                 :             : INTDEF(dwfl_attach_state)
     217                 :             : 
     218                 :             : pid_t
     219                 :         142 : dwfl_pid (Dwfl *dwfl)
     220                 :             : {
     221         [ -  + ]:         142 :   if (dwfl->attacherr != DWFL_E_NOERROR)
     222                 :             :     {
     223                 :           0 :       __libdwfl_seterrno (dwfl->attacherr);
     224                 :           0 :       return -1;
     225                 :             :     }
     226                 :             : 
     227         [ -  + ]:         142 :   if (dwfl->process == NULL)
     228                 :             :     {
     229                 :           0 :       __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE);
     230                 :           0 :       return -1;
     231                 :             :     }
     232                 :         142 :   return dwfl->process->pid;
     233                 :             : }
     234                 :             : INTDEF(dwfl_pid)
     235                 :             : 
     236                 :             : Dwfl *
     237                 :         332 : dwfl_thread_dwfl (Dwfl_Thread *thread)
     238                 :             : {
     239                 :         332 :   return thread->process->dwfl;
     240                 :             : }
     241                 :             : INTDEF(dwfl_thread_dwfl)
     242                 :             : 
     243                 :             : pid_t
     244                 :         488 : dwfl_thread_tid (Dwfl_Thread *thread)
     245                 :             : {
     246                 :         488 :   return thread->tid;
     247                 :             : }
     248                 :             : INTDEF(dwfl_thread_tid)
     249                 :             : 
     250                 :             : Dwfl_Thread *
     251                 :         330 : dwfl_frame_thread (Dwfl_Frame *state)
     252                 :             : {
     253                 :         330 :   return state->thread;
     254                 :             : }
     255                 :             : INTDEF(dwfl_frame_thread)
     256                 :             : 
     257                 :             : Dwfl_Unwound_Source
     258                 :         118 : dwfl_frame_unwound_source (Dwfl_Frame *state)
     259                 :             : {
     260                 :         118 :   return state->unwound_source;
     261                 :             : }
     262                 :             : INTDEF(dwfl_frame_unwound_source)
     263                 :             : 
     264                 :             : const char *
     265                 :         108 : dwfl_unwound_source_str (Dwfl_Unwound_Source unwound_source)
     266                 :             : {
     267   [ +  +  -  -  :         108 :   switch (unwound_source)
                   -  - ]
     268                 :             :     {
     269                 :             :     case DWFL_UNWOUND_NONE:
     270                 :             :       return "none";
     271                 :          32 :     case DWFL_UNWOUND_INITIAL_FRAME:
     272                 :          32 :       return "initial";
     273                 :          76 :     case DWFL_UNWOUND_EH_CFI:
     274                 :          76 :       return "eh_frame";
     275                 :           0 :     case DWFL_UNWOUND_DWARF_CFI:
     276                 :           0 :       return "dwarf";
     277                 :           0 :     case DWFL_UNWOUND_EBL:
     278                 :           0 :       return "ebl";
     279                 :           0 :     default:
     280                 :           0 :       return "unknown";
     281                 :             :     }
     282                 :             : }
     283                 :             : INTDEF(dwfl_unwound_source_str)
     284                 :             : 
     285                 :             : int
     286                 :          64 : dwfl_getthreads (Dwfl *dwfl, int (*callback) (Dwfl_Thread *thread, void *arg),
     287                 :             :                  void *arg)
     288                 :             : {
     289         [ -  + ]:          64 :   if (dwfl->attacherr != DWFL_E_NOERROR)
     290                 :             :     {
     291                 :           0 :       __libdwfl_seterrno (dwfl->attacherr);
     292                 :           0 :       return -1;
     293                 :             :     }
     294                 :             : 
     295                 :          64 :   Dwfl_Process *process = dwfl->process;
     296         [ -  + ]:          64 :   if (process == NULL)
     297                 :             :     {
     298                 :           0 :       __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE);
     299                 :           0 :       return -1;
     300                 :             :     }
     301                 :             : 
     302                 :          64 :   Dwfl_Thread thread;
     303                 :          64 :   thread.process = process;
     304                 :          64 :   thread.unwound = NULL;
     305                 :          64 :   thread.callbacks_arg = NULL;
     306                 :          64 :   thread.aarch64.pauth_insn_mask = 0;
     307                 :             : 
     308                 :         156 :   for (;;)
     309                 :             :     {
     310                 :         156 :       thread.tid = process->callbacks->next_thread (dwfl,
     311                 :             :                                                     process->callbacks_arg,
     312                 :             :                                                     &thread.callbacks_arg);
     313         [ +  - ]:         156 :       if (thread.tid < 0)
     314                 :             :         return -1;
     315         [ +  + ]:         156 :       if (thread.tid == 0)
     316                 :             :         {
     317                 :          62 :           __libdwfl_seterrno (DWFL_E_NOERROR);
     318                 :          62 :           return 0;
     319                 :             :         }
     320                 :          94 :       int err = callback (&thread, arg);
     321         [ +  - ]:          92 :       if (err != DWARF_CB_OK)
     322                 :             :         return err;
     323         [ +  - ]:          92 :       assert (thread.unwound == NULL);
     324                 :             :     }
     325                 :             :   /* NOTREACHED */
     326                 :             : }
     327                 :             : INTDEF(dwfl_getthreads)
     328                 :             : 
     329                 :             : struct one_arg
     330                 :             : {
     331                 :             :   pid_t tid;
     332                 :             :   bool seen;
     333                 :             :   int (*callback) (Dwfl_Thread *thread, void *arg);
     334                 :             :   void *arg;
     335                 :             :   int ret;
     336                 :             : };
     337                 :             : 
     338                 :             : static int
     339                 :           0 : get_one_thread_cb (Dwfl_Thread *thread, void *arg)
     340                 :             : {
     341                 :           0 :   struct one_arg *oa = (struct one_arg *) arg;
     342   [ #  #  #  # ]:           0 :   if (! oa->seen && INTUSE(dwfl_thread_tid) (thread) == oa->tid)
     343                 :             :     {
     344                 :           0 :       oa->seen = true;
     345                 :           0 :       oa->ret = oa->callback (thread, oa->arg);
     346                 :           0 :       return DWARF_CB_ABORT;
     347                 :             :     }
     348                 :             : 
     349                 :             :   return DWARF_CB_OK;
     350                 :             : }
     351                 :             : 
     352                 :             : /* Note not currently exported, will be when there are more Dwfl_Thread
     353                 :             :    properties to query.  Use dwfl_getthread_frames for now directly.  */
     354                 :             : static int
     355                 :           0 : getthread (Dwfl *dwfl, pid_t tid,
     356                 :             :            int (*callback) (Dwfl_Thread *thread, void *arg),
     357                 :             :            void *arg)
     358                 :             : {
     359         [ #  # ]:           0 :   if (dwfl->attacherr != DWFL_E_NOERROR)
     360                 :             :     {
     361                 :           0 :       __libdwfl_seterrno (dwfl->attacherr);
     362                 :           0 :       return -1;
     363                 :             :     }
     364                 :             : 
     365                 :           0 :   Dwfl_Process *process = dwfl->process;
     366         [ #  # ]:           0 :   if (process == NULL)
     367                 :             :     {
     368                 :           0 :       __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE);
     369                 :           0 :       return -1;
     370                 :             :     }
     371                 :             : 
     372         [ #  # ]:           0 :   if (process->callbacks->get_thread != NULL)
     373                 :             :     {
     374                 :           0 :       Dwfl_Thread thread;
     375                 :           0 :       thread.process = process;
     376                 :           0 :       thread.unwound = NULL;
     377                 :           0 :       thread.callbacks_arg = NULL;
     378                 :           0 :       thread.aarch64.pauth_insn_mask = 0;
     379                 :             : 
     380         [ #  # ]:           0 :       if (process->callbacks->get_thread (dwfl, tid, process->callbacks_arg,
     381                 :             :                                           &thread.callbacks_arg))
     382                 :             :         {
     383                 :           0 :           thread.tid = tid;
     384                 :           0 :           return callback (&thread, arg);
     385                 :             :         }
     386                 :             : 
     387                 :             :       return -1;
     388                 :             :     }
     389                 :             : 
     390                 :           0 :    struct one_arg oa = { .tid = tid, .callback = callback,
     391                 :             :                          .arg = arg, .seen = false };
     392                 :           0 :    int err = INTUSE(dwfl_getthreads) (dwfl, get_one_thread_cb, &oa);
     393                 :             : 
     394   [ #  #  #  # ]:           0 :    if (err == DWARF_CB_ABORT && oa.seen)
     395                 :           0 :      return oa.ret;
     396                 :             : 
     397   [ #  #  #  # ]:           0 :    if (err == DWARF_CB_OK && ! oa.seen)
     398                 :             :      {
     399                 :           0 :         errno = ESRCH;
     400                 :           0 :         __libdwfl_seterrno (DWFL_E_ERRNO);
     401                 :           0 :         return -1;
     402                 :             :      }
     403                 :             : 
     404                 :             :    return err;
     405                 :             : }
     406                 :             : 
     407                 :             : struct one_thread
     408                 :             : {
     409                 :             :   int (*callback) (Dwfl_Frame *frame, void *arg);
     410                 :             :   void *arg;
     411                 :             : };
     412                 :             : 
     413                 :             : static int
     414                 :           0 : get_one_thread_frames_cb (Dwfl_Thread *thread, void *arg)
     415                 :             : {
     416                 :           0 :   struct one_thread *ot = (struct one_thread *) arg;
     417                 :           0 :   return INTUSE(dwfl_thread_getframes) (thread, ot->callback, ot->arg);
     418                 :             : }
     419                 :             : 
     420                 :             : int
     421                 :           0 : dwfl_getthread_frames (Dwfl *dwfl, pid_t tid,
     422                 :             :                        int (*callback) (Dwfl_Frame *frame, void *arg),
     423                 :             :                        void *arg)
     424                 :             : {
     425                 :           0 :   struct one_thread ot = { .callback = callback, .arg = arg };
     426                 :           0 :   return getthread (dwfl, tid, get_one_thread_frames_cb, &ot);
     427                 :             : }
     428                 :             : INTDEF(dwfl_getthread_frames)
     429                 :             : 
     430                 :             : int
     431                 :          88 : dwfl_thread_getframes (Dwfl_Thread *thread,
     432                 :             :                        int (*callback) (Dwfl_Frame *state, void *arg),
     433                 :             :                        void *arg)
     434                 :             : {
     435                 :          88 :   Ebl *ebl = thread->process->ebl;
     436         [ -  + ]:          88 :   if (ebl_frame_nregs (ebl) == 0)
     437                 :             :     {
     438                 :           0 :       __libdwfl_seterrno (DWFL_E_NO_UNWIND);
     439                 :           0 :       return -1;
     440                 :             :     }
     441         [ -  + ]:          88 :   if (state_alloc (thread) == NULL)
     442                 :             :     {
     443                 :           0 :       __libdwfl_seterrno (DWFL_E_NOMEM);
     444                 :           0 :       return -1;
     445                 :             :     }
     446                 :          88 :   Dwfl_Process *process = thread->process;
     447         [ -  + ]:          88 :   if (! process->callbacks->set_initial_registers (thread,
     448                 :             :                                                    thread->callbacks_arg))
     449                 :             :     {
     450                 :           0 :       free_states (thread->unwound);
     451                 :           0 :       thread->unwound = NULL;
     452                 :           0 :       return -1;
     453                 :             :     }
     454                 :          88 :   Dwfl_Frame *state = thread->unwound;
     455                 :          88 :   thread->unwound = NULL;
     456         [ -  + ]:          88 :   if (! state_fetch_pc (state))
     457                 :             :     {
     458         [ #  # ]:           0 :       if (process->callbacks->thread_detach)
     459                 :           0 :         process->callbacks->thread_detach (thread, thread->callbacks_arg);
     460                 :          36 :       free_states (state);
     461                 :             :       return -1;
     462                 :             :     }
     463                 :         448 :   do
     464                 :             :     {
     465                 :         448 :       int err = callback (state, arg);
     466         [ +  + ]:         446 :       if (err != DWARF_CB_OK)
     467                 :             :         {
     468         [ -  + ]:          14 :           if (process->callbacks->thread_detach)
     469                 :           0 :             process->callbacks->thread_detach (thread, thread->callbacks_arg);
     470                 :          86 :           free_states (state);
     471                 :             :           return err;
     472                 :             :         }
     473                 :         432 :       __libdwfl_frame_unwind (state);
     474                 :         432 :       Dwfl_Frame *next = state->unwound;
     475                 :             :       /* The old frame is no longer needed.  */
     476                 :         432 :       free (state);
     477                 :         432 :       state = next;
     478                 :             :     }
     479   [ +  +  +  + ]:         432 :   while (state && state->pc_state == DWFL_FRAME_STATE_PC_SET);
     480                 :             : 
     481                 :          72 :   Dwfl_Error err = dwfl_errno ();
     482         [ +  + ]:          72 :   if (process->callbacks->thread_detach)
     483                 :           6 :     process->callbacks->thread_detach (thread, thread->callbacks_arg);
     484   [ +  +  -  + ]:          72 :   if (state == NULL || state->pc_state == DWFL_FRAME_STATE_ERROR)
     485                 :             :     {
     486                 :          36 :       free_states (state);
     487                 :          36 :       __libdwfl_seterrno (err);
     488                 :          36 :       return -1;
     489                 :             :     }
     490         [ -  + ]:          36 :   assert (state->pc_state == DWFL_FRAME_STATE_PC_UNDEFINED);
     491                 :          86 :   free_states (state);
     492                 :             :   return 0;
     493                 :             : }
     494                 :             : INTDEF(dwfl_thread_getframes)
        

Generated by: LCOV version 2.0-1