LCOV - code coverage report
Current view: top level - libdw - dwarf_cu_die.c (source / functions) Hit Total Coverage
Test: elfutils-0.191 Lines: 14 15 93.3 %
Date: 2024-08-30 13:26:44 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 13 16 81.2 %

           Branch data     Line data    Source code
       1                 :            : /* Internal definitions for libdwarf.
       2                 :            :    Copyright (C) 2014 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 <stddef.h>
      34                 :            : #include "libdwP.h"
      35                 :            : 
      36                 :            : 
      37                 :            : Dwarf_Die *
      38                 :     974338 : dwarf_cu_die (Dwarf_CU *cu, Dwarf_Die *result, Dwarf_Half *versionp,
      39                 :            :               Dwarf_Off *abbrev_offsetp, uint8_t *address_sizep,
      40                 :            :               uint8_t *offset_sizep, uint64_t *unit_idp,
      41                 :            :               Dwarf_Off *subdie_offsetp)
      42                 :            : {
      43         [ +  - ]:     974338 :   if (cu == NULL)
      44                 :            :     return NULL;
      45                 :            : 
      46         [ -  + ]:     974338 :   *result = CUDIE (cu);
      47                 :            : 
      48         [ -  + ]:     974338 :   if (versionp != NULL)
      49                 :          0 :     *versionp = cu->version;
      50         [ +  + ]:     974338 :   if (abbrev_offsetp != NULL)
      51                 :       3694 :     *abbrev_offsetp = cu->orig_abbrev_offset;
      52         [ +  + ]:     974338 :   if (address_sizep != NULL)
      53                 :       3694 :     *address_sizep = cu->address_size;
      54         [ +  + ]:     974338 :   if (offset_sizep != NULL)
      55                 :       3694 :     *offset_sizep = cu->offset_size;
      56         [ +  + ]:     974338 :   if (unit_idp != NULL)
      57                 :       3746 :     *unit_idp = cu->unit_id8;
      58         [ +  + ]:     974338 :   if (subdie_offsetp != NULL)
      59                 :       3694 :     *subdie_offsetp = cu->subdie_offset;
      60                 :            : 
      61                 :            :   return result;
      62                 :            : }

Generated by: LCOV version 1.16