LLVMFuzzerTestOneInput:
   28|  8.45k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   29|  8.45k|  char filename[256];
   30|  8.45k|  sprintf(filename, "/tmp/libfuzzer.%d", getpid());
   31|       |
   32|  8.45k|  FILE *fp = fopen(filename, "wb");
   33|  8.45k|  if (!fp) {
  ------------------
  |  Branch (33:7): [True: 0, False: 8.45k]
  ------------------
   34|      0|    return 0;
   35|      0|  }
   36|  8.45k|  fwrite(data, size, 1, fp);
   37|  8.45k|  fclose(fp);
   38|  8.45k|  Dwarf_Ptr errarg = 0;
   39|  8.45k|  Dwarf_Handler errhand = 0;
   40|  8.45k|  Dwarf_Debug dbg = 0;
   41|  8.45k|  Dwarf_Error *errp = NULL;
   42|  8.45k|#define MACHO_PATH_LEN 2000
   43|  8.45k|  char macho_real_path[2000];
   44|  8.45k|  dwarf_init_path(filename, macho_real_path, MACHO_PATH_LEN, DW_GROUPNUMBER_ANY,
  ------------------
  |  |   42|  8.45k|#define MACHO_PATH_LEN 2000
  ------------------
                dwarf_init_path(filename, macho_real_path, MACHO_PATH_LEN, DW_GROUPNUMBER_ANY,
  ------------------
  |  |  126|  8.45k|#define DW_GROUPNUMBER_ANY  0
  ------------------
   45|  8.45k|                  errhand, errarg, &dbg, errp);
   46|       |
   47|  8.45k|  dwarf_finish(dbg);
   48|  8.45k|  static const char *glpath[1] = {"/usr/include/c++/9/debug"};
   49|  8.45k|  unsigned char path_source = 0;
   50|  8.45k|  dwarf_init_path_dl(filename, NULL, 256, DW_GROUPNUMBER_ANY, errhand, errarg,
  ------------------
  |  |  126|  8.45k|#define DW_GROUPNUMBER_ANY  0
  ------------------
   51|  8.45k|                     &dbg, (char **)glpath, 1, &path_source, errp);
   52|  8.45k|  dwarf_finish(dbg);
   53|  8.45k|  unlink(filename);
   54|  8.45k|  return 0;
   55|  8.45k|}

_dwarf_error_destructor:
  137|  6.37k|{
  138|  6.37k|    Dwarf_Error er = (Dwarf_Error)m;
  139|  6.37k|    dwarfstring *erm = (dwarfstring *)er->er_msg;
  140|  6.37k|    if (! erm) {
  ------------------
  |  Branch (140:9): [True: 5.39k, False: 986]
  ------------------
  141|  5.39k|        return;
  142|  5.39k|    }
  143|       |#if DEBUG_ALLOC
  144|       |    printf("libdwarfdetector DEALLOC Now destruct error "
  145|       |        "string %s\n",dwarfstring_string(erm));
  146|       |    fflush(stdout);
  147|       |#endif /* DEBUG_ALLOC */
  148|    986|    dwarfstring_destructor(erm);
  149|    986|    free(erm);
  150|    986|    er->er_msg = 0;
  151|    986|    return;
  152|  6.37k|}
_dwarf_add_to_static_err_list:
  227|  5.20k|{
  228|  5.20k|    unsigned i = 0;
  229|  5.20k|    if (!error) {
  ------------------
  |  Branch (229:9): [True: 0, False: 5.20k]
  ------------------
  230|      0|        return;
  231|      0|    }
  232|       |#ifdef DEBUG_ALLOC
  233|       |    printf("\nlibdwarfdetector add to static err list "
  234|       |        " 0x%lx\n",(unsigned long)(uintptr_t)error);
  235|       |    fflush(stdout);
  236|       |#endif /* DEBUG_ALLOC */
  237|  5.20k|    for ( ; i <static_used; ++i) {
  ------------------
  |  Branch (237:13): [True: 5.20k, False: 1]
  ------------------
  238|  5.20k|        Dwarf_Error e = staticerrlist[i];
  239|  5.20k|        if (e) {
  ------------------
  |  Branch (239:13): [True: 0, False: 5.20k]
  ------------------
  240|      0|            continue;
  241|      0|        }
  242|       |#ifdef DEBUG_ALLOC
  243|       |        printf("libdwarfdetector add to static err list at %u\n",
  244|       |            i);
  245|       |        fflush(stdout);
  246|       |#endif /* DEBUG_ALLOC */
  247|  5.20k|        staticerrlist[i] = error;
  248|  5.20k|        return;
  249|  5.20k|    }
  250|      1|    if (static_used < STATIC_ALLOWED) {
  ------------------
  |  |  184|      1|#define STATIC_ALLOWED 10 /* arbitrary, must be > 2, see below*/
  ------------------
  |  Branch (250:9): [True: 1, False: 0]
  ------------------
  251|      1|        staticerrlist[static_used] = error;
  252|      1|        ++static_used;
  253|      1|    }
  254|      1|}
_dwarf_free_static_errlist:
  291|  25.8k|{
  292|  25.8k|    unsigned i = 0;
  293|       |
  294|  51.7k|    for ( ; i <static_used; ++i) {
  ------------------
  |  Branch (294:13): [True: 25.8k, False: 25.8k]
  ------------------
  295|  25.8k|        Dwarf_Error e = staticerrlist[i];
  296|  25.8k|        if (e) {
  ------------------
  |  Branch (296:13): [True: 0, False: 25.8k]
  ------------------
  297|      0|            dw_empty_errlist_item(e);
  298|      0|            staticerrlist[i] = 0;
  299|      0|        }
  300|  25.8k|    }
  301|  25.8k|}
_dwarf_get_alloc:
  625|  1.45k|{
  626|  1.45k|    char * alloc_mem = 0;
  627|  1.45k|    Dwarf_Unsigned basesize = 0;
  628|  1.45k|    Dwarf_Unsigned size = 0;
  629|  1.45k|    unsigned int type = alloc_type;
  630|  1.45k|    short action = 0;
  631|       |
  632|  1.45k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  1.45k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  1.45k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|      0|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  1.45k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 0, False: 1.45k]
  |  |  |  Branch (159:7): [True: 0, False: 1.45k]
  |  |  |  Branch (159:15): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  633|       |#if DEBUG_ALLOC
  634|       |        printf("libdwarfdetector ALLOC dbg null  "
  635|       |            "ret NULL type 0x%x size %lu line %d %s\n",
  636|       |            (unsigned)alloc_type,(unsigned long)size,
  637|       |            __LINE__,__FILE__);
  638|       |        fflush(stdout);
  639|       |#endif /* DEBUG_ALLOC */
  640|      0|        return NULL;
  641|      0|    }
  642|  1.45k|    if (type >= ALLOC_AREA_INDEX_TABLE_MAX) {
  ------------------
  |  |   48|  1.45k|#define ALLOC_AREA_INDEX_TABLE_MAX 66
  ------------------
  |  Branch (642:9): [True: 0, False: 1.45k]
  ------------------
  643|       |        /* internal error */
  644|       |#if DEBUG_ALLOC
  645|       |        printf("libdwarfdetector ALLOC type bad ret null  "
  646|       |            "ret NULL type 0x%x size %lu line %d %s\n",
  647|       |            (unsigned)alloc_type,(unsigned long)size,
  648|       |            __LINE__,__FILE__);
  649|       |        fflush(stdout);
  650|       |#endif /* DEBUG_ALLOC */
  651|      0|        return NULL;
  652|      0|    }
  653|  1.45k|    basesize = alloc_instance_basics[alloc_type].ia_struct_size;
  654|  1.45k|    action = alloc_instance_basics[alloc_type].ia_multiply_count;
  655|  1.45k|    if (action == MULTIPLY_NO) {
  ------------------
  |  |   86|  1.45k|#define MULTIPLY_NO 0
  ------------------
  |  Branch (655:9): [True: 1.45k, False: 0]
  ------------------
  656|       |        /* Usually count is 1, but do not assume it. */
  657|  1.45k|        size = basesize;
  658|  1.45k|    } else if (action == MULTIPLY_CT) {
  ------------------
  |  |   87|      0|#define MULTIPLY_CT 1
  ------------------
  |  Branch (658:16): [True: 0, False: 0]
  ------------------
  659|      0|        size = basesize * count;
  660|      0|    }  else {
  661|       |        /* MULTIPLY_SP */
  662|       |        /* DW_DLA_ADDR.. count * largest size */
  663|      0|        size = count *
  664|      0|            (sizeof(Dwarf_Addr) > sizeof(Dwarf_Off) ?
  ------------------
  |  Branch (664:14): [Folded - Ignored]
  ------------------
  665|      0|            sizeof(Dwarf_Addr) : sizeof(Dwarf_Off));
  666|      0|    }
  667|  1.45k|    size += DW_RESERVE;
  ------------------
  |  |  171|  1.45k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  668|  1.45k|    alloc_mem = malloc(size);
  669|  1.45k|    if (!alloc_mem) {
  ------------------
  |  Branch (669:9): [True: 0, False: 1.45k]
  ------------------
  670|      0|        return NULL;
  671|      0|    }
  672|  1.45k|    {
  673|  1.45k|        char * ret_mem = alloc_mem + DW_RESERVE;
  ------------------
  |  |  171|  1.45k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  674|  1.45k|        void *key = ret_mem;
  675|  1.45k|        struct reserve_data_s *r = (struct reserve_data_s*)alloc_mem;
  676|  1.45k|        void *result = 0;
  677|       |
  678|  1.45k|        memset(alloc_mem, 0, size);
  679|       |        /* We are not actually using rd_dbg, we are using rd_type. */
  680|  1.45k|        r->rd_dbg = dbg;
  681|  1.45k|        r->rd_type = (unsigned short)alloc_type;
  682|       |        /*  The following is wrong for large records, but
  683|       |            it's not important, so let it be truncated.*/
  684|  1.45k|        r->rd_length = (unsigned short)size;
  685|  1.45k|        if (alloc_instance_basics[type].specialconstructor) {
  ------------------
  |  Branch (685:13): [True: 0, False: 1.45k]
  ------------------
  686|      0|            int res = alloc_instance_basics[type].
  687|      0|                specialconstructor(dbg, ret_mem);
  688|      0|            if (res != DW_DLV_OK) {
  ------------------
  |  |  122|      0|#define DW_DLV_OK        0
  ------------------
  |  Branch (688:17): [True: 0, False: 0]
  ------------------
  689|       |                /*  We leak what we allocated in
  690|       |                    _dwarf_find_memory when
  691|       |                    constructor fails. */
  692|       |#if DEBUG_ALLOC
  693|       |    printf("libdwarfdetector ALLOC constructor fails ret NULL "
  694|       |        "type 0x%x size %lu line %d %s\n",
  695|       |        (unsigned)alloc_type,(unsigned long)size,__LINE__,__FILE__);
  696|       |    fflush(stdout);
  697|       |#endif /* DEBUG_ALLOC */
  698|      0|                return NULL;
  699|      0|            }
  700|      0|        }
  701|       |        /*  See global flag.
  702|       |            If zero then caller chooses not
  703|       |            to track allocations, so dwarf_finish()
  704|       |            is unable to free anything the caller
  705|       |            omitted to dealloc. Normally
  706|       |            the global flag is non-zero */
  707|       |        /*  As of March 14, 2020 it's
  708|       |            not necessary to test for alloc type, but instead
  709|       |            only call tsearch if de_alloc_tree_on. */
  710|  1.45k|        if (global_de_alloc_tree_on) {
  ------------------
  |  Branch (710:13): [True: 1.45k, False: 0]
  ------------------
  711|  1.45k|            result = dwarf_tsearch((void *)key,
  ------------------
  |  |   76|  1.45k|#define dwarf_tsearch  _dwarf_tsearch
  ------------------
  712|  1.45k|                &dbg->de_alloc_tree,simple_compare_function);
  713|  1.45k|            if (!result) {
  ------------------
  |  Branch (713:17): [True: 0, False: 1.45k]
  ------------------
  714|       |                /*  Something badly wrong. Out of memory.
  715|       |                    pretend all is well. */
  716|      0|            }
  717|  1.45k|        }
  718|       |#if DEBUG_ALLOC
  719|       |        printf("\nlibdwarfdetector ALLOC ret 0x%lx type 0x%x "
  720|       |            "size %lu line %d %s\n",
  721|       |            (unsigned long)ret_mem,(unsigned)alloc_type,
  722|       |            (unsigned long)size,__LINE__,__FILE__);
  723|       |        fflush(stdout);
  724|       |#endif /* DEBUG_ALLOC */
  725|  1.45k|        return (ret_mem);
  726|  1.45k|    }
  727|  1.45k|}
dwarf_dealloc_error:
  769|  5.64k|{
  770|  5.64k|    dwarf_dealloc(dbg,err,DW_DLA_ERROR);
  ------------------
  |  |  924|  5.64k|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
  771|  5.64k|}
dwarf_dealloc:
  848|  6.66k|{
  849|  6.66k|    unsigned int type = 0;
  850|  6.66k|    char * malloc_addr = 0;
  851|  6.66k|    struct reserve_data_s * r = 0;
  852|       |#if 0
  853|       |    Dwarf_Bool check_errmsg_list = FALSE;
  854|       |#endif
  855|       |
  856|  6.66k|    if (!space) {
  ------------------
  |  Branch (856:9): [True: 0, False: 6.66k]
  ------------------
  857|       |#ifdef DEBUG_ALLOC
  858|       |        printf("DEALLOC does nothing, space NULL line %d %s\n",
  859|       |            __LINE__,__FILE__);
  860|       |        fflush(stdout);
  861|       |#endif /* DEBUG_ALLOC*/
  862|      0|        return;
  863|      0|    }
  864|  6.66k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  6.66k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  1.45k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|  5.20k|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  1.45k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 5.20k, False: 1.45k]
  |  |  |  Branch (159:7): [True: 5.20k, False: 1.45k]
  |  |  |  Branch (159:15): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  865|       |        /*  App error, or an app that failed in a
  866|       |            dwarf_init*() or dwarf_elf_init*() call.
  867|       |
  868|       |        */
  869|  5.20k|        dw_empty_errlist_item(space);
  870|       |#ifdef DEBUG_ALLOC
  871|       |        printf( "DEALLOC dbg NULL line %d %s\n",
  872|       |            __LINE__,__FILE__);
  873|       |        fflush(stdout);
  874|       |#endif /* DEBUG_ALLOC*/
  875|  5.20k|        return;
  876|  5.20k|    }
  877|  1.45k|    if (space == (Dwarf_Ptr)&_dwarf_failsafe_error) {
  ------------------
  |  Branch (877:9): [True: 0, False: 1.45k]
  ------------------
  878|       |#ifdef DEBUG_ALLOC
  879|       |        printf("DEALLOC failsafe requested at 0x%lx. "
  880|       |            "ignore. line %d %s\n",
  881|       |            (unsigned long)space,
  882|       |            __LINE__,__FILE__);
  883|       |        fflush(stdout);
  884|       |        return;
  885|       |#endif /* DEBUG_ALLOC*/
  886|      0|    }
  887|  1.45k|    if (dbg && dbg->de_alloc_tree) {
  ------------------
  |  Branch (887:9): [True: 1.45k, False: 0]
  |  Branch (887:16): [True: 1.45k, False: 0]
  ------------------
  888|       |        /*  If it's a string in debug_info etc doing
  889|       |            (char *)space - DW_RESERVE is totally bogus. */
  890|  1.45k|        if (alloc_type == DW_DLA_STRING &&
  ------------------
  |  |  911|  2.91k|#define DW_DLA_STRING          0x01  /* char* */
  ------------------
  |  Branch (890:13): [True: 0, False: 1.45k]
  ------------------
  891|  1.45k|            string_is_in_debug_section(dbg,space)) {
  ------------------
  |  Branch (891:13): [True: 0, False: 0]
  ------------------
  892|       |            /*  A string pointer may point into .debug_info or
  893|       |                .debug_string etc.
  894|       |                So must not be freed.  And strings have
  895|       |                no need of a specialdestructor().
  896|       |                Mostly a historical mistake here.
  897|       |                Corrected in libdwarf March 14,2020. */
  898|       |#ifdef DEBUG_ALLOC
  899|       |            printf( "DEALLOC string in section, no dealloc "
  900|       |                "line %d %s\n", __LINE__,__FILE__);
  901|       |            fflush(stdout);
  902|       |#endif /* DEBUG_ALLOC*/
  903|      0|            return;
  904|      0|        }
  905|  1.45k|    }
  906|       |    /*  Otherwise it might be allocated string so it is ok
  907|       |        do the (char *)space - DW_RESERVE  */
  908|       |
  909|       |    /*  If it's a DW_DLA_STRING case and erroneous
  910|       |        the following pointer operations might
  911|       |        result in a coredump if the pointer
  912|       |        is to the beginning of a string section.
  913|       |        If not DW_DLA_STRING
  914|       |        no correctly written caller could coredump
  915|       |        here.  */
  916|  1.45k|    if ((uintptr_t)space > DW_RESERVE) {
  ------------------
  |  |  171|  1.45k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  |  Branch (916:9): [True: 1.45k, False: 0]
  ------------------
  917|  1.45k|        malloc_addr = (char *)space - DW_RESERVE;
  ------------------
  |  |  171|  1.45k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  918|  1.45k|    } else {
  919|       |        /* Impossible */
  920|      0|        return;
  921|      0|    }
  922|  1.45k|    r =(struct reserve_data_s *)malloc_addr;
  923|  1.45k|    if (dbg && dbg != r->rd_dbg) {
  ------------------
  |  Branch (923:9): [True: 1.45k, False: 0]
  |  Branch (923:16): [True: 0, False: 1.45k]
  ------------------
  924|       |        /*  Mixed up or originally a no_dbg alloc */
  925|       |#ifdef DEBUG_ALLOC
  926|       |        printf("DEALLOC find was NULL  dbg 0x%lx "
  927|       |            "rd_dbg 0x%lx space 0x%lx line %d %s\n",
  928|       |            (unsigned long)dbg,
  929|       |            (unsigned long)r->rd_dbg,
  930|       |            (unsigned long)space,
  931|       |            __LINE__,__FILE__);
  932|       |        fflush(stdout);
  933|       |#endif /* DEBUG_ALLOC*/
  934|      0|    }
  935|  1.45k|    if (dbg && alloc_type != r->rd_type) {
  ------------------
  |  Branch (935:9): [True: 1.45k, False: 0]
  |  Branch (935:16): [True: 0, False: 1.45k]
  ------------------
  936|       |        /*  Something is mixed up. */
  937|       |#ifdef DEBUG_ALLOC
  938|       |        printf("DEALLOC does nothing, type 0x%lx rd_type 0x%lx"
  939|       |            " space 0x%lx line %d %s\n",
  940|       |            (unsigned long)alloc_type,
  941|       |            (unsigned long)r->rd_type,
  942|       |            (unsigned long)space,
  943|       |            __LINE__,__FILE__);
  944|       |        fflush(stdout);
  945|       |#endif /* DEBUG_ALLOC*/
  946|      0|        return;
  947|      0|    }
  948|  1.45k|    if (alloc_type == DW_DLA_ERROR) {
  ------------------
  |  |  924|  1.45k|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
  |  Branch (948:9): [True: 1.17k, False: 285]
  ------------------
  949|  1.17k|        Dwarf_Error ep = (Dwarf_Error)space;
  950|       |
  951|  1.17k|        if (ep->er_static_alloc == DE_STATIC) {
  ------------------
  |  |   46|  1.17k|#define DE_STATIC 1   /* Using global static var */
  ------------------
  |  Branch (951:13): [True: 0, False: 1.17k]
  ------------------
  952|       |            /*  This is special, malloc arena
  953|       |                was exhausted or a NULL dbg
  954|       |                was used for the error because the real
  955|       |                dbg was unavailable.
  956|       |                There is nothing to delete, really.
  957|       |                Set er_errval to signal that the
  958|       |                space was dealloc'd. */
  959|      0|            _dwarf_failsafe_error.er_errval =
  960|      0|                DW_DLE_FAILSAFE_ERRVAL;
  ------------------
  |  | 1248|      0|#define DW_DLE_FAILSAFE_ERRVAL                 273
  ------------------
  961|      0|            _dwarf_error_destructor(ep);
  962|       |#ifdef DEBUG_ALLOC
  963|       |            printf("DEALLOC does nothing, DE_STATIC line %d %s\n",
  964|       |                __LINE__,__FILE__);
  965|       |            fflush(stdout);
  966|       |#endif /* DEBUG_ALLOC*/
  967|      0|            return;
  968|      0|        }
  969|  1.17k|        if (ep->er_static_alloc == DE_MALLOC) {
  ------------------
  |  |   47|  1.17k|#define DE_MALLOC 2   /* Using malloc space */
  ------------------
  |  Branch (969:13): [True: 0, False: 1.17k]
  ------------------
  970|       |            /*  This is special, we had no arena
  971|       |                but have a full special area as normal. */
  972|       |#if 0
  973|       |            check_errmsg_list = TRUE;
  974|       |#endif
  975|       |#ifdef DEBUG_ALLOC
  976|       |            printf("DEALLOC does free, DE_MALLOC line %d %s\n",
  977|       |                __LINE__,__FILE__);
  978|       |            fflush(stdout);
  979|       |#endif /* DEBUG_ALLOC*/
  980|      0|            _dwarf_remove_from_staticerrlist(space);
  981|      0|        }
  982|       |        /* Was normal alloc, use normal dealloc. */
  983|       |        /* DW_DLA_ERROR has a specialdestructor */
  984|  1.17k|    }
  985|       |    /*  alloc types are a defined library-private
  986|       |        set of integers. Less than 256 of them. */
  987|  1.45k|    type = (unsigned int)alloc_type;
  988|       |#if DEBUG_ALLOC
  989|       |    if (dbg != r->rd_dbg) {
  990|       |        printf("DEALLOC  dbg != rd_dbg"
  991|       |            " going ahead line %d %s\n",
  992|       |            __LINE__,__FILE__);
  993|       |        fflush(stdout);
  994|       |    }
  995|       |    printf("libdwarfdetector DEALLOC ret 0x%lx type 0x%x "
  996|       |        "size %lu line %d %s\n",
  997|       |        (unsigned long)space,(unsigned)type,
  998|       |        (unsigned long)r->rd_length,__LINE__,__FILE__);
  999|       |#endif /* DEBUG_ALLOC*/
 1000|  1.45k|    if (type >= ALLOC_AREA_INDEX_TABLE_MAX) {
  ------------------
  |  |   48|  1.45k|#define ALLOC_AREA_INDEX_TABLE_MAX 66
  ------------------
  |  Branch (1000:9): [True: 0, False: 1.45k]
  ------------------
 1001|       |        /* internal or user app error */
 1002|       |#ifdef DEBUG_ALLOC
 1003|       |        printf("DEALLOC does nothing, type too big %lu line %d %s\n",
 1004|       |            (unsigned long)type,
 1005|       |            __LINE__,__FILE__);
 1006|       |        fflush(stdout);
 1007|       |#endif /* DEBUG_ALLOC*/
 1008|      0|        return;
 1009|      0|    }
 1010|  1.45k|    if (alloc_instance_basics[type].specialdestructor) {
  ------------------
  |  Branch (1010:9): [True: 1.17k, False: 285]
  ------------------
 1011|  1.17k|        alloc_instance_basics[type].specialdestructor(space);
 1012|  1.17k|    }
 1013|  1.45k|    if (dbg && dbg->de_alloc_tree) {
  ------------------
  |  Branch (1013:9): [True: 1.45k, False: 0]
  |  Branch (1013:16): [True: 1.45k, False: 0]
  ------------------
 1014|       |        /*  The 'space' pointer we get points after the
 1015|       |            reserve space.  The key is 'space'
 1016|       |            and address to free
 1017|       |            is just a few bytes before 'space'. */
 1018|  1.45k|        void *key = space;
 1019|       |
 1020|  1.45k|        dwarf_tdelete(key,&dbg->de_alloc_tree,
  ------------------
  |  |   78|  1.45k|#define dwarf_tdelete  _dwarf_tdelete
  ------------------
 1021|  1.45k|            simple_compare_function);
 1022|       |        /*  If dwarf_tdelete returns NULL it might mean
 1023|       |            a) tree is empty.
 1024|       |            b) If hashsearch, then a single chain might
 1025|       |                now be empty,
 1026|       |                so we do not know of a 'parent node'.
 1027|       |            c) We did not find that key, we did nothing.
 1028|       |
 1029|       |            In any case, we simply don't worry about it.
 1030|       |            Not Supposed To Happen. */
 1031|  1.45k|    }
 1032|  1.45k|    r->rd_dbg  = (void *)(uintptr_t)0xfeadbeef;
 1033|  1.45k|    r->rd_length = 0;
 1034|  1.45k|    r->rd_type = 0;
 1035|  1.45k|    free(malloc_addr);
 1036|  1.45k|    return;
 1037|  1.45k|}
_dwarf_get_debug:
 1045|  10.6k|{
 1046|  10.6k|    Dwarf_Debug dbg;
 1047|       |
 1048|  10.6k|    dbg = (Dwarf_Debug) malloc(sizeof(struct Dwarf_Debug_s));
 1049|  10.6k|    if (!dbg) {
  ------------------
  |  Branch (1049:9): [True: 0, False: 10.6k]
  ------------------
 1050|      0|        return NULL;
 1051|      0|    }
 1052|  10.6k|    memset(dbg, 0, sizeof(struct Dwarf_Debug_s));
 1053|       |    /* Set up for a dwarf_tsearch hash table */
 1054|  10.6k|    dbg->de_magic = DBG_IS_VALID;
  ------------------
  |  |  538|  10.6k|#define DBG_IS_VALID 0xebfdebfd
  ------------------
 1055|       |
 1056|  10.6k|    if (global_de_alloc_tree_on) {
  ------------------
  |  Branch (1056:9): [True: 10.6k, False: 0]
  ------------------
 1057|       |        /*  The type of the dwarf_initialize_search_hash
 1058|       |            initial-size argument */
 1059|  10.6k|        unsigned long size_est = (unsigned long)(filesize/30);
 1060|       |
 1061|       |#ifdef TESTINGHASHTAB
 1062|       |        printf("debugging: src filesize %lu hashtab init %lu\n",
 1063|       |            (unsigned long)filesize,size_est);
 1064|       |#endif
 1065|  10.6k|        dwarf_initialize_search_hash(&dbg->de_alloc_tree,
  ------------------
  |  |   82|  10.6k|#define dwarf_initialize_search_hash _dwarf_initialize_search_hash
  ------------------
 1066|  10.6k|            simple_value_hashfunc,size_est);
 1067|  10.6k|    }
 1068|  10.6k|    return dbg;
 1069|  10.6k|}
_dwarf_free_all_of_one_debug:
 1121|  10.6k|{
 1122|  10.6k|    unsigned g = 0;
 1123|       |
 1124|  10.6k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  10.6k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  10.6k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|      0|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  10.6k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 0, False: 10.6k]
  |  |  |  Branch (159:7): [True: 0, False: 10.6k]
  |  |  |  Branch (159:15): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1125|      0|        _dwarf_free_static_errlist();
 1126|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
 1127|      0|    }
 1128|       |    /*  To do complete validation that we have no surprising
 1129|       |        missing or erroneous deallocs it is advisable to do
 1130|       |        the dwarf_deallocs here
 1131|       |        that are not things the user can otherwise request.
 1132|       |        Housecleaning.  */
 1133|  10.6k|    if (dbg->de_cu_hashindex_data) {
  ------------------
  |  Branch (1133:9): [True: 171, False: 10.5k]
  ------------------
 1134|    171|        dwarf_dealloc_xu_header(dbg->de_cu_hashindex_data);
 1135|    171|        dbg->de_cu_hashindex_data = 0;
 1136|    171|    }
 1137|  10.6k|    if (dbg->de_tu_hashindex_data) {
  ------------------
  |  Branch (1137:9): [True: 63, False: 10.6k]
  ------------------
 1138|     63|        dwarf_dealloc_xu_header(dbg->de_tu_hashindex_data);
 1139|     63|        dbg->de_tu_hashindex_data = 0;
 1140|     63|    }
 1141|  10.6k|    if (dbg->de_printf_callback_null_device_handle) {
  ------------------
  |  Branch (1141:9): [True: 0, False: 10.6k]
  ------------------
 1142|      0|        fclose(dbg->de_printf_callback_null_device_handle);
 1143|      0|        dbg->de_printf_callback_null_device_handle = 0;
 1144|      0|    }
 1145|  10.6k|    freecontextlist(dbg,&dbg->de_info_reading);
 1146|  10.6k|    freecontextlist(dbg,&dbg->de_types_reading);
 1147|       |    /* Housecleaning done. Now really free all the space. */
 1148|  10.6k|    malloc_section_free(&dbg->de_debug_info);
 1149|  10.6k|    malloc_section_free(&dbg->de_debug_types);
 1150|  10.6k|    malloc_section_free(&dbg->de_debug_abbrev);
 1151|  10.6k|    malloc_section_free(&dbg->de_debug_line);
 1152|  10.6k|    malloc_section_free(&dbg->de_debug_line_str);
 1153|  10.6k|    malloc_section_free(&dbg->de_debug_loc);
 1154|  10.6k|    malloc_section_free(&dbg->de_debug_aranges);
 1155|  10.6k|    malloc_section_free(&dbg->de_debug_macinfo);
 1156|  10.6k|    malloc_section_free(&dbg->de_debug_macro);
 1157|  10.6k|    malloc_section_free(&dbg->de_debug_names);
 1158|  10.6k|    malloc_section_free(&dbg->de_debug_pubnames);
 1159|  10.6k|    malloc_section_free(&dbg->de_debug_str);
 1160|  10.6k|    malloc_section_free(&dbg->de_debug_sup);
 1161|  10.6k|    malloc_section_free(&dbg->de_debug_frame);
 1162|  10.6k|    malloc_section_free(&dbg->de_debug_frame_eh_gnu);
 1163|  10.6k|    malloc_section_free(&dbg->de_debug_pubtypes);
 1164|  10.6k|    malloc_section_free(&dbg->de_debug_funcnames);
 1165|  10.6k|    malloc_section_free(&dbg->de_debug_typenames);
 1166|  10.6k|    malloc_section_free(&dbg->de_debug_varnames);
 1167|  10.6k|    malloc_section_free(&dbg->de_debug_weaknames);
 1168|  10.6k|    malloc_section_free(&dbg->de_debug_ranges);
 1169|  10.6k|    malloc_section_free(&dbg->de_debug_str_offsets);
 1170|  10.6k|    malloc_section_free(&dbg->de_debug_addr);
 1171|  10.6k|    malloc_section_free(&dbg->de_debug_gdbindex);
 1172|  10.6k|    malloc_section_free(&dbg->de_debug_cu_index);
 1173|  10.6k|    malloc_section_free(&dbg->de_debug_tu_index);
 1174|  10.6k|    malloc_section_free(&dbg->de_debug_loclists);
 1175|  10.6k|    malloc_section_free(&dbg->de_debug_rnglists);
 1176|  10.6k|    malloc_section_free(&dbg->de_gnu_debuglink);
 1177|  10.6k|    malloc_section_free(&dbg->de_note_gnu_buildid);
 1178|  10.6k|    _dwarf_harmless_cleanout(&dbg->de_harmless_errors);
 1179|       |
 1180|  10.6k|    _dwarf_dealloc_rnglists_context(dbg);
 1181|  10.6k|    _dwarf_dealloc_loclists_context(dbg);
 1182|  10.6k|    if (dbg->de_printf_callback.dp_buffer &&
  ------------------
  |  Branch (1182:9): [True: 0, False: 10.6k]
  ------------------
 1183|  10.6k|        !dbg->de_printf_callback.dp_buffer_user_provided ) {
  ------------------
  |  Branch (1183:9): [True: 0, False: 0]
  ------------------
 1184|      0|        free(dbg->de_printf_callback.dp_buffer);
 1185|      0|    }
 1186|       |
 1187|  10.6k|    _dwarf_destroy_group_map(dbg);
 1188|       |    /*  de_alloc_tree might be NULL if
 1189|       |        global_de_alloc_tree_on is zero. */
 1190|  10.6k|    if (dbg->de_alloc_tree) {
  ------------------
  |  Branch (1190:9): [True: 10.6k, False: 0]
  ------------------
 1191|  10.6k|        dbg->de_in_tdestroy = TRUE;
  ------------------
  |  |   37|  10.6k|#define TRUE 1
  ------------------
 1192|  10.6k|        dwarf_tdestroy(dbg->de_alloc_tree,tdestroy_free_node);
  ------------------
  |  |   80|  10.6k|#define dwarf_tdestroy _dwarf_tdestroy
  ------------------
 1193|  10.6k|        dbg->de_in_tdestroy = FALSE;
  ------------------
  |  |   40|  10.6k|#define FALSE 0
  ------------------
 1194|  10.6k|        dbg->de_alloc_tree = 0;
 1195|  10.6k|    }
 1196|  10.6k|    _dwarf_free_static_errlist();
 1197|       |    /*  first, walk the search and free()
 1198|       |        contents. */
 1199|       |    /*  Now  do the search tree itself */
 1200|  10.6k|    if (dbg->de_tied_data.td_tied_search) {
  ------------------
  |  Branch (1200:9): [True: 0, False: 10.6k]
  ------------------
 1201|      0|        dwarf_tdestroy(dbg->de_tied_data.td_tied_search,
  ------------------
  |  |   80|      0|#define dwarf_tdestroy _dwarf_tdestroy
  ------------------
 1202|      0|            _dwarf_tied_destroy_free_node);
 1203|      0|        dbg->de_tied_data.td_tied_search = 0;
 1204|      0|    }
 1205|  10.6k|    free((void *)dbg->de_path);
 1206|  10.6k|    dbg->de_path = 0;
 1207|  13.2k|    for (g = 0; g < dbg->de_gnu_global_path_count; ++g) {
  ------------------
  |  Branch (1207:17): [True: 2.56k, False: 10.6k]
  ------------------
 1208|  2.56k|        free((char *)dbg->de_gnu_global_paths[g]);
 1209|  2.56k|        dbg->de_gnu_global_paths[g] = 0;
 1210|  2.56k|    }
 1211|  10.6k|    free((void*)dbg->de_gnu_global_paths);
 1212|  10.6k|    dbg->de_gnu_global_paths = 0;
 1213|  10.6k|    dbg->de_gnu_global_path_count = 0;
 1214|  10.6k|    memset(dbg, 0, sizeof(*dbg)); /* Prevent accidental use later. */
 1215|  10.6k|    free(dbg);
 1216|  10.6k|    return DW_DLV_OK;
  ------------------
  |  |  122|  10.6k|#define DW_DLV_OK        0
  ------------------
 1217|  10.6k|}
_dwarf_special_no_dbg_error_malloc:
 1230|  5.20k|{
 1231|  5.20k|    Dwarf_Error e = 0;
 1232|  5.20k|    Dwarf_Unsigned len =  0;
 1233|  5.20k|    struct reserve_data_s *base = 0;
 1234|  5.20k|    char *mem = 0;
 1235|       |
 1236|  5.20k|    len = sizeof(struct Dwarf_Error_s) + DW_RESERVE;
  ------------------
  |  |  171|  5.20k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
 1237|  5.20k|    mem = (char *)malloc((size_t)len);
 1238|  5.20k|    if (!mem) {
  ------------------
  |  Branch (1238:9): [True: 0, False: 5.20k]
  ------------------
 1239|      0|        return 0;
 1240|      0|    }
 1241|  5.20k|    memset(mem, 0, len);
 1242|  5.20k|    base = (struct reserve_data_s *)mem;
 1243|  5.20k|    base->rd_dbg = 0;
 1244|  5.20k|    base->rd_length = (unsigned short)sizeof(struct Dwarf_Error_s);
 1245|  5.20k|    base->rd_type = DW_DLA_ERROR;
  ------------------
  |  |  924|  5.20k|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
 1246|  5.20k|    e = (Dwarf_Error)(mem+DW_RESERVE);
  ------------------
  |  |  171|  5.20k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
 1247|  5.20k|    e->er_static_alloc = DE_MALLOC;
  ------------------
  |  |   47|  5.20k|#define DE_MALLOC 2   /* Using malloc space */
  ------------------
 1248|  5.20k|    return e;
 1249|  5.20k|}
dwarf_alloc.c:dw_empty_errlist_item:
  193|  5.20k|{
  194|  5.20k|    unsigned i = 0;
  195|  5.20k|    if (!e_in) {
  ------------------
  |  Branch (195:9): [True: 0, False: 5.20k]
  ------------------
  196|      0|        return;
  197|      0|    }
  198|  10.4k|    for ( ; i <static_used; ++i) {
  ------------------
  |  Branch (198:13): [True: 5.20k, False: 5.20k]
  ------------------
  199|  5.20k|        Dwarf_Error e = staticerrlist[i];
  200|  5.20k|        if (e != e_in) {
  ------------------
  |  Branch (200:13): [True: 0, False: 5.20k]
  ------------------
  201|      0|            continue;
  202|      0|        }
  203|  5.20k|        if (e->er_static_alloc == DE_MALLOC) {
  ------------------
  |  |   47|  5.20k|#define DE_MALLOC 2   /* Using malloc space */
  ------------------
  |  Branch (203:13): [True: 5.20k, False: 0]
  ------------------
  204|       |            /* e is the returned address, not
  205|       |                the base. Free by the base.  */
  206|  5.20k|            void *mallocaddr = 0;
  207|       |
  208|  5.20k|            if ( (uintptr_t)e > DW_RESERVE) {
  ------------------
  |  |  171|  5.20k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  |  Branch (208:18): [True: 5.20k, False: 0]
  ------------------
  209|  5.20k|                mallocaddr = (char*)e - DW_RESERVE;
  ------------------
  |  |  171|  5.20k|#define DW_RESERVE sizeof(struct reserve_size_s)
  ------------------
  210|  5.20k|            } else {
  211|       |                /*  Impossible */
  212|      0|                continue;
  213|      0|            }
  214|  5.20k|            _dwarf_error_destructor(e);
  215|  5.20k|            free(mallocaddr);
  216|  5.20k|        }
  217|  5.20k|        staticerrlist[i] = 0;
  218|  5.20k|    }
  219|  5.20k|}
dwarf_alloc.c:simple_compare_function:
  594|  1.45k|{
  595|  1.45k|    DW_TSHASHTYPE lp = (DW_TSHASHTYPE)(uintptr_t)l;
  ------------------
  |  |   54|  1.45k|#define DW_TSHASHTYPE uintptr_t
  ------------------
  596|  1.45k|    DW_TSHASHTYPE rp = (DW_TSHASHTYPE)(uintptr_t)r;
  ------------------
  |  |   54|  1.45k|#define DW_TSHASHTYPE uintptr_t
  ------------------
  597|  1.45k|    if (lp < rp) {
  ------------------
  |  Branch (597:9): [True: 0, False: 1.45k]
  ------------------
  598|      0|        return -1;
  599|      0|    }
  600|  1.45k|    if (lp > rp) {
  ------------------
  |  Branch (600:9): [True: 0, False: 1.45k]
  ------------------
  601|      0|        return 1;
  602|      0|    }
  603|  1.45k|    return 0;
  604|  1.45k|}
dwarf_alloc.c:simple_value_hashfunc:
  544|  2.91k|{
  545|  2.91k|    DW_TSHASHTYPE up = (DW_TSHASHTYPE)(uintptr_t)keyp;
  ------------------
  |  |   54|  2.91k|#define DW_TSHASHTYPE uintptr_t
  ------------------
  546|  2.91k|    return up;
  547|  2.91k|}
dwarf_alloc.c:freecontextlist:
 1087|  21.3k|{
 1088|  21.3k|    Dwarf_CU_Context context = 0;
 1089|  21.3k|    Dwarf_CU_Context nextcontext = 0;
 1090|  21.3k|    for (context = dis->de_cu_context_list;
 1091|  21.3k|        context; context = nextcontext) {
  ------------------
  |  Branch (1091:9): [True: 0, False: 21.3k]
  ------------------
 1092|      0|        Dwarf_Hash_Table hash_table = 0;
 1093|       |
 1094|      0|        hash_table = context->cc_abbrev_hash_table;
 1095|       |
 1096|      0|        _dwarf_free_abbrev_hash_table_contents(hash_table,
 1097|      0|            FALSE);
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
 1098|      0|        hash_table->tb_entries = 0;
 1099|      0|        nextcontext = context->cc_next;
 1100|      0|        context->cc_next = 0;
 1101|       |        /*  See also  local_dealloc_cu_context() in
 1102|       |            dwarf_die_deliv.c */
 1103|      0|        free(hash_table);
 1104|      0|        context->cc_abbrev_hash_table = 0;
 1105|      0|        dwarf_dealloc(dbg, context, DW_DLA_CU_CONTEXT);
  ------------------
  |  |  108|      0|#define DW_DLA_CU_CONTEXT       0x20
  ------------------
 1106|      0|    }
 1107|  21.3k|    dis->de_cu_context_list = 0;
 1108|  21.3k|}
dwarf_alloc.c:malloc_section_free:
 1077|   320k|{
 1078|   320k|    if (sec->dss_data_was_malloc) {
  ------------------
  |  Branch (1078:9): [True: 0, False: 320k]
  ------------------
 1079|      0|        free(sec->dss_data);
 1080|      0|    }
 1081|   320k|    sec->dss_data = 0;
 1082|   320k|    sec->dss_data_was_malloc = 0;
 1083|   320k|}

_dwarf_pathjoinl:
  235|  1.00k|{
  236|  1.00k|    char *inputs = dwarfstring_string(input);
  237|  1.00k|    char *targ = dwarfstring_string(target);
  238|  1.00k|    size_t targlenszt = 0;
  239|       |#if defined (_WIN32)
  240|       |    /*  Assuming we are in mingw msys2 or equivalent.
  241|       |        If we are reading a Windows object file but
  242|       |        running non-Windows this won't happen
  243|       |        but debuglink won't be useful anyway. */
  244|       |    dwarfstring winput;
  245|       |
  246|       |    dwarfstring_constructor_static(&winput,winbuf,sizeof(winbuf));
  247|       |    transform_to_posix_slash(&winput,inputs);
  248|       |    targlenszt = dwarfstring_strlen(target);
  249|       |    inputs = dwarfstring_string(&winput);
  250|       |    if (!targlenszt) {
  251|       |        dwarfstring_append(target,inputs);
  252|       |        return DW_DLV_OK;
  253|       |    }
  254|       |#else /* !_Windows */
  255|  1.00k|    targlenszt = dwarfstring_strlen(target);
  256|  1.00k|#endif /* _WIN32 */
  257|       |
  258|  1.00k|    if (!targlenszt) {
  ------------------
  |  Branch (258:9): [True: 185, False: 817]
  ------------------
  259|    185|        dwarfstring_append(target,inputs);
  260|    185|        return DW_DLV_OK;
  ------------------
  |  |  122|    185|#define DW_DLV_OK        0
  ------------------
  261|    185|    }
  262|    817|    targ = dwarfstring_string(target);
  263|    817|    if (!is_full_path(targ+targlenszt-1)) {
  ------------------
  |  Branch (263:9): [True: 817, False: 0]
  ------------------
  264|    817|        if (!is_full_path(inputs)) {
  ------------------
  |  Branch (264:13): [True: 493, False: 324]
  ------------------
  265|    493|            dwarfstring_append(target,joinstr);
  266|    493|            dwarfstring_append(target,inputs);
  267|    493|        } else {
  268|    324|            dwarfstring_append(target,inputs);
  269|    324|        }
  270|    817|    } else {
  271|      0|        if (!is_full_path(inputs)) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|            dwarfstring_append(target,inputs);
  273|      0|        } else {
  274|      0|            dwarfstring_append(target,inputs+1);
  275|      0|        }
  276|      0|    }
  277|       |#if defined (_WIN32)
  278|       |    dwarfstring_destructor(&winput);
  279|       |#endif /* _WIN32 */
  280|    817|    return DW_DLV_OK;
  ------------------
  |  |  122|    817|#define DW_DLV_OK        0
  ------------------
  281|  1.00k|}
_dwarf_construct_linkedto_path:
  617|    185|{
  618|    185|    char * pathname = pathname_in;
  619|    185|    int               res = 0;
  620|    185|    struct joins_s    joind;
  621|    185|    size_t            dirnamelen = 0;
  622|    185|    struct dwarfstring_list_s  base_dwlist;
  623|    185|    struct dwarfstring_list_s *last_entry = 0;
  624|       |
  625|    185|    dwarfstring_list_constructor(&base_dwlist);
  626|    185|    construct_js(&joind);
  627|    185|    dirnamelen = mydirlen(pathname);
  628|    185|    if (dirnamelen) {
  ------------------
  |  Branch (628:9): [True: 185, False: 0]
  ------------------
  629|       |        /*  Original dirname, before cwd (if needed) */
  630|    185|        dwarfstring_append_length(&joind.js_tmp2,
  631|    185|            pathname,dirnamelen);
  632|    185|    }
  633|    185|    if (!is_full_path(pathname)) {
  ------------------
  |  Branch (633:9): [True: 0, False: 185]
  ------------------
  634|       |        /*  Meaning a/b or b, not /a/b or /b ,
  635|       |            so we apply cwd */
  636|      0|        char  buffer[2000];
  637|      0|        unsigned buflen= sizeof(buffer);
  638|      0|        char *wdret = 0;
  639|       |
  640|      0|        buffer[0] = 0;
  641|      0|        wdret = getcwd(buffer,buflen);
  642|      0|        if (!wdret) {
  ------------------
  |  Branch (642:13): [True: 0, False: 0]
  ------------------
  643|       |            /* printf("getcwd() issue. Do nothing. "
  644|       |                " line  %d %s\n",__LINE__,__FILE__); */
  645|      0|            dwarfstring_list_destructor(&base_dwlist);
  646|      0|            destruct_js(&joind);
  647|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  648|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  649|      0|        }
  650|      0|        dwarfstring_append(&joind.js_cwd,buffer);
  651|      0|    }
  652|       |    /* Applies to the leading chars in the named file */
  653|    185|    if (dwarfstring_strlen(&joind.js_tmp2) > 0) {
  ------------------
  |  Branch (653:9): [True: 185, False: 0]
  ------------------
  654|    185|        transform_leading_windowsletter(&joind.js_dirname,
  655|    185|            dwarfstring_string(&joind.js_tmp2));
  656|    185|    }
  657|    185|    dwarfstring_reset(&joind.js_tmp2);
  658|       |
  659|       |    /* Creating a real basename. No slashes. */
  660|    185|    dwarfstring_append(&joind.js_basenamesimple,
  661|    185|        pathname+dirnamelen);
  662|    185|    dwarfstring_append(&joind.js_basesimpledebug,
  663|    185|        dwarfstring_string(&joind.js_basenamesimple));
  664|    185|    dwarfstring_append(&joind.js_basesimpledebug,".debug");
  665|       |
  666|       |    /*  Now js_dirname / js_basenamesimple
  667|       |        are reflecting a full path  */
  668|       |
  669|       |    /*  saves the full path to the original
  670|       |        executable */
  671|    185|    dwarfstring_append(&joind.js_originalfullpath,
  672|    185|        dwarfstring_string(&joind.js_dirname));
  673|    185|    _dwarf_pathjoinl(&joind.js_originalfullpath,
  674|    185|        &joind.js_basenamesimple);
  675|       |
  676|    185|    build_buildid_filename(&joind.js_buildid_filename,
  677|    185|        buildid_length, buildid);
  678|       |    /*  The GNU buildid method of finding debug files.
  679|       |        No crc calculation required ever. */
  680|    185|    res = _dwarf_do_buildid_setup(buildid_length,
  681|    185|        global_prefixes_in,
  682|    185|        length_global_prefixes_in,
  683|    185|        &last_entry,
  684|    185|        &joind,
  685|    185|        &base_dwlist,errcode);
  686|    185|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    185|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (686:9): [True: 0, False: 185]
  ------------------
  687|      0|        dwarfstring_list_destructor(&base_dwlist);
  688|      0|        destruct_js(&joind);
  689|      0|        return res;
  690|      0|    }
  691|       |
  692|       |    /*  The debug link method of finding debug files.
  693|       |        A crc calculation is required for full
  694|       |        checking.  Which can be slow if an object file is large.  */
  695|    185|    res = _dwarf_do_debuglink_setup(link_string_in,
  696|    185|        link_string_fullpath_out,
  697|    185|        global_prefixes_in,
  698|    185|        length_global_prefixes_in,
  699|    185|        &last_entry,
  700|    185|        &joind,&base_dwlist,errcode);
  701|    185|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    185|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (701:9): [True: 0, False: 185]
  ------------------
  702|      0|        dwarfstring_list_destructor(&base_dwlist);
  703|      0|        destruct_js(&joind);
  704|      0|        return res;
  705|      0|    }
  706|       |
  707|       |    /*  Now malloc space for the pointer array
  708|       |        and the strings they point at so a simple
  709|       |        free by our caller will clean up
  710|       |        everything.  Copy the data from
  711|       |        base_dwlist to the new area. */
  712|    185|    {
  713|    185|        struct dwarfstring_list_s *cur = 0;
  714|    185|        char        **resultfullstring = 0;
  715|    185|        unsigned long count = 0;
  716|    185|        size_t        pointerarraysize = 0;
  717|    185|        size_t        sumstringlengths = 0;
  718|    185|        size_t        totalareasize = 0;
  719|    185|        size_t        setptrindex = 0;
  720|    185|        size_t        setstrindex = 0;
  721|       |
  722|    185|        cur = &base_dwlist;
  723|    596|        for ( ; cur ; cur = cur->dl_next) {
  ------------------
  |  Branch (723:17): [True: 411, False: 185]
  ------------------
  724|    411|            ++count;
  725|    411|            pointerarraysize += sizeof(void *);
  726|    411|            sumstringlengths +=
  727|    411|                dwarfstring_strlen(&cur->dl_string) +1;
  728|    411|        }
  729|       |        /*  Make a final null pointer in the pointer array. */
  730|    185|        pointerarraysize += sizeof(void *);
  731|    185|        totalareasize = pointerarraysize + sumstringlengths +8;
  732|    185|        resultfullstring = (char **)malloc(totalareasize);
  733|    185|        setstrindex = pointerarraysize;
  734|    185|        if (!resultfullstring) {
  ------------------
  |  Branch (734:13): [True: 0, False: 185]
  ------------------
  735|      0|            dwarfstring_list_destructor(&base_dwlist);
  736|      0|            destruct_js(&joind);
  737|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  738|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  739|      0|        }
  740|    185|        memset(resultfullstring,0,totalareasize);
  741|    185|        cur = &base_dwlist;
  742|       |
  743|    596|        for ( ; cur ; cur = cur->dl_next,++setptrindex) {
  ------------------
  |  Branch (743:17): [True: 411, False: 185]
  ------------------
  744|    411|            char **iptr = (char **)((char *)resultfullstring +
  745|    411|                setptrindex*sizeof(void *));
  746|    411|            char *sptr = (char*)resultfullstring + setstrindex;
  747|    411|            char *msg = dwarfstring_string(&cur->dl_string);
  748|    411|            size_t slen = dwarfstring_strlen(&cur->dl_string);
  749|       |
  750|    411|            _dwarf_safe_strcpy(sptr,totalareasize - setstrindex,
  751|    411|                msg,slen);
  752|    411|            setstrindex += slen +1;
  753|    411|            *iptr = sptr;
  754|    411|        }
  755|    185|        *paths_out = resultfullstring;
  756|    185|        *paths_out_length = count;
  757|    185|    }
  758|      0|    dwarfstring_list_destructor(&base_dwlist);
  759|    185|    destruct_js(&joind);
  760|    185|    return DW_DLV_OK;
  ------------------
  |  |  122|    185|#define DW_DLV_OK        0
  ------------------
  761|    185|}
dwarf_gnu_debuglink:
  963|    854|{
  964|    854|    dwarfstring debuglink_fullpath;
  965|    854|    int res = DW_DLV_ERROR;
  ------------------
  |  |  123|    854|#define DW_DLV_ERROR     1
  ------------------
  966|    854|    char * pathname = 0;
  967|    854|    int errcode = 0;
  968|    854|    struct Dwarf_Section_s * pdebuglink = 0;
  969|    854|    struct Dwarf_Section_s * pbuildid = 0;
  970|       |
  971|    854|    CHECK_DBG(dbg,error,"dwarf_gnu_debuglink()");
  ------------------
  |  |  190|    854|    do {                                                      \
  |  |  191|    854|        if (!(cd_dbg) || (cd_dbg)->de_magic != DBG_IS_VALID) {    \
  |  |  ------------------
  |  |  |  |  538|    854|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |  |  Branch (191:13): [True: 0, False: 854]
  |  |  |  Branch (191:26): [True: 0, False: 854]
  |  |  ------------------
  |  |  192|      0|            _dwarf_error_string(NULL, (cd_er), DW_DLE_DBG_NULL, \
  |  |  ------------------
  |  |  |  | 1055|      0|#define DW_DLE_DBG_NULL                         81
  |  |  ------------------
  |  |  193|      0|                "DW_DLE_DBG_NULL: "                           \
  |  |  194|      0|                "dbg argument to " cd_funcname                \
  |  |  195|      0|                "either null or it contains"                  \
  |  |  196|      0|                "a stale Dwarf_Debug pointer");               \
  |  |  197|      0|            return DW_DLV_ERROR;                              \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  198|      0|        }                                                     \
  |  |  199|    854|    } while (0)
  |  |  ------------------
  |  |  |  Branch (199:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  972|    854|    if (dbg->de_gnu_debuglink.dss_size) {
  ------------------
  |  Branch (972:9): [True: 339, False: 515]
  ------------------
  973|    339|        pdebuglink = &dbg->de_gnu_debuglink;
  974|    339|        res = _dwarf_load_section(dbg, pdebuglink,error);
  975|    339|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    339|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (975:13): [True: 169, False: 170]
  ------------------
  976|    169|            return res;
  977|    169|        }
  978|    339|    }
  979|    685|    if (dbg->de_note_gnu_buildid.dss_size) {
  ------------------
  |  Branch (979:9): [True: 298, False: 387]
  ------------------
  980|    298|        pbuildid = &dbg->de_note_gnu_buildid;
  981|    298|        res = _dwarf_load_section(dbg, pbuildid,error);
  982|    298|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    298|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (982:13): [True: 121, False: 177]
  ------------------
  983|    121|            return res;
  984|    121|        }
  985|    298|    }
  986|    564|    if (!pdebuglink && !pbuildid) {
  ------------------
  |  Branch (986:9): [True: 394, False: 170]
  |  Branch (986:24): [True: 229, False: 165]
  ------------------
  987|    229|        if (dbg->de_path) {
  ------------------
  |  Branch (987:13): [True: 229, False: 0]
  ------------------
  988|    229|            *debuglink_fullpath_returned = strdup(dbg->de_path);
  989|    229|            *debuglink_fullpath_length_returned =
  990|    229|            (unsigned)strlen(dbg->de_path);
  991|    229|        } else {
  992|      0|            *debuglink_fullpath_returned = 0;
  993|      0|            *debuglink_fullpath_length_returned = 0;
  994|      0|        }
  995|    229|        return DW_DLV_OK;
  ------------------
  |  |  122|    229|#define DW_DLV_OK        0
  ------------------
  996|    229|    }
  997|       |
  998|    335|    if (pbuildid) {
  ------------------
  |  Branch (998:9): [True: 177, False: 158]
  ------------------
  999|       |        /* buildid does not involve calculating a crc at any point */
 1000|    177|        int buildidres = 0;
 1001|    177|        buildidres = _dwarf_extract_buildid(dbg,
 1002|    177|            pbuildid,
 1003|    177|            buildid_type_returned,
 1004|    177|            buildid_owner_name_returned,
 1005|    177|            buildid_returned,
 1006|    177|            buildid_length_returned,
 1007|    177|            error);
 1008|    177|        if (buildidres == DW_DLV_ERROR) {
  ------------------
  |  |  123|    177|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1008:13): [True: 101, False: 76]
  ------------------
 1009|    101|            return buildidres;
 1010|    101|        }
 1011|    177|    }
 1012|    234|    if (pdebuglink) {
  ------------------
  |  Branch (1012:9): [True: 161, False: 73]
  ------------------
 1013|    161|        int linkres = 0;
 1014|       |
 1015|    161|        linkres = _dwarf_extract_debuglink(dbg,
 1016|    161|            pdebuglink,
 1017|    161|            debuglink_path_returned,
 1018|    161|            crc_returned,
 1019|    161|            error);
 1020|    161|        if (linkres == DW_DLV_ERROR) {
  ------------------
  |  |  123|    161|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1020:13): [True: 49, False: 112]
  ------------------
 1021|     49|            return linkres;
 1022|     49|        }
 1023|    161|    }
 1024|    185|    dwarfstring_constructor(&debuglink_fullpath);
 1025|    185|    pathname = dbg->de_path?(char *)dbg->de_path:
  ------------------
  |  Branch (1025:16): [True: 185, False: 0]
  ------------------
 1026|    185|        "";
 1027|    185|    if (pathname && paths_returned) {
  ------------------
  |  Branch (1027:9): [True: 185, False: 0]
  |  Branch (1027:21): [True: 185, False: 0]
  ------------------
 1028|       |        /*  Caller wants paths created and returned. */
 1029|    185|        res =  _dwarf_construct_linkedto_path(
 1030|    185|            (char **)dbg->de_gnu_global_paths,
 1031|    185|            dbg->de_gnu_global_path_count,
 1032|    185|            pathname,
 1033|    185|            *debuglink_path_returned,
 1034|    185|            &debuglink_fullpath,
 1035|    185|            *buildid_returned,
 1036|    185|            *buildid_length_returned,
 1037|    185|            paths_returned,
 1038|    185|            paths_count_returned,
 1039|    185|            &errcode);
 1040|    185|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    185|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1040:13): [True: 0, False: 185]
  ------------------
 1041|      0|            dwarfstring_destructor(&debuglink_fullpath);
 1042|      0|            return res;
 1043|      0|        }
 1044|    185|        if (dwarfstring_strlen(&debuglink_fullpath)) {
  ------------------
  |  Branch (1044:13): [True: 112, False: 73]
  ------------------
 1045|    112|            *debuglink_fullpath_returned =
 1046|    112|                strdup(dwarfstring_string(&debuglink_fullpath));
 1047|    112|            *debuglink_fullpath_length_returned =
 1048|    112|                (unsigned)dwarfstring_strlen(&debuglink_fullpath);
 1049|    112|        }
 1050|    185|    } else if (paths_count_returned) {
  ------------------
  |  Branch (1050:16): [True: 0, False: 0]
  ------------------
 1051|      0|        *paths_count_returned = 0;
 1052|      0|    } else {
 1053|       |        /* nothing special to do */
 1054|      0|    }
 1055|    185|    dwarfstring_destructor(&debuglink_fullpath);
 1056|    185|    return DW_DLV_OK;
  ------------------
  |  |  122|    185|#define DW_DLV_OK        0
  ------------------
 1057|    185|}
dwarf_add_debuglink_global_path:
 1068|  2.56k|{
 1069|  2.56k|    unsigned    glpath_count_in = 0;
 1070|  2.56k|    unsigned    glpath_count_out = 0;
 1071|  2.56k|    char      **glpaths = 0;
 1072|  2.56k|    char       *path1 = 0;
 1073|       |
 1074|  2.56k|    CHECK_DBG(dbg,error,"dwarf_add_debuglink_global_path()");
  ------------------
  |  |  190|  2.56k|    do {                                                      \
  |  |  191|  2.56k|        if (!(cd_dbg) || (cd_dbg)->de_magic != DBG_IS_VALID) {    \
  |  |  ------------------
  |  |  |  |  538|  2.56k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |  |  Branch (191:13): [True: 0, False: 2.56k]
  |  |  |  Branch (191:26): [True: 0, False: 2.56k]
  |  |  ------------------
  |  |  192|      0|            _dwarf_error_string(NULL, (cd_er), DW_DLE_DBG_NULL, \
  |  |  ------------------
  |  |  |  | 1055|      0|#define DW_DLE_DBG_NULL                         81
  |  |  ------------------
  |  |  193|      0|                "DW_DLE_DBG_NULL: "                           \
  |  |  194|      0|                "dbg argument to " cd_funcname                \
  |  |  195|      0|                "either null or it contains"                  \
  |  |  196|      0|                "a stale Dwarf_Debug pointer");               \
  |  |  197|      0|            return DW_DLV_ERROR;                              \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  198|      0|        }                                                     \
  |  |  199|  2.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (199:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1075|  2.56k|    glpath_count_in = dbg->de_gnu_global_path_count;
 1076|  2.56k|    glpath_count_out = glpath_count_in+1;
 1077|  2.56k|    glpaths = (char **)malloc(sizeof(char *)*
 1078|  2.56k|        glpath_count_out);
 1079|  2.56k|    if (!glpaths) {
  ------------------
  |  Branch (1079:9): [True: 0, False: 2.56k]
  ------------------
 1080|      0|        _dwarf_error(dbg,error,DW_DLE_ALLOC_FAIL);
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1081|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
 1082|      0|    }
 1083|  2.56k|    if (glpath_count_in) {
  ------------------
  |  Branch (1083:9): [True: 0, False: 2.56k]
  ------------------
 1084|      0|        memcpy(glpaths, dbg->de_gnu_global_paths,
 1085|      0|            sizeof(char *)*glpath_count_in);
 1086|      0|    }
 1087|  2.56k|    path1 = strdup(pathname);
 1088|  2.56k|    if (!path1) {
  ------------------
  |  Branch (1088:9): [True: 0, False: 2.56k]
  ------------------
 1089|      0|        free(glpaths);
 1090|      0|        _dwarf_error(dbg,error,DW_DLE_ALLOC_FAIL);
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1091|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
 1092|      0|    }
 1093|  2.56k|    free(dbg->de_gnu_global_paths);
 1094|  2.56k|    glpaths[glpath_count_in] = path1;
 1095|  2.56k|    dbg->de_gnu_global_paths = (const char **)glpaths;
 1096|  2.56k|    dbg->de_gnu_global_path_count = glpath_count_out;
 1097|  2.56k|    return DW_DLV_OK;
  ------------------
  |  |  122|  2.56k|#define DW_DLV_OK        0
  ------------------
 1098|  2.56k|}
dwarf_debuglink.c:is_full_path:
   77|  1.81k|{
   78|  1.81k|    unsigned char c = path[0];
   79|  1.81k|    unsigned char c1 = 0;
   80|  1.81k|    int okdriveletter = FALSE;
  ------------------
  |  |   40|  1.81k|#define FALSE 0
  ------------------
   81|       |
   82|  1.81k|    if (!c) {
  ------------------
  |  Branch (82:9): [True: 6, False: 1.81k]
  ------------------
   83|       |        /* empty string. */
   84|      6|        return FALSE;
  ------------------
  |  |   40|      6|#define FALSE 0
  ------------------
   85|      6|    }
   86|  1.81k|    if (c == joinchar) {
  ------------------
  |  Branch (86:9): [True: 485, False: 1.32k]
  ------------------
   87|    485|        return TRUE;
  ------------------
  |  |   37|    485|#define TRUE 1
  ------------------
   88|    485|    }
   89|  1.32k|    if (c >= 'c' && c <= 'z') {
  ------------------
  |  Branch (89:9): [True: 1.08k, False: 241]
  |  Branch (89:21): [True: 1.06k, False: 24]
  ------------------
   90|  1.06k|        okdriveletter = TRUE;
  ------------------
  |  |   37|  1.06k|#define TRUE 1
  ------------------
   91|  1.06k|    } else  if (c >= 'C' && c <= 'Z') {
  ------------------
  |  Branch (91:17): [True: 54, False: 211]
  |  Branch (91:29): [True: 24, False: 30]
  ------------------
   92|     24|        okdriveletter = TRUE;
  ------------------
  |  |   37|     24|#define TRUE 1
  ------------------
   93|     24|    }
   94|  1.32k|    if (!okdriveletter) {
  ------------------
  |  Branch (94:9): [True: 241, False: 1.08k]
  ------------------
   95|    241|        return FALSE;
  ------------------
  |  |   40|    241|#define FALSE 0
  ------------------
   96|    241|    }
   97|       |
   98|  1.08k|    c1 = path[1];
   99|  1.08k|    if (!c1) {
  ------------------
  |  Branch (99:9): [True: 820, False: 267]
  ------------------
  100|       |        /* No second character */
  101|    820|        return FALSE;
  ------------------
  |  |   40|    820|#define FALSE 0
  ------------------
  102|    820|    }
  103|    267|    if (c1 == ':') {
  ------------------
  |  Branch (103:9): [True: 24, False: 243]
  ------------------
  104|       |        /*  Windows full path, we assume
  105|       |            We just assume nobody would be silly enough
  106|       |            to name a linux/posix directory starting with "C:" */
  107|     24|        return TRUE;
  ------------------
  |  |   37|     24|#define TRUE 1
  ------------------
  108|     24|    }
  109|       |    /*  No kind of full path name */
  110|    243|    return FALSE;
  ------------------
  |  |   40|    243|#define FALSE 0
  ------------------
  111|    267|}
dwarf_debuglink.c:dwarfstring_list_constructor:
  320|    411|{
  321|    411|    dwarfstring_constructor(&l->dl_string);
  322|    411|    l->dl_next = 0;
  323|    411|}
dwarf_debuglink.c:construct_js:
  138|    185|{
  139|    185|    memset(js,0,sizeof(struct joins_s));
  140|    185|    dwarfstring_constructor(&js->js_dirname);
  141|    185|    dwarfstring_constructor(&js->js_basenamesimple);
  142|    185|    dwarfstring_constructor(&js->js_basesimpledebug);
  143|    185|    dwarfstring_constructor(&js->js_cwd);
  144|    185|    dwarfstring_constructor(&js->js_originalfullpath);
  145|    185|    dwarfstring_constructor(&js->js_linkstring);
  146|    185|    dwarfstring_constructor(&js->js_tmp2);
  147|    185|    dwarfstring_constructor(&js->js_tmp3);
  148|    185|    dwarfstring_constructor(&js->js_buildid);
  149|    185|    dwarfstring_constructor(&js->js_buildid_filename);
  150|    185|}
dwarf_debuglink.c:mydirlen:
  286|    185|{
  287|    185|    char *cp = 0;
  288|    185|    char *lastjoinchar = 0;
  289|    185|    size_t count =0;
  290|       |
  291|  3.51k|    for (cp = s ; *cp ; ++cp,++count)  {
  ------------------
  |  Branch (291:19): [True: 3.33k, False: 185]
  ------------------
  292|  3.33k|        if (*cp == joinchar) {
  ------------------
  |  Branch (292:13): [True: 370, False: 2.96k]
  ------------------
  293|    370|            lastjoinchar = cp;
  294|    370|        }
  295|  3.33k|    }
  296|    185|    if (lastjoinchar) {
  ------------------
  |  Branch (296:9): [True: 185, False: 0]
  ------------------
  297|       |        /*  ptrdiff_t is generated but not named */
  298|    185|        Dwarf_Unsigned sizetoendjoin =
  299|    185|            (lastjoinchar >= s)?
  ------------------
  |  Branch (299:13): [True: 185, False: 0]
  ------------------
  300|    185|            (Dwarf_Unsigned)(uintptr_t)lastjoinchar -
  301|    185|            (Dwarf_Unsigned)(uintptr_t)s
  302|    185|            :(Dwarf_Unsigned)0xffffffff;
  303|       |        /* count the last join as mydirlen. */
  304|    185|        if (sizetoendjoin == 0xffffffff) {
  ------------------
  |  Branch (304:13): [True: 0, False: 185]
  ------------------
  305|       |            /* impossible. */
  306|      0|            return 0;
  307|      0|        }
  308|    185|        return sizetoendjoin;
  309|    185|    }
  310|      0|    return 0;
  311|    185|}
dwarf_debuglink.c:dwarfstring_list_destructor:
  358|    185|{
  359|    185|    struct dwarfstring_list_s *curl = l;
  360|    185|    struct dwarfstring_list_s *nextl = l;
  361|       |
  362|    185|    nextl = curl->dl_next;
  363|    185|    dwarfstring_destructor(&curl->dl_string);
  364|    185|    curl->dl_next = 0;
  365|    185|    curl = nextl;
  366|    411|    for ( ; curl ; curl = nextl) {
  ------------------
  |  Branch (366:13): [True: 226, False: 185]
  ------------------
  367|    226|        nextl = curl->dl_next;
  368|    226|        dwarfstring_destructor(&curl->dl_string);
  369|    226|        curl->dl_next = 0;
  370|    226|        free(curl);
  371|    226|    }
  372|    185|}
dwarf_debuglink.c:destruct_js:
  153|    185|{
  154|    185|    dwarfstring_destructor(&js->js_dirname);
  155|    185|    dwarfstring_destructor(&js->js_basenamesimple);
  156|    185|    dwarfstring_destructor(&js->js_basesimpledebug);
  157|    185|    dwarfstring_destructor(&js->js_cwd);
  158|    185|    dwarfstring_destructor(&js->js_originalfullpath);
  159|    185|    dwarfstring_destructor(&js->js_linkstring);
  160|    185|    dwarfstring_destructor(&js->js_tmp2);
  161|    185|    dwarfstring_destructor(&js->js_tmp3);
  162|    185|    dwarfstring_destructor(&js->js_buildid);
  163|    185|    dwarfstring_destructor(&js->js_buildid_filename);
  164|    185|}
dwarf_debuglink.c:transform_leading_windowsletter:
  189|    185|{
  190|    185|    char *cp      = in;
  191|    185|    char  c       = 0;
  192|    185|    int   isupper = FALSE;
  ------------------
  |  |   40|    185|#define FALSE 0
  ------------------
  193|    185|    int   islower = FALSE;
  ------------------
  |  |   40|    185|#define FALSE 0
  ------------------
  194|       |
  195|    185|    if (!cp) {
  ------------------
  |  Branch (195:9): [True: 0, False: 185]
  ------------------
  196|       |        /* Nothing to do here. */
  197|      0|        return;
  198|      0|    }
  199|    185|    c = *cp++;
  200|       |    /* Unsure if a, b are normal Windows drive letters. */
  201|    185|    if (c && (c >= 'C') && (c <= 'Z')) {
  ------------------
  |  Branch (201:9): [True: 185, False: 0]
  |  Branch (201:14): [True: 0, False: 185]
  |  Branch (201:28): [True: 0, False: 0]
  ------------------
  202|      0|        isupper = TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  203|    185|    } else if (c && (c >= 'c') && (c <= 'z')) {
  ------------------
  |  Branch (203:16): [True: 185, False: 0]
  |  Branch (203:21): [True: 0, False: 185]
  |  Branch (203:35): [True: 0, False: 0]
  ------------------
  204|      0|        islower = TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  205|      0|    }
  206|    185|    if (isupper || islower) {
  ------------------
  |  Branch (206:9): [True: 0, False: 185]
  |  Branch (206:20): [True: 0, False: 185]
  ------------------
  207|      0|        int c2 = 0;
  208|       |
  209|       |        /* ++ here to move past the colon in the input */
  210|      0|        c2 = *cp++;
  211|      0|        if (c2 && (c2 == ':')) {
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  |  Branch (211:19): [True: 0, False: 0]
  ------------------
  212|       |            /* Example: Turn uppercase C to c */
  213|      0|            char newstr[4];
  214|      0|            char newletter = c;
  215|       |
  216|      0|            if (isupper) {
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|      0|                char distance = 'a' - 'A';
  218|      0|                newletter = c + distance;
  219|      0|            }
  220|      0|            newstr[0] = '/';
  221|      0|            newstr[1] = newletter;
  222|      0|            newstr[2] = 0;
  223|      0|            dwarfstring_append(out,newstr);
  224|      0|        } else {
  225|      0|            cp = in;
  226|      0|        }
  227|    185|    } else {
  228|    185|        cp = in;
  229|    185|    }
  230|    185|    transform_to_posix_slash(out,cp);
  231|    185|}
dwarf_debuglink.c:transform_to_posix_slash:
  172|    185|{
  173|    185|    char *cp = in;
  174|    185|    int c = 0;
  175|       |
  176|    925|    for (c = *cp ; c  ; ++cp,c = *cp) {
  ------------------
  |  Branch (176:20): [True: 740, False: 185]
  ------------------
  177|    740|        if ( *cp == joincharw ) {
  ------------------
  |  Branch (177:14): [True: 0, False: 740]
  ------------------
  178|      0|            dwarfstring_append_length(out,joinstr,1);
  179|    740|        } else {
  180|    740|            dwarfstring_append_length(out,cp,1);
  181|    740|        }
  182|    740|    }
  183|    185|}
dwarf_debuglink.c:build_buildid_filename:
  391|    185|{
  392|    185|    dwarfstring tmp;
  393|    185|    unsigned bu = 0;
  394|    185|    unsigned char *cp  = 0;
  395|       |
  396|    185|    dwarfstring_constructor(&tmp);
  397|    185|    dwarfstring_append(&tmp,".build-id");
  398|    185|    dwarfstring_append(&tmp,joinstr);
  399|    185|    cp = buildid;
  400|  98.0k|    for (bu = 0; bu < buildid_length; ++bu ,++cp) {
  ------------------
  |  Branch (400:18): [True: 97.8k, False: 185]
  ------------------
  401|  97.8k|        dwarfstring_append_printf_u(&tmp, "%02x",*cp);
  402|  97.8k|        if (bu == 0) {
  ------------------
  |  Branch (402:13): [True: 72, False: 97.8k]
  ------------------
  403|     72|            dwarfstring_append(&tmp,"/");
  404|     72|        }
  405|  97.8k|    }
  406|    185|    _dwarf_pathjoinl(target,&tmp);
  407|    185|    dwarfstring_append(target,".debug");
  408|    185|    dwarfstring_destructor(&tmp);
  409|    185|    return;
  410|    185|}
dwarf_debuglink.c:_dwarf_do_buildid_setup:
  541|    185|{
  542|    185|    unsigned                   global_prefix_number = 0;
  543|    185|    int res = 0;
  544|       |
  545|    185|    if (!buildid_length) {
  ------------------
  |  Branch (545:9): [True: 113, False: 72]
  ------------------
  546|    113|        return DW_DLV_OK;
  ------------------
  |  |  122|    113|#define DW_DLV_OK        0
  ------------------
  547|    113|    }
  548|     72|    for (global_prefix_number = 0;
  549|    144|        buildid_length &&
  ------------------
  |  Branch (549:9): [True: 144, False: 0]
  ------------------
  550|    144|        (global_prefix_number < length_global_prefixes_in);
  ------------------
  |  Branch (550:9): [True: 72, False: 72]
  ------------------
  551|     72|        ++global_prefix_number) {
  552|     72|        char * prefix = 0;
  553|     72|        struct dwarfstring_list_s *now_last = 0;
  554|       |
  555|     72|        prefix = global_prefixes_in[global_prefix_number];
  556|     72|        dwarfstring_reset(&joind->js_buildid);
  557|     72|        dwarfstring_append(&joind->js_buildid,prefix);
  558|     72|        _dwarf_pathjoinl(&joind->js_buildid,
  559|     72|            &joind->js_buildid_filename);
  560|     72|        res = dwarfstring_list_add_new(
  561|     72|            base_dwlist,
  562|     72|            *last_entry,&joind->js_buildid,
  563|     72|            &now_last,errcode);
  564|     72|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|     72|#define DW_DLV_OK        0
  ------------------
  |  Branch (564:13): [True: 0, False: 72]
  ------------------
  565|      0|            return res;
  566|      0|        }
  567|     72|        *last_entry = now_last;
  568|     72|    }
  569|     72|    return DW_DLV_OK;
  ------------------
  |  |  122|     72|#define DW_DLV_OK        0
  ------------------
  570|     72|}
dwarf_debuglink.c:dwarfstring_list_add_new:
  331|    408|{
  332|    408|    struct dwarfstring_list_s *next = 0;
  333|       |
  334|    408|    if (prev) {
  ------------------
  |  Branch (334:9): [True: 226, False: 182]
  ------------------
  335|    226|        next = ( struct dwarfstring_list_s *)
  336|    226|        malloc(sizeof(struct dwarfstring_list_s));
  337|    226|        if (!next) {
  ------------------
  |  Branch (337:13): [True: 0, False: 226]
  ------------------
  338|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  339|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  340|      0|        }
  341|    226|        dwarfstring_list_constructor(next);
  342|    226|    } else {
  343|    182|        next = base_entry;
  344|    182|    }
  345|    408|    dwarfstring_append(&next->dl_string,
  346|    408|        dwarfstring_string(input));
  347|    408|    if (prev) {
  ------------------
  |  Branch (347:9): [True: 226, False: 182]
  ------------------
  348|    226|        prev->dl_next = next;
  349|    226|    }
  350|    408|    *new_out = next;
  351|    408|    return DW_DLV_OK;
  ------------------
  |  |  122|    408|#define DW_DLV_OK        0
  ------------------
  352|    408|}
dwarf_debuglink.c:_dwarf_do_debuglink_setup:
  452|    185|{
  453|    185|    int res = 0;
  454|       |
  455|    185|    if (!link_string_in) {
  ------------------
  |  Branch (455:9): [True: 73, False: 112]
  ------------------
  456|     73|        return DW_DLV_OK;
  ------------------
  |  |  122|     73|#define DW_DLV_OK        0
  ------------------
  457|     73|    }
  458|    112|    {
  459|       |        /* First try dir of executable */
  460|    112|        struct dwarfstring_list_s *now_last = 0;
  461|    112|        unsigned  global_prefix_number = 0;
  462|       |
  463|    112|        dwarfstring_append(&joind->js_linkstring,
  464|    112|            link_string_in);
  465|    112|        dwarfstring_reset(&joind->js_tmp3);
  466|    112|        dwarfstring_reset(&joind->js_tmp2);
  467|    112|        prepare_linked_name(&joind->js_tmp3,
  468|    112|            &joind->js_dirname,
  469|    112|            0,&joind->js_linkstring);
  470|    112|        dwarfstring_append(
  471|    112|            link_string_fullpath_out,
  472|    112|            dwarfstring_string(&joind->js_tmp3));
  473|    112|        if (!duplicatedpath(&joind->js_originalfullpath,
  ------------------
  |  Branch (473:13): [True: 112, False: 0]
  ------------------
  474|    112|            &joind->js_tmp3)) {
  475|    112|            res = dwarfstring_list_add_new(
  476|    112|                base_dwlist,
  477|    112|                *last_entry,&joind->js_tmp3,
  478|    112|                &now_last,errcode);
  479|    112|            if (res != DW_DLV_OK) {
  ------------------
  |  |  122|    112|#define DW_DLV_OK        0
  ------------------
  |  Branch (479:17): [True: 0, False: 112]
  ------------------
  480|      0|                return res;
  481|      0|            }
  482|    112|            *last_entry = now_last;
  483|    112|        }
  484|    112|        dwarfstring_reset(&joind->js_tmp2);
  485|    112|        dwarfstring_reset(&joind->js_tmp3);
  486|    112|        dwarfstring_append(&joind->js_tmp3,".debug");
  487|    112|        prepare_linked_name(&joind->js_tmp2,
  488|    112|            &joind->js_dirname,
  489|    112|            &joind->js_tmp3,&joind->js_linkstring);
  490|    112|        if (! duplicatedpath(&joind->js_originalfullpath,
  ------------------
  |  Branch (490:13): [True: 112, False: 0]
  ------------------
  491|    112|            &joind->js_tmp2)) {
  492|    112|            res = dwarfstring_list_add_new(
  493|    112|                base_dwlist,
  494|    112|                *last_entry,&joind->js_tmp2,
  495|    112|                &now_last,errcode);
  496|    112|            if (res != DW_DLV_OK) {
  ------------------
  |  |  122|    112|#define DW_DLV_OK        0
  ------------------
  |  Branch (496:17): [True: 0, False: 112]
  ------------------
  497|      0|                return res;
  498|      0|            }
  499|    112|            *last_entry = now_last;
  500|    112|        } else {
  501|      0|        }
  502|       |        /*  Now look in the global locations. */
  503|    112|        for (global_prefix_number = 0;
  504|    224|            global_prefix_number < length_global_prefixes_in;
  ------------------
  |  Branch (504:13): [True: 112, False: 112]
  ------------------
  505|    112|            ++global_prefix_number) {
  506|    112|            char * prefix =
  507|    112|                global_prefixes_in[global_prefix_number];
  508|       |
  509|    112|            dwarfstring_reset(&joind->js_tmp2);
  510|    112|            dwarfstring_reset(&joind->js_tmp3);
  511|    112|            dwarfstring_append(&joind->js_tmp2, prefix);
  512|    112|            prepare_linked_name(&joind->js_tmp3,
  513|    112|                &joind->js_tmp2,
  514|    112|                &joind->js_dirname,
  515|    112|                &joind->js_linkstring);
  516|    112|            if (!duplicatedpath(&joind->js_originalfullpath,
  ------------------
  |  Branch (516:17): [True: 112, False: 0]
  ------------------
  517|    112|                &joind->js_tmp3)) {
  518|    112|                res = dwarfstring_list_add_new(
  519|    112|                    base_dwlist,
  520|    112|                    *last_entry,&joind->js_tmp3,
  521|    112|                    &now_last,errcode);
  522|    112|                if (res != DW_DLV_OK) {
  ------------------
  |  |  122|    112|#define DW_DLV_OK        0
  ------------------
  |  Branch (522:21): [True: 0, False: 112]
  ------------------
  523|      0|                    return res;
  524|      0|                }
  525|    112|                *last_entry = now_last;
  526|    112|            } else {
  527|      0|            }
  528|    112|        }
  529|    112|    }
  530|    112|    return DW_DLV_OK;
  ------------------
  |  |  122|    112|#define DW_DLV_OK        0
  ------------------
  531|    112|}
dwarf_debuglink.c:prepare_linked_name:
  379|    336|{
  380|    336|    dwarfstring_append(out, dwarfstring_string(dirname));
  381|    336|    if (extradir) {
  ------------------
  |  Branch (381:9): [True: 224, False: 112]
  ------------------
  382|    224|        _dwarf_pathjoinl(out,extradir);
  383|    224|    }
  384|    336|    _dwarf_pathjoinl(out,linkname);
  385|    336|}
dwarf_debuglink.c:duplicatedpath:
  434|    336|{
  435|    336|    if (strcmp(dwarfstring_string(l),
  ------------------
  |  Branch (435:9): [True: 336, False: 0]
  ------------------
  436|    336|        dwarfstring_string(r))) {
  437|    336|        return FALSE;
  ------------------
  |  |   40|    336|#define FALSE 0
  ------------------
  438|    336|    }
  439|       |    /*  Oops. somebody made a mistake */
  440|      0|    return TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  441|    336|}
dwarf_debuglink.c:_dwarf_extract_buildid:
  824|    177|{
  825|    177|    Dwarf_Small * ptr = 0;
  826|    177|    Dwarf_Small * endptr = 0;
  827|    177|    int res = DW_DLV_ERROR;
  ------------------
  |  |  123|    177|#define DW_DLV_ERROR     1
  ------------------
  828|    177|    struct buildid_s *bu = 0;
  829|    177|    Dwarf_Unsigned namesize = 0;
  830|    177|    Dwarf_Unsigned descrsize = 0;
  831|    177|    Dwarf_Unsigned type = 0;
  832|    177|    Dwarf_Unsigned finalsize;
  833|    177|    Dwarf_Unsigned secsize = 0;
  834|       |
  835|    177|    if (!pbuildid->dss_data) {
  ------------------
  |  Branch (835:9): [True: 0, False: 177]
  ------------------
  836|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  837|      0|    }
  838|    177|    secsize = pbuildid->dss_size;
  839|    177|    ptr = pbuildid->dss_data;
  840|    177|    if (secsize < sizeof(struct buildid_s)) {
  ------------------
  |  Branch (840:9): [True: 2, False: 175]
  ------------------
  841|      2|        _dwarf_error(dbg,error,DW_DLE_CORRUPT_NOTE_GNU_DEBUGID);
  ------------------
  |  | 1432|      2|#define DW_DLE_CORRUPT_NOTE_GNU_DEBUGID        457
  ------------------
  842|      2|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      2|#define DW_DLV_ERROR     1
  ------------------
  843|      2|    }
  844|    175|    endptr = ptr + secsize;
  845|       |    /*  We hold gh_content till all is closed
  846|       |        as we return pointers into it
  847|       |        if all goes well. */
  848|    175|    bu = (struct buildid_s *)ptr;
  849|    175|    ASNAR(dbg->de_copy_word,namesize, bu->bu_ownernamesize);
  ------------------
  |  |   57|    175|    do {                                        \
  |  |   58|    175|        (t) = 0;                                \
  |  |   59|    175|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    175|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  850|    175|    ASNAR(dbg->de_copy_word,descrsize,bu->bu_buildidsize);
  ------------------
  |  |   57|    175|    do {                                        \
  |  |   58|    175|        (t) = 0;                                \
  |  |   59|    175|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    175|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  851|    175|    if (descrsize >= secsize) {
  ------------------
  |  Branch (851:9): [True: 31, False: 144]
  ------------------
  852|     31|        _dwarf_error_string(dbg,error,
  853|     31|            DW_DLE_BUILD_ID_DESCRIPTION_SIZE,
  ------------------
  |  | 1470|     31|#define DW_DLE_BUILD_ID_DESCRIPTION_SIZE       495
  ------------------
  854|     31|            "DW_DLE_BUILD_ID_DESCRIPTION_SIZE Size is much too "
  855|     31|            "large to be correct. Corrupt Dwarf");
  856|     31|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     31|#define DW_DLV_ERROR     1
  ------------------
  857|     31|    }
  858|    144|    if ((descrsize+8) >= secsize) {
  ------------------
  |  Branch (858:9): [True: 3, False: 141]
  ------------------
  859|      3|        _dwarf_error_string(dbg,error,
  860|      3|            DW_DLE_BUILD_ID_DESCRIPTION_SIZE,
  ------------------
  |  | 1470|      3|#define DW_DLE_BUILD_ID_DESCRIPTION_SIZE       495
  ------------------
  861|      3|            "DW_DLE_BUILD_ID_DESCRIPTION_SIZE Size is too "
  862|      3|            "large to be correct. Corrupt Dwarf");
  863|      3|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      3|#define DW_DLV_ERROR     1
  ------------------
  864|      3|    }
  865|    141|    if (descrsize >= DW_BUILDID_SANE_SIZE) {
  ------------------
  |  |   38|    141|#define  DW_BUILDID_SANE_SIZE (8*1024)
  ------------------
  |  Branch (865:9): [True: 5, False: 136]
  ------------------
  866|      5|        _dwarf_error_string(dbg,error,
  867|      5|            DW_DLE_BUILD_ID_DESCRIPTION_SIZE,
  ------------------
  |  | 1470|      5|#define DW_DLE_BUILD_ID_DESCRIPTION_SIZE       495
  ------------------
  868|      5|            "DW_DLE_BUILD_ID_DESCRIPTION_SIZE Size is too "
  869|      5|            "large to be sane. Corrupt Dwarf");
  870|      5|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      5|#define DW_DLV_ERROR     1
  ------------------
  871|      5|    }
  872|       |
  873|    136|    ASNAR(dbg->de_copy_word,type,     bu->bu_type);
  ------------------
  |  |   57|    136|    do {                                        \
  |  |   58|    136|        (t) = 0;                                \
  |  |   59|    136|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    136|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  874|       |    /*  descrsize  test is no longer appropriate, other lengths
  875|       |        than 20 may exist.  --Wl,--build-id= can have
  876|       |        at least one of 'fast', 'md5', 'sha1', 'uuid' or
  877|       |        possibly others so we should not check the length. */
  878|    136|    res = _dwarf_check_string_valid(dbg,
  879|    136|        (Dwarf_Small *)&bu->bu_owner[0],
  880|    136|        (Dwarf_Small *)&bu->bu_owner[0],
  881|    136|        endptr,
  882|    136|        DW_DLE_CORRUPT_GNU_DEBUGID_STRING,
  ------------------
  |  | 1434|    136|#define DW_DLE_CORRUPT_GNU_DEBUGID_STRING      459
  ------------------
  883|    136|        error);
  884|    136|    if ( res != DW_DLV_OK) {
  ------------------
  |  |  122|    136|#define DW_DLV_OK        0
  ------------------
  |  Branch (884:10): [True: 1, False: 135]
  ------------------
  885|      1|        return res;
  886|      1|    }
  887|    135|    if ((strlen(bu->bu_owner) +1) != namesize) {
  ------------------
  |  Branch (887:9): [True: 57, False: 78]
  ------------------
  888|     57|        _dwarf_error(dbg,error, DW_DLE_CORRUPT_GNU_DEBUGID_STRING);
  ------------------
  |  | 1434|     57|#define DW_DLE_CORRUPT_GNU_DEBUGID_STRING      459
  ------------------
  889|     57|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     57|#define DW_DLV_ERROR     1
  ------------------
  890|     57|    }
  891|       |
  892|     78|    finalsize = sizeof(struct buildid_s)-1 + namesize + descrsize;
  893|     78|    if (finalsize > secsize) {
  ------------------
  |  Branch (893:9): [True: 2, False: 76]
  ------------------
  894|      2|        _dwarf_error(dbg,error, DW_DLE_CORRUPT_GNU_DEBUGID_SIZE);
  ------------------
  |  | 1433|      2|#define DW_DLE_CORRUPT_GNU_DEBUGID_SIZE        458
  ------------------
  895|      2|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      2|#define DW_DLV_ERROR     1
  ------------------
  896|      2|    }
  897|     76|    *type_returned = (unsigned)type;
  898|     76|    *owner_name_returned = &bu->bu_owner[0];
  899|     76|    if (descrsize >= secsize) { /* In case value insanely large */
  ------------------
  |  Branch (899:9): [True: 0, False: 76]
  ------------------
  900|      0|        dwarfstring m;
  901|       |
  902|      0|        dwarfstring_constructor(&m);
  903|      0|        dwarfstring_append_printf_u(&m,
  904|      0|            "DW_DLE_CORRUPT_NOTE_GNU_DEBUGID buildid description"
  905|      0|            "length %u larger than the section size. "
  906|      0|            "Corrupt object section",descrsize);
  907|      0|        _dwarf_error_string(dbg,error,
  908|      0|            DW_DLE_CORRUPT_GNU_DEBUGID_SIZE,
  ------------------
  |  | 1433|      0|#define DW_DLE_CORRUPT_GNU_DEBUGID_SIZE        458
  ------------------
  909|      0|            dwarfstring_string(&m));
  910|      0|        dwarfstring_destructor(&m);
  911|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  912|      0|    }
  913|     76|    if ((descrsize+8) >= secsize) { /* In case a bit too large */
  ------------------
  |  Branch (913:9): [True: 0, False: 76]
  ------------------
  914|      0|        dwarfstring m;
  915|       |
  916|      0|        dwarfstring_constructor(&m);
  917|      0|        dwarfstring_append_printf_u(&m,
  918|      0|            "DW_DLE_CORRUPT_NOTE_GNU_DEBUGID buildid description"
  919|      0|            "length %u larger than is appropriate. "
  920|      0|            "Corrupt object section",descrsize);
  921|      0|        _dwarf_error_string(dbg,error,
  922|      0|            DW_DLE_CORRUPT_GNU_DEBUGID_SIZE,
  ------------------
  |  | 1433|      0|#define DW_DLE_CORRUPT_GNU_DEBUGID_SIZE        458
  ------------------
  923|      0|            dwarfstring_string(&m));
  924|      0|        dwarfstring_destructor(&m);
  925|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  926|      0|    }
  927|     76|    *build_id_length_returned = (unsigned)descrsize;
  928|     76|    *build_id_returned = (unsigned char *)ptr +
  929|     76|        sizeof(struct buildid_s)-1 + namesize;
  930|     76|    return DW_DLV_OK;
  ------------------
  |  |  122|     76|#define DW_DLV_OK        0
  ------------------
  931|     76|}
dwarf_debuglink.c:_dwarf_extract_debuglink:
  769|    161|{
  770|    161|    Dwarf_Small *ptr = 0;
  771|    161|    Dwarf_Small *endptr = 0;
  772|    161|    size_t   namelenszt = 0;
  773|    161|    unsigned m = 0;
  774|    161|    unsigned incr = 0;
  775|    161|    Dwarf_Small *crcptr = 0;
  776|    161|    int res = DW_DLV_ERROR;
  ------------------
  |  |  123|    161|#define DW_DLV_ERROR     1
  ------------------
  777|    161|    Dwarf_Unsigned secsize = 0;
  778|       |
  779|    161|    if (!pdebuglink->dss_data) {
  ------------------
  |  Branch (779:9): [True: 0, False: 161]
  ------------------
  780|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  781|      0|    }
  782|    161|    secsize = pdebuglink->dss_size;
  783|    161|    ptr = pdebuglink->dss_data;
  784|    161|    endptr = ptr + secsize;
  785|       |
  786|    161|    res = _dwarf_check_string_valid(dbg,ptr,
  787|    161|        ptr, endptr,  DW_DLE_FORM_STRING_BAD_STRING,
  ------------------
  |  | 1336|    161|#define DW_DLE_FORM_STRING_BAD_STRING          361
  ------------------
  788|    161|        error);
  789|    161|    if ( res != DW_DLV_OK) {
  ------------------
  |  |  122|    161|#define DW_DLV_OK        0
  ------------------
  |  Branch (789:10): [True: 14, False: 147]
  ------------------
  790|     14|        return res;
  791|     14|    }
  792|    147|    namelenszt = strlen((const char*)ptr);
  793|    147|    m = (namelenszt+1) %4;
  794|    147|    if (m) {
  ------------------
  |  Branch (794:9): [True: 77, False: 70]
  ------------------
  795|     77|        incr = 4 - m;
  796|     77|    }
  797|    147|    crcptr = (unsigned char *)ptr +namelenszt +1 +incr;
  798|    147|    if ((crcptr +4) != (unsigned char*)endptr) {
  ------------------
  |  Branch (798:9): [True: 35, False: 112]
  ------------------
  799|     35|        _dwarf_error(dbg,error,DW_DLE_CORRUPT_GNU_DEBUGLINK);
  ------------------
  |  | 1431|     35|#define DW_DLE_CORRUPT_GNU_DEBUGLINK           456
  ------------------
  800|     35|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     35|#define DW_DLV_ERROR     1
  ------------------
  801|     35|    }
  802|    112|    *name_returned = (char *)ptr;
  803|    112|    *crc_returned = crcptr;
  804|    112|    return DW_DLV_OK;
  ------------------
  |  |  122|    112|#define DW_DLV_OK        0
  ------------------
  805|    147|}

_dwarf_load_elf_symtab_symbols:
  877|  7.87k|{
  878|  7.87k|    int res = 0;
  879|  7.87k|    struct generic_symentry *gsym = 0;
  880|  7.87k|    Dwarf_Unsigned count = 0;
  881|  7.87k|    Dwarf_Unsigned secnum = ep->f_symtab_sect_index;
  882|  7.87k|    struct generic_shdr * psh = 0;
  883|       |
  884|  7.87k|    if (!secnum) {
  ------------------
  |  Branch (884:9): [True: 7.60k, False: 267]
  ------------------
  885|  7.60k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|  7.60k|#define DW_DLV_NO_ENTRY  -1
  ------------------
  886|  7.60k|    }
  887|    267|    psh = ep->f_shdr + secnum;
  888|    267|    if (psh->gh_size > ep->f_filesize) {
  ------------------
  |  Branch (888:9): [True: 0, False: 267]
  ------------------
  889|      0|        *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|      0|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
  890|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  891|      0|    }
  892|    267|    res = _dwarf_generic_elf_load_symbols(ep,
  893|    267|        secnum,
  894|    267|        psh,
  895|    267|        &gsym,
  896|    267|        &count,errcode);
  897|    267|    if (res == DW_DLV_OK) {
  ------------------
  |  |   59|    267|#define DW_DLV_OK         0
  ------------------
  |  Branch (897:9): [True: 138, False: 129]
  ------------------
  898|    138|        ep->f_symtab = gsym;
  899|    138|        ep->f_loc_symtab.g_count = count;
  900|    138|    }
  901|    267|    return res;
  902|    267|}
_dwarf_load_elf_symstr:
 1124|  8.20k|{
 1125|  8.20k|    struct generic_shdr *strpsh = 0;
 1126|  8.20k|    int res = 0;
 1127|  8.20k|    Dwarf_Unsigned strsectindex  =0;
 1128|  8.20k|    Dwarf_Unsigned strsectlength = 0;
 1129|       |
 1130|  8.20k|    if (!ep->f_symtab_sect_strings_sect_index) {
  ------------------
  |  Branch (1130:9): [True: 7.34k, False: 858]
  ------------------
 1131|  7.34k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|  7.34k|#define DW_DLV_NO_ENTRY  -1
  ------------------
 1132|  7.34k|    }
 1133|    858|    strsectindex = ep->f_symtab_sect_strings_sect_index;
 1134|    858|    strsectlength = ep->f_symtab_sect_strings_max;
 1135|    858|    strpsh = ep->f_shdr + strsectindex;
 1136|       |    /*  Alloc an extra byte as a guaranteed NUL byte
 1137|       |        at the end of the strings in case the section
 1138|       |        is corrupted and lacks a NUL at end. */
 1139|    858|    if (strsectlength > ep->f_filesize ||
  ------------------
  |  Branch (1139:9): [True: 0, False: 858]
  ------------------
 1140|    858|        strpsh->gh_offset >ep->f_filesize ||
  ------------------
  |  Branch (1140:9): [True: 318, False: 540]
  ------------------
 1141|    858|        (strsectlength + strpsh->gh_offset) >
  ------------------
  |  Branch (1141:9): [True: 12, False: 528]
  ------------------
 1142|    540|            ep->f_filesize) {
 1143|    330|        *errcode = DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE;
  ------------------
  |  | 1445|    330|#define DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE    470
  ------------------
 1144|    330|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    330|#define DW_DLV_ERROR      1
  ------------------
 1145|    330|    }
 1146|    528|    ep->f_symtab_sect_strings = calloc(1,strsectlength+1);
 1147|    528|    if (!ep->f_symtab_sect_strings) {
  ------------------
  |  Branch (1147:9): [True: 0, False: 528]
  ------------------
 1148|      0|        ep->f_symtab_sect_strings = 0;
 1149|      0|        ep->f_symtab_sect_strings_max = 0;
 1150|      0|        ep->f_symtab_sect_strings_sect_index = 0;
 1151|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1152|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1153|      0|    }
 1154|    528|    res = RRMOA(ep->f_fd,ep->f_symtab_sect_strings,
  ------------------
  |  |   65|    528|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    528|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1155|    528|        strpsh->gh_offset,
 1156|    528|        strsectlength,
 1157|    528|        ep->f_filesize,errcode);
 1158|    528|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    528|#define DW_DLV_OK         0
  ------------------
  |  Branch (1158:9): [True: 3, False: 525]
  ------------------
 1159|      3|        free(ep->f_symtab_sect_strings);
 1160|      3|        ep->f_symtab_sect_strings = 0;
 1161|      3|        ep->f_symtab_sect_strings_max = 0;
 1162|      3|        ep->f_symtab_sect_strings_sect_index = 0;
 1163|      3|        return res;
 1164|      3|    }
 1165|    525|    return DW_DLV_OK;
  ------------------
  |  |   59|    525|#define DW_DLV_OK         0
  ------------------
 1166|    528|}
_dwarf_load_elf_relx:
 1633|  62.0k|{
 1634|  62.0k|    struct generic_shdr *gshdr = 0;
 1635|  62.0k|    Dwarf_Unsigned seccount = 0;
 1636|  62.0k|    unsigned offsetsize = 0;
 1637|  62.0k|    struct generic_rela *grp = 0;
 1638|  62.0k|    Dwarf_Unsigned count_read = 0;
 1639|  62.0k|    int res = 0;
 1640|  62.0k|    unsigned oksec = 0;
 1641|  62.0k|    enum RelocOffsetSize localoffsize = RelocOffset32;
 1642|       |
 1643|       |    /*  ASSERT: Caller guarantees localr is
 1644|       |        a valid RelocRela  */
 1645|  62.0k|    if (!ep) {
  ------------------
  |  Branch (1645:9): [True: 0, False: 62.0k]
  ------------------
 1646|      0|        *errcode = DW_DLE_INTERNAL_NULL_POINTER;
  ------------------
  |  | 1411|      0|#define DW_DLE_INTERNAL_NULL_POINTER           436
  ------------------
 1647|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1648|      0|    }
 1649|  62.0k|    offsetsize = ep->f_offsetsize;
 1650|  62.0k|    seccount = ep->f_loc_shdr.g_count;
 1651|  62.0k|    if (secnum >= seccount) {
  ------------------
  |  Branch (1651:9): [True: 0, False: 62.0k]
  ------------------
 1652|      0|        *errcode = DW_DLE_ELF_SECTION_ERROR;
  ------------------
  |  | 1421|      0|#define DW_DLE_ELF_SECTION_ERROR               446
  ------------------
 1653|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1654|      0|    }
 1655|  62.0k|    gshdr = ep->f_shdr +secnum;
 1656|  62.0k|    if (is_empty_section(gshdr->gh_type)) {
  ------------------
  |  Branch (1656:9): [True: 37.3k, False: 24.7k]
  ------------------
 1657|       |
 1658|  37.3k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|  37.3k|#define DW_DLV_NO_ENTRY  -1
  ------------------
 1659|  37.3k|    }
 1660|       |
 1661|  24.7k|    res = this_rel_is_a_section_dwarf_related(ep,gshdr,
 1662|  24.7k|        &oksec,errcode);
 1663|  24.7k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  24.7k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (1663:9): [True: 267, False: 24.5k]
  ------------------
 1664|    267|        return res;
 1665|    267|    }
 1666|  24.5k|    if (!oksec) {
  ------------------
  |  Branch (1666:9): [True: 15.4k, False: 9.04k]
  ------------------
 1667|  15.4k|        return DW_DLV_OK;
  ------------------
  |  |   59|  15.4k|#define DW_DLV_OK         0
  ------------------
 1668|  15.4k|    }
 1669|       |    /*  We will actually read these relocations. */
 1670|  9.04k|    if (offsetsize == 64) {
  ------------------
  |  Branch (1670:9): [True: 1.23k, False: 7.81k]
  ------------------
 1671|  1.23k|        localoffsize = RelocOffset64;
 1672|  7.81k|    } else if (offsetsize == 32) {
  ------------------
  |  Branch (1672:16): [True: 7.81k, False: 0]
  ------------------
 1673|  7.81k|        localoffsize = RelocOffset32;
 1674|  7.81k|    } else {
 1675|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
 1676|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1677|      0|    }
 1678|       |    /*  ASSERT: localoffsize is now a valid enum value,
 1679|       |        one of the two defined. */
 1680|  9.04k|    res = _dwarf_elf_load_a_relx_batch(ep,
 1681|  9.04k|        gshdr,&grp,&count_read,localr,localoffsize,errcode);
 1682|  9.04k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  9.04k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (1682:9): [True: 474, False: 8.56k]
  ------------------
 1683|    474|        return res;
 1684|    474|    }
 1685|  8.56k|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   58|  8.56k|#define DW_DLV_NO_ENTRY  -1
  ------------------
  |  Branch (1685:9): [True: 2.01k, False: 6.54k]
  ------------------
 1686|  2.01k|        return res;
 1687|  2.01k|    }
 1688|  6.54k|    gshdr->gh_rels = grp;
 1689|  6.54k|    gshdr->gh_relcount = count_read;
 1690|  6.54k|    return DW_DLV_OK;
  ------------------
  |  |   59|  6.54k|#define DW_DLV_OK         0
  ------------------
 1691|  8.56k|}
_dwarf_load_elf_header:
 1826|  12.9k|{
 1827|  12.9k|    unsigned offsetsize = ep->f_offsetsize;
 1828|  12.9k|    int res = 0;
 1829|       |
 1830|  12.9k|    if (offsetsize == 32) {
  ------------------
  |  Branch (1830:9): [True: 8.26k, False: 4.73k]
  ------------------
 1831|  8.26k|        res = elf_load_elf_header32(ep,errcode);
 1832|  8.26k|    } else if (offsetsize == 64) {
  ------------------
  |  Branch (1832:16): [True: 4.73k, False: 0]
  ------------------
 1833|  4.73k|        if (sizeof(Dwarf_Unsigned) < 8) {
  ------------------
  |  Branch (1833:13): [Folded - Ignored]
  ------------------
 1834|      0|            *errcode =  DW_DLE_INTEGER_TOO_SMALL;
  ------------------
  |  | 1414|      0|#define DW_DLE_INTEGER_TOO_SMALL               439
  ------------------
 1835|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1836|      0|        }
 1837|  4.73k|        res = elf_load_elf_header64(ep,errcode);
 1838|  4.73k|    } else {
 1839|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
 1840|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1841|      0|    }
 1842|  12.9k|    return res;
 1843|  12.9k|}
_dwarf_load_elf_sectheaders:
 2207|  12.8k|{
 2208|  12.8k|    int res = 0;
 2209|       |
 2210|  12.8k|    if (ep->f_offsetsize == 32) {
  ------------------
  |  Branch (2210:9): [True: 8.17k, False: 4.64k]
  ------------------
 2211|  8.17k|        res  = elf_load_sectheaders32(ep,ep->f_ehdr->ge_shoff,
 2212|  8.17k|            ep->f_ehdr->ge_shentsize,
 2213|  8.17k|            ep->f_ehdr->ge_shnum,errcode);
 2214|  8.17k|    } else  if (ep->f_offsetsize == 64) {
  ------------------
  |  Branch (2214:17): [True: 4.64k, False: 0]
  ------------------
 2215|  4.64k|        res  = elf_load_sectheaders64(ep,ep->f_ehdr->ge_shoff,
 2216|  4.64k|            ep->f_ehdr->ge_shentsize,
 2217|  4.64k|            ep->f_ehdr->ge_shnum,errcode);
 2218|  4.64k|    } else {
 2219|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
 2220|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 2221|      0|    }
 2222|  12.8k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  12.8k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2222:9): [True: 3.28k, False: 9.52k]
  ------------------
 2223|  3.28k|        return res;
 2224|  3.28k|    }
 2225|  9.52k|    res  = _dwarf_elf_load_sectstrings(ep,
 2226|  9.52k|        ep->f_ehdr->ge_shstrndx,errcode);
 2227|  9.52k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  9.52k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2227:9): [True: 423, False: 9.10k]
  ------------------
 2228|    423|        return res;
 2229|    423|    }
 2230|  9.10k|    res  = _dwarf_elf_load_sect_namestring(ep,errcode);
 2231|  9.10k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  9.10k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2231:9): [True: 111, False: 8.99k]
  ------------------
 2232|    111|        return res;
 2233|    111|    }
 2234|  8.99k|    res  = _dwarf_elf_find_sym_sections(ep,errcode);
 2235|  8.99k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  8.99k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2235:9): [True: 45, False: 8.94k]
  ------------------
 2236|     45|        return res;
 2237|     45|    }
 2238|  8.94k|    res = _dwarf_elf_setup_all_section_groups(ep,errcode);
 2239|  8.94k|    return res;
 2240|  8.99k|}
dwarf_elf_load_headers.c:_dwarf_generic_elf_load_symbols:
  813|    267|{
  814|    267|    int res = 0;
  815|    267|    struct generic_symentry *gsym = 0;
  816|    267|    Dwarf_Unsigned count = 0;
  817|       |
  818|    267|    if (!secnum) {
  ------------------
  |  Branch (818:9): [True: 0, False: 267]
  ------------------
  819|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  820|      0|    }
  821|    267|    if (psh->gh_size > ep->f_filesize) {
  ------------------
  |  Branch (821:9): [True: 0, False: 267]
  ------------------
  822|      0|        *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|      0|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
  823|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  824|      0|    }
  825|    267|    if (ep->f_offsetsize == 32) {
  ------------------
  |  Branch (825:9): [True: 69, False: 198]
  ------------------
  826|     69|        res = _dwarf_generic_elf_load_symbols32(ep,
  827|     69|            &gsym,
  828|     69|            psh->gh_offset,psh->gh_size,
  829|     69|            &count,errcode);
  830|    198|    } else if (ep->f_offsetsize == 64) {
  ------------------
  |  Branch (830:16): [True: 198, False: 0]
  ------------------
  831|    198|        res = _dwarf_generic_elf_load_symbols64(ep,
  832|    198|            &gsym,
  833|    198|            psh->gh_offset,psh->gh_size,
  834|    198|            &count,errcode);
  835|    198|    } else {
  836|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  837|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  838|      0|    }
  839|    267|    if (res == DW_DLV_OK) {
  ------------------
  |  |   59|    267|#define DW_DLV_OK         0
  ------------------
  |  Branch (839:9): [True: 138, False: 129]
  ------------------
  840|    138|        *gsym_out = gsym;
  841|    138|        *count_out = count;
  842|    138|    }
  843|    267|    return res;
  844|    267|}
dwarf_elf_load_headers.c:_dwarf_generic_elf_load_symbols32:
  677|     69|{
  678|     69|    Dwarf_Unsigned ecount = 0;
  679|     69|    Dwarf_Unsigned size2 = 0;
  680|     69|    Dwarf_Unsigned i = 0;
  681|     69|    dw_elf32_sym *psym = 0;
  682|     69|    dw_elf32_sym *orig_psym = 0;
  683|     69|    struct generic_symentry * gsym = 0;
  684|     69|    struct generic_symentry * orig_gsym = 0;
  685|     69|    int res = 0;
  686|       |
  687|     69|    ecount = (long)(size/sizeof(dw_elf32_sym));
  688|     69|    size2 = ecount * sizeof(dw_elf32_sym);
  689|     69|    if (size != size2) {
  ------------------
  |  Branch (689:9): [True: 15, False: 54]
  ------------------
  690|     15|        *errcode = DW_DLE_SYMBOL_SECTION_SIZE_ERROR;
  ------------------
  |  | 1465|     15|#define DW_DLE_SYMBOL_SECTION_SIZE_ERROR       490
  ------------------
  691|     15|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     15|#define DW_DLV_ERROR      1
  ------------------
  692|     15|    }
  693|     54|    if (size >= ep->f_filesize ) {
  ------------------
  |  Branch (693:9): [True: 0, False: 54]
  ------------------
  694|      0|        *errcode = DW_DLE_SYMBOL_SECTION_SIZE_ERROR;
  ------------------
  |  | 1465|      0|#define DW_DLE_SYMBOL_SECTION_SIZE_ERROR       490
  ------------------
  695|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  696|      0|    }
  697|     54|    psym = calloc(ecount,sizeof(dw_elf32_sym));
  698|     54|    if (!psym) {
  ------------------
  |  Branch (698:9): [True: 0, False: 54]
  ------------------
  699|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  700|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  701|      0|    }
  702|     54|    gsym = calloc(ecount,sizeof(struct generic_symentry));
  703|     54|    if (!gsym) {
  ------------------
  |  Branch (703:9): [True: 0, False: 54]
  ------------------
  704|      0|        free(psym);
  705|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  706|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  707|      0|    }
  708|     54|    res = RRMOA(ep->f_fd,psym,offset,size,
  ------------------
  |  |   65|     54|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|     54|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  709|     54|        ep->f_filesize,errcode);
  710|     54|    if (res!= DW_DLV_OK) {
  ------------------
  |  |   59|     54|#define DW_DLV_OK         0
  ------------------
  |  Branch (710:9): [True: 18, False: 36]
  ------------------
  711|     18|        free(psym);
  712|     18|        free(gsym);
  713|     18|        return res;
  714|     18|    }
  715|     36|    orig_psym = psym;
  716|     36|    orig_gsym = gsym;
  717|    828|    for ( i = 0; i < ecount; ++i,++psym,++gsym) {
  ------------------
  |  Branch (717:18): [True: 792, False: 36]
  ------------------
  718|    792|        Dwarf_Unsigned bind = 0;
  719|    792|        Dwarf_Unsigned type = 0;
  720|       |
  721|    792|        ASNAR(ep->f_copy_word,gsym->gs_name,psym->st_name);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  722|    792|        ASNAR(ep->f_copy_word,gsym->gs_value,psym->st_value);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  723|    792|        ASNAR(ep->f_copy_word,gsym->gs_size,psym->st_size);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  724|    792|        ASNAR(ep->f_copy_word,gsym->gs_info,psym->st_info);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  725|    792|        ASNAR(ep->f_copy_word,gsym->gs_other,psym->st_other);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  726|    792|        ASNAR(ep->f_copy_word,gsym->gs_shndx,psym->st_shndx);
  ------------------
  |  |   57|    792|    do {                                        \
  |  |   58|    792|        (t) = 0;                                \
  |  |   59|    792|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    792|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  727|    792|        bind = gsym->gs_info >> 4;
  728|    792|        type = gsym->gs_info & 0xf;
  729|    792|        gsym->gs_bind = bind;
  730|    792|        gsym->gs_type = type;
  731|    792|    }
  732|     36|    *count_out = ecount;
  733|     36|    *gsym_out = orig_gsym;
  734|     36|    free(orig_psym);
  735|     36|    return DW_DLV_OK;
  ------------------
  |  |   59|     36|#define DW_DLV_OK         0
  ------------------
  736|     54|}
dwarf_elf_load_headers.c:_dwarf_generic_elf_load_symbols64:
  744|    198|{
  745|    198|    Dwarf_Unsigned ecount = 0;
  746|    198|    Dwarf_Unsigned size2 = 0;
  747|    198|    Dwarf_Unsigned i = 0;
  748|    198|    dw_elf64_sym *psym = 0;
  749|    198|    dw_elf64_sym *orig_psym = 0;
  750|    198|    struct generic_symentry * gsym = 0;
  751|    198|    struct generic_symentry * orig_gsym = 0;
  752|    198|    int res = 0;
  753|       |
  754|    198|    ecount = (long)(size/sizeof(dw_elf64_sym));
  755|    198|    size2 = ecount * sizeof(dw_elf64_sym);
  756|    198|    if (size != size2) {
  ------------------
  |  Branch (756:9): [True: 48, False: 150]
  ------------------
  757|     48|        *errcode = DW_DLE_SYMBOL_SECTION_SIZE_ERROR;
  ------------------
  |  | 1465|     48|#define DW_DLE_SYMBOL_SECTION_SIZE_ERROR       490
  ------------------
  758|     48|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     48|#define DW_DLV_ERROR      1
  ------------------
  759|     48|    }
  760|    150|    if (size >= ep->f_filesize ) {
  ------------------
  |  Branch (760:9): [True: 0, False: 150]
  ------------------
  761|      0|        *errcode = DW_DLE_SYMBOL_SECTION_SIZE_ERROR;
  ------------------
  |  | 1465|      0|#define DW_DLE_SYMBOL_SECTION_SIZE_ERROR       490
  ------------------
  762|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  763|      0|    }
  764|    150|    psym = calloc(ecount,sizeof(dw_elf64_sym));
  765|    150|    if (!psym) {
  ------------------
  |  Branch (765:9): [True: 0, False: 150]
  ------------------
  766|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  767|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  768|      0|    }
  769|    150|    gsym = calloc(ecount,sizeof(struct generic_symentry));
  770|    150|    if (!gsym) {
  ------------------
  |  Branch (770:9): [True: 0, False: 150]
  ------------------
  771|      0|        free(psym);
  772|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  773|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  774|      0|    }
  775|    150|    res = RRMOA(ep->f_fd,psym,offset,size,
  ------------------
  |  |   65|    150|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    150|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  776|    150|        ep->f_filesize,errcode);
  777|    150|    if (res!= DW_DLV_OK) {
  ------------------
  |  |   59|    150|#define DW_DLV_OK         0
  ------------------
  |  Branch (777:9): [True: 48, False: 102]
  ------------------
  778|     48|        free(psym);
  779|     48|        free(gsym);
  780|     48|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|     48|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  781|     48|        return res;
  782|     48|    }
  783|    102|    orig_psym = psym;
  784|    102|    orig_gsym = gsym;
  785|  72.2k|    for ( i = 0; i < ecount; ++i,++psym,++gsym) {
  ------------------
  |  Branch (785:18): [True: 72.0k, False: 102]
  ------------------
  786|  72.0k|        Dwarf_Unsigned bind = 0;
  787|  72.0k|        Dwarf_Unsigned type = 0;
  788|       |
  789|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_name,psym->st_name);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  790|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_value,psym->st_value);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  791|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_size,psym->st_size);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  792|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_info,psym->st_info);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  793|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_other,psym->st_other);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  794|  72.0k|        ASNAR(ep->f_copy_word,gsym->gs_shndx,psym->st_shndx);
  ------------------
  |  |   57|  72.0k|    do {                                        \
  |  |   58|  72.0k|        (t) = 0;                                \
  |  |   59|  72.0k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  72.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  795|  72.0k|        bind = gsym->gs_info >> 4;
  796|  72.0k|        type = gsym->gs_info & 0xf;
  797|  72.0k|        gsym->gs_bind = bind;
  798|  72.0k|        gsym->gs_type = type;
  799|  72.0k|    }
  800|    102|    *count_out = ecount;
  801|    102|    *gsym_out = orig_gsym;
  802|    102|    free(orig_psym);
  803|    102|    return DW_DLV_OK;
  ------------------
  |  |   59|    102|#define DW_DLV_OK         0
  ------------------
  804|    150|}
dwarf_elf_load_headers.c:is_empty_section:
  157|  1.92M|{
  158|  1.92M|    if (type == SHT_NOBITS) {
  ------------------
  |  |   84|  1.92M|#define SHT_NOBITS 8
  ------------------
  |  Branch (158:9): [True: 24.1k, False: 1.89M]
  ------------------
  159|  24.1k|        return TRUE;
  ------------------
  |  |   37|  24.1k|#define TRUE 1
  ------------------
  160|  24.1k|    }
  161|  1.89M|    if (type == SHT_NULL) {
  ------------------
  |  |   41|  1.89M|#define SHT_NULL 0
  ------------------
  |  Branch (161:9): [True: 1.50M, False: 391k]
  ------------------
  162|  1.50M|        return TRUE;
  ------------------
  |  |   37|  1.50M|#define TRUE 1
  ------------------
  163|  1.50M|    }
  164|   391k|    return FALSE;
  ------------------
  |  |   40|   391k|#define FALSE 0
  ------------------
  165|  1.89M|}
dwarf_elf_load_headers.c:this_rel_is_a_section_dwarf_related:
 1601|  24.7k|{
 1602|  24.7k|    Dwarf_Unsigned oksecnum = 0;
 1603|  24.7k|    struct generic_shdr *gstarg = 0;
 1604|       |
 1605|  24.7k|    if (gshdr->gh_type != SHT_RELA &&
  ------------------
  |  |   53|  49.5k|#define SHT_RELA 4
  ------------------
  |  Branch (1605:9): [True: 15.8k, False: 8.95k]
  ------------------
 1606|  24.7k|        gshdr->gh_type != SHT_REL)  {
  ------------------
  |  |   56|  15.8k|#define SHT_REL 9
  ------------------
  |  Branch (1606:9): [True: 5.67k, False: 10.1k]
  ------------------
 1607|  5.67k|        *oksecnum_out = 0;
 1608|  5.67k|        return DW_DLV_OK;
  ------------------
  |  |   59|  5.67k|#define DW_DLV_OK         0
  ------------------
 1609|  5.67k|    }
 1610|  19.1k|    oksecnum = gshdr->gh_reloc_target_secnum;
 1611|  19.1k|    if (oksecnum >= ep->f_loc_shdr.g_count) {
  ------------------
  |  Branch (1611:9): [True: 267, False: 18.8k]
  ------------------
 1612|    267|        *oksecnum_out = 0;
 1613|    267|        *errcode = DW_DLE_ELF_SECTION_ERROR;
  ------------------
  |  | 1421|    267|#define DW_DLE_ELF_SECTION_ERROR               446
  ------------------
 1614|    267|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    267|#define DW_DLV_ERROR      1
  ------------------
 1615|    267|    }
 1616|  18.8k|    gstarg = ep->f_shdr+oksecnum;
 1617|  18.8k|    if (!gstarg->gh_is_dwarf) {
  ------------------
  |  Branch (1617:9): [True: 9.79k, False: 9.04k]
  ------------------
 1618|  9.79k|        *oksecnum_out = 0; /* no reloc needed. */
 1619|  9.79k|        return DW_DLV_OK;
  ------------------
  |  |   59|  9.79k|#define DW_DLV_OK         0
  ------------------
 1620|  9.79k|    }
 1621|  9.04k|    *oksecnum_out = (unsigned)oksecnum;
 1622|  9.04k|    return DW_DLV_OK;
  ------------------
  |  |   59|  9.04k|#define DW_DLV_OK         0
  ------------------
 1623|  18.8k|}
dwarf_elf_load_headers.c:_dwarf_elf_load_a_relx_batch:
 1437|  9.04k|{
 1438|  9.04k|    Dwarf_Unsigned count = 0;
 1439|  9.04k|    Dwarf_Unsigned size = 0;
 1440|  9.04k|    Dwarf_Unsigned size2 = 0;
 1441|  9.04k|    Dwarf_Unsigned sizeg = 0;
 1442|  9.04k|    Dwarf_Unsigned offset = 0;
 1443|  9.04k|    int res = 0;
 1444|  9.04k|    Dwarf_Unsigned object_reclen = 0;
 1445|  9.04k|    struct generic_rela *grel = 0;
 1446|       |
 1447|       |    /*  ASSERT: Caller guarantees localoffsetsize
 1448|       |        is a valid 4 or 8. */
 1449|       |    /*  ASSERT: Caller guarantees localrela is one
 1450|       |        of the 2 valid values 1 or 2 */
 1451|       |
 1452|  9.04k|    offset = gsh->gh_offset;
 1453|  9.04k|    size = gsh->gh_size;
 1454|  9.04k|    if (size == 0) {
  ------------------
  |  Branch (1454:9): [True: 2.01k, False: 7.02k]
  ------------------
 1455|  2.01k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|  2.01k|#define DW_DLV_NO_ENTRY  -1
  ------------------
 1456|  2.01k|    }
 1457|  7.02k|    if ((offset > ep->f_filesize)||
  ------------------
  |  Branch (1457:9): [True: 312, False: 6.71k]
  ------------------
 1458|  7.02k|        (size > ep->f_filesize) ||
  ------------------
  |  Branch (1458:9): [True: 0, False: 6.71k]
  ------------------
 1459|  7.02k|        ((size +offset) > ep->f_filesize)) {
  ------------------
  |  Branch (1459:9): [True: 69, False: 6.64k]
  ------------------
 1460|    381|        *errcode = DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE;
  ------------------
  |  | 1445|    381|#define DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE    470
  ------------------
 1461|    381|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    381|#define DW_DLV_ERROR      1
  ------------------
 1462|    381|    }
 1463|  6.64k|    if (localoffsize == RelocOffset32) {
  ------------------
  |  Branch (1463:9): [True: 5.67k, False: 966]
  ------------------
 1464|  5.67k|        if (localrela ==  RelocIsRela) {
  ------------------
  |  Branch (1464:13): [True: 1.58k, False: 4.08k]
  ------------------
 1465|  1.58k|            object_reclen = sizeof(dw_elf32_rela);
 1466|  1.58k|            count = (long)(size/object_reclen);
 1467|  1.58k|            size2 = count * object_reclen;
 1468|  1.58k|            if (size != size2) {
  ------------------
  |  Branch (1468:17): [True: 54, False: 1.53k]
  ------------------
 1469|     54|                *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     54|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1470|     54|                return DW_DLV_ERROR;
  ------------------
  |  |   60|     54|#define DW_DLV_ERROR      1
  ------------------
 1471|     54|            }
 1472|  4.08k|        } else {
 1473|  4.08k|            object_reclen = sizeof(dw_elf32_rel);
 1474|  4.08k|            count = (long)(size/object_reclen);
 1475|  4.08k|            size2 = count * object_reclen;
 1476|  4.08k|            if (size != size2) {
  ------------------
  |  Branch (1476:17): [True: 15, False: 4.07k]
  ------------------
 1477|     15|                *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     15|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1478|     15|                return DW_DLV_ERROR;
  ------------------
  |  |   60|     15|#define DW_DLV_ERROR      1
  ------------------
 1479|     15|            }
 1480|  4.08k|        }
 1481|  5.67k|    } else {
 1482|    966|        if (localrela ==  RelocIsRela) {
  ------------------
  |  Branch (1482:13): [True: 534, False: 432]
  ------------------
 1483|    534|            object_reclen = sizeof(dw_elf64_rela);
 1484|    534|            count = (long)(size/object_reclen);
 1485|    534|            size2 = count * object_reclen;
 1486|    534|            if (size != size2) {
  ------------------
  |  Branch (1486:17): [True: 12, False: 522]
  ------------------
 1487|     12|                *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     12|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1488|     12|                return DW_DLV_ERROR;
  ------------------
  |  |   60|     12|#define DW_DLV_ERROR      1
  ------------------
 1489|     12|            }
 1490|    534|        } else {
 1491|    432|            object_reclen = sizeof(dw_elf64_rel);
 1492|    432|            count = (long)(size/object_reclen);
 1493|    432|            size2 = count * object_reclen;
 1494|    432|            if (size != size2) {
  ------------------
  |  Branch (1494:17): [True: 12, False: 420]
  ------------------
 1495|     12|                *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     12|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1496|     12|                return DW_DLV_ERROR;
  ------------------
  |  |   60|     12|#define DW_DLV_ERROR      1
  ------------------
 1497|     12|            }
 1498|    432|        }
 1499|    966|    }
 1500|  6.54k|    sizeg = count*sizeof(struct generic_rela);
 1501|  6.54k|    grel = (struct generic_rela *)malloc(sizeg);
 1502|  6.54k|    if (!grel) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 6.54k]
  ------------------
 1503|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1504|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1505|      0|    }
 1506|  6.54k|    if (localoffsize == RelocOffset32) {
  ------------------
  |  Branch (1506:9): [True: 5.60k, False: 942]
  ------------------
 1507|  5.60k|        if (localrela ==  RelocIsRela) {
  ------------------
  |  Branch (1507:13): [True: 1.53k, False: 4.07k]
  ------------------
 1508|  1.53k|            dw_elf32_rela *relp = 0;
 1509|  1.53k|            relp = (dw_elf32_rela *)malloc(size);
 1510|  1.53k|            if (!relp) {
  ------------------
  |  Branch (1510:17): [True: 0, False: 1.53k]
  ------------------
 1511|      0|                free(grel);
 1512|      0|                *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1513|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1514|      0|            }
 1515|  1.53k|            res = RRMOA(ep->f_fd,relp,offset,size,
  ------------------
  |  |   65|  1.53k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  1.53k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1516|  1.53k|                ep->f_filesize,errcode);
 1517|  1.53k|            if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.53k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1517:17): [True: 0, False: 1.53k]
  ------------------
 1518|      0|                free(relp);
 1519|      0|                free(grel);
 1520|      0|                return res;
 1521|      0|            }
 1522|  1.53k|            res = generic_rel_from_rela32(ep,gsh,relp,grel,errcode);
 1523|  1.53k|            free(relp);
 1524|  4.07k|        } else {
 1525|  4.07k|            dw_elf32_rel *relp = 0;
 1526|  4.07k|            relp = (dw_elf32_rel *)malloc(size);
 1527|  4.07k|            if (!relp) {
  ------------------
  |  Branch (1527:17): [True: 0, False: 4.07k]
  ------------------
 1528|      0|                free(grel);
 1529|      0|                *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1530|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1531|      0|            }
 1532|  4.07k|            res = RRMOA(ep->f_fd,relp,offset,size,
  ------------------
  |  |   65|  4.07k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  4.07k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1533|  4.07k|                ep->f_filesize,errcode);
 1534|  4.07k|            if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  4.07k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1534:17): [True: 0, False: 4.07k]
  ------------------
 1535|      0|                free(relp);
 1536|      0|                free(grel);
 1537|      0|                return res;
 1538|      0|            }
 1539|  4.07k|            res = generic_rel_from_rel32(ep,gsh,relp,grel,errcode);
 1540|  4.07k|            free(relp);
 1541|  4.07k|        }
 1542|  5.60k|    } else {
 1543|    942|        if (localrela ==  RelocIsRela) {
  ------------------
  |  Branch (1543:13): [True: 522, False: 420]
  ------------------
 1544|    522|            dw_elf64_rela *relp = 0;
 1545|    522|            relp = (dw_elf64_rela *)malloc(size);
 1546|    522|            if (!relp) {
  ------------------
  |  Branch (1546:17): [True: 0, False: 522]
  ------------------
 1547|      0|                free(grel);
 1548|      0|                *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1549|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1550|      0|            }
 1551|    522|            res = RRMOA(ep->f_fd,relp,offset,size,
  ------------------
  |  |   65|    522|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    522|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1552|    522|                ep->f_filesize,errcode);
 1553|    522|            if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    522|#define DW_DLV_OK         0
  ------------------
  |  Branch (1553:17): [True: 0, False: 522]
  ------------------
 1554|      0|                free(relp);
 1555|      0|                free(grel);
 1556|      0|                return res;
 1557|      0|            }
 1558|    522|            res = generic_rel_from_rela64(ep,gsh,relp,grel,errcode);
 1559|    522|            free(relp);
 1560|    522|        } else {
 1561|    420|            dw_elf64_rel *relp = 0;
 1562|    420|            relp = (dw_elf64_rel *)malloc(size);
 1563|    420|            if (!relp) {
  ------------------
  |  Branch (1563:17): [True: 0, False: 420]
  ------------------
 1564|      0|                free(grel);
 1565|      0|                *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1566|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1567|      0|            }
 1568|    420|            res = RRMOA(ep->f_fd,relp,offset,size,
  ------------------
  |  |   65|    420|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    420|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1569|    420|                ep->f_filesize,errcode);
 1570|    420|            if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    420|#define DW_DLV_OK         0
  ------------------
  |  Branch (1570:17): [True: 0, False: 420]
  ------------------
 1571|      0|                free(relp);
 1572|      0|                free(grel);
 1573|      0|                return res;
 1574|      0|            }
 1575|    420|            res = generic_rel_from_rel64(ep,gsh,relp,grel,errcode);
 1576|    420|            free(relp);
 1577|    420|        }
 1578|    942|    }
 1579|  6.54k|    if (res == DW_DLV_OK) {
  ------------------
  |  |   59|  6.54k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1579:9): [True: 6.54k, False: 0]
  ------------------
 1580|  6.54k|        gsh->gh_relcount = count;
 1581|  6.54k|        gsh->gh_rels = grel;
 1582|  6.54k|        *count_out = count;
 1583|  6.54k|        *grel_out = grel;
 1584|  6.54k|        return res;
 1585|  6.54k|    }
 1586|       |    /* Some sort of issue */
 1587|      0|    count_out = 0;
 1588|      0|    free(grel);
 1589|      0|    return res;
 1590|  6.54k|}
dwarf_elf_load_headers.c:generic_rel_from_rela32:
  911|  1.53k|{
  912|  1.53k|    Dwarf_Unsigned ecount = 0;
  913|  1.53k|    Dwarf_Unsigned size = gsh->gh_size;
  914|  1.53k|    Dwarf_Unsigned size2 = 0;
  915|  1.53k|    Dwarf_Unsigned i = 0;
  916|       |
  917|  1.53k|    ecount = size/sizeof(dw_elf32_rela);
  918|  1.53k|    size2 = ecount * sizeof(dw_elf32_rela);
  919|  1.53k|    if (size >= ep->f_filesize) {
  ------------------
  |  Branch (919:9): [True: 0, False: 1.53k]
  ------------------
  920|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
  921|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  922|      0|    }
  923|  1.53k|    if (size != size2) {
  ------------------
  |  Branch (923:9): [True: 0, False: 1.53k]
  ------------------
  924|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
  925|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  926|      0|    }
  927|   150k|    for ( i = 0; i < ecount; ++i,++relp,++grel) {
  ------------------
  |  Branch (927:18): [True: 149k, False: 1.53k]
  ------------------
  928|   149k|        ASNAR(ep->f_copy_word,grel->gr_offset,relp->r_offset);
  ------------------
  |  |   57|   149k|    do {                                        \
  |  |   58|   149k|        (t) = 0;                                \
  |  |   59|   149k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  929|   149k|        ASNAR(ep->f_copy_word,grel->gr_info,relp->r_info);
  ------------------
  |  |   57|   149k|    do {                                        \
  |  |   58|   149k|        (t) = 0;                                \
  |  |   59|   149k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  930|       |        /* addend signed */
  931|   149k|        ASNAR(ep->f_copy_word,grel->gr_addend,relp->r_addend);
  ------------------
  |  |   57|   149k|    do {                                        \
  |  |   58|   149k|        (t) = 0;                                \
  |  |   59|   149k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  932|   149k|        SIGN_EXTEND(grel->gr_addend,sizeof(relp->r_addend));
  ------------------
  |  |  104|   149k|    do {                                                          \
  |  |  105|   149k|        if (*(Dwarf_Sbyte *)((char *)&(dest)+ ((length)-1)) < 0) { \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 7.83k, False: 141k]
  |  |  ------------------
  |  |  106|  7.83k|            memcpy((char *)&(dest)+(length),                      \
  |  |  107|  7.83k|                "\xff\xff\xff\xff\xff\xff\xff\xff",               \
  |  |  108|  7.83k|                sizeof(dest) - (length));                         \
  |  |  109|  7.83k|        }                                                         \
  |  |  110|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  933|   149k|        grel->gr_sym  = grel->gr_info>>8; /* ELF32_R_SYM */
  934|   149k|        grel->gr_type = grel->gr_info & 0xff;
  935|   149k|        grel->gr_is_rela = TRUE;
  ------------------
  |  |   37|   149k|#define TRUE 1
  ------------------
  936|   149k|    }
  937|  1.53k|    return DW_DLV_OK;
  ------------------
  |  |   59|  1.53k|#define DW_DLV_OK         0
  ------------------
  938|  1.53k|}
dwarf_elf_load_headers.c:generic_rel_from_rel32:
 1000|  4.07k|{
 1001|  4.07k|    Dwarf_Unsigned ecount = 0;
 1002|  4.07k|    Dwarf_Unsigned size = gsh->gh_size;
 1003|  4.07k|    Dwarf_Unsigned size2 = 0;
 1004|  4.07k|    Dwarf_Unsigned i = 0;
 1005|       |
 1006|  4.07k|    ecount = size/sizeof(dw_elf32_rel);
 1007|  4.07k|    size2 = ecount * sizeof(dw_elf32_rel);
 1008|  4.07k|    if (size >= ep->f_filesize) {
  ------------------
  |  Branch (1008:9): [True: 0, False: 4.07k]
  ------------------
 1009|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
 1010|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1011|      0|    }
 1012|  4.07k|    if (size != size2) {
  ------------------
  |  Branch (1012:9): [True: 0, False: 4.07k]
  ------------------
 1013|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
 1014|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1015|      0|    }
 1016|   672k|    for ( i = 0; i < ecount; ++i,++relp,++grel) {
  ------------------
  |  Branch (1016:18): [True: 668k, False: 4.07k]
  ------------------
 1017|   668k|        ASNAR(ep->f_copy_word,grel->gr_offset,relp->r_offset);
  ------------------
  |  |   57|   668k|    do {                                        \
  |  |   58|   668k|        (t) = 0;                                \
  |  |   59|   668k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   668k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1018|   668k|        ASNAR(ep->f_copy_word,grel->gr_info,relp->r_info);
  ------------------
  |  |   57|   668k|    do {                                        \
  |  |   58|   668k|        (t) = 0;                                \
  |  |   59|   668k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   668k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1019|   668k|        grel->gr_addend  = 0; /* Unused for plain .rel */
 1020|   668k|        grel->gr_sym  = grel->gr_info >>8; /* ELF32_R_SYM */
 1021|   668k|        grel->gr_is_rela = FALSE;
  ------------------
  |  |   40|   668k|#define FALSE 0
  ------------------
 1022|   668k|        grel->gr_type = grel->gr_info & 0xff;
 1023|   668k|    }
 1024|  4.07k|    return DW_DLV_OK;
  ------------------
  |  |   59|  4.07k|#define DW_DLV_OK         0
  ------------------
 1025|  4.07k|}
dwarf_elf_load_headers.c:generic_rel_from_rela64:
  946|    522|{
  947|    522|    Dwarf_Unsigned ecount = 0;
  948|    522|    Dwarf_Unsigned size = gsh->gh_size;
  949|    522|    Dwarf_Unsigned size2 = 0;
  950|    522|    Dwarf_Unsigned i = 0;
  951|    522|    int objlittleendian = (ep->f_endian == DW_END_little);
  ------------------
  |  | 1105|    522|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  952|    522|    int ismips64 = (ep->f_machine == EM_MIPS);
  ------------------
  |  |  206|    522|#define EM_MIPS          8
  ------------------
  953|    522|    int issparcv9 = (ep->f_machine == EM_SPARCV9);
  ------------------
  |  |  260|    522|#define EM_SPARCV9       43
  ------------------
  954|       |
  955|    522|    ecount = size/sizeof(dw_elf64_rela);
  956|    522|    size2 = ecount * sizeof(dw_elf64_rela);
  957|    522|    if (size >= ep->f_filesize) {
  ------------------
  |  Branch (957:9): [True: 0, False: 522]
  ------------------
  958|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
  959|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  960|      0|    }
  961|    522|    if (size != size2) {
  ------------------
  |  Branch (961:9): [True: 0, False: 522]
  ------------------
  962|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
  963|      0|        return  DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  964|      0|    }
  965|   100k|    for ( i = 0; i < ecount; ++i,++relp,++grel) {
  ------------------
  |  Branch (965:18): [True: 100k, False: 522]
  ------------------
  966|   100k|        ASNAR(ep->f_copy_word,grel->gr_offset,relp->r_offset);
  ------------------
  |  |   57|   100k|    do {                                        \
  |  |   58|   100k|        (t) = 0;                                \
  |  |   59|   100k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   100k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  967|   100k|        ASNAR(ep->f_copy_word,grel->gr_info,relp->r_info);
  ------------------
  |  |   57|   100k|    do {                                        \
  |  |   58|   100k|        (t) = 0;                                \
  |  |   59|   100k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   100k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  968|   100k|        ASNAR(ep->f_copy_word,grel->gr_addend,relp->r_addend);
  ------------------
  |  |   57|   100k|    do {                                        \
  |  |   58|   100k|        (t) = 0;                                \
  |  |   59|   100k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   100k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  969|   100k|        SIGN_EXTEND(grel->gr_addend,sizeof(relp->r_addend));
  ------------------
  |  |  104|   100k|    do {                                                          \
  |  |  105|   100k|        if (*(Dwarf_Sbyte *)((char *)&(dest)+ ((length)-1)) < 0) { \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 42.4k, False: 57.7k]
  |  |  ------------------
  |  |  106|  42.4k|            memcpy((char *)&(dest)+(length),                      \
  |  |  107|  42.4k|                "\xff\xff\xff\xff\xff\xff\xff\xff",               \
  |  |  108|  42.4k|                sizeof(dest) - (length));                         \
  |  |  109|  42.4k|        }                                                         \
  |  |  110|   100k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  970|   100k|        if (ismips64 && objlittleendian ) {
  ------------------
  |  Branch (970:13): [True: 1.26k, False: 98.9k]
  |  Branch (970:25): [True: 1.02k, False: 246]
  ------------------
  971|  1.02k|            char realsym[4];
  972|       |
  973|  1.02k|            memcpy(realsym,&relp->r_info,sizeof(realsym));
  974|  1.02k|            ASNAR(ep->f_copy_word,grel->gr_sym,realsym);
  ------------------
  |  |   57|  1.02k|    do {                                        \
  |  |   58|  1.02k|        (t) = 0;                                \
  |  |   59|  1.02k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  975|  1.02k|            grel->gr_type  = relp->r_info[7];
  976|  1.02k|            grel->gr_type2 = relp->r_info[6];
  977|  1.02k|            grel->gr_type3 = relp->r_info[5];
  978|  99.2k|        } else if (issparcv9) {
  ------------------
  |  Branch (978:20): [True: 1.01k, False: 98.2k]
  ------------------
  979|       |            /*  Always Big Endian?  */
  980|  1.01k|            char realsym[4];
  981|       |
  982|  1.01k|            memcpy(realsym,&relp->r_info,sizeof(realsym));
  983|  1.01k|            ASNAR(ep->f_copy_word,grel->gr_sym,realsym);
  ------------------
  |  |   57|  1.01k|    do {                                        \
  |  |   58|  1.01k|        (t) = 0;                                \
  |  |   59|  1.01k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  984|  1.01k|            grel->gr_type  = relp->r_info[7];
  985|  98.2k|        } else {
  986|  98.2k|            grel->gr_sym  = grel->gr_info >> 32;
  987|  98.2k|            grel->gr_type = grel->gr_info & 0xffffffff;
  988|  98.2k|        }
  989|   100k|        grel->gr_is_rela = TRUE;
  ------------------
  |  |   37|   100k|#define TRUE 1
  ------------------
  990|   100k|    }
  991|    522|    return DW_DLV_OK;
  ------------------
  |  |   59|    522|#define DW_DLV_OK         0
  ------------------
  992|    522|}
dwarf_elf_load_headers.c:generic_rel_from_rel64:
 1033|    420|{
 1034|    420|    Dwarf_Unsigned ecount = 0;
 1035|    420|    Dwarf_Unsigned size = gsh->gh_size;
 1036|    420|    Dwarf_Unsigned size2 = 0;
 1037|    420|    Dwarf_Unsigned i = 0;
 1038|    420|    int objlittleendian = (ep->f_endian == DW_END_little);
  ------------------
  |  | 1105|    420|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
 1039|    420|    int ismips64 = (ep->f_machine == EM_MIPS);
  ------------------
  |  |  206|    420|#define EM_MIPS          8
  ------------------
 1040|    420|    int issparcv9 = (ep->f_machine == EM_SPARCV9);
  ------------------
  |  |  260|    420|#define EM_SPARCV9       43
  ------------------
 1041|       |
 1042|    420|    ecount = size/sizeof(dw_elf64_rel);
 1043|    420|    size2 = ecount * sizeof(dw_elf64_rel);
 1044|    420|    if (size >= ep->f_filesize) {
  ------------------
  |  Branch (1044:9): [True: 0, False: 420]
  ------------------
 1045|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
 1046|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1047|      0|    }
 1048|    420|    if (size != size2) {
  ------------------
  |  Branch (1048:9): [True: 0, False: 420]
  ------------------
 1049|      0|        *errcode = DW_DLE_RELOCATION_SECTION_SIZE_ERROR;
  ------------------
  |  | 1464|      0|#define DW_DLE_RELOCATION_SECTION_SIZE_ERROR   489
  ------------------
 1050|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1051|      0|    }
 1052|  19.8k|    for ( i = 0; i < ecount; ++i,++relp,++grel) {
  ------------------
  |  Branch (1052:18): [True: 19.4k, False: 420]
  ------------------
 1053|  19.4k|        ASNAR(ep->f_copy_word,grel->gr_offset,relp->r_offset);
  ------------------
  |  |   57|  19.4k|    do {                                        \
  |  |   58|  19.4k|        (t) = 0;                                \
  |  |   59|  19.4k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1054|  19.4k|        ASNAR(ep->f_copy_word,grel->gr_info,relp->r_info);
  ------------------
  |  |   57|  19.4k|    do {                                        \
  |  |   58|  19.4k|        (t) = 0;                                \
  |  |   59|  19.4k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1055|  19.4k|        grel->gr_addend  = 0; /* Unused for plain .rel */
 1056|  19.4k|        if (ismips64 && objlittleendian ) {
  ------------------
  |  Branch (1056:13): [True: 1.68k, False: 17.7k]
  |  Branch (1056:25): [True: 1.13k, False: 552]
  ------------------
 1057|  1.13k|            char realsym[4];
 1058|       |
 1059|  1.13k|            memcpy(realsym,&relp->r_info,sizeof(realsym));
 1060|  1.13k|            ASNAR(ep->f_copy_word,grel->gr_sym,realsym);
  ------------------
  |  |   57|  1.13k|    do {                                        \
  |  |   58|  1.13k|        (t) = 0;                                \
  |  |   59|  1.13k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1061|  1.13k|            grel->gr_type  = relp->r_info[7];
 1062|  1.13k|            grel->gr_type2 = relp->r_info[6];
 1063|  1.13k|            grel->gr_type3 = relp->r_info[5];
 1064|  18.2k|        } else if (issparcv9) {
  ------------------
  |  Branch (1064:20): [True: 1.95k, False: 16.3k]
  ------------------
 1065|       |            /*  Always Big Endian?  */
 1066|  1.95k|            char realsym[4];
 1067|       |
 1068|  1.95k|            memcpy(realsym,&relp->r_info,sizeof(realsym));
 1069|  1.95k|            ASNAR(ep->f_copy_word,grel->gr_sym,realsym);
  ------------------
  |  |   57|  1.95k|    do {                                        \
  |  |   58|  1.95k|        (t) = 0;                                \
  |  |   59|  1.95k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1070|  1.95k|            grel->gr_type  = relp->r_info[7];
 1071|  16.3k|        } else {
 1072|  16.3k|            grel->gr_sym  = grel->gr_info >>32;
 1073|  16.3k|            grel->gr_type = grel->gr_info & 0xffffffff;
 1074|  16.3k|        }
 1075|  19.4k|        grel->gr_is_rela = FALSE;
  ------------------
  |  |   40|  19.4k|#define FALSE 0
  ------------------
 1076|  19.4k|    }
 1077|    420|    return DW_DLV_OK;
  ------------------
  |  |   59|    420|#define DW_DLV_OK         0
  ------------------
 1078|    420|}
dwarf_elf_load_headers.c:elf_load_elf_header32:
 1767|  8.26k|{
 1768|  8.26k|    int res = 0;
 1769|  8.26k|    dw_elf32_ehdr ehdr32;
 1770|  8.26k|    struct generic_ehdr *ehdr = 0;
 1771|       |
 1772|  8.26k|    ehdr32 = eh32_zero;
 1773|  8.26k|    res = RRMOA(ep->f_fd,&ehdr32,0,sizeof(ehdr32),
  ------------------
  |  |   65|  8.26k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  8.26k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1774|  8.26k|        ep->f_filesize,errcode);
 1775|  8.26k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  8.26k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1775:9): [True: 15, False: 8.24k]
  ------------------
 1776|     15|        return res;
 1777|     15|    }
 1778|  8.24k|    ehdr = (struct generic_ehdr *)calloc(1,
 1779|  8.24k|        sizeof(struct generic_ehdr));
 1780|  8.24k|    if (!ehdr) {
  ------------------
  |  Branch (1780:9): [True: 0, False: 8.24k]
  ------------------
 1781|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1782|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1783|      0|    }
 1784|  8.24k|    res  = generic_ehdr_from_32(ep,ehdr,&ehdr32,errcode);
 1785|  8.24k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  8.24k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1785:9): [True: 75, False: 8.17k]
  ------------------
 1786|     75|        free(ehdr);
 1787|     75|        return res;
 1788|     75|    }
 1789|  8.17k|    ep->f_machine = (unsigned)ehdr->ge_machine;
 1790|  8.17k|    ep->f_flags = ehdr->ge_flags;
 1791|  8.17k|    return res;
 1792|  8.24k|}
dwarf_elf_load_headers.c:generic_ehdr_from_32:
  171|  8.24k|{
  172|  8.24k|    int i = 0;
  173|       |
  174|   140k|    for (i = 0; i < EI_NIDENT; ++i) {
  ------------------
  |  |  865|   140k|#define EI_NIDENT        16
  ------------------
  |  Branch (174:17): [True: 131k, False: 8.24k]
  ------------------
  175|   131k|        ehdr->ge_ident[i] = e->e_ident[i];
  176|   131k|    }
  177|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_type,e->e_type);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  178|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_machine,e->e_machine);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  179|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_version,e->e_version);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  180|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_entry,e->e_entry);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  181|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_phoff,e->e_phoff);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  182|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_shoff,e->e_shoff);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  183|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_flags,e->e_flags);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  184|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_ehsize,e->e_ehsize);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  185|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_phentsize,e->e_phentsize);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  186|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_phnum,e->e_phnum);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  187|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_shentsize,e->e_shentsize);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  188|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_shnum,e->e_shnum);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  189|  8.24k|    ASNAR(ep->f_copy_word,ehdr->ge_shstrndx,e->e_shstrndx);
  ------------------
  |  |   57|  8.24k|    do {                                        \
  |  |   58|  8.24k|        (t) = 0;                                \
  |  |   59|  8.24k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  8.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  190|  8.24k|    if (!ehdr->ge_shoff) {
  ------------------
  |  Branch (190:9): [True: 3, False: 8.24k]
  ------------------
  191|      3|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      3|#define DW_DLV_NO_ENTRY  -1
  ------------------
  192|      3|    }
  193|  8.24k|    if (ehdr->ge_shoff < sizeof(dw_elf32_ehdr)) {
  ------------------
  |  Branch (193:9): [True: 9, False: 8.23k]
  ------------------
  194|       |        /* offset is inside the header! */
  195|      9|        *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|      9|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
  196|      9|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      9|#define DW_DLV_ERROR      1
  ------------------
  197|      9|    }
  198|  8.23k|    if (ehdr->ge_shstrndx == SHN_XINDEX) {
  ------------------
  |  |  279|  8.23k|#define SHN_XINDEX 0xffff
  ------------------
  |  Branch (198:9): [True: 129, False: 8.10k]
  ------------------
  199|    129|        ehdr->ge_strndx_extended = TRUE;
  ------------------
  |  |   37|    129|#define TRUE 1
  ------------------
  200|  8.10k|    } else {
  201|  8.10k|        ehdr->ge_strndx_in_strndx = TRUE;
  ------------------
  |  |   37|  8.10k|#define TRUE 1
  ------------------
  202|  8.10k|        if (ehdr->ge_shstrndx < 1) {
  ------------------
  |  Branch (202:13): [True: 6, False: 8.10k]
  ------------------
  203|      6|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|      6|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
  204|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
  205|      6|        }
  206|  8.10k|    }
  207|       |    /*  If !ge_strndx_extended && !ehdr->ge_shnum
  208|       |        this is a very unusual case.  */
  209|  8.22k|    if (!ehdr->ge_shnum) {
  ------------------
  |  Branch (209:9): [True: 288, False: 7.94k]
  ------------------
  210|    288|        ehdr->ge_shnum_extended = TRUE;
  ------------------
  |  |   37|    288|#define TRUE 1
  ------------------
  211|  7.94k|    } else {
  212|  7.94k|        ehdr->ge_shnum_in_shnum = TRUE;
  ------------------
  |  |   37|  7.94k|#define TRUE 1
  ------------------
  213|  7.94k|        if (!ehdr->ge_shnum) {
  ------------------
  |  Branch (213:13): [True: 0, False: 7.94k]
  ------------------
  214|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  215|      0|        }
  216|  7.94k|        if (ehdr->ge_shnum < 3) {
  ------------------
  |  Branch (216:13): [True: 6, False: 7.93k]
  ------------------
  217|      6|            *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|      6|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
  218|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
  219|      6|        }
  220|  7.94k|    }
  221|  8.22k|    if (ehdr->ge_shnum_in_shnum &&
  ------------------
  |  Branch (221:9): [True: 7.93k, False: 288]
  ------------------
  222|  8.22k|        ehdr->ge_strndx_in_strndx &&
  ------------------
  |  Branch (222:9): [True: 7.82k, False: 108]
  ------------------
  223|  8.22k|        (ehdr->ge_shstrndx >= ehdr->ge_shnum)) {
  ------------------
  |  Branch (223:9): [True: 51, False: 7.77k]
  ------------------
  224|     51|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|     51|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
  225|     51|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     51|#define DW_DLV_ERROR      1
  ------------------
  226|     51|    }
  227|       |
  228|  8.17k|    ep->f_machine = (unsigned int)ehdr->ge_machine;
  229|  8.17k|    ep->f_ehdr = ehdr;
  230|  8.17k|    ep->f_loc_ehdr.g_name = "Elf File Header";
  231|  8.17k|    ep->f_loc_ehdr.g_offset = 0;
  232|  8.17k|    ep->f_loc_ehdr.g_count = 1;
  233|  8.17k|    ep->f_loc_ehdr.g_entrysize = sizeof(dw_elf32_ehdr);
  234|  8.17k|    ep->f_loc_ehdr.g_totalsize = sizeof(dw_elf32_ehdr);
  235|  8.17k|    return DW_DLV_OK;
  ------------------
  |  |   59|  8.17k|#define DW_DLV_OK         0
  ------------------
  236|  8.22k|}
dwarf_elf_load_headers.c:elf_load_elf_header64:
 1796|  4.73k|{
 1797|  4.73k|    int res = 0;
 1798|  4.73k|    dw_elf64_ehdr ehdr64;
 1799|  4.73k|    struct generic_ehdr *ehdr = 0;
 1800|       |
 1801|  4.73k|    ehdr64 = eh64_zero;
 1802|  4.73k|    res = RRMOA(ep->f_fd,&ehdr64,0,sizeof(ehdr64),
  ------------------
  |  |   65|  4.73k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  4.73k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1803|  4.73k|        ep->f_filesize,errcode);
 1804|  4.73k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  4.73k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1804:9): [True: 9, False: 4.72k]
  ------------------
 1805|      9|        return res;
 1806|      9|    }
 1807|  4.72k|    ehdr = (struct generic_ehdr *)calloc(1,
 1808|  4.72k|        sizeof(struct generic_ehdr));
 1809|  4.72k|    if (!ehdr) {
  ------------------
  |  Branch (1809:9): [True: 0, False: 4.72k]
  ------------------
 1810|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1811|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1812|      0|    }
 1813|  4.72k|    res  = generic_ehdr_from_64(ep,ehdr,&ehdr64,errcode);
 1814|  4.72k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  4.72k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1814:9): [True: 87, False: 4.64k]
  ------------------
 1815|     87|        free(ehdr);
 1816|     87|        return res;
 1817|     87|    }
 1818|  4.64k|    ep->f_machine = (unsigned)ehdr->ge_machine;
 1819|  4.64k|    ep->f_flags = ehdr->ge_flags;
 1820|  4.64k|    return res;
 1821|  4.72k|}
dwarf_elf_load_headers.c:generic_ehdr_from_64:
  242|  4.72k|{
  243|  4.72k|    int i = 0;
  244|       |
  245|  80.3k|    for (i = 0; i < EI_NIDENT; ++i) {
  ------------------
  |  |  865|  80.3k|#define EI_NIDENT        16
  ------------------
  |  Branch (245:17): [True: 75.6k, False: 4.72k]
  ------------------
  246|  75.6k|        ehdr->ge_ident[i] = e->e_ident[i];
  247|  75.6k|    }
  248|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_type,e->e_type);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_machine,e->e_machine);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  250|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_version,e->e_version);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  251|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_entry,e->e_entry);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  252|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_phoff,e->e_phoff);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  253|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_shoff,e->e_shoff);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  254|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_flags,e->e_flags);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  255|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_ehsize,e->e_ehsize);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  256|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_phentsize,e->e_phentsize);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  257|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_phnum,e->e_phnum);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  258|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_shentsize,e->e_shentsize);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  259|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_shnum,e->e_shnum);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  260|  4.72k|    ASNAR(ep->f_copy_word,ehdr->ge_shstrndx,e->e_shstrndx);
  ------------------
  |  |   57|  4.72k|    do {                                        \
  |  |   58|  4.72k|        (t) = 0;                                \
  |  |   59|  4.72k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  261|  4.72k|    if (!ehdr->ge_shoff) {
  ------------------
  |  Branch (261:9): [True: 3, False: 4.72k]
  ------------------
  262|      3|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      3|#define DW_DLV_NO_ENTRY  -1
  ------------------
  263|      3|    }
  264|  4.72k|    if (ehdr->ge_shoff < sizeof(dw_elf64_ehdr)) {
  ------------------
  |  Branch (264:9): [True: 21, False: 4.70k]
  ------------------
  265|       |        /* zero or offset is inside the header! */
  266|     21|        *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|     21|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
  267|     21|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     21|#define DW_DLV_ERROR      1
  ------------------
  268|     21|    }
  269|  4.70k|    if (ehdr->ge_shstrndx == SHN_XINDEX) {
  ------------------
  |  |  279|  4.70k|#define SHN_XINDEX 0xffff
  ------------------
  |  Branch (269:9): [True: 96, False: 4.60k]
  ------------------
  270|     96|        ehdr->ge_strndx_extended = TRUE;
  ------------------
  |  |   37|     96|#define TRUE 1
  ------------------
  271|  4.60k|    } else {
  272|  4.60k|        ehdr->ge_strndx_in_strndx = TRUE;
  ------------------
  |  |   37|  4.60k|#define TRUE 1
  ------------------
  273|  4.60k|        if (ehdr->ge_shstrndx < 1) {
  ------------------
  |  Branch (273:13): [True: 3, False: 4.60k]
  ------------------
  274|      3|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|      3|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
  275|      3|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
  276|      3|        }
  277|  4.60k|    }
  278|  4.70k|    if (!ehdr->ge_shnum) {
  ------------------
  |  Branch (278:9): [True: 513, False: 4.18k]
  ------------------
  279|    513|        ehdr->ge_shnum_extended = TRUE;
  ------------------
  |  |   37|    513|#define TRUE 1
  ------------------
  280|  4.18k|    } else {
  281|  4.18k|        ehdr->ge_shnum_in_shnum = TRUE;
  ------------------
  |  |   37|  4.18k|#define TRUE 1
  ------------------
  282|  4.18k|        if (!ehdr->ge_shnum) {
  ------------------
  |  Branch (282:13): [True: 0, False: 4.18k]
  ------------------
  283|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  284|      0|        }
  285|  4.18k|        if (ehdr->ge_shnum < 3) {
  ------------------
  |  Branch (285:13): [True: 6, False: 4.18k]
  ------------------
  286|      6|            *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|      6|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
  287|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
  288|      6|        }
  289|  4.18k|    }
  290|  4.69k|    if (ehdr->ge_shnum_in_shnum &&
  ------------------
  |  Branch (290:9): [True: 4.18k, False: 513]
  ------------------
  291|  4.69k|        ehdr->ge_strndx_in_strndx &&
  ------------------
  |  Branch (291:9): [True: 4.10k, False: 78]
  ------------------
  292|  4.69k|        (ehdr->ge_shstrndx >= ehdr->ge_shnum)) {
  ------------------
  |  Branch (292:9): [True: 54, False: 4.05k]
  ------------------
  293|     54|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|     54|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
  294|     54|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     54|#define DW_DLV_ERROR      1
  ------------------
  295|     54|    }
  296|  4.64k|    ep->f_machine = (unsigned int)ehdr->ge_machine;
  297|  4.64k|    ep->f_ehdr = ehdr;
  298|  4.64k|    ep->f_loc_ehdr.g_name = "Elf File Header";
  299|  4.64k|    ep->f_loc_ehdr.g_offset = 0;
  300|  4.64k|    ep->f_loc_ehdr.g_count = 1;
  301|  4.64k|    ep->f_loc_ehdr.g_entrysize = sizeof(dw_elf64_ehdr);
  302|  4.64k|    ep->f_loc_ehdr.g_totalsize = sizeof(dw_elf64_ehdr);
  303|  4.64k|    return DW_DLV_OK;
  ------------------
  |  |   59|  4.64k|#define DW_DLV_OK         0
  ------------------
  304|  4.69k|}
dwarf_elf_load_headers.c:elf_load_sectheaders32:
 1274|  8.17k|{
 1275|  8.17k|    Dwarf_Unsigned generic_count = 0;
 1276|  8.17k|    Dwarf_Unsigned shdr_count = 0;
 1277|  8.17k|    Dwarf_Bool have_shdr_count = FALSE;
  ------------------
  |  |   40|  8.17k|#define FALSE 0
  ------------------
 1278|  8.17k|    Dwarf_Unsigned shstrndx_number = 0;
 1279|  8.17k|    Dwarf_Bool have_shstrndx_number = FALSE;
  ------------------
  |  |   40|  8.17k|#define FALSE 0
  ------------------
 1280|  8.17k|    struct generic_ehdr *ehp = 0;
 1281|  8.17k|    int res = 0;
 1282|       |
 1283|  8.17k|    if (entsize < sizeof(dw_elf32_shdr)) {
  ------------------
  |  Branch (1283:9): [True: 21, False: 8.15k]
  ------------------
 1284|     21|        *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     21|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1285|     21|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     21|#define DW_DLV_ERROR      1
  ------------------
 1286|     21|    }
 1287|  8.15k|    ehp = ep->f_ehdr;
 1288|  8.15k|    if (!ehp->ge_shnum_in_shnum || !ehp->ge_strndx_in_strndx) {
  ------------------
  |  Branch (1288:9): [True: 282, False: 7.86k]
  |  Branch (1288:36): [True: 105, False: 7.76k]
  ------------------
 1289|    387|        res = get_counts_from_sec32_zero(ep,offset,
 1290|    387|            &have_shdr_count,&shdr_count,
 1291|    387|            &have_shstrndx_number,&shstrndx_number,
 1292|    387|            errcode);
 1293|    387|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    387|#define DW_DLV_OK         0
  ------------------
  |  Branch (1293:13): [True: 231, False: 156]
  ------------------
 1294|    231|            return res;
 1295|    231|        }
 1296|    156|        if (have_shdr_count) {
  ------------------
  |  Branch (1296:13): [True: 156, False: 0]
  ------------------
 1297|    156|            count = shdr_count;
 1298|    156|        }
 1299|    156|    }
 1300|  7.92k|    if (count == 0) {
  ------------------
  |  Branch (1300:9): [True: 0, False: 7.92k]
  ------------------
 1301|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
 1302|      0|    }
 1303|  7.92k|    if ((offset > ep->f_filesize)||
  ------------------
  |  Branch (1303:9): [True: 84, False: 7.83k]
  ------------------
 1304|  7.92k|        (entsize > 200)||
  ------------------
  |  Branch (1304:9): [True: 45, False: 7.79k]
  ------------------
 1305|  7.92k|        (count > ep->f_filesize) ||
  ------------------
  |  Branch (1305:9): [True: 162, False: 7.62k]
  ------------------
 1306|  7.92k|        ((count *entsize +offset) > ep->f_filesize)) {
  ------------------
  |  Branch (1306:9): [True: 141, False: 7.48k]
  ------------------
 1307|    432|        *errcode = DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE;
  ------------------
  |  | 1445|    432|#define DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE    470
  ------------------
 1308|    432|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    432|#define DW_DLV_ERROR      1
  ------------------
 1309|    432|    }
 1310|  7.48k|    res = generic_shdr_from_shdr32(ep,&generic_count,
 1311|  7.48k|        offset,entsize,count,errcode);
 1312|  7.48k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  7.48k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1312:9): [True: 582, False: 6.90k]
  ------------------
 1313|    582|        return res;
 1314|    582|    }
 1315|  6.90k|    if (generic_count != count) {
  ------------------
  |  Branch (1315:9): [True: 0, False: 6.90k]
  ------------------
 1316|      0|        *errcode = DW_DLE_ELF_SECTION_COUNT_MISMATCH;
  ------------------
  |  | 1417|      0|#define DW_DLE_ELF_SECTION_COUNT_MISMATCH      442
  ------------------
 1317|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1318|      0|    }
 1319|  6.90k|    return DW_DLV_OK;
  ------------------
  |  |   59|  6.90k|#define DW_DLV_OK         0
  ------------------
 1320|  6.90k|}
dwarf_elf_load_headers.c:get_counts_from_sec32_zero:
 1227|    387|{
 1228|    387|    dw_elf32_shdr       shd32;
 1229|    387|    struct generic_shdr shdg;
 1230|    387|    int res = 0;
 1231|    387|    Dwarf_Unsigned size = sizeof(shd32);
 1232|    387|    struct generic_ehdr * geh  = ep->f_ehdr;
 1233|       |
 1234|    387|    shd32 =  shd32zero;
 1235|    387|    shdg  = shdgzero;
 1236|    387|    res = RRMOA(ep->f_fd,&shd32,offset,size,
  ------------------
  |  |   65|    387|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    387|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1237|    387|        ep->f_filesize,errcode);
 1238|    387|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    387|#define DW_DLV_OK         0
  ------------------
  |  Branch (1238:9): [True: 129, False: 258]
  ------------------
 1239|    129|        return res;
 1240|    129|    }
 1241|    258|    copysection32(ep,&shdg,&shd32);
 1242|    258|    if (geh->ge_shnum_extended) {
  ------------------
  |  Branch (1242:9): [True: 186, False: 72]
  ------------------
 1243|    186|        geh->ge_shnum = shdg.gh_size;
 1244|    186|        geh->ge_shnum_in_shnum = TRUE;
  ------------------
  |  |   37|    186|#define TRUE 1
  ------------------
 1245|    186|        if (geh->ge_shnum  < 3) {
  ------------------
  |  Branch (1245:13): [True: 6, False: 180]
  ------------------
 1246|      6|            *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|      6|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
 1247|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
 1248|      6|        }
 1249|    186|    }
 1250|    252|    *have_shdr_count = TRUE;
  ------------------
  |  |   37|    252|#define TRUE 1
  ------------------
 1251|    252|    *shdr_count = geh->ge_shnum;
 1252|    252|    if (geh->ge_strndx_extended) {
  ------------------
  |  Branch (1252:9): [True: 93, False: 159]
  ------------------
 1253|     93|        geh->ge_shstrndx = shdg.gh_link;
 1254|     93|        geh->ge_strndx_in_strndx = TRUE;
  ------------------
  |  |   37|     93|#define TRUE 1
  ------------------
 1255|     93|    }
 1256|    252|    if (geh->ge_shnum_in_shnum &&
  ------------------
  |  Branch (1256:9): [True: 252, False: 0]
  ------------------
 1257|    252|        geh->ge_strndx_in_strndx&&
  ------------------
  |  Branch (1257:9): [True: 252, False: 0]
  ------------------
 1258|    252|        (geh->ge_shstrndx >= geh->ge_shnum)) {
  ------------------
  |  Branch (1258:9): [True: 96, False: 156]
  ------------------
 1259|     96|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|     96|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
 1260|     96|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     96|#define DW_DLV_ERROR      1
  ------------------
 1261|     96|    }
 1262|    156|    *have_shstrndx_number = TRUE;
  ------------------
  |  |   37|    156|#define TRUE 1
  ------------------
 1263|    156|    *shstrndx_number = geh->ge_shstrndx;
 1264|    156|    return DW_DLV_OK;
  ------------------
  |  |   59|    156|#define DW_DLV_OK         0
  ------------------
 1265|    252|}
dwarf_elf_load_headers.c:copysection32:
  435|   466k|{
  436|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_name,psh->sh_name);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  437|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_type,psh->sh_type);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  438|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_flags,psh->sh_flags);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  439|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_addr,psh->sh_addr);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  440|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_offset,psh->sh_offset);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  441|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_size,psh->sh_size);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  442|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_link,psh->sh_link);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  443|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_info,psh->sh_info);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  444|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_addralign,psh->sh_addralign);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|   466k|    ASNAR(ep->f_copy_word,gshdr->gh_entsize,psh->sh_entsize);
  ------------------
  |  |   57|   466k|    do {                                        \
  |  |   58|   466k|        (t) = 0;                                \
  |  |   59|   466k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   466k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  446|   466k|}
dwarf_elf_load_headers.c:generic_shdr_from_shdr32:
  455|  7.48k|{
  456|  7.48k|    dw_elf32_shdr          *psh =0;
  457|  7.48k|    dw_elf32_shdr          *orig_psh =0;
  458|  7.48k|    struct generic_ehdr *ehdr = ep->f_ehdr;
  459|  7.48k|    struct generic_shdr *gshdr =0;
  460|  7.48k|    struct generic_shdr *orig_gshdr =0;
  461|  7.48k|    Dwarf_Unsigned i = 0;
  462|  7.48k|    int res = 0;
  463|       |
  464|  7.48k|    *count_out = 0;
  465|  7.48k|    psh = (dw_elf32_shdr *)calloc(count , entsize);
  466|  7.48k|    if (!psh) {
  ------------------
  |  Branch (466:9): [True: 0, False: 7.48k]
  ------------------
  467|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  468|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  469|      0|    }
  470|  7.48k|    gshdr = (struct generic_shdr *)calloc(count,sizeof(*gshdr));
  471|  7.48k|    if (!gshdr) {
  ------------------
  |  Branch (471:9): [True: 0, False: 7.48k]
  ------------------
  472|      0|        free(psh);
  473|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  474|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  475|      0|    }
  476|       |
  477|  7.48k|    orig_psh = psh;
  478|  7.48k|    orig_gshdr = gshdr;
  479|  7.48k|    res = RRMOA(ep->f_fd,psh,offset,count*entsize,
  ------------------
  |  |   65|  7.48k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  7.48k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  480|  7.48k|        ep->f_filesize,errcode);
  481|  7.48k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  7.48k|#define DW_DLV_OK         0
  ------------------
  |  Branch (481:9): [True: 0, False: 7.48k]
  ------------------
  482|      0|        free(orig_psh);
  483|      0|        free(orig_gshdr);
  484|      0|        return res;
  485|      0|    }
  486|   472k|    for (i = 0; i < count;
  ------------------
  |  Branch (486:17): [True: 466k, False: 6.90k]
  ------------------
  487|   466k|        ++i,  psh++,gshdr++) {
  488|   466k|        int isempty     = FALSE;
  ------------------
  |  |   40|   466k|#define FALSE 0
  ------------------
  489|   466k|        int bitsoncount = 0;
  490|       |
  491|   466k|        gshdr->gh_secnum = i;
  492|   466k|        copysection32(ep,gshdr,psh);
  493|   466k|#if 1
  494|   466k|        if (gshdr->gh_size >= ep->f_filesize &&
  ------------------
  |  Branch (494:13): [True: 1.16k, False: 464k]
  ------------------
  495|   466k|            gshdr->gh_type != SHT_NOBITS) {
  ------------------
  |  |   84|  1.16k|#define SHT_NOBITS 8
  ------------------
  |  Branch (495:13): [True: 51, False: 1.11k]
  ------------------
  496|     51|            free(orig_psh);
  497|     51|            free(orig_gshdr);
  498|     51|            *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     51|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
  499|     51|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     51|#define DW_DLV_ERROR      1
  ------------------
  500|     51|        }
  501|   466k|#endif /* 0 */
  502|   466k|        isempty = is_empty_section(gshdr->gh_type);
  503|   466k|        if (i == 0) {
  ------------------
  |  Branch (503:13): [True: 7.47k, False: 458k]
  ------------------
  504|  7.47k|            Dwarf_Unsigned shnum = 0;
  505|  7.47k|            Dwarf_Unsigned shstrx = 0;
  506|       |
  507|       |            /*  Catch errors asap */
  508|  7.47k|            if (!ehdr->ge_shnum_extended) {
  ------------------
  |  Branch (508:17): [True: 7.47k, False: 3]
  ------------------
  509|  7.47k|                shnum = gshdr->gh_size;
  510|  7.47k|            }
  511|  7.47k|            if (!ehdr->ge_strndx_extended) {
  ------------------
  |  Branch (511:17): [True: 7.45k, False: 21]
  ------------------
  512|  7.45k|                shstrx = gshdr->gh_link;
  513|  7.45k|            }
  514|       |            /*  We require that section zero be 'empty'
  515|       |                per the Elf ABI.
  516|       |                gh_link and gh_size are sometimes used
  517|       |                with the elf header, so we do not check
  518|       |                them here. */
  519|  7.47k|            if (!isempty || gshdr->gh_name || gshdr->gh_flags ||
  ------------------
  |  Branch (519:17): [True: 3, False: 7.47k]
  |  Branch (519:29): [True: 93, False: 7.38k]
  |  Branch (519:47): [True: 87, False: 7.29k]
  ------------------
  520|  7.47k|                shnum || shstrx ||
  ------------------
  |  Branch (520:17): [True: 96, False: 7.20k]
  |  Branch (520:26): [True: 90, False: 7.11k]
  ------------------
  521|  7.47k|                gshdr->gh_addr ||
  ------------------
  |  Branch (521:17): [True: 15, False: 7.09k]
  ------------------
  522|  7.47k|                gshdr->gh_info) {
  ------------------
  |  Branch (522:17): [True: 81, False: 7.01k]
  ------------------
  523|    465|                free(orig_psh);
  524|    465|                free(orig_gshdr);
  525|    465|                *errcode = DW_DLE_IMPROPER_SECTION_ZERO;
  ------------------
  |  | 1472|    465|#define DW_DLE_IMPROPER_SECTION_ZERO           497
  ------------------
  526|    465|                return DW_DLV_ERROR;
  ------------------
  |  |   60|    465|#define DW_DLV_ERROR      1
  ------------------
  527|    465|            }
  528|  7.47k|        }
  529|   465k|        bitsoncount = getbitsoncount(gshdr->gh_flags);
  530|   465k|        if (bitsoncount > 8) {
  ------------------
  |  Branch (530:13): [True: 66, False: 465k]
  ------------------
  531|     66|            free(orig_psh);
  532|     66|            free(orig_gshdr);
  533|     66|            *errcode = DW_DLE_BAD_SECTION_FLAGS;
  ------------------
  |  | 1471|     66|#define DW_DLE_BAD_SECTION_FLAGS               496
  ------------------
  534|     66|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     66|#define DW_DLV_ERROR      1
  ------------------
  535|     66|        }
  536|       |
  537|   465k|        if (gshdr->gh_type == SHT_REL || gshdr->gh_type == SHT_RELA){
  ------------------
  |  |   56|   930k|#define SHT_REL 9
  ------------------
                      if (gshdr->gh_type == SHT_REL || gshdr->gh_type == SHT_RELA){
  ------------------
  |  |   53|   450k|#define SHT_RELA 4
  ------------------
  |  Branch (537:13): [True: 15.3k, False: 450k]
  |  Branch (537:42): [True: 11.5k, False: 438k]
  ------------------
  538|  26.9k|            gshdr->gh_reloc_target_secnum = gshdr->gh_info;
  539|  26.9k|        }
  540|   465k|    }
  541|  6.90k|    free(orig_psh);
  542|  6.90k|    *count_out = count;
  543|  6.90k|    ep->f_shdr = orig_gshdr;
  544|  6.90k|    ep->f_loc_shdr.g_name = "Section Header";
  545|  6.90k|    ep->f_loc_shdr.g_count = count;
  546|  6.90k|    ep->f_loc_shdr.g_offset = offset;
  547|  6.90k|    ep->f_loc_shdr.g_entrysize = sizeof(dw_elf32_shdr);
  548|  6.90k|    ep->f_loc_shdr.g_totalsize = sizeof(dw_elf32_shdr)*count;
  549|  6.90k|    return DW_DLV_OK;
  ------------------
  |  |   59|  6.90k|#define DW_DLV_OK         0
  ------------------
  550|  7.48k|}
dwarf_elf_load_headers.c:getbitsoncount:
  102|   520k|{
  103|   520k|    int           bitscount = 0;
  104|   520k|    Dwarf_Unsigned v = v_in;
  105|       |
  106|   945k|    while (v) {
  ------------------
  |  Branch (106:12): [True: 424k, False: 520k]
  ------------------
  107|   424k|        unsigned int nibble = v & 0xf;
  108|   424k|        bitscount += nibblecounts[nibble];
  109|   424k|        v >>= 4;
  110|   424k|    }
  111|   520k|    return bitscount;
  112|   520k|}
dwarf_elf_load_headers.c:elf_load_sectheaders64:
 1379|  4.64k|{
 1380|  4.64k|    Dwarf_Unsigned generic_count = 0;
 1381|  4.64k|    Dwarf_Unsigned shdr_count = 0;
 1382|  4.64k|    Dwarf_Bool have_shdr_count = FALSE;
  ------------------
  |  |   40|  4.64k|#define FALSE 0
  ------------------
 1383|  4.64k|    Dwarf_Unsigned shstrndx_number = 0;
 1384|  4.64k|    Dwarf_Bool have_shstrndx_number = FALSE;
  ------------------
  |  |   40|  4.64k|#define FALSE 0
  ------------------
 1385|  4.64k|    struct generic_ehdr *ehp = 0;
 1386|  4.64k|    int res = 0;
 1387|       |
 1388|  4.64k|    ehp = ep->f_ehdr;
 1389|  4.64k|    if (!ehp->ge_shnum_in_shnum || !ehp->ge_strndx_in_strndx ) {
  ------------------
  |  Branch (1389:9): [True: 513, False: 4.12k]
  |  Branch (1389:36): [True: 78, False: 4.05k]
  ------------------
 1390|    591|        res = get_counts_from_sec64_zero(ep,offset,
 1391|    591|            &have_shdr_count,&shdr_count,
 1392|    591|            &have_shstrndx_number,&shstrndx_number,
 1393|    591|            errcode);
 1394|    591|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    591|#define DW_DLV_OK         0
  ------------------
  |  Branch (1394:13): [True: 174, False: 417]
  ------------------
 1395|    174|            return res;
 1396|    174|        }
 1397|    417|        if (have_shdr_count) {
  ------------------
  |  Branch (1397:13): [True: 417, False: 0]
  ------------------
 1398|    417|            count = shdr_count;
 1399|    417|        }
 1400|    417|    }
 1401|  4.46k|    if (count == 0) {
  ------------------
  |  Branch (1401:9): [True: 0, False: 4.46k]
  ------------------
 1402|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
 1403|      0|    }
 1404|  4.46k|    if (entsize < sizeof(dw_elf64_shdr)) {
  ------------------
  |  Branch (1404:9): [True: 51, False: 4.41k]
  ------------------
 1405|     51|        *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     51|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
 1406|     51|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     51|#define DW_DLV_ERROR      1
  ------------------
 1407|     51|    }
 1408|  4.41k|    if ((offset > ep->f_filesize)||
  ------------------
  |  Branch (1408:9): [True: 252, False: 4.16k]
  ------------------
 1409|  4.41k|        (entsize > 200)||
  ------------------
  |  Branch (1409:9): [True: 84, False: 4.08k]
  ------------------
 1410|  4.41k|        (count > ep->f_filesize) ||
  ------------------
  |  Branch (1410:9): [True: 351, False: 3.72k]
  ------------------
 1411|  4.41k|        ((count *entsize +offset) > ep->f_filesize)) {
  ------------------
  |  Branch (1411:9): [True: 117, False: 3.61k]
  ------------------
 1412|    804|        *errcode = DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE;
  ------------------
  |  | 1445|    804|#define DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE    470
  ------------------
 1413|    804|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    804|#define DW_DLV_ERROR      1
  ------------------
 1414|    804|    }
 1415|       |
 1416|  3.61k|    res = generic_shdr_from_shdr64(ep,&generic_count,
 1417|  3.61k|        offset,entsize,count,errcode);
 1418|  3.61k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  3.61k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1418:9): [True: 990, False: 2.62k]
  ------------------
 1419|    990|        return res;
 1420|    990|    }
 1421|  2.62k|    if (generic_count != count) {
  ------------------
  |  Branch (1421:9): [True: 0, False: 2.62k]
  ------------------
 1422|      0|        *errcode = DW_DLE_ELF_SECTION_COUNT_MISMATCH;
  ------------------
  |  | 1417|      0|#define DW_DLE_ELF_SECTION_COUNT_MISMATCH      442
  ------------------
 1423|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1424|      0|    }
 1425|  2.62k|    return DW_DLV_OK;
  ------------------
  |  |   59|  2.62k|#define DW_DLV_OK         0
  ------------------
 1426|  2.62k|}
dwarf_elf_load_headers.c:get_counts_from_sec64_zero:
 1333|    591|{
 1334|    591|    dw_elf64_shdr       shd64;
 1335|    591|    struct generic_shdr shdg;
 1336|    591|    int res = 0;
 1337|    591|    Dwarf_Unsigned size = sizeof(shd64);
 1338|    591|    struct generic_ehdr * geh  = ep->f_ehdr;
 1339|       |
 1340|    591|    shd64 =  shd64zero;
 1341|    591|    shdg  = shdgzero;
 1342|    591|    res = RRMOA(ep->f_fd,&shd64,offset,size,
  ------------------
  |  |   65|    591|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    591|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1343|    591|        ep->f_filesize,errcode);
 1344|    591|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    591|#define DW_DLV_OK         0
  ------------------
  |  Branch (1344:9): [True: 165, False: 426]
  ------------------
 1345|    165|        return res;
 1346|    165|    }
 1347|    426|    copysection64(ep,&shdg,&shd64);
 1348|    426|    if (geh->ge_shnum_extended) {
  ------------------
  |  Branch (1348:9): [True: 396, False: 30]
  ------------------
 1349|    396|        geh->ge_shnum = shdg.gh_size;
 1350|    396|        geh->ge_shnum_in_shnum = TRUE;
  ------------------
  |  |   37|    396|#define TRUE 1
  ------------------
 1351|    396|        if (geh->ge_shnum  < 3) {
  ------------------
  |  Branch (1351:13): [True: 6, False: 390]
  ------------------
 1352|      6|            *errcode = DW_DLE_TOO_FEW_SECTIONS;
  ------------------
  |  | 1469|      6|#define DW_DLE_TOO_FEW_SECTIONS                494
  ------------------
 1353|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
 1354|      6|        }
 1355|    396|    }
 1356|    420|    *have_shdr_count = TRUE;
  ------------------
  |  |   37|    420|#define TRUE 1
  ------------------
 1357|    420|    *shdr_count = geh->ge_shnum;
 1358|    420|    if (geh->ge_strndx_extended) {
  ------------------
  |  Branch (1358:9): [True: 42, False: 378]
  ------------------
 1359|     42|        geh->ge_shstrndx = shdg.gh_link;
 1360|     42|        geh->ge_strndx_in_strndx = TRUE;
  ------------------
  |  |   37|     42|#define TRUE 1
  ------------------
 1361|     42|    }
 1362|    420|    if (geh->ge_shnum_in_shnum    &&
  ------------------
  |  Branch (1362:9): [True: 420, False: 0]
  ------------------
 1363|    420|        geh->ge_strndx_in_strndx &&
  ------------------
  |  Branch (1363:9): [True: 420, False: 0]
  ------------------
 1364|    420|        (geh->ge_shstrndx >= geh->ge_shnum)) {
  ------------------
  |  Branch (1364:9): [True: 3, False: 417]
  ------------------
 1365|      3|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|      3|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
 1366|      3|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
 1367|      3|    }
 1368|       |
 1369|    417|    *have_shstrndx_number = TRUE;
  ------------------
  |  |   37|    417|#define TRUE 1
  ------------------
 1370|    417|    *shstrndx_number = geh->ge_shstrndx;
 1371|    417|    return DW_DLV_OK;
  ------------------
  |  |   59|    417|#define DW_DLV_OK         0
  ------------------
 1372|    420|}
dwarf_elf_load_headers.c:copysection64:
  557|  56.2k|{
  558|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_name,psh->sh_name);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  559|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_type,psh->sh_type);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  560|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_flags,psh->sh_flags);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  561|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_addr,psh->sh_addr);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  562|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_offset,psh->sh_offset);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  563|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_size,psh->sh_size);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  564|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_link,psh->sh_link);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  565|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_info,psh->sh_info);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  566|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_addralign,psh->sh_addralign);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  567|  56.2k|    ASNAR(ep->f_copy_word,gshdr->gh_entsize,psh->sh_entsize);
  ------------------
  |  |   57|  56.2k|    do {                                        \
  |  |   58|  56.2k|        (t) = 0;                                \
  |  |   59|  56.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  56.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  568|  56.2k|}
dwarf_elf_load_headers.c:generic_shdr_from_shdr64:
  577|  3.61k|{
  578|  3.61k|    dw_elf64_shdr          *psh =0;
  579|  3.61k|    dw_elf64_shdr          *orig_psh =0;
  580|  3.61k|    struct generic_shdr *gshdr =0;
  581|  3.61k|    struct generic_shdr *orig_gshdr =0;
  582|  3.61k|    struct generic_ehdr *ehdr = ep->f_ehdr;
  583|  3.61k|    Dwarf_Unsigned i = 0;
  584|  3.61k|    int res = 0;
  585|       |
  586|  3.61k|    *count_out = 0;
  587|  3.61k|    psh = (dw_elf64_shdr *)calloc(count , entsize);
  588|  3.61k|    if (!psh) {
  ------------------
  |  Branch (588:9): [True: 0, False: 3.61k]
  ------------------
  589|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  590|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  591|      0|    }
  592|  3.61k|    gshdr = (struct generic_shdr *)calloc(count,sizeof(*gshdr));
  593|  3.61k|    if (gshdr == 0) {
  ------------------
  |  Branch (593:9): [True: 0, False: 3.61k]
  ------------------
  594|      0|        free(psh);
  595|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  596|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  597|      0|    }
  598|  3.61k|    orig_psh = psh;
  599|  3.61k|    orig_gshdr = gshdr;
  600|  3.61k|    res = RRMOA(ep->f_fd,psh,offset,count*entsize,
  ------------------
  |  |   65|  3.61k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  3.61k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  601|  3.61k|        ep->f_filesize,errcode);
  602|  3.61k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  3.61k|#define DW_DLV_OK         0
  ------------------
  |  Branch (602:9): [True: 0, False: 3.61k]
  ------------------
  603|      0|        free(orig_psh);
  604|      0|        free(orig_gshdr);
  605|      0|        return res;
  606|      0|    }
  607|  58.4k|    for ( i = 0; i < count;
  ------------------
  |  Branch (607:18): [True: 55.8k, False: 2.62k]
  ------------------
  608|  55.8k|        ++i,  psh++,gshdr++) {
  609|  55.8k|        int bitsoncount = 0;
  610|  55.8k|        int isempty = FALSE;
  ------------------
  |  |   40|  55.8k|#define FALSE 0
  ------------------
  611|       |
  612|  55.8k|        gshdr->gh_secnum = i;
  613|  55.8k|        copysection64(ep,gshdr,psh);
  614|  55.8k|        if (gshdr->gh_size >= ep->f_filesize &&
  ------------------
  |  Branch (614:13): [True: 1.59k, False: 54.2k]
  ------------------
  615|  55.8k|            gshdr->gh_type != SHT_NOBITS) {
  ------------------
  |  |   84|  1.59k|#define SHT_NOBITS 8
  ------------------
  |  Branch (615:13): [True: 81, False: 1.51k]
  ------------------
  616|     81|            free(orig_psh);
  617|     81|            free(orig_gshdr);
  618|     81|            *errcode = DW_DLE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1410|     81|#define DW_DLE_SECTION_SIZE_ERROR              435
  ------------------
  619|     81|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     81|#define DW_DLV_ERROR      1
  ------------------
  620|     81|        }
  621|  55.7k|        isempty = is_empty_section(gshdr->gh_type);
  622|  55.7k|        if (i == 0) {
  ------------------
  |  Branch (622:13): [True: 3.57k, False: 52.2k]
  ------------------
  623|  3.57k|            Dwarf_Unsigned shnum = 0;
  624|  3.57k|            Dwarf_Unsigned shstrx = 0;
  625|       |
  626|       |            /*  Catch errors asap */
  627|  3.57k|            if (!ehdr->ge_shnum_extended) {
  ------------------
  |  Branch (627:17): [True: 3.57k, False: 9]
  ------------------
  628|  3.57k|                shnum = gshdr->gh_size;
  629|  3.57k|            }
  630|  3.57k|            if (!ehdr->ge_strndx_extended) {
  ------------------
  |  Branch (630:17): [True: 3.55k, False: 24]
  ------------------
  631|  3.55k|                shstrx = gshdr->gh_link;
  632|  3.55k|            }
  633|       |            /*  We require that section zero be 'empty'
  634|       |                per the Elf ABI.
  635|       |                But gh_link  and gh_size might be used for
  636|       |                ge_shstrndx and ge_shnum, respectively*/
  637|  3.57k|            if (!isempty || gshdr->gh_name || gshdr->gh_flags ||
  ------------------
  |  Branch (637:17): [True: 12, False: 3.56k]
  |  Branch (637:29): [True: 96, False: 3.47k]
  |  Branch (637:47): [True: 219, False: 3.25k]
  ------------------
  638|  3.57k|                shnum || shstrx ||
  ------------------
  |  Branch (638:17): [True: 231, False: 3.02k]
  |  Branch (638:26): [True: 87, False: 2.93k]
  ------------------
  639|  3.57k|                gshdr->gh_addr ||
  ------------------
  |  Branch (639:17): [True: 3, False: 2.93k]
  ------------------
  640|  3.57k|                gshdr->gh_info) {
  ------------------
  |  Branch (640:17): [True: 69, False: 2.86k]
  ------------------
  641|    717|                free(orig_psh);
  642|    717|                free(orig_gshdr);
  643|    717|                *errcode = DW_DLE_IMPROPER_SECTION_ZERO;
  ------------------
  |  | 1472|    717|#define DW_DLE_IMPROPER_SECTION_ZERO           497
  ------------------
  644|    717|                return DW_DLV_ERROR;
  ------------------
  |  |   60|    717|#define DW_DLV_ERROR      1
  ------------------
  645|    717|            }
  646|  3.57k|        }
  647|  55.0k|        bitsoncount = getbitsoncount(gshdr->gh_flags);
  648|  55.0k|        if (bitsoncount > 8) {
  ------------------
  |  Branch (648:13): [True: 192, False: 54.8k]
  ------------------
  649|    192|            free(orig_psh);
  650|    192|            free(orig_gshdr);
  651|    192|            *errcode = DW_DLE_BAD_SECTION_FLAGS;
  ------------------
  |  | 1471|    192|#define DW_DLE_BAD_SECTION_FLAGS               496
  ------------------
  652|    192|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    192|#define DW_DLV_ERROR      1
  ------------------
  653|    192|        }
  654|       |
  655|  54.8k|        if (gshdr->gh_type == SHT_REL ||
  ------------------
  |  |   56|   109k|#define SHT_REL 9
  ------------------
  |  Branch (655:13): [True: 1.24k, False: 53.6k]
  ------------------
  656|  54.8k|            gshdr->gh_type == SHT_RELA){
  ------------------
  |  |   53|  53.6k|#define SHT_RELA 4
  ------------------
  |  Branch (656:13): [True: 5.72k, False: 47.9k]
  ------------------
  657|  6.97k|            gshdr->gh_reloc_target_secnum = gshdr->gh_info;
  658|  6.97k|        }
  659|  54.8k|    }
  660|  2.62k|    free(orig_psh);
  661|  2.62k|    *count_out = count;
  662|  2.62k|    ep->f_shdr = orig_gshdr;
  663|  2.62k|    ep->f_loc_shdr.g_name = "Section Header";
  664|  2.62k|    ep->f_loc_shdr.g_count = count;
  665|  2.62k|    ep->f_loc_shdr.g_offset = offset;
  666|  2.62k|    ep->f_loc_shdr.g_entrysize = sizeof(dw_elf64_shdr);
  667|  2.62k|    ep->f_loc_shdr.g_totalsize = sizeof(dw_elf64_shdr)*count;
  668|  2.62k|    return DW_DLV_OK;
  ------------------
  |  |   59|  2.62k|#define DW_DLV_OK         0
  ------------------
  669|  3.61k|}
dwarf_elf_load_headers.c:_dwarf_elf_load_sectstrings:
 1173|  9.52k|{
 1174|  9.52k|    int res = 0;
 1175|  9.52k|    struct generic_shdr *psh = 0;
 1176|  9.52k|    Dwarf_Unsigned secoffset = 0;
 1177|       |
 1178|  9.52k|    ep->f_elf_shstrings_length = 0;
 1179|  9.52k|    if (stringsection >= ep->f_ehdr->ge_shnum) {
  ------------------
  |  Branch (1179:9): [True: 0, False: 9.52k]
  ------------------
 1180|      0|        *errcode = DW_DLE_SECTION_INDEX_BAD;
  ------------------
  |  | 1413|      0|#define DW_DLE_SECTION_INDEX_BAD               438
  ------------------
 1181|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1182|      0|    }
 1183|  9.52k|    psh = ep->f_shdr + stringsection;
 1184|  9.52k|    secoffset = psh->gh_offset;
 1185|  9.52k|    if (is_empty_section(psh->gh_type)) {
  ------------------
  |  Branch (1185:9): [True: 69, False: 9.45k]
  ------------------
 1186|     69|        *errcode = DW_DLE_ELF_STRING_SECTION_MISSING;
  ------------------
  |  | 1418|     69|#define DW_DLE_ELF_STRING_SECTION_MISSING      443
  ------------------
 1187|     69|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     69|#define DW_DLV_ERROR      1
  ------------------
 1188|     69|    }
 1189|  9.45k|    if (secoffset >= ep->f_filesize ||
  ------------------
  |  Branch (1189:9): [True: 297, False: 9.16k]
  ------------------
 1190|  9.45k|        psh->gh_size > ep->f_filesize ||
  ------------------
  |  Branch (1190:9): [True: 0, False: 9.16k]
  ------------------
 1191|  9.45k|        (secoffset + psh->gh_size) >
  ------------------
  |  Branch (1191:9): [True: 57, False: 9.10k]
  ------------------
 1192|  9.16k|            ep->f_filesize) {
 1193|    354|        *errcode = DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE;
  ------------------
  |  | 1445|    354|#define DW_DLE_SECTION_SIZE_OR_OFFSET_LARGE    470
  ------------------
 1194|    354|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    354|#define DW_DLV_ERROR      1
  ------------------
 1195|    354|    }
 1196|  9.10k|    if (psh->gh_size > ep->f_elf_shstrings_max) {
  ------------------
  |  Branch (1196:9): [True: 8.72k, False: 378]
  ------------------
 1197|  8.72k|        free(ep->f_elf_shstrings_data);
 1198|  8.72k|        ep->f_elf_shstrings_data = (char *)malloc(psh->gh_size);
 1199|  8.72k|        ep->f_elf_shstrings_max = psh->gh_size;
 1200|  8.72k|        if (!ep->f_elf_shstrings_data) {
  ------------------
  |  Branch (1200:13): [True: 0, False: 8.72k]
  ------------------
 1201|      0|            ep->f_elf_shstrings_max = 0;
 1202|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1203|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1204|      0|        }
 1205|  8.72k|    }
 1206|  9.10k|    ep->f_elf_shstrings_length = psh->gh_size;
 1207|  9.10k|    res = RRMOA(ep->f_fd,ep->f_elf_shstrings_data,secoffset,
  ------------------
  |  |   65|  9.10k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  9.10k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1208|  9.10k|        psh->gh_size,
 1209|  9.10k|        ep->f_filesize,errcode);
 1210|  9.10k|    return res;
 1211|  9.10k|}
dwarf_elf_load_headers.c:_dwarf_elf_load_sect_namestring:
 1722|  9.10k|{
 1723|  9.10k|    struct generic_shdr *gshdr = 0;
 1724|  9.10k|    Dwarf_Unsigned generic_count = 0;
 1725|  9.10k|    Dwarf_Unsigned i = 1;
 1726|  9.10k|    const char *stringsecbase = 0;
 1727|       |
 1728|  9.10k|    stringsecbase = ep->f_elf_shstrings_data;
 1729|  9.10k|    gshdr = ep->f_shdr;
 1730|  9.10k|    generic_count = ep->f_loc_shdr.g_count;
 1731|   476k|    for (i = 0; i < generic_count; i++, ++gshdr) {
  ------------------
  |  Branch (1731:17): [True: 467k, False: 8.99k]
  ------------------
 1732|   467k|        const char *namestr =
 1733|   467k|            "<No valid Elf section strings exist>";
 1734|   467k|        int res = 0;
 1735|       |
 1736|   467k|        if (!ep->f_ehdr->ge_shstrndx || !stringsecbase) {
  ------------------
  |  Branch (1736:13): [True: 0, False: 467k]
  |  Branch (1736:41): [True: 30.7k, False: 436k]
  ------------------
 1737|  30.7k|            gshdr->gh_namestring = namestr;
 1738|  30.7k|            continue;
 1739|  30.7k|        }
 1740|   436k|        namestr = "<Invalid sh_name value. Corrupt Elf.>";
 1741|   436k|        res = validate_section_name_string(ep->f_elf_shstrings_length,
 1742|   436k|            gshdr->gh_name, stringsecbase,
 1743|   436k|            errcode);
 1744|   436k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|   436k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1744:13): [True: 111, False: 436k]
  ------------------
 1745|    111|            gshdr->gh_namestring = namestr;
 1746|    111|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|    111|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (1746:17): [True: 111, False: 0]
  ------------------
 1747|    111|                return res;
 1748|    111|            }
 1749|       |            /* no entry, missing strings. */
 1750|      0|            *errcode = DW_DLE_NO_SECT_STRINGS;
  ------------------
  |  | 1468|      0|#define DW_DLE_NO_SECT_STRINGS                 493
  ------------------
 1751|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1752|   436k|        } else {
 1753|   436k|            gshdr->gh_namestring = stringsecbase + gshdr->gh_name;
 1754|   436k|        }
 1755|   436k|    }
 1756|  8.99k|    return DW_DLV_OK;
  ------------------
  |  |   59|  8.99k|#define DW_DLV_OK         0
  ------------------
 1757|  9.10k|}
dwarf_elf_load_headers.c:validate_section_name_string:
 1698|   436k|{
 1699|   436k|    const char *endpoint = strings_start + section_length;
 1700|   436k|    const char *cur = 0;
 1701|       |
 1702|   436k|    if (section_length <= string_loc_index) {
  ------------------
  |  Branch (1702:9): [True: 105, False: 436k]
  ------------------
 1703|    105|        *errcode = DW_DLE_SECTION_STRING_OFFSET_BAD;
  ------------------
  |  | 1412|    105|#define DW_DLE_SECTION_STRING_OFFSET_BAD       437
  ------------------
 1704|    105|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    105|#define DW_DLV_ERROR      1
  ------------------
 1705|    105|    }
 1706|   436k|    cur = string_loc_index+strings_start;
 1707|  12.8M|    for ( ; cur < endpoint;++cur) {
  ------------------
  |  Branch (1707:13): [True: 12.8M, False: 6]
  ------------------
 1708|  12.8M|        if (!*cur) {
  ------------------
  |  Branch (1708:13): [True: 436k, False: 12.3M]
  ------------------
 1709|   436k|            return DW_DLV_OK;
  ------------------
  |  |   59|   436k|#define DW_DLV_OK         0
  ------------------
 1710|   436k|        }
 1711|  12.8M|    }
 1712|      6|    *errcode = DW_DLE_SECTION_STRING_OFFSET_BAD;
  ------------------
  |  | 1412|      6|#define DW_DLE_SECTION_STRING_OFFSET_BAD       437
  ------------------
 1713|      6|    return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
 1714|   436k|}
dwarf_elf_load_headers.c:_dwarf_elf_find_sym_sections:
 2165|  8.99k|{
 2166|  8.99k|    struct generic_shdr* psh = 0;
 2167|  8.99k|    Dwarf_Unsigned i = 0;
 2168|  8.99k|    Dwarf_Unsigned count = 0;
 2169|  8.99k|    int res = 0;
 2170|       |
 2171|  8.99k|    count = ep->f_loc_shdr.g_count;
 2172|  8.99k|    psh = ep->f_shdr;
 2173|   466k|    for (i = 0; i < count; ++psh,++i) {
  ------------------
  |  Branch (2173:17): [True: 457k, False: 8.99k]
  ------------------
 2174|   457k|        const char *name = psh->gh_namestring;
 2175|   457k|        if (is_empty_section(psh->gh_type)) {
  ------------------
  |  Branch (2175:13): [True: 363k, False: 93.9k]
  ------------------
 2176|       |            /*  No data here. */
 2177|   363k|            continue;
 2178|   363k|        }
 2179|  93.9k|        if (!strcmp(name,".dynsym")) {
  ------------------
  |  Branch (2179:13): [True: 990, False: 92.9k]
  ------------------
 2180|    990|            ep->f_dynsym_sect_index = i;
 2181|    990|            ep->f_loc_dynsym.g_offset = psh->gh_offset;
 2182|  92.9k|        } else if (!strcmp(name,".dynstr")) {
  ------------------
  |  Branch (2182:20): [True: 1.01k, False: 91.9k]
  ------------------
 2183|  1.01k|            ep->f_dynsym_sect_strings_sect_index = i;
 2184|  1.01k|            ep->f_dynsym_sect_strings_max = psh->gh_size;
 2185|  91.9k|        } else if (!strcmp(name,".symtab")) {
  ------------------
  |  Branch (2185:20): [True: 1.47k, False: 90.4k]
  ------------------
 2186|  1.47k|            ep->f_symtab_sect_index = i;
 2187|  1.47k|            ep->f_loc_symtab.g_offset = psh->gh_offset;
 2188|  90.4k|        } else if (!strcmp(name,".strtab")) {
  ------------------
  |  Branch (2188:20): [True: 2.20k, False: 88.2k]
  ------------------
 2189|  2.20k|            ep->f_symtab_sect_strings_sect_index = i;
 2190|  2.20k|            ep->f_symtab_sect_strings_max = psh->gh_size;
 2191|  88.2k|        } else if (!strcmp(name,".dynamic")) {
  ------------------
  |  Branch (2191:20): [True: 1.04k, False: 87.1k]
  ------------------
 2192|  1.04k|            ep->f_dynamic_sect_index = i;
 2193|  1.04k|            ep->f_loc_dynamic.g_offset = psh->gh_offset;
 2194|  1.04k|        }
 2195|  93.9k|    }
 2196|  8.99k|    res = validate_links(ep,ep->f_symtab_sect_index,
 2197|  8.99k|        ep->f_symtab_sect_strings_sect_index,errcode);
 2198|  8.99k|    if (res!= DW_DLV_OK) {
  ------------------
  |  |   59|  8.99k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2198:9): [True: 45, False: 8.94k]
  ------------------
 2199|     45|        return res;
 2200|     45|    }
 2201|  8.94k|    return DW_DLV_OK;
  ------------------
  |  |   59|  8.94k|#define DW_DLV_OK         0
  ------------------
 2202|  8.99k|}
dwarf_elf_load_headers.c:validate_links:
 1851|  8.99k|{
 1852|  8.99k|    struct generic_shdr* pshk = 0;
 1853|       |
 1854|  8.99k|    if (!knownsect) {
  ------------------
  |  Branch (1854:9): [True: 8.67k, False: 318]
  ------------------
 1855|  8.67k|        return DW_DLV_OK;
  ------------------
  |  |   59|  8.67k|#define DW_DLV_OK         0
  ------------------
 1856|  8.67k|    }
 1857|    318|    if (!string_sect) {
  ------------------
  |  Branch (1857:9): [True: 39, False: 279]
  ------------------
 1858|     39|        *errcode = DW_DLE_ELF_STRING_SECTION_ERROR;
  ------------------
  |  | 1422|     39|#define DW_DLE_ELF_STRING_SECTION_ERROR        447
  ------------------
 1859|     39|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     39|#define DW_DLV_ERROR      1
  ------------------
 1860|     39|    }
 1861|    279|    pshk = ep->f_shdr + knownsect;
 1862|    279|    if (string_sect != pshk->gh_link) {
  ------------------
  |  Branch (1862:9): [True: 6, False: 273]
  ------------------
 1863|      6|        *errcode = DW_DLE_ELF_SECTION_LINK_ERROR;
  ------------------
  |  | 1415|      6|#define DW_DLE_ELF_SECTION_LINK_ERROR          440
  ------------------
 1864|      6|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
 1865|      6|    }
 1866|    273|    return DW_DLV_OK;
  ------------------
  |  |   59|    273|#define DW_DLV_OK         0
  ------------------
 1867|    279|}
dwarf_elf_load_headers.c:_dwarf_elf_setup_all_section_groups:
 2084|  8.94k|{
 2085|  8.94k|    struct generic_shdr* psh = 0;
 2086|  8.94k|    Dwarf_Unsigned i = 0;
 2087|  8.94k|    Dwarf_Unsigned count = 0;
 2088|  8.94k|    int res = 0;
 2089|       |
 2090|  8.94k|    count = ep->f_loc_shdr.g_count;
 2091|  8.94k|    psh = ep->f_shdr;
 2092|       |
 2093|       |    /* Does step A and step B */
 2094|   446k|    for (i = 0; i < count; ++psh,++i) {
  ------------------
  |  Branch (2094:17): [True: 438k, False: 8.20k]
  ------------------
 2095|   438k|        const char *name = psh->gh_namestring;
 2096|       |
 2097|   438k|        if (is_empty_section(psh->gh_type)) {
  ------------------
  |  Branch (2097:13): [True: 356k, False: 81.7k]
  ------------------
 2098|       |            /*  No data here. */
 2099|   356k|            continue;
 2100|   356k|        }
 2101|  81.7k|        if (!elf_sht_groupsec(psh->gh_type,name)) {
  ------------------
  |  Branch (2101:13): [True: 69.3k, False: 12.3k]
  ------------------
 2102|       |            /* Step B */
 2103|  69.3k|            if (elf_flagmatches(psh->gh_flags,SHF_GROUP)) {
  ------------------
  |  |   67|  69.3k|#define SHF_GROUP  (1 << 9)
  ------------------
  |  Branch (2103:17): [True: 5.84k, False: 63.4k]
  ------------------
 2104|  5.84k|                ep->f_shf_group_flag_section_count++;
 2105|  5.84k|            }
 2106|  69.3k|            continue;
 2107|  69.3k|        }
 2108|       |        /* Looks like a section group. Do Step A. */
 2109|  12.3k|        res  =read_gs_section_group(ep,psh,errcode);
 2110|  12.3k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  12.3k|#define DW_DLV_OK         0
  ------------------
  |  Branch (2110:13): [True: 741, False: 11.6k]
  ------------------
 2111|    741|            return res;
 2112|    741|        }
 2113|  12.3k|    }
 2114|       |    /*  Any sections not marked above or here are in
 2115|       |        grep DW_GROUPNUMBER_BASE (1).
 2116|       |        Section C. */
 2117|  8.20k|    psh = ep->f_shdr;
 2118|   441k|    for (i = 0; i < count; ++psh,++i) {
  ------------------
  |  Branch (2118:17): [True: 432k, False: 8.20k]
  ------------------
 2119|   432k|        const char *name = psh->gh_namestring;
 2120|   432k|        int is_rel = FALSE;
  ------------------
  |  |   40|   432k|#define FALSE 0
  ------------------
 2121|   432k|        int is_rela = FALSE;
  ------------------
  |  |   40|   432k|#define FALSE 0
  ------------------
 2122|       |
 2123|   432k|        if (is_empty_section(psh->gh_type)) {
  ------------------
  |  Branch (2123:13): [True: 354k, False: 78.4k]
  ------------------
 2124|       |            /*  No data here. */
 2125|   354k|            continue;
 2126|   354k|        }
 2127|  78.4k|        if (elf_sht_groupsec(psh->gh_type,name)) {
  ------------------
  |  Branch (2127:13): [True: 10.9k, False: 67.4k]
  ------------------
 2128|  10.9k|            continue;
 2129|  10.9k|        }
 2130|       |        /* Not a section group */
 2131|  67.4k|        if (string_endswith(name,".dwo")) {
  ------------------
  |  Branch (2131:13): [True: 7.53k, False: 59.9k]
  ------------------
 2132|  7.53k|            if (psh->gh_section_group_number) {
  ------------------
  |  Branch (2132:17): [True: 3, False: 7.53k]
  ------------------
 2133|       |                /* multi-assignment to groups. Oops. */
 2134|      3|                *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      3|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 2135|      3|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
 2136|      3|            }
 2137|  7.53k|            psh->gh_is_dwarf = TRUE;
  ------------------
  |  |   37|  7.53k|#define TRUE 1
  ------------------
 2138|  7.53k|            psh->gh_section_group_number = DW_GROUPNUMBER_DWO;
  ------------------
  |  |  128|  7.53k|#define DW_GROUPNUMBER_DWO  2
  ------------------
 2139|  7.53k|            ep->f_dwo_group_section_count++;
 2140|  59.9k|        } else if (_dwarf_load_elf_section_is_dwarf(name,
  ------------------
  |  Branch (2140:20): [True: 30.3k, False: 29.6k]
  ------------------
 2141|  59.9k|            psh->gh_type,
 2142|  59.9k|            &is_rela,&is_rel)) {
 2143|  30.3k|            if (!psh->gh_section_group_number) {
  ------------------
  |  Branch (2143:17): [True: 30.2k, False: 93]
  ------------------
 2144|  30.2k|                psh->gh_section_group_number = DW_GROUPNUMBER_BASE;
  ------------------
  |  |  127|  30.2k|#define DW_GROUPNUMBER_BASE 1
  ------------------
 2145|  30.2k|            }
 2146|  30.3k|            psh->gh_is_dwarf = TRUE;
  ------------------
  |  |   37|  30.3k|#define TRUE 1
  ------------------
 2147|  30.3k|        } else {
 2148|       |            /* Do nothing. */
 2149|  29.6k|        }
 2150|  67.4k|    }
 2151|  8.20k|    if (ep->f_sht_group_type_section_count) {
  ------------------
  |  Branch (2151:9): [True: 696, False: 7.50k]
  ------------------
 2152|       |        /*  Not ARM. Done. */
 2153|    696|    }
 2154|  8.20k|    if (!ep->f_shf_group_flag_section_count) {
  ------------------
  |  Branch (2154:9): [True: 6.57k, False: 1.62k]
  ------------------
 2155|       |        /*  Nothing more to do. */
 2156|  6.57k|        return DW_DLV_OK;
  ------------------
  |  |   59|  6.57k|#define DW_DLV_OK         0
  ------------------
 2157|  6.57k|    }
 2158|  1.62k|    return DW_DLV_OK;
  ------------------
  |  |   59|  1.62k|#define DW_DLV_OK         0
  ------------------
 2159|  8.20k|}
dwarf_elf_load_headers.c:elf_sht_groupsec:
 1891|   160k|{
 1892|       |    /*  ARM compilers name SHT group "__ARM_grp<long name here>"
 1893|       |        not .group */
 1894|   160k|    if ((type == SHT_GROUP) || (!strcmp(sname,".group"))){
  ------------------
  |  |   96|   160k|#define SHT_GROUP  17
  ------------------
  |  Branch (1894:9): [True: 22.9k, False: 137k]
  |  Branch (1894:32): [True: 435, False: 136k]
  ------------------
 1895|  23.3k|        return TRUE;
  ------------------
  |  |   37|  23.3k|#define TRUE 1
  ------------------
 1896|  23.3k|    }
 1897|   136k|    return FALSE;
  ------------------
  |  |   40|   136k|#define FALSE 0
  ------------------
 1898|   160k|}
dwarf_elf_load_headers.c:elf_flagmatches:
 1902|  69.3k|{
 1903|  69.3k|    if ((flagsword&flag) == flag) {
  ------------------
  |  Branch (1903:9): [True: 5.84k, False: 63.4k]
  ------------------
 1904|  5.84k|        return TRUE;
  ------------------
  |  |   37|  5.84k|#define TRUE 1
  ------------------
 1905|  5.84k|    }
 1906|  63.4k|    return FALSE;
  ------------------
  |  |   40|  63.4k|#define FALSE 0
  ------------------
 1907|  69.3k|}
dwarf_elf_load_headers.c:read_gs_section_group:
 1919|  12.3k|{
 1920|  12.3k|    Dwarf_Unsigned i = 0;
 1921|  12.3k|    int res = 0;
 1922|       |
 1923|  12.3k|    if (!psh->gh_sht_group_array) {
  ------------------
  |  Branch (1923:9): [True: 12.3k, False: 0]
  ------------------
 1924|  12.3k|        Dwarf_Unsigned seclen = psh->gh_size;
 1925|  12.3k|        char *data = 0;
 1926|  12.3k|        char *dp = 0;
 1927|  12.3k|        Dwarf_Unsigned* grouparray = 0;
 1928|  12.3k|        char dblock[4];
 1929|  12.3k|        Dwarf_Unsigned va = 0;
 1930|  12.3k|        Dwarf_Unsigned count = 0;
 1931|  12.3k|        Dwarf_Unsigned groupmallocsize = 0;
 1932|  12.3k|        int foundone = 0;
 1933|       |
 1934|  12.3k|        if (seclen >= ep->f_filesize) {
  ------------------
  |  Branch (1934:13): [True: 0, False: 12.3k]
  ------------------
 1935|      0|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      0|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1936|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1937|      0|        }
 1938|  12.3k|        if (seclen < DWARF_32BIT_SIZE) {
  ------------------
  |  |  135|  12.3k|#define DWARF_32BIT_SIZE 4
  ------------------
  |  Branch (1938:13): [True: 6, False: 12.3k]
  ------------------
 1939|      6|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      6|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1940|      6|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
 1941|      6|        }
 1942|  12.3k|        data = malloc(seclen);
 1943|  12.3k|        if (!data) {
  ------------------
  |  Branch (1943:13): [True: 0, False: 12.3k]
  ------------------
 1944|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1945|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1946|      0|        }
 1947|  12.3k|        dp = data;
 1948|  12.3k|        if (psh->gh_entsize != DWARF_32BIT_SIZE) {
  ------------------
  |  |  135|  12.3k|#define DWARF_32BIT_SIZE 4
  ------------------
  |  Branch (1948:13): [True: 312, False: 12.0k]
  ------------------
 1949|    312|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|    312|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1950|    312|            free(data);
 1951|    312|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    312|#define DW_DLV_ERROR      1
  ------------------
 1952|    312|        }
 1953|  12.0k|        if (!psh->gh_entsize) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 12.0k]
  ------------------
 1954|      0|            free(data);
 1955|      0|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      0|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1956|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1957|      0|        }
 1958|  12.0k|        count = seclen/psh->gh_entsize;
 1959|  12.0k|        if (count >= ep->f_loc_shdr.g_count) {
  ------------------
  |  Branch (1959:13): [True: 90, False: 11.9k]
  ------------------
 1960|       |            /* Impossible */
 1961|     90|            free(data);
 1962|     90|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|     90|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1963|     90|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     90|#define DW_DLV_ERROR      1
  ------------------
 1964|     90|        }
 1965|  11.9k|        res = RRMOA(ep->f_fd,data,psh->gh_offset,seclen,
  ------------------
  |  |   65|  11.9k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  11.9k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1966|  11.9k|            ep->f_filesize,errcode);
 1967|  11.9k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  11.9k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1967:13): [True: 9, False: 11.9k]
  ------------------
 1968|      9|            free(data);
 1969|      9|            return res;
 1970|      9|        }
 1971|       |        /*  Adding 1 is silly but possibly avoids a warning
 1972|       |            from a particular compiler. */
 1973|  11.9k|        groupmallocsize =  (1+count) * sizeof(Dwarf_Unsigned);
 1974|  11.9k|        if (groupmallocsize >= ep->f_filesize) {
  ------------------
  |  Branch (1974:13): [True: 0, False: 11.9k]
  ------------------
 1975|      0|            free(data);
 1976|      0|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      0|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1977|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1978|      0|        }
 1979|  11.9k|        grouparray = malloc(groupmallocsize);
 1980|  11.9k|        if (!grouparray) {
  ------------------
  |  Branch (1980:13): [True: 0, False: 11.9k]
  ------------------
 1981|      0|            free(data);
 1982|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1983|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1984|      0|        }
 1985|       |
 1986|  11.9k|        memcpy(dblock,dp,DWARF_32BIT_SIZE);
  ------------------
  |  |  135|  11.9k|#define DWARF_32BIT_SIZE 4
  ------------------
 1987|  11.9k|        ASNAR(memcpy,va,dblock);
  ------------------
  |  |   57|  11.9k|    do {                                        \
  |  |   58|  11.9k|        (t) = 0;                                \
  |  |   59|  11.9k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  11.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1988|       |        /* There is ambiguity on the endianness of this stuff. */
 1989|  11.9k|        if (va != 1 && va != 0x1000000) {
  ------------------
  |  Branch (1989:13): [True: 8.61k, False: 3.34k]
  |  Branch (1989:24): [True: 114, False: 8.50k]
  ------------------
 1990|       |            /*  Could be corrupted elf object. */
 1991|    114|            *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|    114|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 1992|    114|            free(data);
 1993|    114|            free(grouparray);
 1994|    114|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    114|#define DW_DLV_ERROR      1
  ------------------
 1995|    114|        }
 1996|  11.8k|        grouparray[0] = 1;
 1997|       |        /*  A .group section will have 0 to G sections
 1998|       |            listed. Ignore the initial 'version' value
 1999|       |            of 1 in [0] */
 2000|  11.8k|        dp = dp + DWARF_32BIT_SIZE;
  ------------------
  |  |  135|  11.8k|#define DWARF_32BIT_SIZE 4
  ------------------
 2001|  23.1k|        for ( i = 1; i < count; ++i,dp += DWARF_32BIT_SIZE) {
  ------------------
  |  |  135|  11.3k|#define DWARF_32BIT_SIZE 4
  ------------------
  |  Branch (2001:22): [True: 11.5k, False: 11.6k]
  ------------------
 2002|  11.5k|            Dwarf_Unsigned gseca = 0;
 2003|  11.5k|            Dwarf_Unsigned gsecb = 0;
 2004|  11.5k|            struct generic_shdr* targpsh = 0;
 2005|       |
 2006|  11.5k|            memcpy(dblock,dp,DWARF_32BIT_SIZE);
  ------------------
  |  |  135|  11.5k|#define DWARF_32BIT_SIZE 4
  ------------------
 2007|  11.5k|            ASNAR(memcpy,gseca,dblock);
  ------------------
  |  |   57|  11.5k|    do {                                        \
  |  |   58|  11.5k|        (t) = 0;                                \
  |  |   59|  11.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  11.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2008|       |            /*  Loading gseca and gsecb with different endianness.
 2009|       |                Only one of them can be of any use. */
 2010|  11.5k|            ASNAR(_dwarf_memcpy_swap_bytes,gsecb,dblock);
  ------------------
  |  |   57|  11.5k|    do {                                        \
  |  |   58|  11.5k|        (t) = 0;                                \
  |  |   59|  11.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  11.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2011|  11.5k|            if (!gseca) {
  ------------------
  |  Branch (2011:17): [True: 9, False: 11.5k]
  ------------------
 2012|       |                /*  zero! Oops. No point in looking at gsecb */
 2013|      9|                free(data);
 2014|      9|                free(grouparray);
 2015|      9|                *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|      9|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 2016|      9|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      9|#define DW_DLV_ERROR      1
  ------------------
 2017|      9|            }
 2018|  11.5k|            if (gseca >= ep->f_loc_shdr.g_count) {
  ------------------
  |  Branch (2018:17): [True: 6.23k, False: 5.31k]
  ------------------
 2019|       |                /*  Might be confused endianness by
 2020|       |                    the compiler generating the SHT_GROUP.
 2021|       |                    This is pretty horrible. */
 2022|  6.23k|                if (gsecb >= ep->f_loc_shdr.g_count) {
  ------------------
  |  Branch (2022:21): [True: 186, False: 6.04k]
  ------------------
 2023|    186|                    *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|    186|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 2024|    186|                    free(data);
 2025|    186|                    free(grouparray);
 2026|    186|                    return DW_DLV_ERROR;
  ------------------
  |  |   60|    186|#define DW_DLV_ERROR      1
  ------------------
 2027|    186|                }
 2028|       |                /*  Looks as though gsecb is the correct
 2029|       |                    interpretation.  Yes, ugly. */
 2030|  6.04k|                gseca = gsecb;
 2031|  6.04k|            }
 2032|  11.3k|            grouparray[i] = gseca;
 2033|  11.3k|            targpsh = ep->f_shdr + gseca;
 2034|  11.3k|            if (_dwarf_ignorethissection(targpsh->gh_namestring)){
  ------------------
  |  Branch (2034:17): [True: 9.07k, False: 2.27k]
  ------------------
 2035|  9.07k|                continue;
 2036|  9.07k|            }
 2037|  2.27k|            if (targpsh->gh_section_group_number) {
  ------------------
  |  Branch (2037:17): [True: 15, False: 2.26k]
  ------------------
 2038|       |                /* multi-assignment to groups. Oops. */
 2039|     15|                free(data);
 2040|     15|                free(grouparray);
 2041|     15|                *errcode = DW_DLE_ELF_SECTION_GROUP_ERROR;
  ------------------
  |  | 1416|     15|#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
  ------------------
 2042|     15|                return DW_DLV_ERROR;
  ------------------
  |  |   60|     15|#define DW_DLV_ERROR      1
  ------------------
 2043|     15|            }
 2044|  2.26k|            targpsh->gh_section_group_number =
 2045|  2.26k|                ep->f_sg_next_group_number;
 2046|  2.26k|            foundone = 1;
 2047|  2.26k|        }
 2048|  11.6k|        if (foundone) {
  ------------------
  |  Branch (2048:13): [True: 975, False: 10.6k]
  ------------------
 2049|    975|            ++ep->f_sg_next_group_number;
 2050|    975|            ++ep->f_sht_group_type_section_count;
 2051|    975|        }
 2052|  11.6k|        free(data);
 2053|  11.6k|        psh->gh_sht_group_array = grouparray;
 2054|  11.6k|        psh->gh_sht_group_array_count = count;
 2055|  11.6k|    }
 2056|  11.6k|    return DW_DLV_OK;
  ------------------
  |  |   59|  11.6k|#define DW_DLV_OK         0
  ------------------
 2057|  12.3k|}
dwarf_elf_load_headers.c:string_endswith:
 1871|  67.4k|{
 1872|  67.4k|    size_t len = strlen(n);
 1873|  67.4k|    size_t qlen = strlen(q);
 1874|  67.4k|    const char *startpt = 0;
 1875|       |
 1876|  67.4k|    if ( len < qlen) {
  ------------------
  |  Branch (1876:10): [True: 5.90k, False: 61.5k]
  ------------------
 1877|  5.90k|        return FALSE;
  ------------------
  |  |   40|  5.90k|#define FALSE 0
  ------------------
 1878|  5.90k|    }
 1879|  61.5k|    startpt = n + (len-qlen);
 1880|  61.5k|    if (strcmp(startpt,q)) {
  ------------------
  |  Branch (1880:9): [True: 54.0k, False: 7.53k]
  ------------------
 1881|  54.0k|        return FALSE;
  ------------------
  |  |   40|  54.0k|#define FALSE 0
  ------------------
 1882|  54.0k|    }
 1883|  7.53k|    return TRUE;
  ------------------
  |  |   37|  7.53k|#define TRUE 1
  ------------------
 1884|  61.5k|}
dwarf_elf_load_headers.c:_dwarf_load_elf_section_is_dwarf:
  118|  59.9k|{
  119|  59.9k|    *is_rel = FALSE;
  ------------------
  |  |   40|  59.9k|#define FALSE 0
  ------------------
  120|  59.9k|    *is_rela = FALSE;
  ------------------
  |  |   40|  59.9k|#define FALSE 0
  ------------------
  121|  59.9k|    if (_dwarf_ignorethissection(sname)) {
  ------------------
  |  Branch (121:9): [True: 3.45k, False: 56.4k]
  ------------------
  122|  3.45k|        return FALSE;
  ------------------
  |  |   40|  3.45k|#define FALSE 0
  ------------------
  123|  3.45k|    }
  124|  56.4k|    if (sectype == SHT_RELA) {
  ------------------
  |  |   53|  56.4k|#define SHT_RELA 4
  ------------------
  |  Branch (124:9): [True: 8.92k, False: 47.5k]
  ------------------
  125|  8.92k|        *is_rela = TRUE;
  ------------------
  |  |   37|  8.92k|#define TRUE 1
  ------------------
  126|  8.92k|        return TRUE;
  ------------------
  |  |   37|  8.92k|#define TRUE 1
  ------------------
  127|  8.92k|    }
  128|  47.5k|    if (!strncmp(sname,".rel",4)) {
  ------------------
  |  Branch (128:9): [True: 6.33k, False: 41.2k]
  ------------------
  129|  6.33k|        if (!strncmp(sname,".rela.",6)) {
  ------------------
  |  Branch (129:13): [True: 2.40k, False: 3.93k]
  ------------------
  130|  2.40k|            *is_rela = TRUE;
  ------------------
  |  |   37|  2.40k|#define TRUE 1
  ------------------
  131|  2.40k|            return TRUE;
  ------------------
  |  |   37|  2.40k|#define TRUE 1
  ------------------
  132|  2.40k|        }
  133|  3.93k|        if (!strncmp(sname,".rel.",5)) {
  ------------------
  |  Branch (133:13): [True: 2.73k, False: 1.19k]
  ------------------
  134|  2.73k|            *is_rela = TRUE;
  ------------------
  |  |   37|  2.73k|#define TRUE 1
  ------------------
  135|  2.73k|            return TRUE;
  ------------------
  |  |   37|  2.73k|#define TRUE 1
  ------------------
  136|  2.73k|        }
  137|       |        /*  Else something is goofy/Impossible */
  138|  1.19k|        return FALSE;
  ------------------
  |  |   40|  1.19k|#define FALSE 0
  ------------------
  139|  3.93k|    }
  140|  41.2k|    if (!strncmp(sname,".debug_",7)) {
  ------------------
  |  Branch (140:9): [True: 10.9k, False: 30.2k]
  ------------------
  141|  10.9k|        return TRUE;
  ------------------
  |  |   37|  10.9k|#define TRUE 1
  ------------------
  142|  10.9k|    }
  143|  30.2k|    if (!strncmp(sname,".zdebug_",8)) {
  ------------------
  |  Branch (143:9): [True: 2.15k, False: 28.1k]
  ------------------
  144|  2.15k|        return TRUE;
  ------------------
  |  |   37|  2.15k|#define TRUE 1
  ------------------
  145|  2.15k|    }
  146|  28.1k|    if (!strcmp(sname,".eh_frame")) {
  ------------------
  |  Branch (146:9): [True: 1.92k, False: 26.2k]
  ------------------
  147|  1.92k|        return TRUE;
  ------------------
  |  |   37|  1.92k|#define TRUE 1
  ------------------
  148|  1.92k|    }
  149|  26.2k|    if (!strncmp(sname,".gdb_index",10)) {
  ------------------
  |  Branch (149:9): [True: 1.25k, False: 24.9k]
  ------------------
  150|  1.25k|        return TRUE;
  ------------------
  |  |   37|  1.25k|#define TRUE 1
  ------------------
  151|  1.25k|    }
  152|  24.9k|    return FALSE;
  ------------------
  |  |   40|  24.9k|#define FALSE 0
  ------------------
  153|  26.2k|}

_dwarf_destruct_elf_nlaccess:
  534|  12.9k|{
  535|  12.9k|    dwarf_elf_object_access_internals_t *ep = 0;
  536|  12.9k|    struct generic_shdr *shp = 0;
  537|  12.9k|    Dwarf_Unsigned shcount = 0;
  538|  12.9k|    Dwarf_Unsigned i = 0;
  539|       |
  540|  12.9k|    ep = (dwarf_elf_object_access_internals_t *)aip->ai_object;
  541|  12.9k|    free(ep->f_ehdr);
  542|  12.9k|    shp = ep->f_shdr;
  543|  12.9k|    shcount = ep->f_loc_shdr.g_count;
  544|   504k|    for (i = 0; i < shcount; ++i,++shp) {
  ------------------
  |  Branch (544:17): [True: 491k, False: 12.9k]
  ------------------
  545|   491k|        free(shp->gh_rels);
  546|   491k|        shp->gh_rels = 0;
  547|   491k|        free(shp->gh_content);
  548|   491k|        shp->gh_content = 0;
  549|   491k|        free(shp->gh_sht_group_array);
  550|   491k|        shp->gh_sht_group_array = 0;
  551|   491k|        shp->gh_sht_group_array_count = 0;
  552|   491k|    }
  553|  12.9k|    free(ep->f_shdr);
  554|  12.9k|    ep->f_loc_shdr.g_count = 0;
  555|  12.9k|    free(ep->f_phdr);
  556|  12.9k|    free(ep->f_elf_shstrings_data);
  557|  12.9k|    free(ep->f_dynamic);
  558|  12.9k|    free(ep->f_symtab_sect_strings);
  559|  12.9k|    free(ep->f_dynsym_sect_strings);
  560|  12.9k|    free(ep->f_symtab);
  561|  12.9k|    free(ep->f_dynsym);
  562|       |
  563|       |    /* if TRUE close f_fd on destruct.*/
  564|  12.9k|    if (ep->f_destruct_close_fd) {
  ------------------
  |  Branch (564:9): [True: 0, False: 12.9k]
  ------------------
  565|      0|        _dwarf_closer(ep->f_fd);
  566|      0|    }
  567|  12.9k|    ep->f_ident[0] = 'X';
  568|  12.9k|    free(ep->f_path);
  569|  12.9k|    free(ep);
  570|  12.9k|    free(aip);
  571|  12.9k|}
_dwarf_elf_nlsetup:
  584|  12.9k|{
  585|  12.9k|    Dwarf_Obj_Access_Interface_a *binary_interface = 0;
  586|  12.9k|    dwarf_elf_object_access_internals_t *intfc = 0;
  587|  12.9k|    int res = DW_DLV_OK;
  ------------------
  |  |   59|  12.9k|#define DW_DLV_OK         0
  ------------------
  588|  12.9k|    int localerrnum = 0;
  589|       |
  590|  12.9k|    res = _dwarf_elf_object_access_init(
  591|  12.9k|        fd,
  592|  12.9k|        ftype,endian,offsetsize,filesize,
  593|  12.9k|        &binary_interface,
  594|  12.9k|        &localerrnum);
  595|  12.9k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  12.9k|#define DW_DLV_OK         0
  ------------------
  |  Branch (595:9): [True: 5.99k, False: 7.00k]
  ------------------
  596|  5.99k|        if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   58|  5.99k|#define DW_DLV_NO_ENTRY  -1
  ------------------
  |  Branch (596:13): [True: 6, False: 5.99k]
  ------------------
  597|      6|            return res;
  598|      6|        }
  599|  5.99k|        _dwarf_error(NULL, error, localerrnum);
  600|  5.99k|        return DW_DLV_ERROR;
  ------------------
  |  |   60|  5.99k|#define DW_DLV_ERROR      1
  ------------------
  601|  5.99k|    }
  602|       |    /*  allocates and initializes Dwarf_Debug,
  603|       |        generic code */
  604|  7.00k|    res = dwarf_object_init_b(binary_interface, errhand, errarg,
  605|  7.00k|        groupnumber, dbg, error);
  606|  7.00k|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|  7.00k|#define DW_DLV_OK         0
  ------------------
  |  Branch (606:9): [True: 4.71k, False: 2.28k]
  ------------------
  607|  4.71k|        _dwarf_destruct_elf_nlaccess(binary_interface);
  608|  4.71k|        return res;
  609|  4.71k|    }
  610|  2.28k|    intfc = binary_interface->ai_object;
  611|  2.28k|    intfc->f_path = strdup(true_path);
  612|  2.28k|    (*dbg)->de_obj_machine = intfc->f_machine;
  613|  2.28k|    (*dbg)->de_obj_flags = intfc->f_flags;
  614|  2.28k|    return res;
  615|  7.00k|}
dwarf_elfread.c:_dwarf_elf_object_access_init:
  771|  12.9k|{
  772|       |
  773|  12.9k|    int res = 0;
  774|  12.9k|    dwarf_elf_object_access_internals_t *internals = 0;
  775|  12.9k|    Dwarf_Obj_Access_Interface_a *intfc = 0;
  776|       |
  777|  12.9k|    internals = malloc(sizeof(dwarf_elf_object_access_internals_t));
  778|  12.9k|    if (!internals) {
  ------------------
  |  Branch (778:9): [True: 0, False: 12.9k]
  ------------------
  779|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  780|       |        /* Impossible case, we hope. Give up. */
  781|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  782|      0|    }
  783|  12.9k|    memset(internals,0,sizeof(*internals));
  784|  12.9k|    res = _dwarf_elf_object_access_internals_init(internals,
  785|  12.9k|        fd,
  786|  12.9k|        ftype, endian, offsetsize, filesize,
  787|  12.9k|        localerrnum);
  788|  12.9k|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|  12.9k|#define DW_DLV_OK         0
  ------------------
  |  Branch (788:9): [True: 5.99k, False: 7.00k]
  ------------------
  789|  5.99k|        return res;
  790|  5.99k|    }
  791|       |
  792|  7.00k|    intfc = malloc(sizeof(Dwarf_Obj_Access_Interface_a));
  793|  7.00k|    if (!intfc) {
  ------------------
  |  Branch (793:9): [True: 0, False: 7.00k]
  ------------------
  794|       |        /* Impossible case, we hope. Give up. */
  795|      0|        free(internals);
  796|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  797|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  798|      0|    }
  799|       |    /* Initialize the interface struct */
  800|  7.00k|    intfc->ai_object = internals;
  801|  7.00k|    intfc->ai_methods = &elf_nlmethods;
  802|  7.00k|    *binary_interface = intfc;
  803|  7.00k|    return DW_DLV_OK;
  ------------------
  |  |   59|  7.00k|#define DW_DLV_OK         0
  ------------------
  804|  7.00k|}
dwarf_elfread.c:_dwarf_elf_object_access_internals_init:
  641|  12.9k|{
  642|  12.9k|    dwarf_elf_object_access_internals_t * intfc = internals;
  643|  12.9k|    Dwarf_Unsigned i  = 0;
  644|  12.9k|    struct Dwarf_Obj_Access_Interface_a_s *localdoas;
  645|  12.9k|    int res = 0;
  646|       |
  647|       |    /*  Must malloc as _dwarf_destruct_elf_access()
  648|       |        forces that due to other uses. */
  649|  12.9k|    localdoas = (struct Dwarf_Obj_Access_Interface_a_s *)
  650|  12.9k|        malloc(sizeof(struct Dwarf_Obj_Access_Interface_a_s));
  651|  12.9k|    if (!localdoas) {
  ------------------
  |  Branch (651:9): [True: 0, False: 12.9k]
  ------------------
  652|      0|        free(internals);
  653|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  654|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  655|      0|    }
  656|  12.9k|    memset(localdoas,0,sizeof(struct Dwarf_Obj_Access_Interface_a_s));
  657|       |    /*  E is used with libelf. F with this elf reader. */
  658|  12.9k|    intfc->f_ident[0]    = 'F';
  659|  12.9k|    intfc->f_ident[1]    = '1';
  660|  12.9k|    intfc->f_fd          = fd;
  661|  12.9k|    intfc->f_is_64bit    = ((offsetsize==64)?TRUE:FALSE);
  ------------------
  |  |   37|  4.73k|#define TRUE 1
  ------------------
                  intfc->f_is_64bit    = ((offsetsize==64)?TRUE:FALSE);
  ------------------
  |  |   40|  8.26k|#define FALSE 0
  ------------------
  |  Branch (661:29): [True: 4.73k, False: 8.26k]
  ------------------
  662|  12.9k|    intfc->f_offsetsize  = (Dwarf_Small)offsetsize;
  663|  12.9k|    intfc->f_pointersize = (Dwarf_Small)offsetsize;
  664|  12.9k|    intfc->f_filesize    = filesize;
  665|  12.9k|    intfc->f_ftype       = ftype;
  666|  12.9k|    intfc->f_destruct_close_fd = FALSE;
  ------------------
  |  |   40|  12.9k|#define FALSE 0
  ------------------
  667|       |
  668|       |#ifdef WORDS_BIGENDIAN
  669|       |    if (endian == DW_END_little ) {
  670|       |        intfc->f_copy_word = _dwarf_memcpy_swap_bytes;
  671|       |        intfc->f_endian = DW_END_little;
  672|       |    } else {
  673|       |        intfc->f_copy_word = _dwarf_memcpy_noswap_bytes;
  674|       |        intfc->f_endian = DW_END_big;
  675|       |    }
  676|       |#else  /* LITTLE ENDIAN */
  677|  12.9k|    if (endian == DW_END_little ) {
  ------------------
  |  | 1105|  12.9k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  |  Branch (677:9): [True: 7.93k, False: 5.06k]
  ------------------
  678|  7.93k|        intfc->f_copy_word = _dwarf_memcpy_noswap_bytes;
  679|  7.93k|        intfc->f_endian = DW_END_little;
  ------------------
  |  | 1105|  7.93k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  680|  7.93k|    } else {
  681|  5.06k|        intfc->f_copy_word = _dwarf_memcpy_swap_bytes;
  682|  5.06k|        intfc->f_endian = DW_END_big;
  ------------------
  |  | 1104|  5.06k|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  683|  5.06k|    }
  684|  12.9k|#endif /* LITTLE- BIG-ENDIAN */
  685|       |    /*  The following sets f_machine. */
  686|  12.9k|    res = _dwarf_load_elf_header(intfc,errcode);
  687|  12.9k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  12.9k|#define DW_DLV_OK         0
  ------------------
  |  Branch (687:9): [True: 186, False: 12.8k]
  ------------------
  688|    186|        localdoas->ai_object = intfc;
  689|    186|        localdoas->ai_methods = 0;
  690|    186|        _dwarf_destruct_elf_nlaccess(localdoas);
  691|    186|        localdoas = 0;
  692|    186|        return res;
  693|    186|    }
  694|       |    /* Not loading progheaders */
  695|  12.8k|    res = _dwarf_load_elf_sectheaders(intfc,errcode);
  696|  12.8k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  12.8k|#define DW_DLV_OK         0
  ------------------
  |  Branch (696:9): [True: 4.60k, False: 8.20k]
  ------------------
  697|  4.60k|        localdoas->ai_object = intfc;
  698|  4.60k|        localdoas->ai_methods = 0;
  699|  4.60k|        _dwarf_destruct_elf_nlaccess(localdoas);
  700|  4.60k|        localdoas = 0;
  701|  4.60k|        return res;
  702|  4.60k|    }
  703|       |    /* We are not looking at symbol strings for now. */
  704|  8.20k|    res = _dwarf_load_elf_symstr(intfc,errcode);
  705|  8.20k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  8.20k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (705:9): [True: 333, False: 7.87k]
  ------------------
  706|    333|        localdoas->ai_object = intfc;
  707|    333|        localdoas->ai_methods = 0;
  708|    333|        _dwarf_destruct_elf_nlaccess(localdoas);
  709|    333|        localdoas = 0;
  710|    333|        return res;
  711|    333|    }
  712|  7.87k|    res  = _dwarf_load_elf_symtab_symbols(intfc,errcode);
  713|  7.87k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  7.87k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (713:9): [True: 129, False: 7.74k]
  ------------------
  714|    129|        localdoas->ai_object = intfc;
  715|    129|        localdoas->ai_methods = 0;
  716|    129|        _dwarf_destruct_elf_nlaccess(localdoas);
  717|    129|        localdoas = 0;
  718|    129|        return res;
  719|    129|    }
  720|   412k|    for ( i = 1; i < intfc->f_loc_shdr.g_count; ++i) {
  ------------------
  |  Branch (720:18): [True: 405k, False: 7.00k]
  ------------------
  721|   405k|        struct generic_shdr *shp = 0;
  722|   405k|        Dwarf_Unsigned section_type = 0;
  723|   405k|        enum RelocRela localrel = RelocIsRela;
  724|       |
  725|   405k|        shp = intfc->f_shdr +i;
  726|   405k|        section_type = shp->gh_type;
  727|   405k|        if (!shp->gh_namestring) {
  ------------------
  |  Branch (727:13): [True: 0, False: 405k]
  ------------------
  728|       |            /*  A serious error which we ignore here
  729|       |                as it will be caught elsewhere
  730|       |                if necessary. */
  731|      0|            continue;
  732|   405k|        } else if (section_type == SHT_REL) {
  ------------------
  |  |   56|   405k|#define SHT_REL 9
  ------------------
  |  Branch (732:20): [True: 10.1k, False: 394k]
  ------------------
  733|  10.1k|            localrel = RelocIsRel;
  734|   394k|        } else if (section_type == SHT_RELA) {
  ------------------
  |  |   53|   394k|#define SHT_RELA 4
  ------------------
  |  Branch (734:20): [True: 8.95k, False: 385k]
  ------------------
  735|  8.95k|            localrel = RelocIsRela;
  736|   385k|        } else if (!strncmp(".rel.",shp->gh_namestring,5)) {
  ------------------
  |  Branch (736:20): [True: 33.9k, False: 352k]
  ------------------
  737|  33.9k|            localrel = RelocIsRel;
  738|   352k|        } else if (!strncmp(".rela.",shp->gh_namestring,6)) {
  ------------------
  |  Branch (738:20): [True: 9.08k, False: 342k]
  ------------------
  739|  9.08k|            localrel = RelocIsRela;
  740|   342k|        } else {
  741|   342k|            continue;
  742|   342k|        }
  743|       |        /*  ASSERT: local rel is either RelocIsRel or
  744|       |            RelocIsRela. Never any other value. */
  745|       |        /*  Possibly we should check if the target section
  746|       |            is one we care about before loading rela
  747|       |            FIXME */
  748|  62.0k|        res = _dwarf_load_elf_relx(intfc,i,localrel,errcode);
  749|  62.0k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  62.0k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (749:13): [True: 741, False: 61.3k]
  ------------------
  750|    741|            localdoas->ai_object = intfc;
  751|    741|            localdoas->ai_methods = 0;
  752|    741|            _dwarf_destruct_elf_nlaccess(localdoas);
  753|    741|            localdoas = 0;
  754|    741|            return res;
  755|    741|        }
  756|  62.0k|    }
  757|  7.00k|    free(localdoas);
  758|  7.00k|    localdoas = 0;
  759|  7.00k|    return DW_DLV_OK;
  ------------------
  |  |   59|  7.00k|#define DW_DLV_OK         0
  ------------------
  760|  7.74k|}
dwarf_elfread.c:elf_get_nolibelf_section_info:
  169|   759k|{
  170|   759k|    dwarf_elf_object_access_internals_t *elf =
  171|   759k|        (dwarf_elf_object_access_internals_t*)(obj);
  172|       |
  173|   759k|    (void)error;
  174|   759k|    if (section_index < elf->f_loc_shdr.g_count) {
  ------------------
  |  Branch (174:9): [True: 759k, False: 0]
  ------------------
  175|   759k|        struct generic_shdr *sp = 0;
  176|       |
  177|   759k|        sp = elf->f_shdr + section_index;
  178|   759k|        return_section->as_addr      = sp->gh_addr;
  179|   759k|        return_section->as_type      = sp->gh_type;
  180|   759k|        return_section->as_size      = sp->gh_size;
  181|   759k|        return_section->as_name      = sp->gh_namestring;
  182|   759k|        return_section->as_link      = sp->gh_link;
  183|   759k|        return_section->as_info      = sp->gh_info;
  184|   759k|        return_section->as_flags     = sp->gh_flags;
  185|   759k|        return_section->as_entrysize = sp->gh_entsize;
  186|   759k|        return_section->as_offset    = sp->gh_offset;
  187|   759k|        return DW_DLV_OK;
  ------------------
  |  |   59|   759k|#define DW_DLV_OK         0
  ------------------
  188|   759k|    }
  189|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  190|   759k|}
dwarf_elfread.c:elf_get_nolibelf_byte_order:
  131|  7.00k|{
  132|  7.00k|    dwarf_elf_object_access_internals_t *elf =
  133|  7.00k|        (dwarf_elf_object_access_internals_t*)(obj);
  134|  7.00k|    return (Dwarf_Small)elf->f_endian;
  135|  7.00k|}
dwarf_elfread.c:elf_get_nolibelf_length_size:
  138|  7.00k|{
  139|  7.00k|    dwarf_elf_object_access_internals_t *elf =
  140|  7.00k|        (dwarf_elf_object_access_internals_t*)(obj);
  141|  7.00k|    return elf->f_offsetsize/8;
  142|  7.00k|}
dwarf_elfread.c:elf_get_nolibelf_pointer_size:
  145|  7.00k|{
  146|  7.00k|    dwarf_elf_object_access_internals_t *elf =
  147|  7.00k|        (dwarf_elf_object_access_internals_t*)(obj);
  148|  7.00k|    return elf->f_pointersize/8;
  149|  7.00k|}
dwarf_elfread.c:elf_get_nolibelf_file_size:
  152|  7.00k|{
  153|  7.00k|    dwarf_elf_object_access_internals_t *elf =
  154|  7.00k|        (dwarf_elf_object_access_internals_t*)(obj);
  155|  7.00k|    return elf->f_filesize;
  156|  7.00k|}
dwarf_elfread.c:elf_get_nolibelf_section_count:
  159|  7.00k|{
  160|  7.00k|    dwarf_elf_object_access_internals_t *elf =
  161|  7.00k|        (dwarf_elf_object_access_internals_t*)(obj);
  162|  7.00k|    return elf->f_loc_shdr.g_count;
  163|  7.00k|}
dwarf_elfread.c:elf_load_nolibelf_section:
  195|  12.9k|{
  196|       |    /*  Linux kernel read size limit 0x7ffff000,
  197|       |        Without any good reason, limit our reads
  198|       |        to a bit less. */
  199|  12.9k|    const Dwarf_Unsigned read_size_limit = 0x7ff00000;
  200|  12.9k|    Dwarf_Unsigned read_offset = 0;
  201|  12.9k|    Dwarf_Unsigned read_size = 0;
  202|  12.9k|    Dwarf_Unsigned remaining_bytes = 0;
  203|  12.9k|    Dwarf_Small *  read_target = 0;
  204|  12.9k|    dwarf_elf_object_access_internals_t *elf =
  205|  12.9k|        (dwarf_elf_object_access_internals_t*)(obj);
  206|       |
  207|  12.9k|    if (0 < section_index &&
  ------------------
  |  Branch (207:9): [True: 12.9k, False: 0]
  ------------------
  208|  12.9k|        section_index < elf->f_loc_shdr.g_count) {
  ------------------
  |  Branch (208:9): [True: 12.9k, False: 0]
  ------------------
  209|  12.9k|        int res = 0;
  210|       |
  211|  12.9k|        struct generic_shdr *sp =
  212|  12.9k|            elf->f_shdr + section_index;
  213|  12.9k|        if (sp->gh_content) {
  ------------------
  |  Branch (213:13): [True: 4, False: 12.9k]
  ------------------
  214|      4|            *return_data = (Dwarf_Small *)sp->gh_content;
  215|      4|            return DW_DLV_OK;
  ------------------
  |  |   59|      4|#define DW_DLV_OK         0
  ------------------
  216|      4|        }
  217|  12.9k|        if (!sp->gh_size) {
  ------------------
  |  Branch (217:13): [True: 0, False: 12.9k]
  ------------------
  218|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  219|      0|        }
  220|       |        /*  Guarding against bad values and
  221|       |            against overflow */
  222|  12.9k|        if (sp->gh_size > elf->f_filesize ||
  ------------------
  |  Branch (222:13): [True: 702, False: 12.2k]
  ------------------
  223|  12.9k|            sp->gh_offset > elf->f_filesize ||
  ------------------
  |  Branch (223:13): [True: 184, False: 12.0k]
  ------------------
  224|  12.9k|            (sp->gh_size + sp->gh_offset) >
  ------------------
  |  Branch (224:13): [True: 56, False: 11.9k]
  ------------------
  225|  12.0k|                elf->f_filesize) {
  226|    942|            *error = DW_DLE_ELF_SECTION_ERROR;
  ------------------
  |  | 1421|    942|#define DW_DLE_ELF_SECTION_ERROR               446
  ------------------
  227|    942|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    942|#define DW_DLV_ERROR      1
  ------------------
  228|    942|        }
  229|       |
  230|  11.9k|        sp->gh_content = malloc((size_t)sp->gh_size);
  231|  11.9k|        if (!sp->gh_content) {
  ------------------
  |  Branch (231:13): [True: 0, False: 11.9k]
  ------------------
  232|      0|            *error = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  233|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  234|      0|        }
  235|       |        /*  Linux has a 2GB limit on read size.
  236|       |            So break this into 2gb pieces.  */
  237|  11.9k|        remaining_bytes = sp->gh_size;
  238|  11.9k|        read_size = remaining_bytes;
  239|  11.9k|        read_offset = sp->gh_offset;
  240|  11.9k|        read_target = (Dwarf_Small*)sp->gh_content;
  241|  23.9k|        for ( ; remaining_bytes > 0; read_size = remaining_bytes ) {
  ------------------
  |  Branch (241:17): [True: 11.9k, False: 11.9k]
  ------------------
  242|  11.9k|            if (read_size > read_size_limit) {
  ------------------
  |  Branch (242:17): [True: 0, False: 11.9k]
  ------------------
  243|      0|                read_size = read_size_limit;
  244|      0|            }
  245|  11.9k|            res = RRMOA(elf->f_fd,
  ------------------
  |  |   65|  11.9k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  11.9k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  246|  11.9k|                (void *)read_target, read_offset,
  247|  11.9k|                read_size,
  248|  11.9k|                elf->f_filesize, error);
  249|  11.9k|            if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  11.9k|#define DW_DLV_OK         0
  ------------------
  |  Branch (249:17): [True: 0, False: 11.9k]
  ------------------
  250|      0|                free(sp->gh_content);
  251|      0|                sp->gh_content = 0;
  252|      0|                return res;
  253|      0|            }
  254|  11.9k|            remaining_bytes -= read_size;
  255|  11.9k|            read_offset += read_size;
  256|  11.9k|            read_target += read_size;
  257|  11.9k|        }
  258|  11.9k|        *return_data = (Dwarf_Small *)sp->gh_content;
  259|  11.9k|        return DW_DLV_OK;
  ------------------
  |  |   59|  11.9k|#define DW_DLV_OK         0
  ------------------
  260|  11.9k|    }
  261|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  262|  12.9k|}
dwarf_elfread.c:elf_relocations_nolibelf:
  475|    271|{
  476|    271|    int res = DW_DLV_ERROR;
  ------------------
  |  |   60|    271|#define DW_DLV_ERROR      1
  ------------------
  477|    271|    dwarf_elf_object_access_internals_t*obj = 0;
  478|    271|    struct Dwarf_Section_s * relocatablesec = 0;
  479|    271|    Dwarf_Unsigned section_with_reloc_records = 0;
  480|       |
  481|    271|    if (section_index == 0) {
  ------------------
  |  Branch (481:9): [True: 0, False: 271]
  ------------------
  482|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  483|      0|    }
  484|    271|    obj = (dwarf_elf_object_access_internals_t*)obj_in;
  485|       |
  486|       |    /*  The section to relocate must already be loaded into memory.
  487|       |        This just turns section_index into a pointer
  488|       |        to a de_debug_info or other  section record in
  489|       |        Dwarf_Debug. */
  490|    271|    res = find_section_to_relocate(dbg, section_index,
  491|    271|        &relocatablesec, error);
  492|    271|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    271|#define DW_DLV_OK         0
  ------------------
  |  Branch (492:9): [True: 271, False: 0]
  ------------------
  493|    271|        return res;
  494|    271|    }
  495|       |    /*  Now we know the  Dwarf_Section_s section
  496|       |        we need to relocate.
  497|       |        So lets find the rela section(s) targeting this.
  498|       |    */
  499|       |
  500|       |    /*  Sun and possibly others do not always set
  501|       |        sh_link in .debug_* sections.
  502|       |        So we cannot do full  consistency checks.
  503|       |        FIXME: This approach assumes there is only one
  504|       |        relocation section applying to section section_index! */
  505|      0|    section_with_reloc_records = relocatablesec->dss_reloc_index;
  506|      0|    if (!section_with_reloc_records) {
  ------------------
  |  Branch (506:9): [True: 0, False: 0]
  ------------------
  507|       |        /* Something is wrong. */
  508|      0|        *error = DW_DLE_RELOC_SECTION_MISSING_INDEX;
  ------------------
  |  | 1189|      0|#define DW_DLE_RELOC_SECTION_MISSING_INDEX     215
  ------------------
  509|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  510|      0|    }
  511|       |    /* The relocations, if they exist, have been loaded. */
  512|       |    /* The symtab was already loaded. */
  513|      0|    if (!obj->f_symtab || !obj->f_symtab_sect_strings) {
  ------------------
  |  Branch (513:9): [True: 0, False: 0]
  |  Branch (513:27): [True: 0, False: 0]
  ------------------
  514|      0|        *error = DW_DLE_DEBUG_SYMTAB_ERR;
  ------------------
  |  | 1183|      0|#define DW_DLE_DEBUG_SYMTAB_ERR                209
  ------------------
  515|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  516|      0|    }
  517|      0|    if (obj->f_symtab_sect_index != relocatablesec->dss_reloc_link) {
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|       |        /* Something is wrong. */
  519|      0|        *error = DW_DLE_RELOC_MISMATCH_RELOC_INDEX;
  ------------------
  |  | 1186|      0|#define DW_DLE_RELOC_MISMATCH_RELOC_INDEX      212
  ------------------
  520|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  521|      0|    }
  522|       |    /* We have all the data we need in memory. */
  523|       |    /*  Now we apply the relocs in section_with_reloc_records to the
  524|       |        target, relocablesec */
  525|      0|    res = apply_rela_entries(dbg,
  526|      0|        section_with_reloc_records,
  527|      0|        obj, relocatablesec,error);
  528|      0|    return res;
  529|      0|}
dwarf_elfread.c:find_section_to_relocate:
  273|    271|{
  274|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_info,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  275|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_abbrev,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  276|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_line,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  277|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_loc,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  278|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_aranges,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  279|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_macinfo,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  280|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_pubnames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  281|    271|        relocatablesec);
  282|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_names,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  283|    271|        relocatablesec);
  284|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_ranges,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  285|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_frame,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  286|    271|        relocatablesec);
  287|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_frame_eh_gnu,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  288|    271|        relocatablesec);
  289|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_pubtypes,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  290|    271|        relocatablesec);
  291|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_funcnames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  292|    271|        relocatablesec);
  293|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_typenames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  294|    271|        relocatablesec);
  295|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_varnames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  296|    271|        relocatablesec);
  297|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_weaknames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  298|    271|        relocatablesec);
  299|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_types,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  300|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_macro,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  301|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_rnglists,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  302|    271|        relocatablesec);
  303|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_loclists,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  304|    271|        relocatablesec);
  305|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_aranges,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  306|    271|        relocatablesec);
  307|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_sup,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  308|    271|        relocatablesec);
  309|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_str_offsets,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  310|    271|        relocatablesec);
  311|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_addr,relocatablesec);
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  312|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_gnu_pubnames,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  313|    271|        relocatablesec);
  314|    271|    MATCH_REL_SEC(section_index,dbg->de_debug_gnu_pubtypes,
  ------------------
  |  |  264|    271|#define MATCH_REL_SEC(i_,s_,r_)  \
  |  |  265|    271|if ((i_) == (s_).dss_index) { \
  |  |  ------------------
  |  |  |  Branch (265:5): [True: 0, False: 271]
  |  |  ------------------
  |  |  266|      0|    *(r_) = &(s_);            \
  |  |  267|      0|    return DW_DLV_OK;    \
  |  |  ------------------
  |  |  |  |   59|      0|#define DW_DLV_OK         0
  |  |  ------------------
  |  |  268|      0|}
  ------------------
  315|    271|        relocatablesec);
  316|       |    /* dbg-> de_debug_tu_index,reloctablesec); */
  317|       |    /* dbg-> de_debug_cu_index,reloctablesec); */
  318|       |    /* dbg-> de_debug_gdbindex,reloctablesec); */
  319|       |    /* dbg-> de_debug_str,syms); */
  320|       |    /* de_elf_symtab,syms); */
  321|       |    /* de_elf_strtab,syms); */
  322|    271|    *error = DW_DLE_RELOC_SECTION_MISMATCH;
  ------------------
  |  | 1188|    271|#define DW_DLE_RELOC_SECTION_MISMATCH          214
  ------------------
  323|    271|    return DW_DLV_ERROR;
  ------------------
  |  |   60|    271|#define DW_DLV_ERROR      1
  ------------------
  324|    271|}

_dwarf_error:
  110|  15.3k|{
  111|  15.3k|    _dwarf_error_string(dbg,error,errval,0);
  112|  15.3k|}
_dwarf_error_string:
  116|  16.7k|{
  117|  16.7k|    Dwarf_Error errptr = 0;
  118|       |
  119|       |    /*  Allow NULL dbg on entry, since sometimes that
  120|       |        can happen and we want to report the upper-level
  121|       |        error, not the null dbg error. */
  122|  16.7k|    if (error) {
  ------------------
  |  Branch (122:9): [True: 6.37k, False: 10.4k]
  ------------------
  123|       |        /*  If dbg is NULL, use the alternate error struct. However,
  124|       |            this will overwrite the earlier error. */
  125|  6.37k|        if (dbg) {
  ------------------
  |  Branch (125:13): [True: 1.17k, False: 5.20k]
  ------------------
  126|  1.17k|            errptr =
  127|  1.17k|                (Dwarf_Error) _dwarf_get_alloc(dbg, DW_DLA_ERROR, 1);
  ------------------
  |  |  924|  1.17k|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
  128|  1.17k|            if (!errptr) {
  ------------------
  |  Branch (128:17): [True: 0, False: 1.17k]
  ------------------
  129|      0|                errptr = &_dwarf_failsafe_error;
  130|      0|                errptr->er_static_alloc = DE_STATIC;
  ------------------
  |  |   46|      0|#define DE_STATIC 1   /* Using global static var */
  ------------------
  131|  1.17k|            } else {
  132|  1.17k|                errptr->er_static_alloc = DE_STANDARD;
  ------------------
  |  |   45|  1.17k|#define DE_STANDARD 0 /* Normal alloc attached to dbg. */
  ------------------
  133|  1.17k|            }
  134|  5.20k|        } else {
  135|       |            /*  We have no dbg to work with. dwarf_init
  136|       |                failed. We hack
  137|       |                up a special area. */
  138|  5.20k|            errptr = _dwarf_special_no_dbg_error_malloc();
  139|  5.20k|            if (!errptr) {
  ------------------
  |  Branch (139:17): [True: 0, False: 5.20k]
  ------------------
  140|      0|                errptr = &_dwarf_failsafe_error;
  141|      0|                errptr->er_static_alloc = DE_STATIC;
  ------------------
  |  |   46|      0|#define DE_STATIC 1   /* Using global static var */
  ------------------
  142|       |#ifdef DEBUG
  143|       |                printf("libdwarf no dbg to dwarf_error_string,"
  144|       |                    " fullystatic, "
  145|       |                    "using DE_STATIC alloc, addr"
  146|       |                    " 0x%lx line %d %s\n",
  147|       |                    (unsigned long)errptr,
  148|       |                    __LINE__,__FILE__);
  149|       |#endif /* DEBUG */
  150|  5.20k|            } else {
  151|  5.20k|                errptr->er_static_alloc = DE_MALLOC;
  ------------------
  |  |   47|  5.20k|#define DE_MALLOC 2   /* Using malloc space */
  ------------------
  152|       |
  153|       |#ifdef DEBUG
  154|       |                printf("libdwarf no dbg, add to static_err_list "
  155|       |                    "static DE_MALLOC alloc, addr"
  156|       |                    " 0x%lx line %d %s\n",
  157|       |                    (unsigned long)errptr,
  158|       |                    __LINE__,__FILE__);
  159|       |#endif /* DEBUG */
  160|  5.20k|                _dwarf_add_to_static_err_list(errptr);
  161|  5.20k|            }
  162|  5.20k|        }
  163|       |
  164|  6.37k|        errptr->er_errval = errval;
  165|  6.37k|        if (msg && errptr->er_static_alloc != DE_STATIC) {
  ------------------
  |  |   46|    986|#define DE_STATIC 1   /* Using global static var */
  ------------------
  |  Branch (165:13): [True: 986, False: 5.39k]
  |  Branch (165:20): [True: 986, False: 0]
  ------------------
  166|    986|            dwarfstring *em = 0;
  167|       |
  168|       |#ifdef DEBUG
  169|       |            printf("libdwarf ALLOC creating error string"
  170|       |                " %s errval %ld errptr 0x%lx \n",
  171|       |                msg,(long)errval,(unsigned long)errptr);
  172|       |#endif /* DEBUG */
  173|    986|            em = (dwarfstring *)calloc(1,sizeof(dwarfstring));
  174|    986|            if (em) {
  ------------------
  |  Branch (174:17): [True: 986, False: 0]
  ------------------
  175|    986|                dwarfstring_constructor(em);
  176|    986|                dwarfstring_append(em,msg);
  177|    986|                errptr->er_msg = (void*)em;
  178|    986|            }
  179|    986|        }
  180|  6.37k|        *error = errptr;
  181|  6.37k|        return;
  182|  6.37k|    }
  183|       |
  184|  10.4k|    if (dbg  && dbg->de_errhand != NULL) {
  ------------------
  |  Branch (184:9): [True: 1.46k, False: 8.94k]
  |  Branch (184:17): [True: 0, False: 1.46k]
  ------------------
  185|      0|        errptr = (Dwarf_Error) _dwarf_get_alloc(dbg, DW_DLA_ERROR, 1);
  ------------------
  |  |  924|      0|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
  186|      0|        if (errptr == NULL) {
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|            errptr = &_dwarf_failsafe_error;
  188|      0|            errptr->er_static_alloc = DE_STATIC;
  ------------------
  |  |   46|      0|#define DE_STATIC 1   /* Using global static var */
  ------------------
  189|      0|        }
  190|      0|        errptr->er_errval = errval;
  191|      0|        dbg->de_errhand(errptr, dbg->de_errarg);
  192|      0|        return;
  193|      0|    }
  194|  10.4k|    fflush(stderr);
  195|  10.4k|    fprintf(stderr,
  196|  10.4k|        "\nlibdwarf is unable to record error %s "
  197|  10.4k|        "No error argument or handler available\n",
  198|  10.4k|        dwarf_errmsg_by_number(errval));
  199|  10.4k|    fflush(stderr);
  200|  10.4k|    return;
  201|  10.4k|}
dwarf_errno:
  205|  6.37k|{
  206|  6.37k|    if (!error) {
  ------------------
  |  Branch (206:9): [True: 0, False: 6.37k]
  ------------------
  207|      0|        return (0);
  208|      0|    }
  209|  6.37k|    return (error->er_errval);
  210|  6.37k|}
dwarf_errmsg_by_number:
  214|  10.9k|{
  215|  10.9k|    if (errornum > DW_DLE_LAST) {
  ------------------
  |  | 1482|  10.9k|#define DW_DLE_LAST        504
  ------------------
  |  Branch (215:9): [True: 0, False: 10.9k]
  ------------------
  216|      0|        return "Dwarf_Error value out of range";
  217|      0|    }
  218|  10.9k|    return ((char *) &_dwarf_errmsgs[errornum][0]);
  219|  10.9k|}
dwarf_errmsg:
  225|    731|{
  226|    731|    if (!error) {
  ------------------
  |  Branch (226:9): [True: 0, False: 731]
  ------------------
  227|      0|        return "Dwarf_Error is NULL";
  228|      0|    }
  229|    731|    if (error->er_msg) {
  ------------------
  |  Branch (229:9): [True: 211, False: 520]
  ------------------
  230|    211|        return dwarfstring_string(error->er_msg);
  231|    211|    }
  232|    520|    return  dwarf_errmsg_by_number(error->er_errval);
  233|    731|}

dwarf_init_path:
  118|  16.9k|{
  119|  16.9k|    unsigned int universalnumber = 0;
  120|  16.9k|    return dwarf_init_path_dl_a(path,
  121|  16.9k|        true_path_out_buffer,true_path_bufferlen,
  122|  16.9k|        groupnumber,universalnumber,
  123|  16.9k|        errhand,errarg,ret_dbg,
  124|  16.9k|        0,0,0,
  125|  16.9k|        error);
  126|  16.9k|}
dwarf_init_path_dl:
  179|  8.45k|{
  180|  8.45k|    unsigned int universalnumber = 0;
  181|  8.45k|    int res = 0;
  182|       |
  183|  8.45k|    res = dwarf_init_path_dl_a(path,
  184|  8.45k|        true_path_out_buffer, true_path_bufferlen,
  185|  8.45k|        groupnumber,universalnumber,
  186|  8.45k|        errhand,errarg,ret_dbg, dl_path_array,
  187|  8.45k|        dl_path_count,path_source,error);
  188|  8.45k|    return res;
  189|  8.45k|}
dwarf_init_path_dl_a:
  223|  25.3k|{
  224|  25.3k|    unsigned       ftype = 0;
  225|  25.3k|    unsigned       endian = 0;
  226|  25.3k|    unsigned       offsetsize = 0;
  227|  25.3k|    Dwarf_Unsigned filesize = 0;
  228|  25.3k|    int res =  DW_DLV_ERROR;
  ------------------
  |  |  123|  25.3k|#define DW_DLV_ERROR     1
  ------------------
  229|  25.3k|    int errcode = 0;
  230|  25.3k|    int fd = -1;
  231|  25.3k|    Dwarf_Debug dbg = 0;
  232|  25.3k|    char *file_path = 0;
  233|  25.3k|    unsigned char  lpath_source = DW_PATHSOURCE_basic;
  ------------------
  |  |  108|  25.3k|#define DW_PATHSOURCE_basic     1
  ------------------
  234|       |
  235|  25.3k|    if (!ret_dbg) {
  ------------------
  |  Branch (235:9): [True: 0, False: 25.3k]
  ------------------
  236|      0|        DWARF_DBG_ERROR(NULL,DW_DLE_DWARF_INIT_DBG_NULL,
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  237|      0|            DW_DLV_ERROR);
  238|      0|    }
  239|       |    /*  Non-null *ret_dbg will cause problems dealing with
  240|       |        DW_DLV_ERROR */
  241|  25.3k|    *ret_dbg = 0;
  242|  25.3k|    if (!path) {
  ------------------
  |  Branch (242:9): [True: 0, False: 25.3k]
  ------------------
  243|       |        /* Oops. Null path */
  244|      0|        _dwarf_error_string(NULL,
  245|      0|            error,DW_DLE_STRING_PTR_NULL,
  ------------------
  |  | 1096|      0|#define DW_DLE_STRING_PTR_NULL                 122
  ------------------
  246|      0|            "DW_DLE_STRING_PTR_NULL: Passing a"
  247|      0|            " null path argument to "
  248|      0|            "dwarf_init_path or dwarf_init_path_dl"
  249|      0|            " cannot work. Error.");
  250|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  251|      0|    }
  252|       |    /* a special dsym call so we only check once. */
  253|  25.3k|    if (true_path_out_buffer) {
  ------------------
  |  Branch (253:9): [True: 8.45k, False: 16.9k]
  ------------------
  254|  8.45k|        res = dwarf_object_detector_path_dSYM(path,
  255|  8.45k|            true_path_out_buffer,
  256|  8.45k|            true_path_bufferlen,
  257|  8.45k|            dl_path_array,dl_path_count,
  258|  8.45k|            &ftype,&endian,&offsetsize,&filesize,
  259|  8.45k|            &lpath_source,
  260|  8.45k|            &errcode);
  261|  8.45k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  8.45k|#define DW_DLV_OK        0
  ------------------
  |  Branch (261:13): [True: 8.45k, False: 0]
  ------------------
  262|  8.45k|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (262:17): [True: 0, False: 8.45k]
  ------------------
  263|       |                /* ignore error. Look further. */
  264|      0|                errcode = 0;
  265|      0|            }
  266|  8.45k|        }
  267|  8.45k|    }
  268|  25.3k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  25.3k|#define DW_DLV_OK        0
  ------------------
  |  Branch (268:9): [True: 25.3k, False: 0]
  ------------------
  269|  25.3k|        res = dwarf_object_detector_path_b(path,
  270|  25.3k|            true_path_out_buffer,
  271|  25.3k|            true_path_bufferlen,
  272|  25.3k|            dl_path_array,dl_path_count,
  273|  25.3k|            &ftype,&endian,&offsetsize,&filesize,
  274|  25.3k|            &lpath_source,
  275|  25.3k|            &errcode);
  276|  25.3k|        if (res != DW_DLV_OK ) {
  ------------------
  |  |  122|  25.3k|#define DW_DLV_OK        0
  ------------------
  |  Branch (276:13): [True: 6.51k, False: 18.8k]
  ------------------
  277|  6.51k|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|  6.51k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (277:17): [True: 5.24k, False: 1.26k]
  ------------------
  278|  5.24k|                errcode = 0;
  279|  5.24k|            }
  280|  6.51k|        }
  281|  25.3k|    }
  282|  25.3k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  25.3k|#define DW_DLV_OK        0
  ------------------
  |  Branch (282:9): [True: 6.51k, False: 18.8k]
  ------------------
  283|       |        /*  So as a last resort in case
  284|       |            of data corruption in the object.
  285|       |            Lets try without
  286|       |            investigating debuglink  or dSYM. */
  287|  6.51k|        res = dwarf_object_detector_path_b(path,
  288|  6.51k|            0,
  289|  6.51k|            0,
  290|  6.51k|            dl_path_array,dl_path_count,
  291|  6.51k|            &ftype,&endian,&offsetsize,&filesize,
  292|  6.51k|            &lpath_source,
  293|  6.51k|            &errcode);
  294|  6.51k|    }
  295|  25.3k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  25.3k|#define DW_DLV_OK        0
  ------------------
  |  Branch (295:9): [True: 1.33k, False: 24.0k]
  ------------------
  296|       |        /* impossible. The last above *had* to work */
  297|  1.33k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|  1.33k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (297:13): [True: 66, False: 1.26k]
  ------------------
  298|     66|            _dwarf_error(NULL, error, errcode);
  299|     66|        }
  300|  1.33k|        return res;
  301|  1.33k|    }
  302|       |    /*  ASSERT: lpath_source != DW_PATHSOURCE_unspecified  */
  303|  24.0k|    if (lpath_source != DW_PATHSOURCE_basic &&
  ------------------
  |  |  108|  48.0k|#define DW_PATHSOURCE_basic     1
  ------------------
  |  Branch (303:9): [True: 0, False: 24.0k]
  ------------------
  304|  24.0k|        true_path_out_buffer && *true_path_out_buffer) {
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  |  Branch (304:33): [True: 0, False: 0]
  ------------------
  305|       |        /* MacOS dSYM or GNU debuglink */
  306|      0|        file_path = true_path_out_buffer;
  307|      0|        fd = _dwarf_openr(true_path_out_buffer);
  308|  24.0k|    } else {
  309|       |        /*  ASSERT: lpath_source = DW_PATHSOURCE_basic */
  310|  24.0k|        file_path = (char *)path;
  311|  24.0k|        fd = _dwarf_openr(path);
  312|  24.0k|    }
  313|       |
  314|  24.0k|    if (fd == -1) {
  ------------------
  |  Branch (314:9): [True: 0, False: 24.0k]
  ------------------
  315|      0|        DWARF_DBG_ERROR(NULL, DW_DLE_FILE_UNAVAILABLE,
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  316|      0|            DW_DLV_ERROR);
  317|      0|    }
  318|  24.0k|    switch(ftype) {
  319|  12.9k|    case DW_FTYPE_ELF: {
  ------------------
  |  |  114|  12.9k|#define DW_FTYPE_ELF        1  /* Unix/Linux/etc */
  ------------------
  |  Branch (319:5): [True: 12.9k, False: 11.0k]
  ------------------
  320|  12.9k|        res = _dwarf_elf_nlsetup(fd,
  321|  12.9k|            file_path,
  322|  12.9k|            ftype,endian,offsetsize,filesize,
  323|  12.9k|            groupnumber,errhand,errarg,&dbg,error);
  324|  12.9k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  12.9k|#define DW_DLV_OK        0
  ------------------
  |  Branch (324:13): [True: 10.7k, False: 2.28k]
  ------------------
  325|  10.7k|            _dwarf_closer(fd);
  326|  10.7k|            return res;
  327|  10.7k|        }
  328|  2.28k|        final_common_settings(dbg,file_path,fd,
  329|  2.28k|            lpath_source,path_source,error);
  330|  2.28k|        dbg->de_ftype =  ftype;
  331|  2.28k|        *ret_dbg = dbg;
  332|  2.28k|        return res;
  333|  12.9k|    }
  334|  1.77k|    case DW_FTYPE_APPLEUNIVERSAL:
  ------------------
  |  |  118|  1.77k|#define DW_FTYPE_APPLEUNIVERSAL    5
  ------------------
  |  Branch (334:5): [True: 1.77k, False: 22.2k]
  ------------------
  335|  9.05k|    case DW_FTYPE_MACH_O: {
  ------------------
  |  |  115|  9.05k|#define DW_FTYPE_MACH_O     2  /* MacOS. */
  ------------------
  |  Branch (335:5): [True: 7.28k, False: 16.7k]
  ------------------
  336|  9.05k|        res = _dwarf_macho_setup(fd,
  337|  9.05k|            file_path,
  338|  9.05k|            universalnumber,
  339|  9.05k|            ftype,endian,offsetsize,filesize,
  340|  9.05k|            groupnumber,errhand,errarg,&dbg,error);
  341|  9.05k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  9.05k|#define DW_DLV_OK        0
  ------------------
  |  Branch (341:13): [True: 8.91k, False: 138]
  ------------------
  342|  8.91k|            _dwarf_closer(fd);
  343|  8.91k|            return res;
  344|  8.91k|        }
  345|    138|        final_common_settings(dbg,file_path,fd,
  346|    138|            lpath_source,path_source,error);
  347|    138|        dbg->de_ftype =  ftype;
  348|    138|        *ret_dbg = dbg;
  349|    138|        return res;
  350|  9.05k|    }
  351|  1.98k|    case DW_FTYPE_PE: {
  ------------------
  |  |  116|  1.98k|#define DW_FTYPE_PE         3  /* Windows */
  ------------------
  |  Branch (351:5): [True: 1.98k, False: 22.0k]
  ------------------
  352|  1.98k|        res = _dwarf_pe_setup(fd,
  353|  1.98k|            file_path,
  354|  1.98k|            ftype,endian,offsetsize,filesize,
  355|  1.98k|            groupnumber,errhand,errarg,&dbg,error);
  356|  1.98k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  1.98k|#define DW_DLV_OK        0
  ------------------
  |  Branch (356:13): [True: 1.84k, False: 135]
  ------------------
  357|  1.84k|            _dwarf_closer(fd);
  358|  1.84k|            return res;
  359|  1.84k|        }
  360|    135|        final_common_settings(dbg,file_path,fd,
  361|    135|            lpath_source,path_source,error);
  362|    135|        dbg->de_ftype =  ftype;
  363|    135|        *ret_dbg = dbg;
  364|    135|        return res;
  365|  1.98k|    }
  366|      3|    default:
  ------------------
  |  Branch (366:5): [True: 3, False: 24.0k]
  ------------------
  367|      3|        _dwarf_closer(fd);
  368|      3|        DWARF_DBG_ERROR(NULL, DW_DLE_FILE_WRONG_TYPE,
  ------------------
  |  |   43|      3|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  369|  1.98k|            DW_DLV_ERROR);
  370|       |        /* Macro returns, cannot reach this line. */
  371|  24.0k|    }
  372|       |    /* Cannot reach this line */
  373|  24.0k|}
dwarf_finish:
  468|  17.7k|{
  469|  17.7k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  17.7k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  2.56k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|  15.2k|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  2.56k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 15.2k, False: 2.56k]
  |  |  |  Branch (159:7): [True: 15.2k, False: 2.56k]
  |  |  |  Branch (159:15): [True: 0, False: 2.56k]
  |  |  ------------------
  ------------------
  470|  15.2k|        _dwarf_free_static_errlist();
  471|  15.2k|        return DW_DLV_OK;
  ------------------
  |  |  122|  15.2k|#define DW_DLV_OK        0
  ------------------
  472|  15.2k|    }
  473|  2.56k|    if (dbg->de_obj_file) {
  ------------------
  |  Branch (473:9): [True: 2.56k, False: 0]
  ------------------
  474|       |        /*  The initial character of a valid
  475|       |            dbg->de_obj_file->object struct is a letter:
  476|       |            E, F, M, or P */
  477|  2.56k|        char otype  = *(char *)(dbg->de_obj_file->ai_object);
  478|       |
  479|  2.56k|        switch(otype) {
  480|      0|        case 'E':
  ------------------
  |  Branch (480:9): [True: 0, False: 2.56k]
  ------------------
  481|      0|            break;
  482|  2.28k|        case 'F':
  ------------------
  |  Branch (482:9): [True: 2.28k, False: 273]
  ------------------
  483|       |            /* Non-libelf elf access */
  484|  2.28k|            _dwarf_destruct_elf_nlaccess(dbg->de_obj_file);
  485|  2.28k|            break;
  486|    138|        case 'M':
  ------------------
  |  Branch (486:9): [True: 138, False: 2.42k]
  ------------------
  487|    138|            _dwarf_destruct_macho_access(dbg->de_obj_file);
  488|    138|            break;
  489|    135|        case 'P':
  ------------------
  |  Branch (489:9): [True: 135, False: 2.42k]
  ------------------
  490|    135|            _dwarf_destruct_pe_access(dbg->de_obj_file);
  491|    135|            break;
  492|      0|        default:
  ------------------
  |  Branch (492:9): [True: 0, False: 2.56k]
  ------------------
  493|       |            /*  Do nothing. A serious internal error */
  494|      0|            break;
  495|  2.56k|        }
  496|  2.56k|    }
  497|  2.56k|    if (dbg->de_owns_fd) {
  ------------------
  |  Branch (497:9): [True: 2.56k, False: 0]
  ------------------
  498|  2.56k|        _dwarf_closer(dbg->de_fd);
  499|  2.56k|        dbg->de_owns_fd = FALSE;
  ------------------
  |  |   40|  2.56k|#define FALSE 0
  ------------------
  500|  2.56k|    }
  501|  2.56k|    free((void *)dbg->de_path);
  502|  2.56k|    dbg->de_path = 0;
  503|       |    /*  dwarf_object_finish() also frees de_path,
  504|       |        but that is safe because we set it to zero
  505|       |        here so no duplicate free will occur.
  506|       |        It never returns DW_DLV_ERROR.
  507|       |        Not all code uses libdwarf exactly as we do
  508|       |        hence the free() there. */
  509|  2.56k|    return dwarf_object_finish(dbg);
  510|  2.56k|}
dwarf_generic_init.c:final_common_settings:
  135|  2.56k|{
  136|  2.56k|    int res = 0;
  137|       |
  138|  2.56k|    dbg->de_path = strdup(file_path);
  139|  2.56k|    dbg->de_fd = fd;
  140|  2.56k|    dbg->de_owns_fd = TRUE;
  ------------------
  |  |   37|  2.56k|#define TRUE 1
  ------------------
  141|  2.56k|    dbg->de_path_source = lpath_source;
  142|  2.56k|    if (path_source) {
  ------------------
  |  Branch (142:9): [True: 854, False: 1.70k]
  ------------------
  143|    854|        *path_source = lpath_source;
  144|    854|    }
  145|  2.56k|    dbg->de_owns_fd = TRUE;
  ------------------
  |  |   37|  2.56k|#define TRUE 1
  ------------------
  146|  2.56k|    res = set_global_paths_init(dbg,error);
  147|  2.56k|    if (res == DW_DLV_ERROR && error) {
  ------------------
  |  |  123|  5.12k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (147:9): [True: 0, False: 2.56k]
  |  Branch (147:32): [True: 0, False: 0]
  ------------------
  148|      0|        dwarf_dealloc_error(dbg,*error);
  149|      0|        *error = 0;
  150|      0|    }
  151|  2.56k|    return;
  152|  2.56k|}
dwarf_generic_init.c:set_global_paths_init:
   83|  2.56k|{
   84|  2.56k|    int res = 0;
   85|       |
   86|  2.56k|    res = dwarf_add_debuglink_global_path(dbg,
   87|  2.56k|        "/usr/lib/debug",error);
   88|  2.56k|    return res;
   89|  2.56k|}

_dwarf_insert_in_group_map:
  118|   259k|{
  119|   259k|    struct Dwarf_Group_Data_s *grp = &dbg->de_groupnumbers;
  120|       |
  121|   259k|    void *entry2 = 0;
  122|   259k|    struct Dwarf_Group_Map_Entry_s * entry3 = 0;
  123|       |
  124|   259k|    if (!grp->gd_map) {
  ------------------
  |  Branch (124:9): [True: 5.95k, False: 253k]
  ------------------
  125|       |        /*  Number of sections is a kind of decent guess
  126|       |            as to how much space would be useful. */
  127|  5.95k|        dwarf_initialize_search_hash(&grp->gd_map,
  ------------------
  |  |   82|  5.95k|#define dwarf_initialize_search_hash _dwarf_initialize_search_hash
  ------------------
  128|  5.95k|            grp_data_hashfunc,grp->gd_number_of_sections);
  129|  5.95k|        if (!grp->gd_map) {
  ------------------
  |  Branch (129:13): [True: 0, False: 5.95k]
  ------------------
  130|       |            /*  It's really an error I suppose. */
  131|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  132|      0|        }
  133|  5.95k|    }
  134|   259k|    entry3 = grp_make_entry(section_index,groupnum,name);
  135|   259k|    if (!entry3) {
  ------------------
  |  Branch (135:9): [True: 0, False: 259k]
  ------------------
  136|      0|        _dwarf_error(dbg, error, DW_DLE_GROUP_MAP_ALLOC);
  ------------------
  |  | 1362|      0|#define DW_DLE_GROUP_MAP_ALLOC                 387
  ------------------
  137|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  138|      0|    }
  139|   259k|    entry2 = dwarf_tsearch(entry3,&grp->gd_map,grp_compare_function);
  ------------------
  |  |   76|   259k|#define dwarf_tsearch  _dwarf_tsearch
  ------------------
  140|   259k|    if (!entry2) {
  ------------------
  |  Branch (140:9): [True: 0, False: 259k]
  ------------------
  141|      0|        free(entry3);
  142|      0|        _dwarf_error(dbg, error, DW_DLE_GROUP_MAP_ALLOC);
  ------------------
  |  | 1362|      0|#define DW_DLE_GROUP_MAP_ALLOC                 387
  ------------------
  143|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  144|   259k|    } else {
  145|   259k|        struct Dwarf_Group_Map_Entry_s *re = 0;
  146|   259k|        re = *(struct Dwarf_Group_Map_Entry_s **)entry2;
  147|   259k|        if (re != entry3) {
  ------------------
  |  Branch (147:13): [True: 30, False: 259k]
  ------------------
  148|     30|            free(entry3);
  149|     30|            _dwarf_error(dbg, error, DW_DLE_GROUP_MAP_DUPLICATE);
  ------------------
  |  | 1363|     30|#define DW_DLE_GROUP_MAP_DUPLICATE             388
  ------------------
  150|     30|            return DW_DLV_ERROR;
  ------------------
  |  |  123|     30|#define DW_DLV_ERROR     1
  ------------------
  151|   259k|        } else {
  152|   259k|            ++grp->gd_map_entry_count;
  153|       |            /* OK. Added. Fall thru */
  154|   259k|        }
  155|   259k|    }
  156|   259k|    return DW_DLV_OK;
  ------------------
  |  |  122|   259k|#define DW_DLV_OK        0
  ------------------
  157|   259k|}
_dwarf_section_get_target_group_from_map:
  164|   836k|{
  165|   836k|    struct Dwarf_Group_Map_Entry_s entry;
  166|   836k|    struct Dwarf_Group_Map_Entry_s *entry2;
  167|   836k|    struct Dwarf_Group_Data_s *grp = &dbg->de_groupnumbers;
  168|       |
  169|   836k|    (void)error;
  170|   836k|    if (!grp->gd_map) {
  ------------------
  |  Branch (170:9): [True: 244k, False: 591k]
  ------------------
  171|   244k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|   244k|#define DW_DLV_NO_ENTRY -1
  ------------------
  172|   244k|    }
  173|   591k|    entry.gm_key = obj_section_index;
  174|   591k|    entry.gm_group_number = 0; /* FAKE */
  175|   591k|    entry.gm_section_name = ""; /* FAKE */
  176|       |
  177|   591k|    entry2 = dwarf_tfind(&entry, &grp->gd_map,grp_compare_function);
  ------------------
  |  |   77|   591k|#define dwarf_tfind    _dwarf_tfind
  ------------------
  178|   591k|    if (entry2) {
  ------------------
  |  Branch (178:9): [True: 256k, False: 335k]
  ------------------
  179|   256k|        struct Dwarf_Group_Map_Entry_s *e2 =
  180|   256k|            *(struct Dwarf_Group_Map_Entry_s **)entry2;;
  181|   256k|        *groupnumber_out = e2->gm_group_number;
  182|   256k|        return DW_DLV_OK;
  ------------------
  |  |  122|   256k|#define DW_DLV_OK        0
  ------------------
  183|   256k|    }
  184|   335k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|   335k|#define DW_DLV_NO_ENTRY -1
  ------------------
  185|   591k|}
_dwarf_dwo_groupnumber_given_name:
  336|   579k|{
  337|   579k|    const char **s = 0;
  338|       |
  339|  7.15M|    for (s = dwo_secnames; *s; s++) {
  ------------------
  |  Branch (339:28): [True: 6.75M, False: 407k]
  ------------------
  340|  6.75M|        if (!strcmp(name,*s)) {
  ------------------
  |  Branch (340:13): [True: 172k, False: 6.57M]
  ------------------
  341|   172k|            *grpnum_out = DW_GROUPNUMBER_DWO;
  ------------------
  |  |  128|   172k|#define DW_GROUPNUMBER_DWO  2
  ------------------
  342|   172k|            return DW_DLV_OK;
  ------------------
  |  |  122|   172k|#define DW_DLV_OK        0
  ------------------
  343|   172k|        }
  344|  6.75M|    }
  345|   407k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|   407k|#define DW_DLV_NO_ENTRY -1
  ------------------
  346|   579k|}
_dwarf_section_in_group_by_name:
  376|  4.84k|{
  377|  4.84k|    struct Dwarf_Group_Data_s *grp = 0;
  378|       |
  379|  4.84k|    grp = &dbg->de_groupnumbers;
  380|  4.84k|    found_name_in_group = FALSE;
  ------------------
  |  |   40|  4.84k|#define FALSE 0
  ------------------
  381|  4.84k|    target_group = groupnum;
  382|  4.84k|    lookfor_name = scn_name;
  383|  4.84k|    dwarf_twalk(grp->gd_map,grp_walk_for_name);
  ------------------
  |  |   79|  4.84k|#define dwarf_twalk    _dwarf_twalk
  ------------------
  384|  4.84k|    return found_name_in_group;
  385|  4.84k|}
_dwarf_destroy_group_map:
  397|  10.6k|{
  398|  10.6k|    dwarf_tdestroy(dbg->de_groupnumbers.gd_map,
  ------------------
  |  |   80|  10.6k|#define dwarf_tdestroy _dwarf_tdestroy
  ------------------
  399|  10.6k|        _dwarf_grp_destroy_free_node);
  400|  10.6k|    dbg->de_groupnumbers.gd_map = 0;
  401|  10.6k|}
dwarf_groups.c:grp_data_hashfunc:
   87|   987k|{
   88|   987k|    const struct Dwarf_Group_Map_Entry_s * enp = keyp;
   89|   987k|    DW_TSHASHTYPE hashv = 0;
  ------------------
  |  |   54|   987k|#define DW_TSHASHTYPE uintptr_t
  ------------------
   90|       |
   91|   987k|    hashv = enp->gm_key;
   92|   987k|    return hashv;
   93|   987k|}
dwarf_groups.c:grp_make_entry:
   74|   259k|{
   75|   259k|    struct Dwarf_Group_Map_Entry_s *e = 0;
   76|   259k|    e = calloc(1,sizeof(struct Dwarf_Group_Map_Entry_s));
   77|   259k|    if (e) {
  ------------------
  |  Branch (77:9): [True: 259k, False: 0]
  ------------------
   78|   259k|        e->gm_key =    section;
   79|   259k|        e->gm_group_number = group;
   80|   259k|        e->gm_section_name = name;
   81|   259k|    }
   82|   259k|    return e;
   83|   259k|}
dwarf_groups.c:grp_compare_function:
   97|   256k|{
   98|   256k|    const struct Dwarf_Group_Map_Entry_s * lp = l;
   99|   256k|    const struct Dwarf_Group_Map_Entry_s * rp = r;
  100|       |
  101|   256k|    if (lp->gm_key < rp->gm_key) {
  ------------------
  |  Branch (101:9): [True: 0, False: 256k]
  ------------------
  102|      0|        return -1;
  103|      0|    }
  104|   256k|    if (lp->gm_key > rp->gm_key) {
  ------------------
  |  Branch (104:9): [True: 0, False: 256k]
  ------------------
  105|      0|        return 1;
  106|      0|    }
  107|       |
  108|       |    /* match. */
  109|   256k|    return 0;
  110|   256k|}
dwarf_groups.c:grp_walk_for_name:
  356|  6.44k|{
  357|  6.44k|    struct Dwarf_Group_Map_Entry_s *re = 0;
  358|       |
  359|  6.44k|    (void)depth;
  360|  6.44k|    re = *(struct Dwarf_Group_Map_Entry_s **)nodep;
  361|  6.44k|    if (which == dwarf_postorder || which == dwarf_endorder) {
  ------------------
  |  Branch (361:9): [True: 0, False: 6.44k]
  |  Branch (361:37): [True: 0, False: 6.44k]
  ------------------
  362|      0|        return;
  363|      0|    }
  364|  6.44k|    if (re->gm_group_number == target_group) {
  ------------------
  |  Branch (364:9): [True: 6.19k, False: 249]
  ------------------
  365|  6.19k|        if (!strcmp(lookfor_name,re->gm_section_name)) {
  ------------------
  |  Branch (365:13): [True: 3.66k, False: 2.52k]
  ------------------
  366|  3.66k|            found_name_in_group = TRUE;
  ------------------
  |  |   37|  3.66k|#define TRUE 1
  ------------------
  367|  3.66k|        }
  368|  6.19k|    }
  369|  6.44k|}
dwarf_groups.c:_dwarf_grp_destroy_free_node:
  389|   259k|{
  390|   259k|    struct Dwarf_Group_Map_Entry_s * enp = nodep;
  391|   259k|    free(enp);
  392|   259k|    return;
  393|   259k|}

_dwarf_harmless_init:
  216|  2.56k|{
  217|  2.56k|    unsigned i = 0;
  218|  2.56k|    memset(dhp,0,sizeof(*dhp));
  219|  2.56k|    dhp->dh_maxcount = size +1;
  220|  2.56k|    dhp->dh_errors = (char **)calloc(sizeof(char *),
  221|  2.56k|        dhp->dh_maxcount);
  222|  2.56k|    if (!dhp->dh_errors) {
  ------------------
  |  Branch (222:9): [True: 0, False: 2.56k]
  ------------------
  223|      0|        dhp->dh_maxcount = 0;
  224|      0|        return;
  225|      0|    }
  226|       |
  227|  15.3k|    for (i = 0; i < dhp->dh_maxcount; ++i) {
  ------------------
  |  Branch (227:17): [True: 12.8k, False: 2.56k]
  ------------------
  228|  12.8k|        char *newstr =
  229|  12.8k|            (char *)calloc(1,
  230|  12.8k|            DW_HARMLESS_ERROR_MSG_STRING_SIZE);
  ------------------
  |  |   75|  12.8k|#define DW_HARMLESS_ERROR_MSG_STRING_SIZE 300
  ------------------
  231|  12.8k|        dhp->dh_errors[i] = newstr;
  232|       |#if 0 /* Commentary about avoiding leak */
  233|       |        /*  BAD IDEA. just use the NULL pointer,
  234|       |            so we avoid problems later with
  235|       |            freeing.  */
  236|       |        if (!newstr) {
  237|       |            dhp->dh_maxcount = 0;
  238|       |            /* Let it leak, the leak is a constrained amount. */
  239|       |            free(dhp->dh_errors);
  240|       |            dhp->dh_errors = 0;
  241|       |            return;
  242|       |        }
  243|       |#endif /* 0 */
  244|  12.8k|        dhp->dh_errors[i] = newstr;
  245|  12.8k|    }
  246|  2.56k|}
_dwarf_harmless_cleanout:
  250|  13.2k|{
  251|  13.2k|    unsigned i = 0;
  252|  13.2k|    if (!dhp->dh_errors) {
  ------------------
  |  Branch (252:9): [True: 10.6k, False: 2.56k]
  ------------------
  253|  10.6k|        return;
  254|  10.6k|    }
  255|  15.3k|    for (i = 0; i < dhp->dh_maxcount; ++i) {
  ------------------
  |  Branch (255:17): [True: 12.8k, False: 2.56k]
  ------------------
  256|  12.8k|        free(dhp->dh_errors[i]);
  257|  12.8k|        dhp->dh_errors[i] = 0;
  258|  12.8k|    }
  259|  2.56k|    free(dhp->dh_errors);
  260|  2.56k|    dhp->dh_errors = 0;
  261|  2.56k|    dhp->dh_maxcount = 0;
  262|  2.56k|}

dwarf_object_init_b:
 1019|  10.6k|{
 1020|  10.6k|    Dwarf_Debug dbg = 0;
 1021|  10.6k|    int setup_result = DW_DLV_OK;
  ------------------
  |  |  122|  10.6k|#define DW_DLV_OK        0
  ------------------
 1022|  10.6k|    Dwarf_Unsigned filesize = 0;
 1023|       |
 1024|  10.6k|    if (!ret_dbg) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 10.6k]
  ------------------
 1025|      0|        DWARF_DBG_ERROR(NULL,DW_DLE_DWARF_INIT_DBG_NULL,
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
 1026|      0|            DW_DLV_ERROR);
 1027|      0|    }
 1028|       |    /*  Non-null *ret_dbg will cause problems dealing with
 1029|       |        DW_DLV_ERROR */
 1030|  10.6k|    *ret_dbg = 0;
 1031|  10.6k|    filesize = obj->ai_methods->om_get_filesize(obj->ai_object);
 1032|       |    /*  Initializes  Dwarf_Debug struct and returns
 1033|       |        a pointer to that empty record.
 1034|       |        Filesize is to set up a sensible default hash tree
 1035|       |        size. */
 1036|  10.6k|    dbg = _dwarf_get_debug(filesize);
 1037|  10.6k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  10.6k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  10.6k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|      0|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  10.6k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 0, False: 10.6k]
  |  |  |  Branch (159:7): [True: 0, False: 10.6k]
  |  |  |  Branch (159:15): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1038|      0|        DWARF_DBG_ERROR(dbg, DW_DLE_DBG_ALLOC, DW_DLV_ERROR);
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
 1039|      0|    }
 1040|  10.6k|    dbg->de_errhand = errhand;
 1041|  10.6k|    dbg->de_errarg = errarg;
 1042|  10.6k|    dbg->de_frame_rule_initial_value = DW_FRAME_REG_INITIAL_VALUE;
  ------------------
  |  |  890|  10.6k|#define DW_FRAME_REG_INITIAL_VALUE DW_FRAME_SAME_VAL
  |  |  ------------------
  |  |  |  |  142|  10.6k|#define DW_FRAME_SAME_VAL               12289
  |  |  ------------------
  ------------------
 1043|  10.6k|    dbg->de_frame_reg_rules_entry_count = DW_FRAME_LAST_REG_NUM;
  ------------------
  |  | 1601|  10.6k|#define DW_FRAME_LAST_REG_NUM   (DW_FRAME_HIGHEST_NORMAL_REGISTER + 1)
  |  |  ------------------
  |  |  |  | 1596|  10.6k|#define DW_FRAME_HIGHEST_NORMAL_REGISTER 188
  |  |  ------------------
  ------------------
 1044|  10.6k|    dbg->de_frame_cfa_col_number = DW_FRAME_CFA_COL3;
  ------------------
  |  |  149|  10.6k|#define DW_FRAME_CFA_COL3 DW_FRAME_CFA_COL /*compatibility name*/
  |  |  ------------------
  |  |  |  |  147|  10.6k|#define DW_FRAME_CFA_COL                12290
  |  |  ------------------
  ------------------
 1045|  10.6k|    dbg->de_frame_same_value_number = DW_FRAME_SAME_VAL;
  ------------------
  |  |  142|  10.6k|#define DW_FRAME_SAME_VAL               12289
  ------------------
 1046|  10.6k|    dbg->de_frame_undefined_value_number  = DW_FRAME_UNDEFINED_VAL;
  ------------------
  |  |  137|  10.6k|#define DW_FRAME_UNDEFINED_VAL          12288
  ------------------
 1047|       |
 1048|  10.6k|    dbg->de_obj_file = obj;
 1049|  10.6k|    dbg->de_filesize = filesize;
 1050|  10.6k|    dbg->de_groupnumber = groupnumber;
 1051|  10.6k|    setup_result = _dwarf_setup(dbg, error);
 1052|  10.6k|    if (setup_result == DW_DLV_OK) {
  ------------------
  |  |  122|  10.6k|#define DW_DLV_OK        0
  ------------------
  |  Branch (1052:9): [True: 4.13k, False: 6.54k]
  ------------------
 1053|  4.13k|        int fission_result = load_debugfission_tables(dbg,error);
 1054|       |        /*  In most cases we get
 1055|       |            setup_result == DW_DLV_NO_ENTRY here
 1056|       |            as having debugfission (.dwp objects)
 1057|       |            is fairly rare. */
 1058|  4.13k|        if (fission_result == DW_DLV_ERROR) {
  ------------------
  |  |  123|  4.13k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1058:13): [True: 1.56k, False: 2.56k]
  ------------------
 1059|       |            /*  Something is very wrong. */
 1060|  1.56k|            setup_result = fission_result;
 1061|  1.56k|        }
 1062|  4.13k|        if (setup_result == DW_DLV_OK) {
  ------------------
  |  |  122|  4.13k|#define DW_DLV_OK        0
  ------------------
  |  Branch (1062:13): [True: 2.56k, False: 1.56k]
  ------------------
 1063|  2.56k|            _dwarf_harmless_init(&dbg->de_harmless_errors,
 1064|  2.56k|                DW_HARMLESS_ERROR_CIRCULAR_LIST_DEFAULT_SIZE);
  ------------------
  |  | 8513|  2.56k|#define DW_HARMLESS_ERROR_CIRCULAR_LIST_DEFAULT_SIZE 4
  ------------------
 1065|  2.56k|            *ret_dbg = dbg;
 1066|       |            /*  This is the normal return. */
 1067|  2.56k|            return setup_result;
 1068|  2.56k|        }
 1069|  4.13k|    }
 1070|  8.11k|    if (setup_result == DW_DLV_NO_ENTRY) {
  ------------------
  |  |  121|  8.11k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (1070:9): [True: 5.92k, False: 2.19k]
  ------------------
 1071|  5.92k|        _dwarf_free_all_of_one_debug(dbg);
 1072|  5.92k|        dbg = 0;
 1073|       |        /*  ASSERT: _dwarf_free_all_of_one_debug() never returns
 1074|       |            DW_DLV_ERROR */
 1075|  5.92k|        return setup_result;
 1076|  5.92k|    }
 1077|       |    /*  An error of some sort. Report it as well as
 1078|       |        possible.
 1079|       |        ASSERT: setup_result == DW_DLV_ERROR
 1080|       |        here  */
 1081|  2.19k|    {
 1082|  2.19k|        Dwarf_Unsigned myerr = 0;
 1083|  2.19k|        dwarfstring msg;
 1084|       |
 1085|  2.19k|        dwarfstring_constructor(&msg);
 1086|       |        /* We cannot use any _dwarf_setup()
 1087|       |            error here as
 1088|       |            we are freeing dbg, making that error (setup
 1089|       |            as part of dbg) stale.
 1090|       |            Hence we have to make a new error without a dbg.
 1091|       |            But error might be NULL and the init call
 1092|       |            error-handler function might be set.
 1093|       |        */
 1094|  2.19k|        if (error && *error) {
  ------------------
  |  Branch (1094:13): [True: 731, False: 1.46k]
  |  Branch (1094:22): [True: 731, False: 0]
  ------------------
 1095|       |            /*  Preserve our _dwarf_setup error number, but
 1096|       |                this does not apply if error NULL. */
 1097|       |            /* *error safe */
 1098|    731|            myerr = dwarf_errno(*error);
 1099|       |            /* *error safe */
 1100|    731|            dwarfstring_append(&msg,dwarf_errmsg(*error));
 1101|       |            /*  deallocate the soon-stale error pointer. */
 1102|    731|            dwarf_dealloc(dbg,*error,DW_DLA_ERROR);
  ------------------
  |  |  924|    731|#define DW_DLA_ERROR           0x0e  /* Dwarf_Error */
  ------------------
 1103|       |            /* *error safe */
 1104|    731|            *error = 0;
 1105|    731|        }
 1106|       |        /*  The status we want to return  here is of _dwarf_setup,
 1107|       |            not of the  _dwarf_free_all_of_one_debug(dbg) call.
 1108|       |            So use a local status variable for the free.  */
 1109|  2.19k|        _dwarf_free_all_of_one_debug(dbg);
 1110|  2.19k|        dbg = 0;
 1111|  2.19k|        if (myerr) {
  ------------------
  |  Branch (1111:13): [True: 731, False: 1.46k]
  ------------------
 1112|       |            /*  Use the _dwarf_setup error number.
 1113|       |                If error is NULL the following will issue
 1114|       |                a message on stderr, as without
 1115|       |                dbg there is no error-handler function.
 1116|       |                */
 1117|    731|            _dwarf_error_string(dbg,error,myerr,
 1118|    731|                dwarfstring_string(&msg));
 1119|    731|            dwarfstring_destructor(&msg);
 1120|    731|        } /* else return quietly, a serious error
 1121|       |            was already reported. */
 1122|  2.19k|    }
 1123|  2.19k|    return setup_result;
 1124|  8.11k|}
dwarf_object_finish:
 1135|  2.56k|{
 1136|  2.56k|    int res = 0;
 1137|       |    /* do not use CHECK_DBG */
 1138|  2.56k|    _dwarf_harmless_cleanout(&dbg->de_harmless_errors);
 1139|  2.56k|    res = _dwarf_free_all_of_one_debug(dbg);
 1140|       |    /*  see dwarf_error.h dwarf_error.c  Relevant
 1141|       |        to trying and failing to open/read corrupt
 1142|       |        object files.  */
 1143|  2.56k|    return res;
 1144|  2.56k|}
_dwarf_load_section:
 1412|  13.1k|{
 1413|  13.1k|    int res  = DW_DLV_ERROR;
  ------------------
  |  |  123|  13.1k|#define DW_DLV_ERROR     1
  ------------------
 1414|  13.1k|    int err = 0;
 1415|  13.1k|    struct Dwarf_Obj_Access_Interface_a_s *o = 0;
 1416|       |
 1417|       |    /* check to see if the section is already loaded */
 1418|  13.1k|    if (section->dss_data !=  NULL) {
  ------------------
  |  Branch (1418:9): [True: 0, False: 13.1k]
  ------------------
 1419|      0|        return DW_DLV_OK;
  ------------------
  |  |  122|      0|#define DW_DLV_OK        0
  ------------------
 1420|      0|    }
 1421|  13.1k|    o = dbg->de_obj_file;
 1422|       |    /*  There is an elf convention that section index 0
 1423|       |        is reserved, and that section is always empty.
 1424|       |        Non-elf object formats must honor
 1425|       |        that by ensuring that (when they
 1426|       |        assign numbers to 'sections' or
 1427|       |        'section-like-things') they never
 1428|       |        assign a real section section-number
 1429|       |        0 to dss_index.
 1430|       |
 1431|       |        There is also a convention for 'bss' that that section
 1432|       |        and its like sections have no data but do have a size.
 1433|       |        That is never true of DWARF sections */
 1434|  13.1k|    res = o->ai_methods->om_load_section(
 1435|  13.1k|        o->ai_object, section->dss_index,
 1436|  13.1k|        &section->dss_data, &err);
 1437|  13.1k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|  13.1k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1437:9): [True: 950, False: 12.2k]
  ------------------
 1438|    950|        DWARF_DBG_ERROR(dbg, err, DW_DLV_ERROR);
  ------------------
  |  |   43|    950|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
 1439|      0|    }
 1440|       |    /*  For PE and mach-o all section data was always
 1441|       |        malloc'd. We do not need to set dss_data_was_malloc
 1442|       |        though as the o->object data will eventually free
 1443|       |        the original section data.
 1444|       |        The first character of any o->object struct gives the type. */
 1445|       |
 1446|  12.2k|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |  121|  12.2k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (1446:9): [True: 0, False: 12.2k]
  ------------------
 1447|       |        /*  Gets this for section->dss_index 0.
 1448|       |            Which by ELF definition is a section index
 1449|       |            which is not used (reserved by Elf to
 1450|       |            mean no-section-index).
 1451|       |            Otherwise NULL dss_data gets error.
 1452|       |            BSS would legitimately have no data, but
 1453|       |            no DWARF related section could possibly be bss.
 1454|       |            We also get it if the section is present but
 1455|       |            zero-size. */
 1456|      0|        return res;
 1457|      0|    }
 1458|  12.2k|    if (section->dss_ignore_reloc_group_sec) {
  ------------------
  |  Branch (1458:9): [True: 10.7k, False: 1.49k]
  ------------------
 1459|       |        /* Neither zdebug nor reloc apply to .group sections. */
 1460|  10.7k|        return res;
 1461|  10.7k|    }
 1462|  1.49k|    if ((section->dss_zdebug_requires_decompress ||
  ------------------
  |  Branch (1462:10): [True: 43, False: 1.44k]
  ------------------
 1463|  1.49k|        section->dss_shf_compressed ||
  ------------------
  |  Branch (1463:9): [True: 19, False: 1.42k]
  ------------------
 1464|  1.49k|        section->dss_ZLIB_compressed) &&
  ------------------
  |  Branch (1464:9): [True: 0, False: 1.42k]
  ------------------
 1465|  1.49k|        !section->dss_did_decompress) {
  ------------------
  |  Branch (1465:9): [True: 62, False: 0]
  ------------------
 1466|     62|        if (!section->dss_data) {
  ------------------
  |  Branch (1466:13): [True: 0, False: 62]
  ------------------
 1467|       |            /*  Impossible. This makes no sense.
 1468|       |                Corrupt object. */
 1469|      0|            DWARF_DBG_ERROR(dbg, DW_DLE_COMPRESSED_EMPTY_SECTION,
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
 1470|      0|                DW_DLV_ERROR);
 1471|      0|        }
 1472|       |#if defined(HAVE_ZLIB) && defined(HAVE_ZSTD)
 1473|       |        res = do_decompress(dbg,section,error);
 1474|       |        if (res != DW_DLV_OK) {
 1475|       |            return res;
 1476|       |        }
 1477|       |#else /* !defined(HAVE_ZLIB) && defined(HAVE_ZSTD) */
 1478|     62|        _dwarf_error_string(dbg, error,
 1479|     62|            DW_DLE_ZDEBUG_REQUIRES_ZLIB,
  ------------------
  |  | 1289|     62|#define DW_DLE_ZDEBUG_REQUIRES_ZLIB            314
  ------------------
 1480|     62|            "DW_DLE_ZDEBUG_REQUIRES_ZLIB: "
 1481|     62|            " zlib and zstd are missing, cannot"
 1482|     62|            " decompress section.");
 1483|     62|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     62|#define DW_DLV_ERROR     1
  ------------------
 1484|      0|#endif /* defined(HAVE_ZLIB) && defined(HAVE_ZSTD) */
 1485|      0|        section->dss_did_decompress = TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
 1486|      0|    }
 1487|  1.42k|    if (_dwarf_apply_relocs == 0) {
  ------------------
  |  Branch (1487:9): [True: 0, False: 1.42k]
  ------------------
 1488|      0|        return res;
 1489|      0|    }
 1490|  1.42k|    if (section->dss_reloc_size == 0) {
  ------------------
  |  Branch (1490:9): [True: 1.15k, False: 271]
  ------------------
 1491|  1.15k|        return res;
 1492|  1.15k|    }
 1493|    271|    if (!o->ai_methods->om_relocate_a_section) {
  ------------------
  |  Branch (1493:9): [True: 0, False: 271]
  ------------------
 1494|      0|        return res;
 1495|      0|    }
 1496|       |    /*apply relocations */
 1497|    271|    res = o->ai_methods->om_relocate_a_section(o->ai_object,
 1498|    271|        section->dss_index, dbg, &err);
 1499|    271|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|    271|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (1499:9): [True: 271, False: 0]
  ------------------
 1500|    271|        DWARF_DBG_ERROR(dbg, err, res);
  ------------------
  |  |   43|    271|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
 1501|      0|    }
 1502|      0|    return res;
 1503|    271|}
dwarf_init_finish.c:_dwarf_setup:
  705|  10.6k|{
  706|  10.6k|    const char    *scn_name = 0;
  707|  10.6k|    struct Dwarf_Obj_Access_Interface_a_s * obj = 0;
  708|  10.6k|    int            resn = 0;
  709|  10.6k|    struct Dwarf_Section_s **sections = 0;
  710|  10.6k|    Dwarf_Small    endianness = 0;
  711|  10.6k|    Dwarf_Unsigned section_count = 0;
  712|  10.6k|    unsigned       default_group_number = 0;
  713|  10.6k|    unsigned       foundDwarf = FALSE;
  ------------------
  |  |   40|  10.6k|#define FALSE 0
  ------------------
  714|  10.6k|    Dwarf_Unsigned obj_section_index = 0;
  715|       |
  716|  10.6k|    dbg->de_assume_string_in_bounds =
  717|  10.6k|        _dwarf_assume_string_in_bounds;
  718|       |    /* First make an arbitrary assumption. */
  719|  10.6k|    dbg->de_copy_word = _dwarf_memcpy_noswap_bytes;
  720|  10.6k|    obj = dbg->de_obj_file;
  721|  10.6k|    endianness = obj->ai_methods->om_get_byte_order(obj->ai_object);
  722|       |    /* Then adjust any changes we need. */
  723|       |#ifdef WORDS_BIGENDIAN
  724|       |    dbg->de_big_endian_object = 1;
  725|       |    if (endianness == DW_END_little) {
  726|       |        dbg->de_big_endian_object = 0;
  727|       |        dbg->de_copy_word = _dwarf_memcpy_swap_bytes;
  728|       |    }
  729|       |#else /* little endian */
  730|  10.6k|    dbg->de_big_endian_object = 0;
  731|  10.6k|    if (endianness == DW_END_big ) {
  ------------------
  |  | 1104|  10.6k|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  |  Branch (731:9): [True: 3.03k, False: 7.64k]
  ------------------
  732|  3.03k|        dbg->de_big_endian_object = 1;
  733|  3.03k|        dbg->de_copy_word = _dwarf_memcpy_swap_bytes;
  734|  3.03k|    }
  735|  10.6k|#endif /* !WORDS_BIGENDIAN */
  736|       |
  737|       |    /*  The following de_length_size is Not Too Significant.
  738|       |        Only used one calculation, and an approximate one
  739|       |        at that. */
  740|  10.6k|    dbg->de_length_size = obj->ai_methods->
  741|  10.6k|        om_get_length_size(obj->ai_object);
  742|  10.6k|    dbg->de_pointer_size =
  743|  10.6k|        obj->ai_methods->om_get_pointer_size(obj->ai_object);
  744|  10.6k|    section_count = obj->ai_methods->
  745|  10.6k|        om_get_section_count(obj->ai_object);
  746|  10.6k|    resn = determine_target_group(section_count,obj,
  747|  10.6k|        &default_group_number,dbg,error);
  748|  10.6k|    if (resn == DW_DLV_ERROR) {
  ------------------
  |  |  123|  10.6k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (748:9): [True: 30, False: 10.6k]
  ------------------
  749|     30|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     30|#define DW_DLV_ERROR     1
  ------------------
  750|     30|    }
  751|  10.6k|    if (dbg->de_groupnumber == DW_GROUPNUMBER_ANY) {
  ------------------
  |  |  126|  10.6k|#define DW_GROUPNUMBER_ANY  0
  ------------------
  |  Branch (751:9): [True: 10.6k, False: 0]
  ------------------
  752|  10.6k|        dbg->de_groupnumber = default_group_number;
  753|  10.6k|    }
  754|       |    /*  Allocate space to record references to debug sections
  755|       |        that can be referenced by RELA sections in
  756|       |        the 'sh_info' field. */
  757|  10.6k|    sections = (struct Dwarf_Section_s **)calloc(section_count + 1,
  758|  10.6k|        sizeof(struct Dwarf_Section_s *));
  759|  10.6k|    if (!sections) {
  ------------------
  |  Branch (759:9): [True: 0, False: 10.6k]
  ------------------
  760|       |        /* Impossible case, we hope. Give up. */
  761|      0|        _dwarf_error(dbg, error, DW_DLE_SECTION_ERROR);
  ------------------
  |  | 1222|      0|#define DW_DLE_SECTION_ERROR                   248
  ------------------
  762|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  763|      0|    }
  764|       |
  765|       |    /*  We can skip index 0 when considering ELF files, but not other
  766|       |        object types.  Indeed regardless of the object type we should
  767|       |        skip section 0 here.
  768|       |        This is a convention.  We depend on it.
  769|       |        Non-elf object access code should
  770|       |        (in itself) understand we will index beginning at 1 and adjust
  771|       |        itself to deal with this Elf convention.    Without this
  772|       |        convention various parts of the code in this file won't
  773|       |        work correctly.
  774|       |        A dss_index of 0 must not be used, even though we start at 0
  775|       |        here.  So the get_section_info() must adapt to the situation
  776|       |        (the elf version does automatically as a result of Elf having
  777|       |        a section zero with zero length and an empty name). */
  778|       |
  779|       |    /* ASSERT: all group map entries set up. */
  780|       |
  781|   529k|    for (obj_section_index = 0; obj_section_index < section_count;
  ------------------
  |  Branch (781:33): [True: 519k, False: 10.0k]
  ------------------
  782|   519k|        ++obj_section_index) {
  783|       |
  784|   519k|        struct Dwarf_Obj_Access_Section_a_s doas;
  785|   519k|        int res = DW_DLV_ERROR;
  ------------------
  |  |  123|   519k|#define DW_DLV_ERROR     1
  ------------------
  786|   519k|        int err = 0;
  787|   519k|        unsigned groupnumber = 0;
  788|   519k|        unsigned mapgroupnumber = 0;
  789|   519k|        int is_rela = FALSE;
  ------------------
  |  |   40|   519k|#define FALSE 0
  ------------------
  790|       |
  791|   519k|        res = _dwarf_section_get_target_group_from_map(dbg,
  792|   519k|            (unsigned int)obj_section_index, &groupnumber,error);
  793|   519k|        if (res == DW_DLV_OK ) {
  ------------------
  |  |  122|   519k|#define DW_DLV_OK        0
  ------------------
  |  Branch (793:13): [True: 256k, False: 263k]
  ------------------
  794|       |            /* groupnumber is set. Fall through */
  795|   256k|            mapgroupnumber = groupnumber;
  796|   263k|        } else if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|   263k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (796:20): [True: 0, False: 263k]
  ------------------
  797|      0|            free(sections);
  798|      0|            return res;
  799|   263k|        } else { /* DW_DLV_NO_ENTRY */
  800|       |            /* fall through, a BASE or DWO group, possibly */
  801|   263k|        }
  802|   519k|        memset(&doas,0,sizeof(doas));
  803|       |
  804|   519k|        res = obj->ai_methods->om_get_section_info(obj->ai_object,
  805|   519k|            obj_section_index,
  806|   519k|            &doas, &err);
  807|   519k|        if (res == DW_DLV_NO_ENTRY){
  ------------------
  |  |  121|   519k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (807:13): [True: 0, False: 519k]
  ------------------
  808|      0|            free(sections);
  809|      0|            return res;
  810|      0|        }
  811|   519k|        if (res == DW_DLV_ERROR){
  ------------------
  |  |  123|   519k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (811:13): [True: 0, False: 519k]
  ------------------
  812|      0|            free(sections);
  813|      0|            DWARF_DBG_ERROR(dbg, err, DW_DLV_ERROR);
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  814|      0|        }
  815|   519k|        scn_name = doas.as_name;
  816|   519k|        if (!groupnumber) {
  ------------------
  |  Branch (816:13): [True: 263k, False: 256k]
  ------------------
  817|       |            /* This finds dwo sections, group 2 */
  818|   263k|            res = _dwarf_dwo_groupnumber_given_name(scn_name,
  819|   263k|                &groupnumber);
  820|   263k|            if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |  121|   263k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (820:17): [True: 260k, False: 2.93k]
  ------------------
  821|       |                /* No, must be group 1 */
  822|   260k|                groupnumber = DW_GROUPNUMBER_BASE;
  ------------------
  |  |  127|   260k|#define DW_GROUPNUMBER_BASE 1
  ------------------
  823|   260k|            }
  824|   263k|        }
  825|   519k|        if (!this_section_dwarf_relevant(scn_name,
  ------------------
  |  Branch (825:13): [True: 234k, False: 285k]
  ------------------
  826|   519k|            (int)doas.as_type,
  827|   519k|            &is_rela) ) {
  828|   234k|            continue;
  829|   234k|        }
  830|   285k|        if (!is_a_relx_section(scn_name,(int)doas.as_type,
  ------------------
  |  Branch (830:13): [True: 265k, False: 19.8k]
  ------------------
  831|   285k|            &is_rela)
  832|   285k|            && !is_a_special_section_semi_dwarf(scn_name)) {
  ------------------
  |  Branch (832:16): [True: 261k, False: 3.42k]
  ------------------
  833|       |            /*  We do these actions only for group-related
  834|       |                sections.  Do for .debug_info etc,
  835|       |                never for .strtab or .rela.*
  836|       |                We already tested for relevance, so that part
  837|       |                is not news. */
  838|   261k|            if (mapgroupnumber == dbg->de_groupnumber) {
  ------------------
  |  Branch (838:17): [True: 129k, False: 131k]
  ------------------
  839|       |                /*  OK. Mapped. Part of the group.. This will
  840|       |                    catch the cases where there are versions of
  841|       |                    a section in multiple COMDATs and in BASE
  842|       |                    an DWO to get the right one */
  843|   131k|            } else {
  844|       |                /* This section not mapped into this group. */
  845|   131k|                if (groupnumber == 1 && dbg->de_groupnumber > 2 &&
  ------------------
  |  Branch (845:21): [True: 6.06k, False: 125k]
  |  Branch (845:41): [True: 4.84k, False: 1.22k]
  ------------------
  846|   131k|                    !_dwarf_section_in_group_by_name(dbg,scn_name,
  ------------------
  |  Branch (846:21): [True: 1.92k, False: 2.92k]
  ------------------
  847|  4.84k|                        dbg->de_groupnumber)) {
  848|       |                    /* Load the section (but as group 1) */
  849|   129k|                } else {
  850|   129k|                    continue;
  851|   129k|                }
  852|   131k|            }
  853|   261k|        }
  854|       |        /* BUILDING_SECTIONS.  See also BUILDING_MAP, SETUP_SECTION */
  855|   155k|        {
  856|       |            /*  Build up the sections table and the
  857|       |                de_debug* etc pointers in Dwarf_Debug. */
  858|   155k|            struct Dwarf_dbg_sect_s *section = 0;
  859|   155k|            int found_match = FALSE;
  ------------------
  |  |   40|   155k|#define FALSE 0
  ------------------
  860|       |
  861|   155k|            res = is_section_name_known_already(dbg,scn_name);
  862|   155k|            if (res == DW_DLV_OK) {
  ------------------
  |  |  122|   155k|#define DW_DLV_OK        0
  ------------------
  |  Branch (862:17): [True: 98.3k, False: 56.8k]
  ------------------
  863|       |#if 0 /* Removed check for section duplication */
  864|       |                /* DUPLICATE */
  865|       |                DWARF_DBG_ERROR(dbg, DW_DLE_SECTION_DUPLICATION,
  866|       |                    DW_DLV_ERROR);
  867|       |                /* Metrowerks does this nonsense */
  868|       |#endif
  869|  98.3k|                continue;
  870|  98.3k|            }
  871|  56.8k|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|  56.8k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (871:17): [True: 0, False: 56.8k]
  ------------------
  872|      0|                free(sections);
  873|      0|                DWARF_DBG_ERROR(dbg, err, DW_DLV_ERROR);
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  874|      0|            }
  875|       |            /* No entry: new-to-us section, the normal case. */
  876|  56.8k|            res = _dwarf_enter_section_in_de_debug_sections_array(dbg,
  877|  56.8k|                scn_name, obj_section_index, groupnumber,&err);
  878|  56.8k|            if (res == DW_DLV_OK) {
  ------------------
  |  |  122|  56.8k|#define DW_DLV_OK        0
  ------------------
  |  Branch (878:17): [True: 9.80k, False: 47.0k]
  ------------------
  879|  9.80k|                section = &dbg->de_debug_sections[
  880|  9.80k|                    dbg->de_debug_sections_total_entries-1];
  881|  9.80k|                res = get_basic_section_data(dbg,
  882|  9.80k|                    section->ds_secdata, &doas,
  883|  9.80k|                    obj_section_index,
  884|  9.80k|                    groupnumber,
  885|  9.80k|                    error,
  886|  9.80k|                    section->ds_duperr,
  887|  9.80k|                    section->ds_emptyerr);
  888|  9.80k|                if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  9.80k|#define DW_DLV_OK        0
  ------------------
  |  Branch (888:21): [True: 63, False: 9.74k]
  ------------------
  889|     63|                    free(sections);
  890|     63|                    return res;
  891|     63|                }
  892|  9.74k|                sections[obj_section_index] = section->ds_secdata;
  893|  9.74k|                foundDwarf += section->ds_have_dwarf;
  894|  9.74k|                found_match = TRUE;
  ------------------
  |  |   37|  9.74k|#define TRUE 1
  ------------------
  895|       |                /*  Normal section set up.
  896|       |                    Fall through. */
  897|  47.0k|            } else if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |  121|  47.0k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (897:24): [True: 46.8k, False: 153]
  ------------------
  898|       |                /*  We get here for relocation sections.
  899|       |                    Fall through. */
  900|  46.8k|            } else {
  901|    153|                free(sections);
  902|    153|                DWARF_DBG_ERROR(dbg, err, DW_DLV_ERROR);
  ------------------
  |  |   43|    153|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  903|      0|            }
  904|       |
  905|  56.6k|            if (!found_match) {
  ------------------
  |  Branch (905:17): [True: 46.8k, False: 9.74k]
  ------------------
  906|       |                /*  For an object file with incorrect rel[a]
  907|       |                    section name, the 'readelf' tool,
  908|       |                    prints correct debug information,
  909|       |                    as the tool takes the section type instead
  910|       |                    of the section name. If the current section
  911|       |                    is a RELA one and the 'sh_info'
  912|       |                    refers to a debug section, add the
  913|       |                    relocation data. */
  914|  46.8k|                if (is_a_relx_section(scn_name,
  ------------------
  |  Branch (914:21): [True: 16.0k, False: 30.8k]
  ------------------
  915|  46.8k|                    (int)doas.as_type, &is_rela)) {
  916|  16.0k|                    if ( doas.as_info < section_count) {
  ------------------
  |  Branch (916:26): [True: 15.6k, False: 378]
  ------------------
  917|  15.6k|                        if (sections[doas.as_info]) {
  ------------------
  |  Branch (917:29): [True: 1.86k, False: 13.7k]
  ------------------
  918|  1.86k|                            add_relx_data_to_secdata(
  919|  1.86k|                                sections[doas.as_info],
  920|  1.86k|                                &doas,
  921|  1.86k|                                obj_section_index,is_rela);
  922|  1.86k|                        }
  923|  15.6k|                    } else {
  924|       |                        /* Something is wrong with the ELF file. */
  925|    378|                        free(sections);
  926|    378|                        DWARF_DBG_ERROR(dbg, DW_DLE_ELF_SECT_ERR,
  ------------------
  |  |   43|    378|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  927|    378|                            DW_DLV_ERROR);
  928|      0|                    }
  929|  16.0k|                }
  930|  46.8k|            }
  931|       |            /* Fetch next section */
  932|  56.6k|        }
  933|  56.6k|    }
  934|       |
  935|       |    /* Free table with section information. */
  936|  10.0k|    free(sections);
  937|  10.0k|    if (foundDwarf) {
  ------------------
  |  Branch (937:9): [True: 4.13k, False: 5.92k]
  ------------------
  938|  4.13k|        return DW_DLV_OK;
  ------------------
  |  |  122|  4.13k|#define DW_DLV_OK        0
  ------------------
  939|  4.13k|    }
  940|  5.92k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  5.92k|#define DW_DLV_NO_ENTRY -1
  ------------------
  941|  10.0k|}
dwarf_init_finish.c:determine_target_group:
  558|  10.6k|{
  559|  10.6k|    unsigned obj_section_index = 0;
  560|  10.6k|    int found_group_one = 0;
  561|  10.6k|    int found_group_two = 0;
  562|  10.6k|    struct Dwarf_Group_Data_s *grp = 0;
  563|  10.6k|    unsigned comdat_group_next = 3;
  564|  10.6k|    unsigned lowest_comdat_groupnum = 0;
  565|       |
  566|  10.6k|    grp = &dbg->de_groupnumbers;
  567|  10.6k|    grp->gd_number_of_groups = 0;
  568|  10.6k|    grp->gd_number_of_sections = (unsigned int)section_count;
  569|  10.6k|    if (grp->gd_map) {
  ------------------
  |  Branch (569:9): [True: 0, False: 10.6k]
  ------------------
  570|      0|        _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  571|      0|        return DW_DLV_OK;
  ------------------
  |  |  122|      0|#define DW_DLV_OK        0
  ------------------
  572|      0|    }
  573|   571k|    for (obj_section_index = 0; obj_section_index < section_count;
  ------------------
  |  Branch (573:33): [True: 560k, False: 10.6k]
  ------------------
  574|   560k|        ++obj_section_index) {
  575|       |
  576|   560k|        struct Dwarf_Obj_Access_Section_a_s doas;
  577|   560k|        int res = DW_DLV_ERROR;
  ------------------
  |  |  123|   560k|#define DW_DLV_ERROR     1
  ------------------
  578|   560k|        int err = 0;
  579|   560k|        const char *scn_name = 0;
  580|   560k|        unsigned groupnumber = 0;
  581|   560k|        unsigned mapgroupnumber = 0;
  582|   560k|        int is_rela = FALSE;
  ------------------
  |  |   40|   560k|#define FALSE 0
  ------------------
  583|       |
  584|   560k|        memset(&doas,0,sizeof(doas));
  585|   560k|        res = obj->ai_methods->om_get_section_info(obj->ai_object,
  586|   560k|            obj_section_index,
  587|   560k|            &doas, &err);
  588|   560k|        if (res == DW_DLV_NO_ENTRY){
  ------------------
  |  |  121|   560k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (588:13): [True: 0, False: 560k]
  ------------------
  589|      0|            return res;
  590|      0|        }
  591|   560k|        if (res == DW_DLV_ERROR){
  ------------------
  |  |  123|   560k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (591:13): [True: 0, False: 560k]
  ------------------
  592|      0|            _dwarf_error(dbg, error,err);
  593|      0|            return res;
  594|      0|        }
  595|       |
  596|   560k|        if (doas.as_type == SHT_GROUP) {
  ------------------
  |  |   85|   560k|#define SHT_GROUP 17
  ------------------
  |  Branch (596:13): [True: 10.7k, False: 549k]
  ------------------
  597|       |            /*  See assumptions in function comment above. */
  598|  10.7k|            unsigned did_add_map = 0;
  599|       |            /*  Add to our map. Here we
  600|       |                are assuming SHT_GROUP records come first.
  601|       |                Till proven wrong. */
  602|  10.7k|            res = insert_sht_list_in_group_map(dbg,&doas,
  603|  10.7k|                comdat_group_next,
  604|  10.7k|                obj_section_index,
  605|  10.7k|                section_count,
  606|  10.7k|                obj,
  607|  10.7k|                &did_add_map,error);
  608|  10.7k|            if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  10.7k|#define DW_DLV_OK        0
  ------------------
  |  Branch (608:17): [True: 30, False: 10.7k]
  ------------------
  609|     30|                return res;
  610|     30|            }
  611|  10.7k|            if (!lowest_comdat_groupnum) {
  ------------------
  |  Branch (611:17): [True: 810, False: 9.91k]
  ------------------
  612|    810|                lowest_comdat_groupnum = comdat_group_next;
  613|    810|            }
  614|  10.7k|            if (did_add_map) {
  ------------------
  |  Branch (614:17): [True: 564, False: 10.1k]
  ------------------
  615|    564|                ++grp->gd_number_of_groups;
  616|    564|                ++comdat_group_next;
  617|    564|            }
  618|  10.7k|            continue;
  619|  10.7k|        }
  620|   549k|        scn_name = doas.as_name;
  621|   549k|        if (!this_section_dwarf_relevant(scn_name,
  ------------------
  |  Branch (621:13): [True: 232k, False: 317k]
  ------------------
  622|   549k|            (int)doas.as_type,
  623|   549k|            &is_rela) ) {
  624|   232k|            continue;
  625|   232k|        }
  626|       |
  627|       |        /*  Now at a 'normal' section, though we do not
  628|       |            quite know what group it is. */
  629|       |
  630|   317k|        res = _dwarf_section_get_target_group_from_map(dbg,
  631|   317k|            obj_section_index,&groupnumber,error);
  632|   317k|        if (res == DW_DLV_OK ) {
  ------------------
  |  |  122|   317k|#define DW_DLV_OK        0
  ------------------
  |  Branch (632:13): [True: 315, False: 316k]
  ------------------
  633|       |            /*  groupnumber is set. Fall through.
  634|       |                All COMDAT group should get here. */
  635|    315|            mapgroupnumber = groupnumber;
  636|   316k|        } else if (res == DW_DLV_ERROR) {
  ------------------
  |  |  123|   316k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (636:20): [True: 0, False: 316k]
  ------------------
  637|      0|            return res;
  638|   316k|        } else { /* DW_DLV_NO_ENTRY */
  639|       |            /* Normal non-COMDAT. groupnumber is zero.  */
  640|   316k|        }
  641|       |
  642|       |        /* BUILDING_MAP.  See also BUILDING_SECTIONS, SETUP_SECTION */
  643|   317k|        if (!groupnumber) {
  ------------------
  |  Branch (643:13): [True: 316k, False: 315]
  ------------------
  644|   316k|            res =_dwarf_dwo_groupnumber_given_name(scn_name,
  645|   316k|                &groupnumber);
  646|       |            /* DW_DLV_ERROR impossible here. */
  647|   316k|            if (res == DW_DLV_OK) {
  ------------------
  |  |  122|   316k|#define DW_DLV_OK        0
  ------------------
  |  Branch (647:17): [True: 169k, False: 146k]
  ------------------
  648|       |                /* groupnumber set 2 */
  649|   169k|            } else {
  650|       |                /*  This is what it has to be.
  651|       |                    .rela in here too.  */
  652|   146k|                groupnumber = DW_GROUPNUMBER_BASE;
  ------------------
  |  |  127|   146k|#define DW_GROUPNUMBER_BASE 1
  ------------------
  653|   146k|            }
  654|   316k|        }
  655|   317k|        if (is_a_relx_section(scn_name,(int)doas.as_type,
  ------------------
  |  Branch (655:13): [True: 55.1k, False: 261k]
  ------------------
  656|   317k|            &is_rela)) {
  657|  55.1k|            continue;
  658|  55.1k|        }
  659|       |
  660|       |        /*  ASSERT: groupnumber non-zero now */
  661|   261k|        if (!is_a_special_section_semi_dwarf(scn_name)) {
  ------------------
  |  Branch (661:13): [True: 258k, False: 3.42k]
  ------------------
  662|   258k|            if (mapgroupnumber) {
  ------------------
  |  Branch (662:17): [True: 237, False: 258k]
  ------------------
  663|       |                /* Already in group map */
  664|    237|                continue;
  665|    237|            }
  666|       |            /* !mapgroupnumber */
  667|   258k|            res = _dwarf_insert_in_group_map(dbg,
  668|   258k|                (unsigned)groupnumber,
  669|   258k|                (unsigned)obj_section_index,
  670|   258k|                scn_name,
  671|   258k|                error);
  672|   258k|            if (res != DW_DLV_OK) {
  ------------------
  |  |  122|   258k|#define DW_DLV_OK        0
  ------------------
  |  Branch (672:17): [True: 0, False: 258k]
  ------------------
  673|      0|                return res;
  674|      0|            }
  675|   258k|            if (groupnumber == 1) {
  ------------------
  |  Branch (675:17): [True: 91.4k, False: 166k]
  ------------------
  676|  91.4k|                found_group_one++;
  677|   166k|            } else if (groupnumber == 2) {
  ------------------
  |  Branch (677:24): [True: 166k, False: 0]
  ------------------
  678|   166k|                found_group_two++;
  679|   166k|            } else { /* fall through to continue */ }
  680|   258k|            continue;
  681|   258k|        }
  682|   261k|    }
  683|  10.6k|    if (found_group_two) {
  ------------------
  |  Branch (683:9): [True: 1.67k, False: 8.97k]
  ------------------
  684|  1.67k|        ++grp->gd_number_of_groups;
  685|  1.67k|    }
  686|  10.6k|    if (found_group_one) {
  ------------------
  |  Branch (686:9): [True: 4.49k, False: 6.15k]
  ------------------
  687|  4.49k|        *group_number_out = DW_GROUPNUMBER_BASE;
  ------------------
  |  |  127|  4.49k|#define DW_GROUPNUMBER_BASE 1
  ------------------
  688|  4.49k|        ++grp->gd_number_of_groups;
  689|  6.15k|    } else {
  690|  6.15k|        if (found_group_two) {
  ------------------
  |  Branch (690:13): [True: 972, False: 5.18k]
  ------------------
  691|    972|            *group_number_out = DW_GROUPNUMBER_DWO;
  ------------------
  |  |  128|    972|#define DW_GROUPNUMBER_DWO  2
  ------------------
  692|  5.18k|        } else {
  693|  5.18k|            if (lowest_comdat_groupnum) {
  ------------------
  |  Branch (693:17): [True: 693, False: 4.49k]
  ------------------
  694|    693|                *group_number_out = lowest_comdat_groupnum;
  695|  4.49k|            } else {
  696|  4.49k|                *group_number_out = DW_GROUPNUMBER_BASE;
  ------------------
  |  |  127|  4.49k|#define DW_GROUPNUMBER_BASE 1
  ------------------
  697|  4.49k|            }
  698|  5.18k|        }
  699|  6.15k|    }
  700|  10.6k|    return DW_DLV_OK;
  ------------------
  |  |  122|  10.6k|#define DW_DLV_OK        0
  ------------------
  701|  10.6k|}
dwarf_init_finish.c:insert_sht_list_in_group_map:
  358|  10.7k|{
  359|  10.7k|    struct Dwarf_Section_s secdata;
  360|  10.7k|    Dwarf_Small * data = 0;
  361|  10.7k|    int           res = 0;
  362|  10.7k|    Dwarf_Small*  secend = 0;
  363|       |
  364|  10.7k|    memset(&secdata,0,sizeof(secdata));
  365|  10.7k|    secdata.dss_size =      doas->as_size;
  366|  10.7k|    secdata.dss_entrysize = doas->as_entrysize;
  367|  10.7k|    secdata.dss_group_number = 1; /* arbitrary. */
  368|  10.7k|    secdata.dss_index     = section_number;
  369|  10.7k|    secdata.dss_name      = ".group";
  370|  10.7k|    secdata.dss_standard_name = ".group";
  371|  10.7k|    secdata.dss_number = section_number;
  372|  10.7k|    secdata.dss_ignore_reloc_group_sec = TRUE;
  ------------------
  |  |   37|  10.7k|#define TRUE 1
  ------------------
  373|  10.7k|    res = _dwarf_load_section(dbg,&secdata,error);
  374|  10.7k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  10.7k|#define DW_DLV_OK        0
  ------------------
  |  Branch (374:9): [True: 0, False: 10.7k]
  ------------------
  375|      0|        if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (375:13): [True: 0, False: 0]
  ------------------
  376|      0|            free(secdata.dss_data);
  377|      0|            secdata.dss_data = 0;
  378|      0|        }
  379|      0|        return res;
  380|      0|    }
  381|  10.7k|    if (!secdata.dss_data) {
  ------------------
  |  Branch (381:9): [True: 0, False: 10.7k]
  ------------------
  382|      0|        _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  383|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  384|      0|    }
  385|  10.7k|    if (doas->as_entrysize != 4) {
  ------------------
  |  Branch (385:9): [True: 0, False: 10.7k]
  ------------------
  386|      0|        if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            free(secdata.dss_data);
  388|      0|            secdata.dss_data = 0;
  389|      0|        }
  390|      0|        _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  391|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  392|      0|    }
  393|       |    /*  So now pick up the data in dss_data.
  394|       |        It is an array of 32 bit fields.
  395|       |        Entry zero is just a constant 1.
  396|       |        Each additional is a section number. */
  397|  10.7k|    data = secdata.dss_data;
  398|  10.7k|    secend = data + secdata.dss_size;
  399|  10.7k|    {
  400|  10.7k|        Dwarf_Unsigned i = 1;
  401|  10.7k|        Dwarf_Unsigned count = doas->as_size/doas->as_entrysize;
  402|  10.7k|        Dwarf_Unsigned  fval = 0;
  403|       |
  404|       |        /*  The fields treatments with  regard
  405|       |            to endianness is unclear.  In any case a single
  406|       |            bit should be on, as 0x01000000
  407|       |            without any endiannes swapping.
  408|       |            Or so it seems given limited evidence.
  409|       |            We read with length checking and allow the
  410|       |            reader to byte swap and then fix things.
  411|       |            At least one test case has big-endian
  412|       |            data but little-endian SHT_GROUP data. */
  413|  10.7k|        if ((data+DWARF_32BIT_SIZE) > secend) {
  ------------------
  |  |  135|  10.7k|#define DWARF_32BIT_SIZE 4
  ------------------
  |  Branch (413:13): [True: 0, False: 10.7k]
  ------------------
  414|       |            /* Duplicates the check in READ_UNALIGNED_CK
  415|       |                so we can free allocated memory bere. */
  416|      0|            if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (416:17): [True: 0, False: 0]
  ------------------
  417|      0|                free(secdata.dss_data);
  418|      0|                secdata.dss_data = 0;
  419|      0|            }
  420|      0|            _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  421|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  422|      0|        }
  423|  10.7k|        READ_UNALIGNED_CK(dbg,fval,Dwarf_Unsigned,
  ------------------
  |  |  245|  10.7k|    do  {                                        \
  |  |  246|  10.7k|        desttype _ltmp = 0;                      \
  |  |  247|  10.7k|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|  10.7k|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 10.7k]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|  10.7k|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 10.7k]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|  10.7k|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|  10.7k|            (source), (unsigned long)(length)) ; \
  |  |  264|  10.7k|        (dest) = _ltmp;                          \
  |  |  265|  10.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  424|  10.7k|            data,
  425|  10.7k|            DWARF_32BIT_SIZE,
  426|  10.7k|            error,
  427|  10.7k|            secend);
  428|  10.7k|        if (fval != 1 && fval != 0x1000000) {
  ------------------
  |  Branch (428:13): [True: 2.94k, False: 7.80k]
  |  Branch (428:26): [True: 0, False: 2.94k]
  ------------------
  429|       |            /*  Could be corrupted elf object. */
  430|      0|            if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (430:17): [True: 0, False: 0]
  ------------------
  431|      0|                free(secdata.dss_data);
  432|      0|                secdata.dss_data = 0;
  433|      0|            }
  434|      0|            _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  435|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  436|      0|        }
  437|       |
  438|  10.7k|        data = data + doas->as_entrysize;
  439|  16.7k|        for (i = 1 ; i < count ; ++i) {
  ------------------
  |  Branch (439:22): [True: 6.06k, False: 10.7k]
  ------------------
  440|  6.06k|            Dwarf_Unsigned  val = 0;
  441|       |
  442|  6.06k|            if ((data+DWARF_32BIT_SIZE) > secend) {
  ------------------
  |  |  135|  6.06k|#define DWARF_32BIT_SIZE 4
  ------------------
  |  Branch (442:17): [True: 0, False: 6.06k]
  ------------------
  443|       |                /* Duplicates the check in READ_UNALIGNED_CK
  444|       |                    so we can free allocated memory bere. */
  445|      0|                if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (445:21): [True: 0, False: 0]
  ------------------
  446|      0|                    free(secdata.dss_data);
  447|      0|                    secdata.dss_data = 0;
  448|      0|                }
  449|      0|                _dwarf_error(dbg,error,DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  450|      0|                return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  451|      0|            }
  452|  6.06k|            READ_UNALIGNED_CK(dbg,val,Dwarf_Unsigned,
  ------------------
  |  |  245|  6.06k|    do  {                                        \
  |  |  246|  6.06k|        desttype _ltmp = 0;                      \
  |  |  247|  6.06k|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|  6.06k|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 6.06k]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|  6.06k|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 6.06k]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|  6.06k|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|  6.06k|            (source), (unsigned long)(length)) ; \
  |  |  264|  6.06k|        (dest) = _ltmp;                          \
  |  |  265|  6.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  453|  6.06k|                data,
  454|  6.06k|                DWARF_32BIT_SIZE,
  455|  6.06k|                error,
  456|  6.06k|                secend);
  457|  6.06k|            if (val > section_count) {
  ------------------
  |  Branch (457:17): [True: 2.79k, False: 3.27k]
  ------------------
  458|       |                /*  Might be confused endianness by
  459|       |                    the compiler generating the SHT_GROUP.
  460|       |                    This is pretty horrible. */
  461|  2.79k|                Dwarf_Unsigned valr = 0;
  462|  2.79k|                _dwarf_memcpy_swap_bytes(&valr,&val,
  463|  2.79k|                    DWARF_32BIT_SIZE);
  ------------------
  |  |  135|  2.79k|#define DWARF_32BIT_SIZE 4
  ------------------
  464|  2.79k|                if (valr > section_count) {
  ------------------
  |  Branch (464:21): [True: 0, False: 2.79k]
  ------------------
  465|      0|                    if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (465:25): [True: 0, False: 0]
  ------------------
  466|      0|                        free(secdata.dss_data);
  467|      0|                        secdata.dss_data = 0;
  468|      0|                    }
  469|      0|                    _dwarf_error(dbg,error,
  470|      0|                        DW_DLE_GROUP_INTERNAL_ERROR);
  ------------------
  |  | 1365|      0|#define DW_DLE_GROUP_INTERNAL_ERROR            390
  ------------------
  471|      0|                    return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  472|      0|                }
  473|       |                /* Ok. Yes, ugly. */
  474|  2.79k|                val = valr;
  475|  2.79k|            }
  476|  6.06k|            {
  477|       |                /*  Ensure this group entry DWARF relevant before
  478|       |                    adding to group map */
  479|  6.06k|                struct Dwarf_Obj_Access_Section_a_s doasx;
  480|  6.06k|                int resx = DW_DLV_ERROR;
  ------------------
  |  |  123|  6.06k|#define DW_DLV_ERROR     1
  ------------------
  481|  6.06k|                int err = 0;
  482|  6.06k|                int is_rela = FALSE;
  ------------------
  |  |   40|  6.06k|#define FALSE 0
  ------------------
  483|       |
  484|  6.06k|                memset(&doasx,0,sizeof(doasx));
  485|  6.06k|                resx = obj->ai_methods->
  486|  6.06k|                    om_get_section_info(obj->ai_object,
  487|  6.06k|                    val,
  488|  6.06k|                    &doasx, &err);
  489|  6.06k|                if (resx == DW_DLV_NO_ENTRY){
  ------------------
  |  |  121|  6.06k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (489:21): [True: 0, False: 6.06k]
  ------------------
  490|       |                    /*  Should we really ignore this? */
  491|      0|                    continue;
  492|      0|                }
  493|  6.06k|                if (resx == DW_DLV_ERROR){
  ------------------
  |  |  123|  6.06k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (493:21): [True: 0, False: 6.06k]
  ------------------
  494|      0|                    if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (494:25): [True: 0, False: 0]
  ------------------
  495|      0|                        free(secdata.dss_data);
  496|      0|                        secdata.dss_data = 0;
  497|      0|                    }
  498|      0|                    _dwarf_error(dbg,error,err);
  499|      0|                    return resx;
  500|      0|                }
  501|  6.06k|                if (!this_section_dwarf_relevant(doasx.as_name,
  ------------------
  |  Branch (501:21): [True: 5.18k, False: 885]
  ------------------
  502|  6.06k|                    (int)doasx.as_type,&is_rela) ) {
  503|  5.18k|                    continue;
  504|  5.18k|                }
  505|    885|                data += DWARF_32BIT_SIZE;
  ------------------
  |  |  135|    885|#define DWARF_32BIT_SIZE 4
  ------------------
  506|    885|                *did_add_map = TRUE;
  ------------------
  |  |   37|    885|#define TRUE 1
  ------------------
  507|    885|                res = _dwarf_insert_in_group_map(dbg,
  508|    885|                    (unsigned)comdat_group_number,
  509|    885|                    (unsigned)val,
  510|    885|                    doasx.as_name,
  511|    885|                    error);
  512|    885|                if (res != DW_DLV_OK) {
  ------------------
  |  |  122|    885|#define DW_DLV_OK        0
  ------------------
  |  Branch (512:21): [True: 30, False: 855]
  ------------------
  513|     30|                    if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (513:25): [True: 0, False: 30]
  ------------------
  514|      0|                        free(secdata.dss_data);
  515|      0|                        secdata.dss_data = 0;
  516|      0|                    }
  517|     30|                    return res;
  518|     30|                }
  519|    885|            }
  520|    885|        }
  521|  10.7k|    }
  522|  10.7k|    if (secdata.dss_data_was_malloc) {
  ------------------
  |  Branch (522:9): [True: 0, False: 10.7k]
  ------------------
  523|      0|        free(secdata.dss_data);
  524|      0|        secdata.dss_data = 0;
  525|      0|    }
  526|  10.7k|    return DW_DLV_OK;
  ------------------
  |  |  122|  10.7k|#define DW_DLV_OK        0
  ------------------
  527|  10.7k|}
dwarf_init_finish.c:this_section_dwarf_relevant:
  304|  1.07M|{
  305|       |    /* A small helper function for _dwarf_setup(). */
  306|  1.07M|    if (_dwarf_startswith(scn_name, ".zdebug_") ||
  ------------------
  |  Branch (306:9): [True: 9.30k, False: 1.06M]
  ------------------
  307|  1.07M|        _dwarf_startswith(scn_name, ".debug_")) {
  ------------------
  |  Branch (307:9): [True: 509k, False: 556k]
  ------------------
  308|       |        /* standard debug */
  309|   518k|        return TRUE;
  ------------------
  |  |   37|   518k|#define TRUE 1
  ------------------
  310|   518k|    }
  311|   556k|    if (_dwarf_ignorethissection(scn_name)) {
  ------------------
  |  Branch (311:9): [True: 15.7k, False: 541k]
  ------------------
  312|  15.7k|        return FALSE;
  ------------------
  |  |   40|  15.7k|#define FALSE 0
  ------------------
  313|  15.7k|    }
  314|       |    /* Now check if a special section could be
  315|       |        in a section_group, but though seems unlikely. */
  316|   541k|    if (!strcmp(scn_name, ".eh_frame")) {
  ------------------
  |  Branch (316:9): [True: 3.55k, False: 537k]
  ------------------
  317|       |        /*  This is not really a group related file, but
  318|       |            it is harmless to consider it such. */
  319|  3.55k|        return TRUE;
  ------------------
  |  |   37|  3.55k|#define TRUE 1
  ------------------
  320|  3.55k|    }
  321|   537k|    if (!strcmp(scn_name, ".gnu_debuglink")) {
  ------------------
  |  Branch (321:9): [True: 6.56k, False: 531k]
  ------------------
  322|       |        /*  This is not a group or DWARF related file, but
  323|       |            it is useful for split dwarf. */
  324|  6.56k|        return TRUE;
  ------------------
  |  |   37|  6.56k|#define TRUE 1
  ------------------
  325|  6.56k|    }
  326|   531k|    if (!strcmp(scn_name, ".note.gnu.build-id")) {
  ------------------
  |  Branch (326:9): [True: 2.31k, False: 528k]
  ------------------
  327|       |        /*  This is not a group or DWARF related file, but
  328|       |            it is useful for split dwarf. */
  329|  2.31k|        return TRUE;
  ------------------
  |  |   37|  2.31k|#define TRUE 1
  ------------------
  330|  2.31k|    }
  331|   528k|    if (!strcmp(scn_name, ".gdb_index")) {
  ------------------
  |  Branch (331:9): [True: 1.10k, False: 527k]
  ------------------
  332|  1.10k|        return TRUE;
  ------------------
  |  |   37|  1.10k|#define TRUE 1
  ------------------
  333|  1.10k|    }
  334|   527k|    if (is_a_special_section_semi_dwarf(scn_name)) {
  ------------------
  |  Branch (334:9): [True: 6.97k, False: 520k]
  ------------------
  335|  6.97k|        return TRUE;
  ------------------
  |  |   37|  6.97k|#define TRUE 1
  ------------------
  336|  6.97k|    }
  337|   520k|    if (is_a_relx_section(scn_name,type,is_rela)) {
  ------------------
  |  Branch (337:9): [True: 64.1k, False: 456k]
  ------------------
  338|  64.1k|        return TRUE;
  ------------------
  |  |   37|  64.1k|#define TRUE 1
  ------------------
  339|  64.1k|    }
  340|       |    /*  All sorts of sections are of no interest: .text
  341|       |        .rel. and many others. */
  342|   456k|    return FALSE;
  ------------------
  |  |   40|   456k|#define FALSE 0
  ------------------
  343|   520k|}
dwarf_init_finish.c:is_a_relx_section:
  266|  1.16M|{
  267|  1.16M|    if (type == SHT_RELA) {
  ------------------
  |  |   78|  1.16M|#define SHT_RELA 4
  ------------------
  |  Branch (267:9): [True: 30.1k, False: 1.13M]
  ------------------
  268|  30.1k|        *is_rela = TRUE;
  ------------------
  |  |   37|  30.1k|#define TRUE 1
  ------------------
  269|  30.1k|        return TRUE;
  ------------------
  |  |   37|  30.1k|#define TRUE 1
  ------------------
  270|  30.1k|    }
  271|  1.13M|    if (_dwarf_startswith(scn_name,".rela.")) {
  ------------------
  |  Branch (271:9): [True: 28.8k, False: 1.11M]
  ------------------
  272|  28.8k|        *is_rela = TRUE;
  ------------------
  |  |   37|  28.8k|#define TRUE 1
  ------------------
  273|  28.8k|        return TRUE;
  ------------------
  |  |   37|  28.8k|#define TRUE 1
  ------------------
  274|  28.8k|    }
  275|  1.11M|    if (_dwarf_startswith(scn_name,".rel.")) {
  ------------------
  |  Branch (275:9): [True: 74.2k, False: 1.03M]
  ------------------
  276|  74.2k|        *is_rela = FALSE;
  ------------------
  |  |   40|  74.2k|#define FALSE 0
  ------------------
  277|  74.2k|        return TRUE;
  ------------------
  |  |   37|  74.2k|#define TRUE 1
  ------------------
  278|  74.2k|    }
  279|  1.03M|    if (type == SHT_REL) {
  ------------------
  |  |   81|  1.03M|#define SHT_REL 9
  ------------------
  |  Branch (279:9): [True: 21.9k, False: 1.01M]
  ------------------
  280|  21.9k|        *is_rela = FALSE;
  ------------------
  |  |   40|  21.9k|#define FALSE 0
  ------------------
  281|  21.9k|        return TRUE;
  ------------------
  |  |   37|  21.9k|#define TRUE 1
  ------------------
  282|  21.9k|    }
  283|  1.01M|    *is_rela = FALSE;
  ------------------
  |  |   40|  1.01M|#define FALSE 0
  ------------------
  284|  1.01M|    return FALSE;
  ------------------
  |  |   40|  1.01M|#define FALSE 0
  ------------------
  285|  1.03M|}
dwarf_init_finish.c:is_a_special_section_semi_dwarf:
  290|  1.05M|{
  291|  1.05M|    if (!strcmp(scn_name,".strtab") ||
  ------------------
  |  Branch (291:9): [True: 11.0k, False: 1.04M]
  ------------------
  292|  1.05M|        !strcmp(scn_name,".symtab")) {
  ------------------
  |  Branch (292:9): [True: 2.80k, False: 1.04M]
  ------------------
  293|  13.8k|        return TRUE;
  ------------------
  |  |   37|  13.8k|#define TRUE 1
  ------------------
  294|  13.8k|    }
  295|       |    /*  It's not one of these special sections referenced in
  296|       |        the test. */
  297|  1.04M|    return FALSE;
  ------------------
  |  |   40|  1.04M|#define FALSE 0
  ------------------
  298|  1.05M|}
dwarf_init_finish.c:is_section_name_known_already:
  213|   155k|{
  214|   155k|    unsigned i = 0;
  215|   183k|    for ( ; i < dbg->de_debug_sections_total_entries; ++i) {
  ------------------
  |  Branch (215:13): [True: 126k, False: 56.8k]
  ------------------
  216|   126k|        struct Dwarf_dbg_sect_s *section = &dbg->de_debug_sections[i];
  217|   126k|        if (!strcmp(scn_name, section->ds_name)) {
  ------------------
  |  Branch (217:13): [True: 98.3k, False: 28.6k]
  ------------------
  218|       |            /*  The caller will declare this a duplicate, an error. */
  219|  98.3k|            return DW_DLV_OK;
  ------------------
  |  |  122|  98.3k|#define DW_DLV_OK        0
  ------------------
  220|  98.3k|        }
  221|   126k|    }
  222|       |    /*  This is normal, we expect we've not accepted
  223|       |        scn_name already. */
  224|  56.8k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  56.8k|#define DW_DLV_NO_ENTRY -1
  ------------------
  225|   155k|}
dwarf_init_finish.c:get_basic_section_data:
  133|  9.80k|{
  134|       |    /*  There is an elf convention that section index 0  is reserved,
  135|       |        and that section is always empty.
  136|       |        Non-elf object formats must honor that by ensuring that
  137|       |        (when they assign numbers to 'sections' or
  138|       |        'section-like-things')
  139|       |        they never assign a real section section-number
  140|       |        0 to dss_index. */
  141|  9.80k|    if (secdata->dss_index != 0) {
  ------------------
  |  Branch (141:9): [True: 0, False: 9.80k]
  ------------------
  142|      0|        DWARF_DBG_ERROR(dbg, duperr, DW_DLV_ERROR);
  ------------------
  |  |   43|      0|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  143|      0|    }
  144|  9.80k|    if (doas->as_size == 0) {
  ------------------
  |  Branch (144:9): [True: 1.79k, False: 8.01k]
  ------------------
  145|       |        /*  As of 2018 it seems impossible to detect
  146|       |            (via dwarfdump) whether emptyerr has any
  147|       |            practical effect, whether TRUE or FALSE.  */
  148|  1.79k|        if (emptyerr == 0 ) {
  ------------------
  |  Branch (148:13): [True: 1.73k, False: 63]
  ------------------
  149|       |            /*  Allow empty section. */
  150|  1.73k|            return DW_DLV_OK;
  ------------------
  |  |  122|  1.73k|#define DW_DLV_OK        0
  ------------------
  151|  1.73k|        }
  152|       |        /* Know no reason to allow section */
  153|  1.79k|        DWARF_DBG_ERROR(dbg, emptyerr, DW_DLV_ERROR);
  ------------------
  |  |   43|     63|    _dwarf_error((dbg), error, (errval)); return(retval);
  ------------------
  154|      0|    }
  155|  8.01k|    secdata->dss_index = section_index;
  156|  8.01k|    secdata->dss_size  = doas->as_size;
  157|  8.01k|    secdata->dss_group_number = group_number;
  158|  8.01k|    secdata->dss_addr  = doas->as_addr;
  159|  8.01k|    secdata->dss_link  = doas->as_link;
  160|  8.01k|    secdata->dss_flags = doas->as_flags;
  161|  8.01k|    if (secdata->dss_flags & SHF_COMPRESSED) {
  ------------------
  |  |   91|  8.01k|#define SHF_COMPRESSED (1 << 11)
  ------------------
  |  Branch (161:9): [True: 822, False: 7.18k]
  ------------------
  162|    822|        secdata->dss_shf_compressed = TRUE;
  ------------------
  |  |   37|    822|#define TRUE 1
  ------------------
  163|    822|    }
  164|  8.01k|    secdata->dss_entrysize = doas->as_entrysize;
  165|  8.01k|    secdata->dss_addralign = doas->as_addralign;
  166|  8.01k|    return DW_DLV_OK;
  ------------------
  |  |  122|  8.01k|#define DW_DLV_OK        0
  ------------------
  167|  9.80k|}
dwarf_init_finish.c:add_relx_data_to_secdata:
  174|  1.86k|{
  175|  1.86k|    secdata->dss_reloc_index = section_index;
  176|  1.86k|    secdata->dss_reloc_size = doas->as_size;
  177|  1.86k|    secdata->dss_reloc_entrysize = doas->as_entrysize;
  178|  1.86k|    secdata->dss_reloc_addr = doas->as_addr;
  179|  1.86k|    secdata->dss_reloc_symtab = doas->as_link;
  180|  1.86k|    secdata->dss_reloc_link = doas->as_link;
  181|  1.86k|    secdata->dss_is_rela = is_rela;
  182|  1.86k|}
dwarf_init_finish.c:load_debugfission_tables:
  954|  4.13k|{
  955|  4.13k|    int i = 0;
  956|  4.13k|    if (dbg->de_debug_cu_index.dss_size ==0 &&
  ------------------
  |  Branch (956:9): [True: 3.08k, False: 1.04k]
  ------------------
  957|  4.13k|        dbg->de_debug_tu_index.dss_size ==0) {
  ------------------
  |  Branch (957:9): [True: 2.46k, False: 621]
  ------------------
  958|       |        /*  This is the normal case.
  959|       |            No debug fission. Not a .dwp object. */
  960|  2.46k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  2.46k|#define DW_DLV_NO_ENTRY -1
  ------------------
  961|  2.46k|    }
  962|       |
  963|  2.55k|    for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (963:17): [True: 2.45k, False: 96]
  ------------------
  964|  2.45k|        Dwarf_Xu_Index_Header xuptr = 0;
  965|  2.45k|        struct Dwarf_Section_s* dwsect = 0;
  966|  2.45k|        Dwarf_Unsigned version = 0;
  967|  2.45k|        Dwarf_Unsigned number_of_cols /* L */ = 0;
  968|  2.45k|        Dwarf_Unsigned number_of_CUs /* N */ = 0;
  969|  2.45k|        Dwarf_Unsigned number_of_slots /* M */ = 0;
  970|  2.45k|        const char *secname = 0;
  971|  2.45k|        int res = 0;
  972|  2.45k|        const char *type = 0;
  973|       |
  974|  2.45k|        if (i == 0) {
  ------------------
  |  Branch (974:13): [True: 1.66k, False: 792]
  ------------------
  975|  1.66k|            dwsect = &dbg->de_debug_cu_index;
  976|  1.66k|            type = "cu";
  977|  1.66k|        } else {
  978|    792|            dwsect = &dbg->de_debug_tu_index;
  979|    792|            type = "tu";
  980|    792|        }
  981|  2.45k|        if ( !dwsect->dss_size ) {
  ------------------
  |  Branch (981:14): [True: 654, False: 1.80k]
  ------------------
  982|    654|            continue;
  983|    654|        }
  984|  1.80k|        res = dwarf_get_xu_index_header(dbg,type,
  985|  1.80k|            &xuptr,&version,&number_of_cols,
  986|  1.80k|            &number_of_CUs,&number_of_slots,
  987|  1.80k|            &secname,error);
  988|  1.80k|        if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |  121|  1.80k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (988:13): [True: 0, False: 1.80k]
  ------------------
  989|      0|            continue;
  990|      0|        }
  991|  1.80k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  1.80k|#define DW_DLV_OK        0
  ------------------
  |  Branch (991:13): [True: 1.56k, False: 234]
  ------------------
  992|  1.56k|            return res;
  993|  1.56k|        }
  994|    234|        if (i == 0) {
  ------------------
  |  Branch (994:13): [True: 171, False: 63]
  ------------------
  995|    171|            dbg->de_cu_hashindex_data = xuptr;
  996|    171|        } else {
  997|     63|            dbg->de_tu_hashindex_data = xuptr;
  998|     63|        }
  999|    234|    }
 1000|     96|    return DW_DLV_OK;
  ------------------
  |  |  122|     96|#define DW_DLV_OK        0
  ------------------
 1001|  1.66k|}

_dwarf_dealloc_loclists_context:
  665|  10.6k|{
  666|  10.6k|    Dwarf_Unsigned i = 0;
  667|  10.6k|    Dwarf_Loclists_Context * loccon = 0;
  668|       |
  669|  10.6k|    if (!dbg->de_loclists_context) {
  ------------------
  |  Branch (669:9): [True: 10.6k, False: 0]
  ------------------
  670|  10.6k|        return;
  671|  10.6k|    }
  672|      0|    loccon = dbg->de_loclists_context;
  673|      0|    for ( ; i < dbg->de_loclists_context_count; ++i) {
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|        Dwarf_Loclists_Context con = loccon[i];
  675|      0|        free_loclists_context(con);
  676|      0|        loccon[i] = 0;
  677|      0|    }
  678|      0|    free(dbg->de_loclists_context);
  679|      0|    dbg->de_loclists_context = 0;
  680|      0|    dbg->de_loclists_context_count = 0;
  681|      0|}

_dwarf_destruct_macho_access:
  299|  3.30k|{
  300|  3.30k|    dwarf_macho_object_access_internals_t *mp = 0;
  301|       |
  302|  3.30k|    if (!aip) {
  ------------------
  |  Branch (302:9): [True: 0, False: 3.30k]
  ------------------
  303|      0|        return;
  304|      0|    }
  305|  3.30k|    mp = (dwarf_macho_object_access_internals_t *)aip->ai_object;
  306|  3.30k|    _dwarf_destruct_macho_internals(mp);
  307|  3.30k|    aip->ai_object = 0;
  308|  3.30k|    free(aip);
  309|  3.30k|    return;
  310|  3.30k|}
_dwarf_load_macho_header:
  399|  7.39k|{
  400|  7.39k|    int res = 0;
  401|       |
  402|  7.39k|    if (mfp->mo_offsetsize == 32) {
  ------------------
  |  Branch (402:9): [True: 6.02k, False: 1.37k]
  ------------------
  403|  6.02k|        res = load_macho_header32(mfp,errcode);
  404|  6.02k|    } else if (mfp->mo_offsetsize == 64) {
  ------------------
  |  Branch (404:16): [True: 1.37k, False: 0]
  ------------------
  405|  1.37k|        res = load_macho_header64(mfp,errcode);
  406|  1.37k|    } else {
  407|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  408|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  409|      0|    }
  410|  7.39k|    return res;
  411|  7.39k|}
_dwarf_load_macho_commands:
  802|  6.60k|{
  803|  6.60k|    Dwarf_Unsigned cmdi = 0;
  804|  6.60k|    Dwarf_Unsigned curoff = mfp->mo_command_start_offset;
  805|  6.60k|    struct load_command mc;
  806|  6.60k|    struct generic_macho_command *mcp = 0;
  807|  6.60k|    unsigned segment_command_count = 0;
  808|  6.60k|    int res = 0;
  809|  6.60k|    Dwarf_Unsigned inner = mfp->mo_inner_offset;
  810|       |
  811|  6.60k|    if (mfp->mo_command_count >= mfp->mo_filesize) {
  ------------------
  |  Branch (811:9): [True: 0, False: 6.60k]
  ------------------
  812|       |        /* corrupt object. */
  813|      0|        *errcode = DW_DLE_MACH_O_SEGOFFSET_BAD;
  ------------------
  |  | 1391|      0|#define DW_DLE_MACH_O_SEGOFFSET_BAD            416
  ------------------
  814|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  815|      0|    }
  816|  6.60k|    if ((curoff + mfp->mo_command_count * sizeof(mc)) >=
  ------------------
  |  Branch (816:9): [True: 168, False: 6.43k]
  ------------------
  817|  6.60k|        mfp->mo_filesize) {
  818|       |        /* corrupt object. */
  819|    168|        *errcode = DW_DLE_MACH_O_SEGOFFSET_BAD;
  ------------------
  |  | 1391|    168|#define DW_DLE_MACH_O_SEGOFFSET_BAD            416
  ------------------
  820|    168|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    168|#define DW_DLV_ERROR      1
  ------------------
  821|    168|    }
  822|       |
  823|  6.43k|    mfp->mo_commands = (struct generic_macho_command *) calloc(
  824|  6.43k|        mfp->mo_command_count,sizeof(struct generic_macho_command));
  825|  6.43k|    if (!mfp->mo_commands) {
  ------------------
  |  Branch (825:9): [True: 0, False: 6.43k]
  ------------------
  826|       |        /* out of memory */
  827|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  828|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  829|      0|    }
  830|  6.43k|    mcp = mfp->mo_commands;
  831|  36.8k|    for ( ; cmdi < mfp->mo_header.ncmds; ++cmdi,++mcp ) {
  ------------------
  |  Branch (831:13): [True: 30.6k, False: 6.21k]
  ------------------
  832|  30.6k|        res = RRMOA(mfp->mo_fd, &mc,
  ------------------
  |  |   65|  30.6k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  30.6k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  833|  30.6k|            inner+curoff, sizeof(mc),
  834|  30.6k|            inner+mfp->mo_filesize, errcode);
  835|  30.6k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  30.6k|#define DW_DLV_OK         0
  ------------------
  |  Branch (835:13): [True: 15, False: 30.6k]
  ------------------
  836|     15|            free(mfp->mo_commands);
  837|     15|            mfp->mo_commands = 0;
  838|     15|            return res;
  839|     15|        }
  840|  30.6k|        ASNAR(mfp->mo_copy_word,mcp->cmd,mc.cmd);
  ------------------
  |  |   57|  30.6k|    do {                                        \
  |  |   58|  30.6k|        (t) = 0;                                \
  |  |   59|  30.6k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  30.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  841|  30.6k|        ASNAR(mfp->mo_copy_word,mcp->cmdsize,mc.cmdsize);
  ------------------
  |  |   57|  30.6k|    do {                                        \
  |  |   58|  30.6k|        (t) = 0;                                \
  |  |   59|  30.6k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  30.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  842|  30.6k|        mcp->offset_this_command = curoff;
  843|  30.6k|        curoff += mcp->cmdsize;
  844|  30.6k|        if (mcp->cmdsize > mfp->mo_filesize ||
  ------------------
  |  Branch (844:13): [True: 129, False: 30.5k]
  ------------------
  845|  30.6k|            curoff > mfp->mo_filesize) {
  ------------------
  |  Branch (845:13): [True: 72, False: 30.4k]
  ------------------
  846|       |            /* corrupt object */
  847|    201|            free(mfp->mo_commands);
  848|    201|            mfp->mo_commands = 0;
  849|    201|            *errcode = DW_DLE_FILE_OFFSET_BAD;
  ------------------
  |  | 1392|    201|#define DW_DLE_FILE_OFFSET_BAD                 417
  ------------------
  850|    201|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    201|#define DW_DLV_ERROR      1
  ------------------
  851|    201|        }
  852|  30.4k|        if (mcp->cmd == LC_SEGMENT || mcp->cmd == LC_SEGMENT_64) {
  ------------------
  |  |  360|  60.9k|#define LC_SEGMENT    0x1    /* segment of this file to be mapped */
  ------------------
                      if (mcp->cmd == LC_SEGMENT || mcp->cmd == LC_SEGMENT_64) {
  ------------------
  |  |  407|  14.3k|#define    LC_SEGMENT_64    0x19
  ------------------
  |  Branch (852:13): [True: 16.0k, False: 14.3k]
  |  Branch (852:39): [True: 5.73k, False: 8.62k]
  ------------------
  853|  21.8k|            segment_command_count++;
  854|  21.8k|        }
  855|  30.4k|    }
  856|  6.21k|    mfp->mo_segment_count = segment_command_count;
  857|  6.21k|    res = _dwarf_macho_load_segment_commands(mfp,errcode);
  858|  6.21k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  6.21k|#define DW_DLV_OK         0
  ------------------
  |  Branch (858:9): [True: 1.58k, False: 4.63k]
  ------------------
  859|  1.58k|        free(mfp->mo_commands);
  860|  1.58k|        mfp->mo_commands = 0;
  861|  1.58k|        return res;
  862|  1.58k|    }
  863|  4.63k|    res = _dwarf_macho_load_dwarf_sections(mfp,errcode);
  864|  4.63k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  4.63k|#define DW_DLV_OK         0
  ------------------
  |  Branch (864:9): [True: 1.32k, False: 3.30k]
  ------------------
  865|  1.32k|        free(mfp->mo_commands);
  866|  1.32k|        mfp->mo_commands = 0;
  867|  1.32k|    }
  868|  4.63k|    return res;
  869|  6.21k|}
_dwarf_macho_setup:
  882|  9.05k|{
  883|  9.05k|    Dwarf_Obj_Access_Interface_a *binary_interface = 0;
  884|  9.05k|    dwarf_macho_object_access_internals_t *intfc = 0;
  885|  9.05k|    int res = DW_DLV_OK;
  ------------------
  |  |   59|  9.05k|#define DW_DLV_OK         0
  ------------------
  886|  9.05k|    int localerrnum = 0;
  887|  9.05k|    unsigned universalbinary_count = 0;
  888|       |
  889|  9.05k|    res = _dwarf_macho_object_access_init(
  890|  9.05k|        fd,
  891|  9.05k|        universalnumber,
  892|  9.05k|        ftype,endian,offsetsize,
  893|  9.05k|        &universalbinary_count,
  894|  9.05k|        filesize,
  895|  9.05k|        &binary_interface,
  896|  9.05k|        &localerrnum);
  897|  9.05k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  9.05k|#define DW_DLV_OK         0
  ------------------
  |  Branch (897:9): [True: 5.74k, False: 3.30k]
  ------------------
  898|  5.74k|        if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   58|  5.74k|#define DW_DLV_NO_ENTRY  -1
  ------------------
  |  Branch (898:13): [True: 0, False: 5.74k]
  ------------------
  899|      0|            return res;
  900|      0|        }
  901|  5.74k|        _dwarf_error(NULL, error, localerrnum);
  902|  5.74k|        return DW_DLV_ERROR;
  ------------------
  |  |   60|  5.74k|#define DW_DLV_ERROR      1
  ------------------
  903|  5.74k|    }
  904|       |    /*  allocates and initializes Dwarf_Debug,
  905|       |        generic code */
  906|  3.30k|    res = dwarf_object_init_b(binary_interface, errhand, errarg,
  907|  3.30k|        groupnumber, dbg, error);
  908|  3.30k|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|  3.30k|#define DW_DLV_OK         0
  ------------------
  |  Branch (908:9): [True: 3.17k, False: 138]
  ------------------
  909|  3.17k|        _dwarf_destruct_macho_access(binary_interface);
  910|  3.17k|        return res;
  911|  3.17k|    }
  912|    138|    intfc = binary_interface->ai_object;
  913|    138|    intfc->mo_path = strdup(true_path);
  914|    138|    (*dbg)->de_obj_flags = intfc->mo_flags;
  915|    138|    (*dbg)->de_obj_machine = intfc->mo_machine;
  916|    138|    (*dbg)->de_universalbinary_index = universalnumber;
  917|    138|    (*dbg)->de_universalbinary_count = universalbinary_count;
  918|    138|    return res;
  919|  3.30k|}
_dwarf_dealloc_universal_head:
 1441|    243|{
 1442|    243|    if (!dw_head) {
  ------------------
  |  Branch (1442:9): [True: 0, False: 243]
  ------------------
 1443|      0|        return;
 1444|      0|    }
 1445|    243|    free(dw_head->au_arches);
 1446|    243|    dw_head->au_arches = 0;
 1447|    243|    free(dw_head);
 1448|    243|}
dwarf_machoread.c:_dwarf_destruct_macho_internals:
  264|  9.05k|{
  265|  9.05k|    Dwarf_Unsigned i = 0;
  266|       |
  267|  9.05k|    if (mp->mo_destruct_close_fd) {
  ------------------
  |  Branch (267:9): [True: 0, False: 9.05k]
  ------------------
  268|      0|        _dwarf_closer(mp->mo_fd);
  269|      0|        mp->mo_fd = -1;
  270|      0|    }
  271|  9.05k|    if (mp->mo_commands){
  ------------------
  |  Branch (271:9): [True: 3.30k, False: 5.74k]
  ------------------
  272|  3.30k|        free(mp->mo_commands);
  273|  3.30k|        mp->mo_commands = 0;
  274|  3.30k|    }
  275|  9.05k|    if (mp->mo_segment_commands){
  ------------------
  |  Branch (275:9): [True: 4.35k, False: 4.69k]
  ------------------
  276|  4.35k|        free(mp->mo_segment_commands);
  277|  4.35k|        mp->mo_segment_commands = 0;
  278|  4.35k|    }
  279|  9.05k|    free((char *)mp->mo_path);
  280|  9.05k|    if (mp->mo_dwarf_sections) {
  ------------------
  |  Branch (280:9): [True: 4.10k, False: 4.95k]
  ------------------
  281|  4.10k|        struct generic_macho_section *sp = 0;
  282|       |
  283|  4.10k|        sp = mp->mo_dwarf_sections;
  284|  20.5M|        for ( i=0; i < mp->mo_dwarf_sectioncount; ++i,++sp) {
  ------------------
  |  Branch (284:20): [True: 20.5M, False: 4.10k]
  ------------------
  285|  20.5M|            if (sp->loaded_data) {
  ------------------
  |  Branch (285:17): [True: 94, False: 20.5M]
  ------------------
  286|     94|                free(sp->loaded_data);
  287|     94|                sp->loaded_data = 0;
  288|     94|            }
  289|  20.5M|        }
  290|  4.10k|        free(mp->mo_dwarf_sections);
  291|  4.10k|        mp->mo_dwarf_sections = 0;
  292|  4.10k|    }
  293|  9.05k|    free(mp);
  294|  9.05k|    return;
  295|  9.05k|}
dwarf_machoread.c:load_macho_header32:
  316|  6.02k|{
  317|  6.02k|    struct mach_header mh32;
  318|  6.02k|    int res = 0;
  319|  6.02k|    Dwarf_Unsigned inner = mfp->mo_inner_offset;
  320|       |
  321|  6.02k|    if (sizeof(mh32) > mfp->mo_filesize) {
  ------------------
  |  Branch (321:9): [True: 27, False: 5.99k]
  ------------------
  322|     27|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     27|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  323|     27|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     27|#define DW_DLV_ERROR      1
  ------------------
  324|     27|    }
  325|  5.99k|    res = RRMOA(mfp->mo_fd, &mh32, inner, sizeof(mh32),
  ------------------
  |  |   65|  5.99k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  5.99k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  326|  5.99k|        (inner+mfp->mo_filesize), errcode);
  327|  5.99k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  5.99k|#define DW_DLV_OK         0
  ------------------
  |  Branch (327:9): [True: 0, False: 5.99k]
  ------------------
  328|      0|        return res;
  329|      0|    }
  330|       |    /* Do not adjust endianness of magic, leave as-is. */
  331|  5.99k|    ASNAR(memcpy,mfp->mo_header.magic,mh32.magic);
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  332|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.cputype,mh32.cputype);
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  333|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.cpusubtype,
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  334|  5.99k|        mh32.cpusubtype);
  335|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.filetype,mh32.filetype);
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  336|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.ncmds,mh32.ncmds);
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  337|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.sizeofcmds,
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  338|  5.99k|        mh32.sizeofcmds);
  339|  5.99k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.flags,mh32.flags);
  ------------------
  |  |   57|  5.99k|    do {                                        \
  |  |   58|  5.99k|        (t) = 0;                                \
  |  |   59|  5.99k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  5.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  340|  5.99k|    mfp->mo_header.reserved = 0;
  341|  5.99k|    mfp->mo_command_count = (unsigned int)mfp->mo_header.ncmds;
  342|  5.99k|    if (mfp->mo_command_count >= mfp->mo_filesize ||
  ------------------
  |  Branch (342:9): [True: 138, False: 5.85k]
  ------------------
  343|  5.99k|        mfp->mo_header.sizeofcmds >= mfp->mo_filesize ||
  ------------------
  |  Branch (343:9): [True: 153, False: 5.70k]
  ------------------
  344|  5.99k|        mfp->mo_command_count >= mfp->mo_header.sizeofcmds) {
  ------------------
  |  Branch (344:9): [True: 27, False: 5.67k]
  ------------------
  345|    318|        *errcode = DW_DLE_MACHO_CORRUPT_HEADER;
  ------------------
  |  | 1461|    318|#define DW_DLE_MACHO_CORRUPT_HEADER            486
  ------------------
  346|    318|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    318|#define DW_DLV_ERROR      1
  ------------------
  347|    318|    }
  348|  5.67k|    mfp->mo_machine = mfp->mo_header.cputype;
  349|  5.67k|    mfp->mo_flags = mfp->mo_header.flags;
  350|  5.67k|    mfp->mo_command_start_offset = sizeof(mh32);
  351|  5.67k|    return DW_DLV_OK;
  ------------------
  |  |   59|  5.67k|#define DW_DLV_OK         0
  ------------------
  352|  5.99k|}
dwarf_machoread.c:load_macho_header64:
  358|  1.37k|{
  359|  1.37k|    struct mach_header_64 mh64;
  360|  1.37k|    int res = 0;
  361|  1.37k|    Dwarf_Unsigned inner = mfp->mo_inner_offset;
  362|       |
  363|  1.37k|    if (sizeof(mh64) > mfp->mo_filesize) {
  ------------------
  |  Branch (363:9): [True: 84, False: 1.28k]
  ------------------
  364|     84|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     84|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  365|     84|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     84|#define DW_DLV_ERROR      1
  ------------------
  366|     84|    }
  367|  1.28k|    res = RRMOA(mfp->mo_fd, &mh64, inner, sizeof(mh64),
  ------------------
  |  |   65|  1.28k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  1.28k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  368|  1.28k|        (inner+mfp->mo_filesize), errcode);
  369|  1.28k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.28k|#define DW_DLV_OK         0
  ------------------
  |  Branch (369:9): [True: 0, False: 1.28k]
  ------------------
  370|      0|        return res;
  371|      0|    }
  372|       |    /* Do not adjust endianness of magic, leave as-is. */
  373|  1.28k|    ASNAR(memcpy,mfp->mo_header.magic,mh64.magic);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  374|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.cputype,mh64.cputype);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  375|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.cpusubtype,
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  376|  1.28k|        mh64.cpusubtype);
  377|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.filetype,mh64.filetype);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  378|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.ncmds,mh64.ncmds);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  379|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.sizeofcmds,
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  380|  1.28k|        mh64.sizeofcmds);
  381|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.flags,mh64.flags);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  382|  1.28k|    ASNAR(mfp->mo_copy_word,mfp->mo_header.reserved,mh64.reserved);
  ------------------
  |  |   57|  1.28k|    do {                                        \
  |  |   58|  1.28k|        (t) = 0;                                \
  |  |   59|  1.28k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  383|  1.28k|    mfp->mo_command_count = (unsigned int)mfp->mo_header.ncmds;
  384|  1.28k|    if (mfp->mo_command_count >= mfp->mo_filesize ||
  ------------------
  |  Branch (384:9): [True: 144, False: 1.14k]
  ------------------
  385|  1.28k|        mfp->mo_header.sizeofcmds >= mfp->mo_filesize ||
  ------------------
  |  Branch (385:9): [True: 150, False: 993]
  ------------------
  386|  1.28k|        mfp->mo_command_count >= mfp->mo_header.sizeofcmds) {
  ------------------
  |  Branch (386:9): [True: 69, False: 924]
  ------------------
  387|    363|        *errcode = DW_DLE_MACHO_CORRUPT_HEADER;
  ------------------
  |  | 1461|    363|#define DW_DLE_MACHO_CORRUPT_HEADER            486
  ------------------
  388|    363|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    363|#define DW_DLV_ERROR      1
  ------------------
  389|    363|    }
  390|    924|    mfp->mo_machine = mfp->mo_header.cputype;
  391|    924|    mfp->mo_flags = mfp->mo_header.flags;
  392|    924|    mfp->mo_command_start_offset = sizeof(mh64);
  393|    924|    return DW_DLV_OK;
  ------------------
  |  |   59|    924|#define DW_DLV_OK         0
  ------------------
  394|  1.28k|}
dwarf_machoread.c:_dwarf_macho_load_segment_commands:
  532|  6.21k|{
  533|  6.21k|    Dwarf_Unsigned i = 0;
  534|  6.21k|    struct generic_macho_command *mmp = 0;
  535|  6.21k|    struct generic_macho_segment_command *msp = 0;
  536|       |
  537|  6.21k|    if (mfp->mo_segment_count < 1) {
  ------------------
  |  Branch (537:9): [True: 279, False: 5.94k]
  ------------------
  538|    279|        return DW_DLV_OK;
  ------------------
  |  |   59|    279|#define DW_DLV_OK         0
  ------------------
  539|    279|    }
  540|  5.94k|    mfp->mo_segment_commands =
  541|  5.94k|        (struct generic_macho_segment_command *)
  542|  5.94k|        calloc(sizeof(struct generic_macho_segment_command),
  543|  5.94k|        (size_t)mfp->mo_segment_count);
  544|  5.94k|    if (!mfp->mo_segment_commands) {
  ------------------
  |  Branch (544:9): [True: 0, False: 5.94k]
  ------------------
  545|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  546|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  547|      0|    }
  548|       |
  549|  5.94k|    mmp = mfp->mo_commands;
  550|  5.94k|    msp = mfp->mo_segment_commands;
  551|  27.7k|    for (i = 0 ; i < mfp->mo_command_count; ++i,++mmp) {
  ------------------
  |  Branch (551:18): [True: 23.3k, False: 4.35k]
  ------------------
  552|  23.3k|        unsigned cmd = (unsigned)mmp->cmd;
  553|  23.3k|        int res = 0;
  554|       |
  555|  23.3k|        if (cmd == LC_SEGMENT) {
  ------------------
  |  |  360|  23.3k|#define LC_SEGMENT    0x1    /* segment of this file to be mapped */
  ------------------
  |  Branch (555:13): [True: 15.2k, False: 8.16k]
  ------------------
  556|  15.2k|            res = load_segment_command_content32(mfp,mmp,msp,
  557|  15.2k|                i,errcode);
  558|  15.2k|            ++msp;
  559|  15.2k|        } else if (cmd == LC_SEGMENT_64) {
  ------------------
  |  |  407|  8.16k|#define    LC_SEGMENT_64    0x19
  ------------------
  |  Branch (559:20): [True: 3.80k, False: 4.35k]
  ------------------
  560|  3.80k|            res = load_segment_command_content64(mfp,mmp,msp,
  561|  3.80k|                i,errcode);
  562|  3.80k|            ++msp;
  563|  4.35k|        } else { /* fall through, not a command of interest */ }
  564|  23.3k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  23.3k|#define DW_DLV_OK         0
  ------------------
  |  Branch (564:13): [True: 1.58k, False: 21.8k]
  ------------------
  565|  1.58k|            free(mfp->mo_segment_commands);
  566|  1.58k|            mfp->mo_segment_commands = 0;
  567|  1.58k|            return res;
  568|  1.58k|        }
  569|  23.3k|    }
  570|  4.35k|    return DW_DLV_OK;
  ------------------
  |  |   59|  4.35k|#define DW_DLV_OK         0
  ------------------
  571|  5.94k|}
dwarf_machoread.c:load_segment_command_content32:
  420|  15.2k|{
  421|  15.2k|    struct segment_command sc;
  422|  15.2k|    int res = 0;
  423|  15.2k|    Dwarf_Unsigned filesize = mfp->mo_filesize;
  424|  15.2k|    Dwarf_Unsigned segoffset = mmp->offset_this_command;
  425|  15.2k|    Dwarf_Unsigned afterseghdr = segoffset + sizeof(sc);
  426|  15.2k|    Dwarf_Unsigned inner = mfp->mo_inner_offset;
  427|       |
  428|  15.2k|    if (segoffset > filesize ||
  ------------------
  |  Branch (428:9): [True: 0, False: 15.2k]
  ------------------
  429|  15.2k|        mmp->cmdsize > filesize ||
  ------------------
  |  Branch (429:9): [True: 0, False: 15.2k]
  ------------------
  430|  15.2k|        (mmp->cmdsize + segoffset) > filesize ) {
  ------------------
  |  Branch (430:9): [True: 0, False: 15.2k]
  ------------------
  431|      0|        *errcode = DW_DLE_MACH_O_SEGOFFSET_BAD;
  ------------------
  |  | 1391|      0|#define DW_DLE_MACH_O_SEGOFFSET_BAD            416
  ------------------
  432|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  433|      0|    }
  434|  15.2k|    res = RRMOA(mfp->mo_fd, &sc, (inner+segoffset),
  ------------------
  |  |   65|  15.2k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  15.2k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  435|  15.2k|        sizeof(sc), (inner+filesize), errcode);
  436|  15.2k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  15.2k|#define DW_DLV_OK         0
  ------------------
  |  Branch (436:9): [True: 117, False: 15.1k]
  ------------------
  437|    117|        return res;
  438|    117|    }
  439|  15.1k|    ASNAR(mfp->mo_copy_word,msp->cmd,sc.cmd);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  440|  15.1k|    ASNAR(mfp->mo_copy_word,msp->cmdsize,sc.cmdsize);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  441|  15.1k|    _dwarf_safe_strcpy(msp->segname,
  442|  15.1k|        sizeof(msp->segname),
  443|  15.1k|        sc.segname,sizeof(sc.segname));
  444|  15.1k|    ASNAR(mfp->mo_copy_word,msp->vmaddr,sc.vmaddr);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|  15.1k|    ASNAR(mfp->mo_copy_word,msp->vmsize,sc.vmsize);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  446|  15.1k|    ASNAR(mfp->mo_copy_word,msp->fileoff,sc.fileoff);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  447|  15.1k|    ASNAR(mfp->mo_copy_word,msp->filesize,sc.filesize);
  ------------------
  |  |   57|  15.1k|    do {                                        \
  |  |   58|  15.1k|        (t) = 0;                                \
  |  |   59|  15.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|  15.1k|    if (msp->fileoff > mfp->mo_filesize ||
  ------------------
  |  Branch (448:9): [True: 156, False: 14.9k]
  ------------------
  449|  15.1k|        msp->filesize > mfp->mo_filesize) {
  ------------------
  |  Branch (449:9): [True: 135, False: 14.8k]
  ------------------
  450|       |        /* corrupt */
  451|    291|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|    291|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  452|    291|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    291|#define DW_DLV_ERROR      1
  ------------------
  453|    291|    }
  454|  14.8k|    if ((msp->fileoff+msp->filesize ) > filesize) {
  ------------------
  |  Branch (454:9): [True: 75, False: 14.7k]
  ------------------
  455|       |        /* corrupt */
  456|     75|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|     75|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  457|     75|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     75|#define DW_DLV_ERROR      1
  ------------------
  458|     75|    }
  459|  14.7k|    ASNAR(mfp->mo_copy_word,msp->maxprot,sc.maxprot);
  ------------------
  |  |   57|  14.7k|    do {                                        \
  |  |   58|  14.7k|        (t) = 0;                                \
  |  |   59|  14.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  14.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  460|  14.7k|    ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot);
  ------------------
  |  |   57|  14.7k|    do {                                        \
  |  |   58|  14.7k|        (t) = 0;                                \
  |  |   59|  14.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  14.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  461|  14.7k|    ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects);
  ------------------
  |  |   57|  14.7k|    do {                                        \
  |  |   58|  14.7k|        (t) = 0;                                \
  |  |   59|  14.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  14.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  462|  14.7k|    if (msp->nsects >= mfp->mo_filesize) {
  ------------------
  |  Branch (462:9): [True: 156, False: 14.5k]
  ------------------
  463|    156|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|    156|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  464|    156|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    156|#define DW_DLV_ERROR      1
  ------------------
  465|    156|    }
  466|  14.5k|    ASNAR(mfp->mo_copy_word,msp->flags,sc.flags);
  ------------------
  |  |   57|  14.5k|    do {                                        \
  |  |   58|  14.5k|        (t) = 0;                                \
  |  |   59|  14.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  14.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|  14.5k|    msp->macho_command_index = mmpindex;
  468|  14.5k|    msp->sectionsoffset = afterseghdr;
  469|  14.5k|    return DW_DLV_OK;
  ------------------
  |  |   59|  14.5k|#define DW_DLV_OK         0
  ------------------
  470|  14.7k|}
dwarf_machoread.c:load_segment_command_content64:
  478|  3.80k|{
  479|  3.80k|    struct segment_command_64 sc;
  480|  3.80k|    int res = 0;
  481|  3.80k|    Dwarf_Unsigned filesize = mfp->mo_filesize;
  482|  3.80k|    Dwarf_Unsigned segoffset = mmp->offset_this_command;
  483|  3.80k|    Dwarf_Unsigned afterseghdr = segoffset + sizeof(sc);
  484|  3.80k|    Dwarf_Unsigned inner = mfp->mo_inner_offset;
  485|       |
  486|  3.80k|    if (segoffset > filesize ||
  ------------------
  |  Branch (486:9): [True: 0, False: 3.80k]
  ------------------
  487|  3.80k|        mmp->cmdsize > filesize ||
  ------------------
  |  Branch (487:9): [True: 0, False: 3.80k]
  ------------------
  488|  3.80k|        (mmp->cmdsize + segoffset) > filesize ) {
  ------------------
  |  Branch (488:9): [True: 0, False: 3.80k]
  ------------------
  489|      0|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|      0|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  490|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  491|      0|    }
  492|  3.80k|    res = RRMOA(mfp->mo_fd,&sc,inner+segoffset,
  ------------------
  |  |   65|  3.80k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  3.80k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  493|  3.80k|        sizeof(sc), inner+filesize, errcode);
  494|  3.80k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  3.80k|#define DW_DLV_OK         0
  ------------------
  |  Branch (494:9): [True: 129, False: 3.67k]
  ------------------
  495|    129|        return res;
  496|    129|    }
  497|  3.67k|    ASNAR(mfp->mo_copy_word,msp->cmd,sc.cmd);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  498|  3.67k|    ASNAR(mfp->mo_copy_word,msp->cmdsize,sc.cmdsize);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  499|  3.67k|    _dwarf_safe_strcpy(msp->segname,sizeof(msp->segname),
  500|  3.67k|        sc.segname,sizeof(sc.segname));
  501|  3.67k|    ASNAR(mfp->mo_copy_word,msp->vmaddr,sc.vmaddr);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  502|  3.67k|    ASNAR(mfp->mo_copy_word,msp->vmsize,sc.vmsize);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  503|  3.67k|    ASNAR(mfp->mo_copy_word,msp->fileoff,sc.fileoff);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  504|  3.67k|    ASNAR(mfp->mo_copy_word,msp->filesize,sc.filesize);
  ------------------
  |  |   57|  3.67k|    do {                                        \
  |  |   58|  3.67k|        (t) = 0;                                \
  |  |   59|  3.67k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  505|  3.67k|    if (msp->fileoff > filesize ||
  ------------------
  |  Branch (505:9): [True: 294, False: 3.38k]
  ------------------
  506|  3.67k|        msp->filesize > filesize) {
  ------------------
  |  Branch (506:9): [True: 300, False: 3.08k]
  ------------------
  507|       |        /* corrupt */
  508|    594|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|    594|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  509|    594|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    594|#define DW_DLV_ERROR      1
  ------------------
  510|    594|    }
  511|  3.08k|    if ((msp->fileoff+msp->filesize ) > filesize) {
  ------------------
  |  Branch (511:9): [True: 66, False: 3.01k]
  ------------------
  512|       |        /* corrupt */
  513|     66|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|     66|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  514|     66|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     66|#define DW_DLV_ERROR      1
  ------------------
  515|     66|    }
  516|  3.01k|    ASNAR(mfp->mo_copy_word,msp->maxprot,sc.maxprot);
  ------------------
  |  |   57|  3.01k|    do {                                        \
  |  |   58|  3.01k|        (t) = 0;                                \
  |  |   59|  3.01k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  517|  3.01k|    ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot);
  ------------------
  |  |   57|  3.01k|    do {                                        \
  |  |   58|  3.01k|        (t) = 0;                                \
  |  |   59|  3.01k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  518|  3.01k|    ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects);
  ------------------
  |  |   57|  3.01k|    do {                                        \
  |  |   58|  3.01k|        (t) = 0;                                \
  |  |   59|  3.01k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  519|  3.01k|    if (msp->nsects >= mfp->mo_filesize) {
  ------------------
  |  Branch (519:9): [True: 153, False: 2.86k]
  ------------------
  520|    153|        *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
  ------------------
  |  | 1462|    153|#define DW_DLE_MACHO_CORRUPT_COMMAND           487
  ------------------
  521|    153|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    153|#define DW_DLV_ERROR      1
  ------------------
  522|    153|    }
  523|  2.86k|    ASNAR(mfp->mo_copy_word,msp->flags,sc.flags);
  ------------------
  |  |   57|  2.86k|    do {                                        \
  |  |   58|  2.86k|        (t) = 0;                                \
  |  |   59|  2.86k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  2.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  524|  2.86k|    msp->macho_command_index = mmpindex;
  525|  2.86k|    msp->sectionsoffset = afterseghdr;
  526|  2.86k|    return DW_DLV_OK;
  ------------------
  |  |   59|  2.86k|#define DW_DLV_OK         0
  ------------------
  527|  3.01k|}
dwarf_machoread.c:_dwarf_macho_load_dwarf_sections:
  761|  4.63k|{
  762|  4.63k|    Dwarf_Unsigned segi = 0;
  763|  4.63k|    Dwarf_Unsigned ftype = mfp->mo_header.filetype;
  764|       |
  765|  4.63k|    struct generic_macho_segment_command *segp =
  766|  4.63k|        mfp->mo_segment_commands;
  767|  4.63k|    if (ftype != MH_DSYM &&
  ------------------
  |  |  198|  9.27k|#define    MH_DSYM        0xa /* companion file with only debug */
  ------------------
  |  Branch (767:9): [True: 4.43k, False: 207]
  ------------------
  768|  4.63k|        ftype != MH_OBJECT) {
  ------------------
  |  |  188|  4.43k|#define    MH_OBJECT    0x1        /* relocatable object file */
  ------------------
  |  Branch (768:9): [True: 300, False: 4.13k]
  ------------------
  769|       |        /* We do not think it can have DWARF */
  770|    300|        return DW_DLV_OK;
  ------------------
  |  |   59|    300|#define DW_DLV_OK         0
  ------------------
  771|    300|    }
  772|  7.26k|    for ( ; segi < mfp->mo_segment_count; ++segi,++segp) {
  ------------------
  |  Branch (772:13): [True: 7.03k, False: 234]
  ------------------
  773|  7.03k|        int res = 0;
  774|       |
  775|  7.03k|        switch (ftype) {
  776|  2.93k|        case MH_DSYM: {
  ------------------
  |  |  198|  2.93k|#define    MH_DSYM        0xa /* companion file with only debug */
  ------------------
  |  Branch (776:9): [True: 2.93k, False: 4.09k]
  ------------------
  777|  2.93k|            if (strcmp(segp->segname,"__DWARF")) {
  ------------------
  |  Branch (777:17): [True: 2.93k, False: 6]
  ------------------
  778|       |                /* No DWARF in this segment */
  779|  2.93k|                continue;
  780|  2.93k|            }
  781|  2.93k|            }
  782|       |            /*  will have DWARF */
  783|      6|            break;
  784|  4.09k|        case MH_OBJECT:
  ------------------
  |  |  188|  4.09k|#define    MH_OBJECT    0x1        /* relocatable object file */
  ------------------
  |  Branch (784:9): [True: 4.09k, False: 2.93k]
  ------------------
  785|       |            /* Likely has DWARF */
  786|  4.09k|            break;
  787|      0|        default:
  ------------------
  |  Branch (787:9): [True: 0, False: 7.03k]
  ------------------
  788|       |            /* We do not think it can have DWARF */
  789|      0|            continue;
  790|  7.03k|        }
  791|  4.10k|        res = _dwarf_macho_load_dwarf_section_details(mfp,
  792|  4.10k|            segp,segi,errcode);
  793|  4.10k|        return res;
  794|  7.03k|    }
  795|    234|    return DW_DLV_OK;
  ------------------
  |  |   59|    234|#define DW_DLV_OK         0
  ------------------
  796|  4.33k|}
dwarf_machoread.c:_dwarf_macho_load_dwarf_section_details:
  742|  4.10k|{
  743|  4.10k|    int res = 0;
  744|       |
  745|  4.10k|    if (mfp->mo_offsetsize == 32) {
  ------------------
  |  Branch (745:9): [True: 3.36k, False: 738]
  ------------------
  746|  3.36k|        res = _dwarf_macho_load_dwarf_section_details32(mfp,
  747|  3.36k|            segp,segi,errcode);
  748|  3.36k|    } else if (mfp->mo_offsetsize == 64) {
  ------------------
  |  Branch (748:16): [True: 738, False: 0]
  ------------------
  749|    738|        res = _dwarf_macho_load_dwarf_section_details64(mfp,
  750|    738|            segp,segi,errcode);
  751|    738|    } else {
  752|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  753|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  754|      0|    }
  755|  4.10k|    return res;
  756|  4.10k|}
dwarf_machoread.c:_dwarf_macho_load_dwarf_section_details32:
  578|  3.36k|{
  579|  3.36k|    Dwarf_Unsigned seci = 0;
  580|  3.36k|    Dwarf_Unsigned seccount = segp->nsects;
  581|  3.36k|    Dwarf_Unsigned secalloc = seccount+1;
  582|  3.36k|    Dwarf_Unsigned curoff = segp->sectionsoffset;
  583|  3.36k|    Dwarf_Unsigned shdrlen = sizeof(struct section);
  584|       |
  585|  3.36k|    struct generic_macho_section *secs = 0;
  586|       |
  587|  3.36k|    secs = (struct generic_macho_section *)calloc(
  588|  3.36k|        sizeof(struct generic_macho_section),
  589|  3.36k|        (size_t)secalloc);
  590|  3.36k|    if (!secs) {
  ------------------
  |  Branch (590:9): [True: 0, False: 3.36k]
  ------------------
  591|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  592|      0|        return DW_DLV_OK;
  ------------------
  |  |   59|      0|#define DW_DLV_OK         0
  ------------------
  593|      0|    }
  594|  3.36k|    mfp->mo_dwarf_sections = secs;
  595|  3.36k|    mfp->mo_dwarf_sectioncount = secalloc;
  596|  3.36k|    if ((curoff  > mfp->mo_filesize) ||
  ------------------
  |  Branch (596:9): [True: 0, False: 3.36k]
  ------------------
  597|  3.36k|        (seccount > mfp->mo_filesize) ||
  ------------------
  |  Branch (597:9): [True: 0, False: 3.36k]
  ------------------
  598|  3.36k|        (curoff+(seccount*sizeof(struct section)) >
  ------------------
  |  Branch (598:9): [True: 228, False: 3.13k]
  ------------------
  599|  3.36k|            mfp->mo_filesize)) {
  600|    228|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|    228|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  601|    228|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    228|#define DW_DLV_ERROR      1
  ------------------
  602|    228|    }
  603|  3.13k|    secs->offset_of_sec_rec = curoff;
  604|       |    /*  Leave 0 section all zeros except our offset,
  605|       |        elf-like in a sense */
  606|  3.13k|    secs->dwarfsectname = "";
  607|  3.13k|    ++secs;
  608|  3.13k|    seci = 1;
  609|  87.5k|    for (; seci < secalloc; ++seci,++secs,curoff += shdrlen ) {
  ------------------
  |  Branch (609:12): [True: 84.8k, False: 2.70k]
  ------------------
  610|  84.8k|        struct section mosec;
  611|  84.8k|        int res = 0;
  612|  84.8k|        Dwarf_Unsigned endoffset = 0;
  613|  84.8k|        Dwarf_Unsigned inner = mfp->mo_inner_offset;
  614|       |
  615|  84.8k|        endoffset = curoff + sizeof(mosec);
  616|  84.8k|        if (curoff >=  mfp->mo_filesize ||
  ------------------
  |  Branch (616:13): [True: 0, False: 84.8k]
  ------------------
  617|  84.8k|            endoffset > mfp->mo_filesize) {
  ------------------
  |  Branch (617:13): [True: 0, False: 84.8k]
  ------------------
  618|      0|            *errcode  = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
  ------------------
  |  | 1463|      0|#define DW_DLE_MACHO_CORRUPT_SECTIONDETAILS    488
  ------------------
  619|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  620|      0|        }
  621|  84.8k|        res = RRMOA(mfp->mo_fd, &mosec,
  ------------------
  |  |   65|  84.8k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  84.8k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  622|  84.8k|            inner+curoff, sizeof(mosec),
  623|  84.8k|            inner+mfp->mo_filesize, errcode);
  624|  84.8k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  84.8k|#define DW_DLV_OK         0
  ------------------
  |  Branch (624:13): [True: 0, False: 84.8k]
  ------------------
  625|      0|            return res;
  626|      0|        }
  627|  84.8k|        _dwarf_safe_strcpy(secs->sectname,
  628|  84.8k|            sizeof(secs->sectname),
  629|  84.8k|            mosec.sectname,sizeof(mosec.sectname));
  630|  84.8k|        _dwarf_safe_strcpy(secs->segname,
  631|  84.8k|            sizeof(secs->segname),
  632|  84.8k|            mosec.segname,sizeof(mosec.segname));
  633|  84.8k|        ASNAR(mfp->mo_copy_word,secs->addr,mosec.addr);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  634|  84.8k|        ASNAR(mfp->mo_copy_word,secs->size,mosec.size);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  635|  84.8k|        ASNAR(mfp->mo_copy_word,secs->offset,mosec.offset);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  636|  84.8k|        ASNAR(mfp->mo_copy_word,secs->align,mosec.align);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  637|  84.8k|        ASNAR(mfp->mo_copy_word,secs->reloff,mosec.reloff);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  638|  84.8k|        ASNAR(mfp->mo_copy_word,secs->nreloc,mosec.nreloc);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  639|  84.8k|        ASNAR(mfp->mo_copy_word,secs->flags,mosec.flags);
  ------------------
  |  |   57|  84.8k|    do {                                        \
  |  |   58|  84.8k|        (t) = 0;                                \
  |  |   59|  84.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  640|  84.8k|        if (secs->offset > mfp->mo_filesize ||
  ------------------
  |  Branch (640:13): [True: 186, False: 84.6k]
  ------------------
  641|  84.8k|            secs->size > mfp->mo_filesize ||
  ------------------
  |  Branch (641:13): [True: 168, False: 84.4k]
  ------------------
  642|  84.8k|            (secs->offset+secs->size) > mfp->mo_filesize) {
  ------------------
  |  Branch (642:13): [True: 81, False: 84.4k]
  ------------------
  643|    435|            *errcode  = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
  ------------------
  |  | 1463|    435|#define DW_DLE_MACHO_CORRUPT_SECTIONDETAILS    488
  ------------------
  644|    435|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    435|#define DW_DLV_ERROR      1
  ------------------
  645|    435|        }
  646|  84.4k|        secs->reserved1 = 0;
  647|  84.4k|        secs->reserved2 = 0;
  648|  84.4k|        secs->reserved3 = 0;
  649|  84.4k|        secs->generic_segment_num  = segi;
  650|  84.4k|        secs->offset_of_sec_rec = curoff;
  651|  84.4k|    }
  652|  2.70k|    return DW_DLV_OK;
  ------------------
  |  |   59|  2.70k|#define DW_DLV_OK         0
  ------------------
  653|  3.13k|}
dwarf_machoread.c:_dwarf_macho_load_dwarf_section_details64:
  660|    738|{
  661|    738|    Dwarf_Unsigned seci = 0;
  662|    738|    Dwarf_Unsigned seccount = segp->nsects;
  663|    738|    Dwarf_Unsigned secalloc = seccount+1;
  664|    738|    Dwarf_Unsigned curoff = segp->sectionsoffset;
  665|    738|    Dwarf_Unsigned shdrlen = sizeof(struct section_64);
  666|    738|    struct generic_macho_section *secs = 0;
  667|       |
  668|    738|    secs = (struct generic_macho_section *)calloc(
  669|    738|        sizeof(struct generic_macho_section),
  670|    738|        (size_t)secalloc);
  671|    738|    if (!secs) {
  ------------------
  |  Branch (671:9): [True: 0, False: 738]
  ------------------
  672|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  673|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  674|      0|    }
  675|    738|    mfp->mo_dwarf_sections = secs;
  676|    738|    mfp->mo_dwarf_sectioncount = secalloc;
  677|    738|    secs->offset_of_sec_rec = curoff;
  678|       |    /*  Leave 0 section all zeros except our offset,
  679|       |        elf-like in a sense */
  680|    738|    secs->dwarfsectname = "";
  681|    738|    ++secs;
  682|    738|    if ((curoff  > mfp->mo_filesize) ||
  ------------------
  |  Branch (682:9): [True: 0, False: 738]
  ------------------
  683|    738|        (seccount > mfp->mo_filesize) ||
  ------------------
  |  Branch (683:9): [True: 0, False: 738]
  ------------------
  684|    738|        (curoff+(seccount*sizeof(struct section_64)) >
  ------------------
  |  Branch (684:9): [True: 75, False: 663]
  ------------------
  685|    738|            mfp->mo_filesize)) {
  686|     75|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     75|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  687|     75|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     75|#define DW_DLV_ERROR      1
  ------------------
  688|     75|    }
  689|    663|    seci = 1;
  690|  3.43k|    for (; seci < secalloc; ++seci,++secs,curoff += shdrlen ) {
  ------------------
  |  Branch (690:12): [True: 3.36k, False: 72]
  ------------------
  691|  3.36k|        int res = 0;
  692|  3.36k|        struct section_64 mosec;
  693|  3.36k|        Dwarf_Unsigned endoffset = 0;
  694|  3.36k|        Dwarf_Unsigned inner = mfp->mo_inner_offset;
  695|       |
  696|  3.36k|        endoffset = curoff + sizeof(mosec);
  697|  3.36k|        if (curoff >=  mfp->mo_filesize ||
  ------------------
  |  Branch (697:13): [True: 0, False: 3.36k]
  ------------------
  698|  3.36k|            endoffset > mfp->mo_filesize) {
  ------------------
  |  Branch (698:13): [True: 0, False: 3.36k]
  ------------------
  699|      0|            *errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
  ------------------
  |  | 1463|      0|#define DW_DLE_MACHO_CORRUPT_SECTIONDETAILS    488
  ------------------
  700|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  701|      0|        }
  702|       |
  703|  3.36k|        res = RRMOA(mfp->mo_fd, &mosec,
  ------------------
  |  |   65|  3.36k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  3.36k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  704|  3.36k|            inner+curoff, sizeof(mosec),
  705|  3.36k|            inner+mfp->mo_filesize, errcode);
  706|  3.36k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  3.36k|#define DW_DLV_OK         0
  ------------------
  |  Branch (706:13): [True: 0, False: 3.36k]
  ------------------
  707|      0|            return res;
  708|      0|        }
  709|  3.36k|        _dwarf_safe_strcpy(secs->sectname,
  710|  3.36k|            sizeof(secs->sectname),
  711|  3.36k|            mosec.sectname,sizeof(mosec.sectname));
  712|  3.36k|        _dwarf_safe_strcpy(secs->segname,
  713|  3.36k|            sizeof(secs->segname),
  714|  3.36k|            mosec.segname,sizeof(mosec.segname));
  715|  3.36k|        ASNAR(mfp->mo_copy_word,secs->addr,mosec.addr);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  716|  3.36k|        ASNAR(mfp->mo_copy_word,secs->size,mosec.size);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  717|  3.36k|        ASNAR(mfp->mo_copy_word,secs->offset,mosec.offset);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  718|  3.36k|        ASNAR(mfp->mo_copy_word,secs->align,mosec.align);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  719|  3.36k|        ASNAR(mfp->mo_copy_word,secs->reloff,mosec.reloff);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  720|  3.36k|        ASNAR(mfp->mo_copy_word,secs->nreloc,mosec.nreloc);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  721|  3.36k|        ASNAR(mfp->mo_copy_word,secs->flags,mosec.flags);
  ------------------
  |  |   57|  3.36k|    do {                                        \
  |  |   58|  3.36k|        (t) = 0;                                \
  |  |   59|  3.36k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  3.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  722|  3.36k|        if (secs->offset > mfp->mo_filesize ||
  ------------------
  |  Branch (722:13): [True: 192, False: 3.16k]
  ------------------
  723|  3.36k|            secs->size > mfp->mo_filesize ||
  ------------------
  |  Branch (723:13): [True: 324, False: 2.84k]
  ------------------
  724|  3.36k|            (secs->offset+secs->size) > mfp->mo_filesize) {
  ------------------
  |  Branch (724:13): [True: 75, False: 2.76k]
  ------------------
  725|    591|            *errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
  ------------------
  |  | 1463|    591|#define DW_DLE_MACHO_CORRUPT_SECTIONDETAILS    488
  ------------------
  726|    591|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    591|#define DW_DLV_ERROR      1
  ------------------
  727|    591|        }
  728|  2.76k|        secs->reserved1 = 0;
  729|  2.76k|        secs->reserved2 = 0;
  730|  2.76k|        secs->reserved3 = 0;
  731|  2.76k|        secs->offset_of_sec_rec = curoff;
  732|  2.76k|        secs->generic_segment_num  = segi;
  733|  2.76k|    }
  734|     72|    return DW_DLV_OK;
  ------------------
  |  |   59|     72|#define DW_DLV_OK         0
  ------------------
  735|    663|}
dwarf_machoread.c:_dwarf_macho_object_access_init:
 1118|  9.05k|{
 1119|  9.05k|    int res = 0;
 1120|  9.05k|    dwarf_macho_object_access_internals_t *internals = 0;
 1121|  9.05k|    Dwarf_Obj_Access_Interface_a *intfc = 0;
 1122|       |
 1123|  9.05k|    internals = malloc(
 1124|  9.05k|        sizeof(dwarf_macho_object_access_internals_t));
 1125|  9.05k|    if (!internals) {
  ------------------
  |  Branch (1125:9): [True: 0, False: 9.05k]
  ------------------
 1126|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1127|       |        /* Impossible case, we hope. Give up. */
 1128|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1129|      0|    }
 1130|  9.05k|    memset(internals,0,sizeof(*internals));
 1131|  9.05k|    res = _dwarf_macho_object_access_internals_init(internals,
 1132|  9.05k|        fd,
 1133|  9.05k|        uninumber,
 1134|  9.05k|        ftype, endian, offsetsize,
 1135|  9.05k|        universalbinary_count,
 1136|  9.05k|        filesize,
 1137|  9.05k|        localerrnum);
 1138|  9.05k|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|  9.05k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1138:9): [True: 5.74k, False: 3.30k]
  ------------------
 1139|  5.74k|        _dwarf_destruct_macho_internals(internals);
 1140|  5.74k|        return DW_DLV_ERROR;
  ------------------
  |  |   60|  5.74k|#define DW_DLV_ERROR      1
  ------------------
 1141|  5.74k|    }
 1142|  3.30k|    intfc = malloc(sizeof(Dwarf_Obj_Access_Interface_a));
 1143|  3.30k|    if (!intfc) {
  ------------------
  |  Branch (1143:9): [True: 0, False: 3.30k]
  ------------------
 1144|       |        /* Impossible case, we hope. Give up. */
 1145|      0|        _dwarf_destruct_macho_internals(internals);
 1146|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1147|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1148|      0|    }
 1149|       |    /* Initialize the interface struct */
 1150|  3.30k|    intfc->ai_object = internals;
 1151|  3.30k|    intfc->ai_methods = &macho_methods;
 1152|  3.30k|    *binary_interface = intfc;
 1153|  3.30k|    return DW_DLV_OK;
  ------------------
  |  |   59|  3.30k|#define DW_DLV_OK         0
  ------------------
 1154|  3.30k|}
dwarf_machoread.c:_dwarf_macho_object_access_internals_init:
 1016|  9.05k|{
 1017|  9.05k|    Dwarf_Unsigned i  = 0;
 1018|  9.05k|    struct generic_macho_section *sp = 0;
 1019|  9.05k|    int res = 0;
 1020|  9.05k|    unsigned int   ftypei = ftype;
 1021|  9.05k|    unsigned int   endiani = endian;
 1022|  9.05k|    unsigned int   offsetsizei = offsetsize;
 1023|  9.05k|    Dwarf_Unsigned filesizei = filesize;
 1024|  9.05k|    Dwarf_Unsigned fileoffseti = 0;
 1025|  9.05k|    unsigned int unibinarycounti = 0;
 1026|       |
 1027|  9.05k|    if (ftype == DW_FTYPE_APPLEUNIVERSAL) {
  ------------------
  |  |  118|  9.05k|#define DW_FTYPE_APPLEUNIVERSAL    5
  ------------------
  |  Branch (1027:9): [True: 1.77k, False: 7.28k]
  ------------------
 1028|  1.77k|        res = _dwarf_macho_inner_object_fd(fd,
 1029|  1.77k|            uninumber,
 1030|  1.77k|            filesize,
 1031|  1.77k|            &ftypei,&unibinarycounti,&endiani,
 1032|  1.77k|            &offsetsizei,&fileoffseti,&filesizei,errcode);
 1033|  1.77k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.77k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1033:13): [True: 1.66k, False: 108]
  ------------------
 1034|  1.66k|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|  1.66k|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (1034:17): [True: 1.59k, False: 66]
  ------------------
 1035|  1.59k|            }
 1036|  1.66k|            return res;
 1037|  1.66k|        }
 1038|    108|        *unibinarycount = unibinarycounti;
 1039|    108|        endian = endiani;
 1040|    108|    }
 1041|       |
 1042|  7.39k|    internals->mo_ident[0]    = 'M';
 1043|  7.39k|    internals->mo_ident[1]    = '1';
 1044|  7.39k|    internals->mo_fd          = fd;
 1045|  7.39k|    internals->mo_offsetsize  = offsetsizei;
 1046|  7.39k|    internals->mo_pointersize = offsetsizei;
 1047|  7.39k|    internals->mo_inner_offset  =  fileoffseti;
 1048|  7.39k|    internals->mo_filesize    = filesizei;
 1049|  7.39k|    internals->mo_ftype       = ftypei;
 1050|  7.39k|    internals->mo_uninumber   = uninumber;
 1051|  7.39k|    internals->mo_universal_count = unibinarycounti;
 1052|       |
 1053|       |#ifdef WORDS_BIGENDIAN
 1054|       |    if (endian == DW_END_little ) {
 1055|       |        internals->mo_copy_word = _dwarf_memcpy_swap_bytes;
 1056|       |        internals->mo_endian = DW_END_little;
 1057|       |    } else {
 1058|       |        internals->mo_copy_word = _dwarf_memcpy_noswap_bytes;
 1059|       |        internals->mo_endian = DW_END_big;
 1060|       |    }
 1061|       |#else  /* LITTLE ENDIAN */
 1062|  7.39k|    if (endian == DW_END_little ) {
  ------------------
  |  | 1105|  7.39k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  |  Branch (1062:9): [True: 6.28k, False: 1.10k]
  ------------------
 1063|  6.28k|        internals->mo_copy_word = _dwarf_memcpy_noswap_bytes;
 1064|  6.28k|        internals->mo_endian = DW_END_little;
  ------------------
  |  | 1105|  6.28k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
 1065|  6.28k|    } else {
 1066|  1.10k|        internals->mo_copy_word = _dwarf_memcpy_swap_bytes;
 1067|  1.10k|        internals->mo_endian = DW_END_big;
  ------------------
  |  | 1104|  1.10k|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
 1068|  1.10k|    }
 1069|  7.39k|#endif /* LITTLE- BIG-ENDIAN */
 1070|  7.39k|    res = _dwarf_load_macho_header(internals,errcode);
 1071|  7.39k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  7.39k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1071:9): [True: 792, False: 6.60k]
  ------------------
 1072|    792|        return res;
 1073|    792|    }
 1074|       |    /* Load sections */
 1075|  6.60k|    res = _dwarf_load_macho_commands(internals,errcode);
 1076|  6.60k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  6.60k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1076:9): [True: 3.29k, False: 3.30k]
  ------------------
 1077|  3.29k|        return res;
 1078|  3.29k|    }
 1079|  3.30k|    if (internals->mo_dwarf_sections) {
  ------------------
  |  Branch (1079:9): [True: 2.77k, False: 534]
  ------------------
 1080|  2.77k|        sp = internals->mo_dwarf_sections+1;
 1081|  2.77k|    } else {
 1082|       |        /*  There are no dwarf sections,
 1083|       |            count better be zero. */
 1084|    534|        if (internals->mo_dwarf_sectioncount) {
  ------------------
  |  Branch (1084:13): [True: 0, False: 534]
  ------------------
 1085|      0|            *errcode = DW_DLE_MACHO_CORRUPT_HEADER;
  ------------------
  |  | 1461|      0|#define DW_DLE_MACHO_CORRUPT_HEADER            486
  ------------------
 1086|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1087|      0|        }
 1088|    534|    }
 1089|  83.7k|    for (i = 1; i < internals->mo_dwarf_sectioncount ; ++i,++sp) {
  ------------------
  |  Branch (1089:17): [True: 80.4k, False: 3.30k]
  ------------------
 1090|  80.4k|        int j = 1;
 1091|  80.4k|        int lim = sizeof(SectionNames)/sizeof(SectionNames[0]);
 1092|  80.4k|        sp->dwarfsectname = "";
 1093|  1.12M|        for ( ; j < lim; ++j) {
  ------------------
  |  Branch (1093:17): [True: 1.04M, False: 80.0k]
  ------------------
 1094|  1.04M|            if (!strcmp(sp->sectname,SectionNames[j].ms_moname)) {
  ------------------
  |  Branch (1094:17): [True: 402, False: 1.04M]
  ------------------
 1095|    402|                sp->dwarfsectname = SectionNames[j].ms_dwname;
 1096|    402|                break;
 1097|    402|            }
 1098|  1.04M|        }
 1099|  80.4k|        if (sp->dwarfsectname[0] == 0) {
  ------------------
  |  Branch (1099:13): [True: 80.0k, False: 402]
  ------------------
 1100|       |            /* if not matched, keep the apple section name */
 1101|  80.0k|            sp->dwarfsectname = sp->sectname;
 1102|  80.0k|        }
 1103|  80.4k|    }
 1104|  3.30k|    return DW_DLV_OK;
  ------------------
  |  |   59|  3.30k|#define DW_DLV_OK         0
  ------------------
 1105|  3.30k|}
dwarf_machoread.c:_dwarf_macho_inner_object_fd:
  954|  1.77k|{
  955|  1.77k|    int res = 0;
  956|  1.77k|    Dwarf_Universal_Head  head = 0;
  957|  1.77k|    Dwarf_Unsigned innerbase = 0;
  958|  1.77k|    Dwarf_Unsigned innersize = 0;
  959|       |
  960|  1.77k|    res =  _dwarf_object_detector_universal_head_fd(
  961|  1.77k|        fd, outer_filesize, unibinarycount,
  962|  1.77k|        &head, errcode);
  963|  1.77k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.77k|#define DW_DLV_OK         0
  ------------------
  |  Branch (963:9): [True: 1.52k, False: 243]
  ------------------
  964|  1.52k|        return res;
  965|  1.52k|    }
  966|    243|    if (uninumber >= *unibinarycount) {
  ------------------
  |  Branch (966:9): [True: 6, False: 237]
  ------------------
  967|      6|        *errcode = DW_DLE_UNIVERSAL_BINARY_ERROR;
  ------------------
  |  | 1477|      6|#define DW_DLE_UNIVERSAL_BINARY_ERROR          502
  ------------------
  968|      6|        _dwarf_dealloc_universal_head(head);
  969|      6|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      6|#define DW_DLV_ERROR      1
  ------------------
  970|      6|    }
  971|       |    /*  Now find the precise details of uninumber
  972|       |        instance we want */
  973|       |
  974|    237|    innerbase = head->au_arches[uninumber].au_offset;
  975|    237|    innersize = head->au_arches[uninumber].au_size;
  976|    237|    if (innersize >= outer_filesize ||
  ------------------
  |  Branch (976:9): [True: 0, False: 237]
  ------------------
  977|    237|        innerbase >= outer_filesize) {
  ------------------
  |  Branch (977:9): [True: 0, False: 237]
  ------------------
  978|      0|        *errcode = DW_DLE_UNIVERSAL_BINARY_ERROR;
  ------------------
  |  | 1477|      0|#define DW_DLE_UNIVERSAL_BINARY_ERROR          502
  ------------------
  979|      0|        _dwarf_dealloc_universal_head(head);
  980|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  981|      0|    }
  982|       |    /* Now access inner to return its specs */
  983|    237|    {
  984|       |        /*  But ignore the size this returns!
  985|       |            we determined that above. the following call
  986|       |            does not get the inner size, we got that
  987|       |            just above here! */
  988|    237|        Dwarf_Unsigned fake_size = 0;
  989|       |
  990|    237|        res = _dwarf_object_detector_fd_a(fd,
  991|    237|            ftype,endian,offsetsize,innerbase,&fake_size,
  992|    237|            errcode);
  993|    237|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    237|#define DW_DLV_OK         0
  ------------------
  |  Branch (993:13): [True: 129, False: 108]
  ------------------
  994|    129|            _dwarf_dealloc_universal_head(head);
  995|    129|            return res;
  996|    129|        }
  997|    237|    }
  998|    108|    *fileoffset = innerbase;
  999|    108|    *filesize = innersize;
 1000|    108|    _dwarf_dealloc_universal_head(head);
 1001|    108|    return DW_DLV_OK;
  ------------------
  |  |   59|    108|#define DW_DLV_OK         0
  ------------------
 1002|    237|}
dwarf_machoread.c:_dwarf_object_detector_universal_head_fd:
 1259|  1.77k|{
 1260|  1.77k|    struct Dwarf_Universal_Head_s  duhd;
 1261|  1.77k|    struct Dwarf_Universal_Head_s *duhdp = 0;
 1262|  1.77k|    struct  fat_header fh;
 1263|  1.77k|    int     res = 0;
 1264|  1.77k|    void (*word_swap) (void *, const void *, unsigned long);
 1265|  1.77k|    int     locendian = 0;
 1266|  1.77k|    int     locoffsetsize = 0;
 1267|       |
 1268|  1.77k|    duhd = duhzero;
 1269|  1.77k|    fh = fhzero;
 1270|       |    /*  A universal head is always at offset zero. */
 1271|  1.77k|    duhd.au_filesize = dw_filesize;
 1272|  1.77k|    if (sizeof(fh) >= dw_filesize) {
  ------------------
  |  Branch (1272:9): [True: 0, False: 1.77k]
  ------------------
 1273|      0|        *errcode = DW_DLE_UNIVERSAL_BINARY_ERROR;
  ------------------
  |  | 1477|      0|#define DW_DLE_UNIVERSAL_BINARY_ERROR          502
  ------------------
 1274|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1275|      0|    }
 1276|  1.77k|    res = RRMOA(fd,&fh,0,sizeof(fh), dw_filesize,errcode);
  ------------------
  |  |   65|  1.77k|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|  1.77k|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1277|  1.77k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.77k|#define DW_DLV_OK         0
  ------------------
  |  Branch (1277:9): [True: 0, False: 1.77k]
  ------------------
 1278|      0|        return res;
 1279|      0|    }
 1280|  1.77k|    duhd.au_magic = magic_copy((unsigned char *)&fh.magic[0],4);
 1281|  1.77k|    if (duhd.au_magic == FAT_MAGIC) {
  ------------------
  |  |   84|  1.77k|#define FAT_MAGIC   0xcafebabe
  ------------------
  |  Branch (1281:9): [True: 135, False: 1.63k]
  ------------------
 1282|    135|        locendian = DW_END_big;
  ------------------
  |  | 1104|    135|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
 1283|    135|        locoffsetsize = 32;
 1284|  1.63k|    } else if (duhd.au_magic == FAT_CIGAM) {
  ------------------
  |  |   85|  1.63k|#define FAT_CIGAM   0xbebafeca
  ------------------
  |  Branch (1284:16): [True: 660, False: 975]
  ------------------
 1285|    660|        locendian = DW_END_little;
  ------------------
  |  | 1105|    660|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
 1286|    660|        locoffsetsize = 32;
 1287|    975|    }else if (duhd.au_magic == FAT_MAGIC_64) {
  ------------------
  |  |   86|    975|#define FAT_MAGIC_64    0xcafebabf
  ------------------
  |  Branch (1287:15): [True: 282, False: 693]
  ------------------
 1288|    282|        locendian = DW_END_big;
  ------------------
  |  | 1104|    282|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
 1289|    282|        locoffsetsize = 64;
 1290|    693|    } else if (duhd.au_magic == FAT_CIGAM_64) {
  ------------------
  |  |   87|    693|#define FAT_CIGAM_64    0xbfbafeca
  ------------------
  |  Branch (1290:16): [True: 693, False: 0]
  ------------------
 1291|    693|        locendian = DW_END_little;
  ------------------
  |  | 1105|    693|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
 1292|    693|        locoffsetsize = 64;
 1293|    693|    } else {
 1294|      0|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|      0|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
 1295|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1296|      0|    }
 1297|       |#ifdef WORDS_BIGENDIAN
 1298|       |    if (locendian == DW_END_little) {
 1299|       |        word_swap = _dwarf_memcpy_swap_bytes;
 1300|       |    } else {
 1301|       |        word_swap = _dwarf_memcpy_noswap_bytes;
 1302|       |    }
 1303|       |#else  /* LITTLE ENDIAN */
 1304|  1.77k|    if (locendian == DW_END_little) {
  ------------------
  |  | 1105|  1.77k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  |  Branch (1304:9): [True: 1.35k, False: 417]
  ------------------
 1305|  1.35k|        word_swap = _dwarf_memcpy_noswap_bytes;
 1306|  1.35k|    } else {
 1307|    417|        word_swap = _dwarf_memcpy_swap_bytes;
 1308|    417|    }
 1309|  1.77k|#endif /* LITTLE- BIG-ENDIAN */
 1310|  1.77k|    ASNAR(word_swap,duhd.au_count,fh.nfat_arch);
  ------------------
  |  |   57|  1.77k|    do {                                        \
  |  |   58|  1.77k|        (t) = 0;                                \
  |  |   59|  1.77k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1311|       |    /*  The limit is a first-cut safe heuristic. */
 1312|  1.77k|    if (duhd.au_count >= (dw_filesize/2) ) {
  ------------------
  |  Branch (1312:9): [True: 147, False: 1.62k]
  ------------------
 1313|    147|        *errcode = DW_DLE_UNIVERSAL_BINARY_ERROR ;
  ------------------
  |  | 1477|    147|#define DW_DLE_UNIVERSAL_BINARY_ERROR          502
  ------------------
 1314|    147|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    147|#define DW_DLV_ERROR      1
  ------------------
 1315|    147|    }
 1316|  1.62k|    duhd.au_arches = (struct  Dwarf_Universal_Arch_s*)
 1317|  1.62k|        calloc(duhd.au_count, sizeof(struct Dwarf_Universal_Arch_s));
 1318|  1.62k|    if (!duhd.au_arches) {
  ------------------
  |  Branch (1318:9): [True: 0, False: 1.62k]
  ------------------
 1319|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1320|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1321|      0|    }
 1322|  1.62k|    if (locoffsetsize == 32) {
  ------------------
  |  Branch (1322:9): [True: 696, False: 927]
  ------------------
 1323|    696|        struct fat_arch * fa = 0;
 1324|       |
 1325|    696|        fa = (struct fat_arch *)calloc(duhd.au_count,
 1326|    696|            sizeof(struct fat_arch));
 1327|    696|        if (!fa) {
  ------------------
  |  Branch (1327:13): [True: 0, False: 696]
  ------------------
 1328|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1329|      0|            free(duhd.au_arches);
 1330|      0|            duhd.au_arches = 0;
 1331|      0|            free(fa);
 1332|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1333|      0|        }
 1334|    696|        if (sizeof(fh)+duhd.au_count*sizeof(*fa) >= dw_filesize) {
  ------------------
  |  Branch (1334:13): [True: 120, False: 576]
  ------------------
 1335|    120|            free(duhd.au_arches);
 1336|    120|            duhd.au_arches = 0;
 1337|    120|            free(fa);
 1338|    120|            *errcode = DW_DLE_FILE_OFFSET_BAD;
  ------------------
  |  | 1392|    120|#define DW_DLE_FILE_OFFSET_BAD                 417
  ------------------
 1339|    120|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    120|#define DW_DLV_ERROR      1
  ------------------
 1340|    120|        }
 1341|    576|        res = RRMOA(fd,fa,/*offset=*/sizeof(fh),
  ------------------
  |  |   65|    576|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    576|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1342|    576|            duhd.au_count*sizeof(*fa),
 1343|    576|            dw_filesize,errcode);
 1344|    576|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    576|#define DW_DLV_OK         0
  ------------------
  |  Branch (1344:13): [True: 0, False: 576]
  ------------------
 1345|      0|            free(duhd.au_arches);
 1346|      0|            duhd.au_arches = 0;
 1347|      0|            free(fa);
 1348|      0|            return res;
 1349|      0|        }
 1350|    576|        res = fill_in_uni_arch_32(fa,&duhd,word_swap,
 1351|    576|            errcode);
 1352|    576|        free(fa);
 1353|    576|        fa = 0;
 1354|    576|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    576|#define DW_DLV_OK         0
  ------------------
  |  Branch (1354:13): [True: 453, False: 123]
  ------------------
 1355|    453|            free(duhd.au_arches);
 1356|    453|            duhd.au_arches = 0;
 1357|    453|            return res;
 1358|    453|        }
 1359|    927|    } else { /* 64 */
 1360|    927|        struct fat_arch_64 * fa = 0;
 1361|    927|        fa = (struct fat_arch_64 *)calloc(duhd.au_count,
 1362|    927|            sizeof(struct fat_arch_64));
 1363|    927|        if (!fa) {
  ------------------
  |  Branch (1363:13): [True: 0, False: 927]
  ------------------
 1364|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1365|      0|            free(duhd.au_arches);
 1366|      0|            duhd.au_arches = 0;
 1367|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
 1368|      0|        }
 1369|    927|        if (sizeof(fh)+duhd.au_count*sizeof(*fa) >= dw_filesize) {
  ------------------
  |  Branch (1369:13): [True: 120, False: 807]
  ------------------
 1370|    120|            free(duhd.au_arches);
 1371|    120|            duhd.au_arches = 0;
 1372|    120|            free(fa);
 1373|    120|            *errcode = DW_DLE_FILE_OFFSET_BAD ;
  ------------------
  |  | 1392|    120|#define DW_DLE_FILE_OFFSET_BAD                 417
  ------------------
 1374|    120|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    120|#define DW_DLV_ERROR      1
  ------------------
 1375|    120|        }
 1376|    807|        res = RRMOA(fd,fa,/*offset*/sizeof(fh),
  ------------------
  |  |   65|    807|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|    807|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
 1377|    807|            duhd.au_count*sizeof(fa),
 1378|    807|            dw_filesize,errcode);
 1379|    807|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   60|    807|#define DW_DLV_ERROR      1
  ------------------
  |  Branch (1379:13): [True: 0, False: 807]
  ------------------
 1380|      0|            free(duhd.au_arches);
 1381|      0|            duhd.au_arches = 0;
 1382|      0|            free(fa);
 1383|      0|            return res;
 1384|      0|        }
 1385|    807|        res = fill_in_uni_arch_64(fa,&duhd,word_swap,
 1386|    807|            errcode);
 1387|    807|        free(fa);
 1388|    807|        fa = 0;
 1389|    807|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    807|#define DW_DLV_OK         0
  ------------------
  |  Branch (1389:13): [True: 687, False: 120]
  ------------------
 1390|    687|            free(duhd.au_arches);
 1391|    687|            duhd.au_arches = 0;
 1392|    687|            return res;
 1393|    687|        }
 1394|    807|    }
 1395|       |
 1396|    243|    duhdp = malloc(sizeof(*duhdp));
 1397|    243|    if (!duhdp) {
  ------------------
  |  Branch (1397:9): [True: 0, False: 243]
  ------------------
 1398|      0|        free(duhd.au_arches);
 1399|      0|        duhd.au_arches = 0;
 1400|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
 1401|      0|        return res;
 1402|      0|    }
 1403|    243|    memcpy(duhdp,&duhd,sizeof(duhd));
 1404|    243|    *dw_contentcount = (unsigned int)duhd.au_count;
 1405|    243|    duhdp->au_arches = duhd.au_arches;
 1406|    243|    *dw_head = duhdp;
 1407|    243|    return DW_DLV_OK;
  ------------------
  |  |   59|    243|#define DW_DLV_OK         0
  ------------------
 1408|    243|}
dwarf_machoread.c:magic_copy:
 1158|  1.77k|{
 1159|  1.77k|    unsigned i = 0;
 1160|  1.77k|    unsigned long v = 0;
 1161|       |
 1162|  1.77k|    v = d[0];
 1163|  7.08k|    for (i = 1 ; i < len; ++i) {
  ------------------
  |  Branch (1163:18): [True: 5.31k, False: 1.77k]
  ------------------
 1164|  5.31k|        v <<= 8;
 1165|  5.31k|        v |=  d[i];
 1166|  5.31k|    }
 1167|  1.77k|    return v;
 1168|  1.77k|}
dwarf_machoread.c:fill_in_uni_arch_32:
 1179|    576|{
 1180|    576|    Dwarf_Unsigned i = 0;
 1181|    576|    struct Dwarf_Universal_Arch_s * dua = 0;
 1182|       |
 1183|    576|    dua = duhd->au_arches;
 1184|  1.68k|    for ( ; i < duhd->au_count; ++i,++fa,++dua) {
  ------------------
  |  Branch (1184:13): [True: 1.56k, False: 123]
  ------------------
 1185|  1.56k|        ASNAR(word_swap,dua->au_cputype,fa->cputype);
  ------------------
  |  |   57|  1.56k|    do {                                        \
  |  |   58|  1.56k|        (t) = 0;                                \
  |  |   59|  1.56k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1186|  1.56k|        ASNAR(word_swap,dua->au_cpusubtype,fa->cpusubtype);
  ------------------
  |  |   57|  1.56k|    do {                                        \
  |  |   58|  1.56k|        (t) = 0;                                \
  |  |   59|  1.56k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1187|  1.56k|        ASNAR(word_swap,dua->au_offset,fa->offset);
  ------------------
  |  |   57|  1.56k|    do {                                        \
  |  |   58|  1.56k|        (t) = 0;                                \
  |  |   59|  1.56k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1188|  1.56k|        if (dua->au_offset >= duhd->au_filesize) {
  ------------------
  |  Branch (1188:13): [True: 144, False: 1.41k]
  ------------------
 1189|    144|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|    144|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1190|    144|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    144|#define DW_DLV_ERROR      1
  ------------------
 1191|    144|        }
 1192|  1.41k|        ASNAR(word_swap,dua->au_size,fa->size);
  ------------------
  |  |   57|  1.41k|    do {                                        \
  |  |   58|  1.41k|        (t) = 0;                                \
  |  |   59|  1.41k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1193|  1.41k|        if (dua->au_size >= duhd->au_filesize) {
  ------------------
  |  Branch (1193:13): [True: 141, False: 1.27k]
  ------------------
 1194|    141|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|    141|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1195|    141|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    141|#define DW_DLV_ERROR      1
  ------------------
 1196|    141|        }
 1197|  1.27k|        if ((dua->au_size+dua->au_offset) > duhd->au_filesize) {
  ------------------
  |  Branch (1197:13): [True: 78, False: 1.19k]
  ------------------
 1198|     78|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|     78|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1199|     78|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     78|#define DW_DLV_ERROR      1
  ------------------
 1200|     78|        }
 1201|       |
 1202|  1.19k|        ASNAR(word_swap,dua->au_align,fa->align);
  ------------------
  |  |   57|  1.19k|    do {                                        \
  |  |   58|  1.19k|        (t) = 0;                                \
  |  |   59|  1.19k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1203|  1.19k|        if (dua->au_align >= 32) {
  ------------------
  |  Branch (1203:13): [True: 90, False: 1.10k]
  ------------------
 1204|     90|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|     90|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1205|     90|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     90|#define DW_DLV_ERROR      1
  ------------------
 1206|     90|        }
 1207|  1.10k|        dua->au_reserved = 0;
 1208|  1.10k|    }
 1209|    123|    return DW_DLV_OK;
  ------------------
  |  |   59|    123|#define DW_DLV_OK         0
  ------------------
 1210|    576|}
dwarf_machoread.c:fill_in_uni_arch_64:
 1218|    807|{
 1219|    807|    Dwarf_Unsigned i = 0;
 1220|    807|    struct Dwarf_Universal_Arch_s * dua = 0;
 1221|       |
 1222|    807|    dua = duhd->au_arches;
 1223|  17.6k|    for ( ; i < duhd->au_count; ++i,++fa,++dua) {
  ------------------
  |  Branch (1223:13): [True: 17.5k, False: 120]
  ------------------
 1224|  17.5k|        ASNAR(word_swap,dua->au_cputype,fa->cputype);
  ------------------
  |  |   57|  17.5k|    do {                                        \
  |  |   58|  17.5k|        (t) = 0;                                \
  |  |   59|  17.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  17.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1225|  17.5k|        ASNAR(word_swap,dua->au_cpusubtype,fa->cpusubtype);
  ------------------
  |  |   57|  17.5k|    do {                                        \
  |  |   58|  17.5k|        (t) = 0;                                \
  |  |   59|  17.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  17.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1226|  17.5k|        ASNAR(word_swap,dua->au_offset,fa->offset);
  ------------------
  |  |   57|  17.5k|    do {                                        \
  |  |   58|  17.5k|        (t) = 0;                                \
  |  |   59|  17.5k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  17.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1227|  17.5k|        if (dua->au_offset >= duhd->au_filesize) {
  ------------------
  |  Branch (1227:13): [True: 282, False: 17.2k]
  ------------------
 1228|    282|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|    282|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1229|    282|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    282|#define DW_DLV_ERROR      1
  ------------------
 1230|    282|        }
 1231|  17.2k|        ASNAR(word_swap,dua->au_size,fa->size);
  ------------------
  |  |   57|  17.2k|    do {                                        \
  |  |   58|  17.2k|        (t) = 0;                                \
  |  |   59|  17.2k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  17.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1232|  17.2k|        if (dua->au_size >= duhd->au_filesize) {
  ------------------
  |  Branch (1232:13): [True: 237, False: 16.9k]
  ------------------
 1233|    237|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|    237|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1234|    237|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    237|#define DW_DLV_ERROR      1
  ------------------
 1235|    237|        }
 1236|  16.9k|        if ((dua->au_size+dua->au_offset) > duhd->au_filesize) {
  ------------------
  |  Branch (1236:13): [True: 90, False: 16.9k]
  ------------------
 1237|     90|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|     90|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1238|     90|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     90|#define DW_DLV_ERROR      1
  ------------------
 1239|     90|        }
 1240|  16.9k|        ASNAR(word_swap,dua->au_align,fa->align);
  ------------------
  |  |   57|  16.9k|    do {                                        \
  |  |   58|  16.9k|        (t) = 0;                                \
  |  |   59|  16.9k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1241|  16.9k|        if (dua->au_align >= 32) {
  ------------------
  |  Branch (1241:13): [True: 78, False: 16.8k]
  ------------------
 1242|     78|            *errcode = DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR;
  ------------------
  |  | 1478|     78|#define DW_DLE_UNIV_BIN_OFFSET_SIZE_ERROR      503
  ------------------
 1243|     78|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     78|#define DW_DLV_ERROR      1
  ------------------
 1244|     78|        }
 1245|  16.8k|        ASNAR(word_swap,dua->au_reserved,fa->reserved);
  ------------------
  |  |   57|  16.8k|    do {                                        \
  |  |   58|  16.8k|        (t) = 0;                                \
  |  |   59|  16.8k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  16.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1246|  16.8k|    }
 1247|    120|    return DW_DLV_OK;
  ------------------
  |  |   59|    120|#define DW_DLV_OK         0
  ------------------
 1248|    807|}
dwarf_machoread.c:macho_get_section_info:
  190|   166k|{
  191|   166k|    dwarf_macho_object_access_internals_t *macho =
  192|   166k|        (dwarf_macho_object_access_internals_t*)(obj);
  193|       |
  194|   166k|    (void)error;
  195|   166k|    if (section_index < macho->mo_dwarf_sectioncount) {
  ------------------
  |  Branch (195:9): [True: 166k, False: 0]
  ------------------
  196|   166k|        struct generic_macho_section *sp = 0;
  197|       |
  198|   166k|        sp = macho->mo_dwarf_sections + section_index;
  199|   166k|        return_section->as_name   = sp->dwarfsectname;
  200|   166k|        return_section->as_type   = 0;
  201|   166k|        return_section->as_flags  = sp->flags;
  202|   166k|        return_section->as_addr   = sp->addr;
  203|   166k|        return_section->as_offset = sp->offset;
  204|   166k|        return_section->as_size   = sp->size;
  205|   166k|        return_section->as_link   = 0;
  206|   166k|        return_section->as_info   = 0;
  207|   166k|        return_section->as_addralign = 0;
  208|   166k|        return_section->as_entrysize = 0;
  209|   166k|        return DW_DLV_OK;
  ------------------
  |  |   59|   166k|#define DW_DLV_OK         0
  ------------------
  210|   166k|    }
  211|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  212|   166k|}
dwarf_machoread.c:macho_get_byte_order:
  153|  3.30k|{
  154|  3.30k|    dwarf_macho_object_access_internals_t *macho =
  155|  3.30k|        (dwarf_macho_object_access_internals_t*)(obj);
  156|  3.30k|    return macho->mo_endian;
  157|  3.30k|}
dwarf_machoread.c:macho_get_length_size:
  160|  3.30k|{
  161|  3.30k|    dwarf_macho_object_access_internals_t *macho =
  162|  3.30k|        (dwarf_macho_object_access_internals_t*)(obj);
  163|  3.30k|    return macho->mo_offsetsize/8;
  164|  3.30k|}
dwarf_machoread.c:macho_get_pointer_size:
  167|  3.30k|{
  168|  3.30k|    dwarf_macho_object_access_internals_t *macho =
  169|  3.30k|        (dwarf_macho_object_access_internals_t*)(obj);
  170|  3.30k|    return macho->mo_pointersize/8;
  171|  3.30k|}
dwarf_machoread.c:macho_get_file_size:
  173|  3.30k|{
  174|  3.30k|    dwarf_macho_object_access_internals_t *macho =
  175|  3.30k|        (dwarf_macho_object_access_internals_t*)(obj);
  176|  3.30k|    return macho->mo_filesize;
  177|  3.30k|}
dwarf_machoread.c:macho_get_section_count:
  180|  3.30k|{
  181|  3.30k|    dwarf_macho_object_access_internals_t *macho =
  182|  3.30k|        (dwarf_macho_object_access_internals_t*)(obj);
  183|  3.30k|    return macho->mo_dwarf_sectioncount;
  184|  3.30k|}
dwarf_machoread.c:macho_load_section:
  217|     94|{
  218|     94|    dwarf_macho_object_access_internals_t *macho =
  219|     94|        (dwarf_macho_object_access_internals_t*)(obj);
  220|       |
  221|     94|    if (0 < section_index &&
  ------------------
  |  Branch (221:9): [True: 94, False: 0]
  ------------------
  222|     94|        section_index < macho->mo_dwarf_sectioncount) {
  ------------------
  |  Branch (222:9): [True: 94, False: 0]
  ------------------
  223|     94|        int res = 0;
  224|     94|        Dwarf_Unsigned inner = macho->mo_inner_offset;
  225|       |
  226|     94|        struct generic_macho_section *sp =
  227|     94|            macho->mo_dwarf_sections + section_index;
  228|     94|        if (sp->loaded_data) {
  ------------------
  |  Branch (228:13): [True: 0, False: 94]
  ------------------
  229|      0|            *return_data = sp->loaded_data;
  230|      0|            return DW_DLV_OK;
  ------------------
  |  |   59|      0|#define DW_DLV_OK         0
  ------------------
  231|      0|        }
  232|     94|        if (!sp->size) {
  ------------------
  |  Branch (232:13): [True: 0, False: 94]
  ------------------
  233|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  234|      0|        }
  235|     94|        if ((sp->size + sp->offset) >
  ------------------
  |  Branch (235:13): [True: 0, False: 94]
  ------------------
  236|     94|            macho->mo_filesize) {
  237|      0|            *error = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|      0|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  238|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  239|      0|        }
  240|       |
  241|     94|        sp->loaded_data = malloc((size_t)sp->size);
  242|     94|        if (!sp->loaded_data) {
  ------------------
  |  Branch (242:13): [True: 0, False: 94]
  ------------------
  243|      0|            *error = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  244|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  245|      0|        }
  246|     94|        res = RRMOA(macho->mo_fd,
  ------------------
  |  |   65|     94|#define RRMOA(f,buf,loc,siz,fsiz,errc) _dwarf_object_read_random(\
  |  |   66|     94|    (f),(char *)(buf),(loc),(siz),(fsiz),(errc));
  ------------------
  247|     94|            sp->loaded_data, (inner+sp->offset),
  248|     94|            sp->size,
  249|     94|            (inner+macho->mo_filesize), error);
  250|     94|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|     94|#define DW_DLV_OK         0
  ------------------
  |  Branch (250:13): [True: 0, False: 94]
  ------------------
  251|      0|            free(sp->loaded_data);
  252|      0|            sp->loaded_data = 0;
  253|      0|            return res;
  254|      0|        }
  255|     94|        *return_data = sp->loaded_data;
  256|     94|        return DW_DLV_OK;
  ------------------
  |  |   59|     94|#define DW_DLV_OK         0
  ------------------
  257|     94|    }
  258|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  259|     94|}

_dwarf_memcpy_noswap_bytes:
   48|  4.90M|{
   49|  4.90M|    memcpy(s1,s2,(size_t)len);
   50|  4.90M|    return;
   51|  4.90M|}
_dwarf_memcpy_swap_bytes:
   57|  4.59M|{
   58|  4.59M|    unsigned char       *targ = (unsigned char *) s1;
   59|  4.59M|    const unsigned char *src = (const unsigned char *) s2;
   60|  4.59M|    unsigned long        i = 0;
   61|  4.59M|    unsigned long        n = (long)(len-1);
   62|       |
   63|  4.59M|    if (len > 8) {
  ------------------
  |  Branch (63:9): [True: 0, False: 4.59M]
  ------------------
   64|       |        /*  Really we should not be here!
   65|       |            Not writing an integer, we think, so
   66|       |            best to not swap bytes! */
   67|      0|        memcpy(s1,s2,(size_t)len);
   68|      0|        return;
   69|      0|    }
   70|  22.9M|    for ( ; i < len; ++i,--n) {
  ------------------
  |  Branch (70:13): [True: 18.3M, False: 4.59M]
  ------------------
   71|  18.3M|        targ[n]  = src[i];
   72|  18.3M|    }
   73|  4.59M|    return;
   74|  4.59M|}

dwarf_object_detector_fd:
  498|  26.6k|{
  499|  26.6k|    Dwarf_Unsigned fileoffsetbase = 0;
  500|  26.6k|    int res = 0;
  501|       |
  502|  26.6k|    res = _dwarf_object_detector_fd_a(fd,
  503|  26.6k|        ftype,endian,offsetsize,
  504|  26.6k|        fileoffsetbase,filesize,
  505|  26.6k|        errcode);
  506|  26.6k|    return res;
  507|  26.6k|}
_dwarf_object_detector_fd_a:
  517|  26.9k|{
  518|  26.9k|    struct elf_header h;
  519|  26.9k|    Dwarf_Unsigned readlen = sizeof(h);
  520|  26.9k|    Dwarf_Unsigned fsize = 0;
  521|  26.9k|    Dwarf_Unsigned remaininglen  = 0;
  522|  26.9k|    int            res = 0;
  523|       |
  524|  26.9k|    res = _dwarf_seekr(fd,0,SEEK_END,&fsize);
  525|  26.9k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  26.9k|#define DW_DLV_OK        0
  ------------------
  |  Branch (525:9): [True: 6, False: 26.9k]
  ------------------
  526|      6|        *errcode = DW_DLE_SEEK_ERROR;
  ------------------
  |  | 1393|      6|#define DW_DLE_SEEK_ERROR                      418
  ------------------
  527|      6|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      6|#define DW_DLV_ERROR     1
  ------------------
  528|      6|    }
  529|  26.9k|    if (fsize <= readlen) {
  ------------------
  |  Branch (529:9): [True: 55, False: 26.8k]
  ------------------
  530|       |        /* Not a real object file */
  531|     55|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     55|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  532|     55|        return DW_DLV_ERROR;
  ------------------
  |  |   64|     55|#define DW_DLV_ERROR     1
  ------------------
  533|     55|    }
  534|  26.8k|    if (fsize <= fileoffsetbase) {
  ------------------
  |  Branch (534:9): [True: 0, False: 26.8k]
  ------------------
  535|      0|        *errcode = DW_DLE_SEEK_ERROR;
  ------------------
  |  | 1393|      0|#define DW_DLE_SEEK_ERROR                      418
  ------------------
  536|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  537|      0|    }
  538|  26.8k|    remaininglen = fsize - fileoffsetbase;
  539|  26.8k|    if (remaininglen <= readlen) {
  ------------------
  |  Branch (539:9): [True: 54, False: 26.8k]
  ------------------
  540|       |        /* Not a real object file */
  541|     54|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     54|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  542|     54|        return DW_DLV_ERROR;
  ------------------
  |  |   64|     54|#define DW_DLV_ERROR     1
  ------------------
  543|     54|    }
  544|       |    /*  fileoffsetbase is non zero iff we have
  545|       |        an Apple Universal Binary. */
  546|  26.8k|    res = _dwarf_seekr(fd,fileoffsetbase,SEEK_SET,0);
  547|  26.8k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  26.8k|#define DW_DLV_OK        0
  ------------------
  |  Branch (547:9): [True: 0, False: 26.8k]
  ------------------
  548|      0|        *errcode = DW_DLE_SEEK_ERROR;
  ------------------
  |  | 1393|      0|#define DW_DLE_SEEK_ERROR                      418
  ------------------
  549|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  550|      0|    }
  551|  26.8k|    res = _dwarf_readr(fd,(char *)&h,readlen,0);
  552|  26.8k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  26.8k|#define DW_DLV_OK        0
  ------------------
  |  Branch (552:9): [True: 0, False: 26.8k]
  ------------------
  553|      0|        *errcode = DW_DLE_READ_ERROR;
  ------------------
  |  | 1394|      0|#define DW_DLE_READ_ERROR                      419
  ------------------
  554|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  555|      0|    }
  556|  26.8k|    if (h.e_ident[0] == 0x7f &&
  ------------------
  |  Branch (556:9): [True: 13.2k, False: 13.5k]
  ------------------
  557|  26.8k|        h.e_ident[1] == 'E' &&
  ------------------
  |  Branch (557:9): [True: 13.1k, False: 63]
  ------------------
  558|  26.8k|        h.e_ident[2] == 'L' &&
  ------------------
  |  Branch (558:9): [True: 13.1k, False: 63]
  ------------------
  559|  26.8k|        h.e_ident[3] == 'F') {
  ------------------
  |  Branch (559:9): [True: 13.0k, False: 75]
  ------------------
  560|       |        /* is ELF */
  561|       |
  562|  13.0k|        res = fill_in_elf_fields(&h,endian,offsetsize,errcode);
  563|  13.0k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  13.0k|#define DW_DLV_OK        0
  ------------------
  |  Branch (563:13): [True: 59, False: 12.9k]
  ------------------
  564|     59|            return res;
  565|     59|        }
  566|  12.9k|        *ftype = DW_FTYPE_ELF;
  ------------------
  |  |  114|  12.9k|#define DW_FTYPE_ELF        1  /* Unix/Linux/etc */
  ------------------
  567|  12.9k|        *filesize = (Dwarf_Unsigned)fsize;
  568|  12.9k|        return DW_DLV_OK;
  ------------------
  |  |   63|  12.9k|#define DW_DLV_OK        0
  ------------------
  569|  13.0k|    }
  570|  13.7k|    if (is_mach_o_universal(&h,endian,offsetsize)) {
  ------------------
  |  Branch (570:9): [True: 1.87k, False: 11.8k]
  ------------------
  571|  1.87k|        *ftype = DW_FTYPE_APPLEUNIVERSAL;
  ------------------
  |  |  118|  1.87k|#define DW_FTYPE_APPLEUNIVERSAL    5
  ------------------
  572|  1.87k|        *filesize = (Dwarf_Unsigned)fsize;
  573|  1.87k|        return DW_DLV_OK;
  ------------------
  |  |   63|  1.87k|#define DW_DLV_OK        0
  ------------------
  574|  1.87k|    }
  575|  11.8k|    if (is_mach_o_magic(&h,endian,offsetsize)) {
  ------------------
  |  Branch (575:9): [True: 7.29k, False: 4.58k]
  ------------------
  576|  7.29k|        *ftype = DW_FTYPE_MACH_O;
  ------------------
  |  |  115|  7.29k|#define DW_FTYPE_MACH_O     2  /* MacOS. */
  ------------------
  577|  7.29k|        *filesize = (Dwarf_Unsigned)fsize;
  578|  7.29k|        return DW_DLV_OK;
  ------------------
  |  |   63|  7.29k|#define DW_DLV_OK        0
  ------------------
  579|  7.29k|    }
  580|  4.58k|    if (is_archive_magic(&h)) {
  ------------------
  |  Branch (580:9): [True: 3, False: 4.58k]
  ------------------
  581|      3|        *ftype = DW_FTYPE_ARCHIVE;
  ------------------
  |  |  117|      3|#define DW_FTYPE_ARCHIVE    4  /* unix archive */
  ------------------
  582|      3|        *filesize = (Dwarf_Unsigned)fsize;
  583|      3|        return DW_DLV_OK;
  ------------------
  |  |   63|      3|#define DW_DLV_OK        0
  ------------------
  584|      3|    }
  585|  4.58k|    res = is_pe_object(fd,fsize,endian,offsetsize,errcode);
  586|  4.58k|    if (res == DW_DLV_OK ) {
  ------------------
  |  |   63|  4.58k|#define DW_DLV_OK        0
  ------------------
  |  Branch (586:9): [True: 1.98k, False: 2.59k]
  ------------------
  587|  1.98k|        *ftype = DW_FTYPE_PE;
  ------------------
  |  |  116|  1.98k|#define DW_FTYPE_PE         3  /* Windows */
  ------------------
  588|  1.98k|        *filesize = (Dwarf_Unsigned)fsize;
  589|  1.98k|        return DW_DLV_OK;
  ------------------
  |  |   63|  1.98k|#define DW_DLV_OK        0
  ------------------
  590|  1.98k|    }
  591|       |    /* Unknown object format. */
  592|  2.59k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|  2.59k|#define DW_DLV_NO_ENTRY -1
  ------------------
  593|  4.58k|}
dwarf_object_detector_path_dSYM:
  607|  8.45k|{
  608|  8.45k|    char *cp = 0;
  609|  8.45k|    size_t plen = strlen(path);
  610|  8.45k|    size_t dsprefixlen = sizeof(DSYM_SUFFIX);
  ------------------
  |  |   77|  8.45k|#define DSYM_SUFFIX ".dSYM/Contents/Resources/DWARF/"
  ------------------
  611|  8.45k|    int fd = -1;
  612|  8.45k|    int res = 0;
  613|  8.45k|    int have_outpath = outpath && outpath_len;
  ------------------
  |  Branch (613:24): [True: 8.45k, False: 0]
  |  Branch (613:35): [True: 8.45k, False: 0]
  ------------------
  614|       |
  615|  8.45k|    (void)gl_pathnames;
  616|  8.45k|    (void)gl_pathcount;
  617|  8.45k|    if (have_outpath) {
  ------------------
  |  Branch (617:9): [True: 8.45k, False: 0]
  ------------------
  618|       |        /*   Looking for MacOS dSYM */
  619|  8.45k|        if ((2*plen + dsprefixlen +2) >= (size_t)outpath_len) {
  ------------------
  |  Branch (619:13): [True: 0, False: 8.45k]
  ------------------
  620|      0|            *errcode =  DW_DLE_PATH_SIZE_TOO_SMALL;
  ------------------
  |  | 1399|      0|#define DW_DLE_PATH_SIZE_TOO_SMALL             424
  ------------------
  621|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  622|      0|        }
  623|  8.45k|        res = dw_stpcpy(outpath,path,&cp,outpath+outpath_len);
  624|  8.45k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (624:13): [True: 0, False: 8.45k]
  ------------------
  625|      0|            *errcode =  DW_DLE_PATH_SIZE_TOO_SMALL;
  ------------------
  |  | 1399|      0|#define DW_DLE_PATH_SIZE_TOO_SMALL             424
  ------------------
  626|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  627|      0|        }
  628|  8.45k|        res = dw_stpcpy(cp,DSYM_SUFFIX,&cp,outpath+outpath_len);
  ------------------
  |  |   77|  8.45k|#define DSYM_SUFFIX ".dSYM/Contents/Resources/DWARF/"
  ------------------
  629|  8.45k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (629:13): [True: 0, False: 8.45k]
  ------------------
  630|      0|            *errcode =  DW_DLE_PATH_SIZE_TOO_SMALL;
  ------------------
  |  | 1399|      0|#define DW_DLE_PATH_SIZE_TOO_SMALL             424
  ------------------
  631|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  632|      0|        }
  633|  8.45k|        res= dw_stpcpy(cp,getbasename(path),&cp,outpath+outpath_len);
  634|  8.45k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (634:13): [True: 0, False: 8.45k]
  ------------------
  635|      0|            *errcode =  DW_DLE_PATH_SIZE_TOO_SMALL;
  ------------------
  |  | 1399|      0|#define DW_DLE_PATH_SIZE_TOO_SMALL             424
  ------------------
  636|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  637|      0|        }
  638|  8.45k|        fd = _dwarf_openr(outpath);
  639|  8.45k|        if (fd < 0) {
  ------------------
  |  Branch (639:13): [True: 8.45k, False: 0]
  ------------------
  640|  8.45k|            outpath[0] = 0;
  641|  8.45k|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|  8.45k|#define DW_DLV_NO_ENTRY -1
  ------------------
  642|  8.45k|        }
  643|      0|        *pathsource = DW_PATHSOURCE_dsym;
  ------------------
  |  |  109|      0|#define DW_PATHSOURCE_dsym      2 /* MacOS dSYM */
  ------------------
  644|      0|        res = dwarf_object_detector_fd(fd,
  645|      0|            ftype,endian,offsetsize,filesize,errcode);
  646|      0|        if (res != DW_DLV_OK) {
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  |  Branch (646:13): [True: 0, False: 0]
  ------------------
  647|      0|            _dwarf_closer(fd);
  648|      0|            return res;
  649|      0|        }
  650|      0|        _dwarf_closer(fd);
  651|      0|        return DW_DLV_OK;
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  652|      0|    }
  653|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  654|  8.45k|}
dwarf_object_detector_path_b:
  937|  31.8k|{
  938|  31.8k|    int fd = -1;
  939|  31.8k|    int res = 0;
  940|  31.8k|    int have_outpath = outpath && outpath_len;
  ------------------
  |  Branch (940:24): [True: 8.45k, False: 23.4k]
  |  Branch (940:35): [True: 8.45k, False: 0]
  ------------------
  941|  31.8k|    unsigned char lpathsource = DW_PATHSOURCE_basic;
  ------------------
  |  |  108|  31.8k|#define DW_PATHSOURCE_basic     1
  ------------------
  942|       |
  943|  31.8k|    if (pathsource) {
  ------------------
  |  Branch (943:9): [True: 31.8k, False: 0]
  ------------------
  944|  31.8k|        lpathsource = *pathsource;
  945|  31.8k|    }
  946|  31.8k|    if (lpathsource == DW_PATHSOURCE_basic && have_outpath) {
  ------------------
  |  |  108|  63.7k|#define DW_PATHSOURCE_basic     1
  ------------------
  |  Branch (946:9): [True: 30.5k, False: 1.31k]
  |  Branch (946:47): [True: 8.45k, False: 22.1k]
  ------------------
  947|       |        /*  On return from the following call  we could well
  948|       |            close the fd above and open a new one. */
  949|  8.45k|        int debuglink_fd = -1;
  950|  8.45k|        size_t dllenszt = 0;
  951|  8.45k|        char *cp = 0;
  952|  8.45k|        dwarfstring m;
  953|       |
  954|  8.45k|        dwarfstring_constructor(&m);
  955|  8.45k|        res = _dwarf_debuglink_finder_internal(
  956|  8.45k|            gl_pathnames,gl_pathcount,
  957|  8.45k|            (char *)path, &m,&debuglink_fd, errcode);
  958|  8.45k|        if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (958:13): [True: 5.20k, False: 3.25k]
  ------------------
  959|  5.20k|            dwarfstring_destructor(&m);
  960|  5.20k|            if (debuglink_fd != -1) {
  ------------------
  |  Branch (960:17): [True: 0, False: 5.20k]
  ------------------
  961|      0|                _dwarf_closer(debuglink_fd);
  962|      0|            }
  963|  5.20k|            return res;
  964|  5.20k|        }
  965|  3.25k|        if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   62|  3.25k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (965:13): [True: 3.25k, False: 0]
  ------------------
  966|       |            /*  We did not find an alternative path */
  967|  3.25k|            res = dw_stpcpy(outpath,path,&cp,outpath+outpath_len);
  968|  3.25k|            if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  3.25k|#define DW_DLV_OK        0
  ------------------
  |  Branch (968:17): [True: 0, False: 3.25k]
  ------------------
  969|      0|                *errcode =  DW_DLE_PATH_SIZE_TOO_SMALL;
  ------------------
  |  | 1399|      0|#define DW_DLE_PATH_SIZE_TOO_SMALL             424
  ------------------
  970|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  971|      0|            }
  972|  3.25k|            lpathsource = DW_PATHSOURCE_basic;
  ------------------
  |  |  108|  3.25k|#define DW_PATHSOURCE_basic     1
  ------------------
  973|  3.25k|        } else {
  974|      0|            if (debuglink_fd != -1) {
  ------------------
  |  Branch (974:17): [True: 0, False: 0]
  ------------------
  975|      0|                _dwarf_closer(debuglink_fd);
  976|      0|                debuglink_fd = -1;
  977|      0|            }
  978|      0|            dllenszt = dwarfstring_strlen(&m)+1;
  979|      0|            if (dllenszt >= (size_t)outpath_len) {
  ------------------
  |  Branch (979:17): [True: 0, False: 0]
  ------------------
  980|      0|                *errcode = DW_DLE_DEBUGLINK_PATH_SHORT;
  ------------------
  |  | 1454|      0|#define DW_DLE_DEBUGLINK_PATH_SHORT            479
  ------------------
  981|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  982|      0|            }
  983|      0|            res = dw_stpcpy(outpath,dwarfstring_string(&m),
  984|      0|                &cp,outpath+outpath_len);
  985|      0|            if (res != DW_DLV_OK) {
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  |  Branch (985:17): [True: 0, False: 0]
  ------------------
  986|      0|                *errcode = DW_DLE_DEBUGLINK_PATH_SHORT;
  ------------------
  |  | 1454|      0|#define DW_DLE_DEBUGLINK_PATH_SHORT            479
  ------------------
  987|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  988|      0|            }
  989|      0|            lpathsource = DW_PATHSOURCE_debuglink;
  ------------------
  |  |  110|      0|#define DW_PATHSOURCE_debuglink 3 /* GNU debuglink */
  ------------------
  990|      0|        }
  991|  3.25k|        dwarfstring_destructor(&m);
  992|  3.25k|        fd = _dwarf_openr(outpath);
  993|       |        /* fall through to get fsize etc */
  994|  23.4k|    } else {
  995|  23.4k|        lpathsource = DW_PATHSOURCE_basic;
  ------------------
  |  |  108|  23.4k|#define DW_PATHSOURCE_basic     1
  ------------------
  996|  23.4k|        fd = _dwarf_openr(path);
  997|  23.4k|    }
  998|  26.6k|    if (fd < 0) {
  ------------------
  |  Branch (998:9): [True: 0, False: 26.6k]
  ------------------
  999|      0|        if (pathsource) {
  ------------------
  |  Branch (999:13): [True: 0, False: 0]
  ------------------
 1000|      0|            *pathsource = DW_PATHSOURCE_unspecified;
  ------------------
  |  |  107|      0|#define DW_PATHSOURCE_unspecified 0
  ------------------
 1001|      0|        }
 1002|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
 1003|      0|    }
 1004|  26.6k|    res = dwarf_object_detector_fd(fd,
 1005|  26.6k|        ftype,endian,offsetsize,filesize,errcode);
 1006|  26.6k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  26.6k|#define DW_DLV_OK        0
  ------------------
  |  Branch (1006:9): [True: 2.64k, False: 24.0k]
  ------------------
 1007|  2.64k|        lpathsource = DW_PATHSOURCE_unspecified;
  ------------------
  |  |  107|  2.64k|#define DW_PATHSOURCE_unspecified 0
  ------------------
 1008|  2.64k|    }
 1009|  26.6k|    if (pathsource) {
  ------------------
  |  Branch (1009:9): [True: 26.6k, False: 0]
  ------------------
 1010|  26.6k|        *pathsource = lpathsource;
 1011|  26.6k|    }
 1012|  26.6k|    _dwarf_closer(fd);
 1013|  26.6k|    return res;
 1014|  26.6k|}
dwarf_object_detector.c:fill_in_elf_fields:
  265|  13.0k|{
  266|  13.0k|    unsigned locendian = 0;
  267|  13.0k|    unsigned locoffsetsize = 0;
  268|       |
  269|  13.0k|    switch(h->e_ident[EI_CLASS]) {
  ------------------
  |  |   68|  13.0k|#define EI_CLASS  4
  ------------------
  270|  8.30k|    case ELFCLASS32:
  ------------------
  |  |   71|  8.30k|#define ELFCLASS32 1
  ------------------
  |  Branch (270:5): [True: 8.30k, False: 4.75k]
  ------------------
  271|  8.30k|        locoffsetsize = 32;
  272|  8.30k|        break;
  273|  4.74k|    case ELFCLASS64:
  ------------------
  |  |   72|  4.74k|#define ELFCLASS64 2
  ------------------
  |  Branch (273:5): [True: 4.74k, False: 8.31k]
  ------------------
  274|  4.74k|        locoffsetsize = 64;
  275|  4.74k|        break;
  276|      8|    default:
  ------------------
  |  Branch (276:5): [True: 8, False: 13.0k]
  ------------------
  277|      8|        *errcode = DW_DLE_ELF_CLASS_BAD;
  ------------------
  |  | 1395|      8|#define DW_DLE_ELF_CLASS_BAD                   420
  ------------------
  278|      8|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      8|#define DW_DLV_ERROR     1
  ------------------
  279|  13.0k|    }
  280|  13.0k|    switch(h->e_ident[EI_DATA]) {
  ------------------
  |  |   69|  13.0k|#define EI_DATA   5
  ------------------
  281|  7.94k|    case ELFDATA2LSB:
  ------------------
  |  |   73|  7.94k|#define ELFDATA2LSB 1
  ------------------
  |  Branch (281:5): [True: 7.94k, False: 5.10k]
  ------------------
  282|  7.94k|        locendian = DW_END_little;
  ------------------
  |  | 1105|  7.94k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  283|  7.94k|        break;
  284|  5.09k|    case ELFDATA2MSB:
  ------------------
  |  |   74|  5.09k|#define ELFDATA2MSB 2
  ------------------
  |  Branch (284:5): [True: 5.09k, False: 7.95k]
  ------------------
  285|  5.09k|        locendian = DW_END_big;
  ------------------
  |  | 1104|  5.09k|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  286|  5.09k|        break;
  287|      8|    default:
  ------------------
  |  Branch (287:5): [True: 8, False: 13.0k]
  ------------------
  288|      8|        *errcode = DW_DLE_ELF_ENDIAN_BAD;
  ------------------
  |  | 1396|      8|#define DW_DLE_ELF_ENDIAN_BAD                  421
  ------------------
  289|      8|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      8|#define DW_DLV_ERROR     1
  ------------------
  290|  13.0k|    }
  291|  13.0k|    if (h->e_ident[EI_VERSION] != 1 /* EV_CURRENT */) {
  ------------------
  |  |   70|  13.0k|#define EI_VERSION 6
  ------------------
  |  Branch (291:9): [True: 43, False: 12.9k]
  ------------------
  292|     43|        *errcode = DW_DLE_ELF_VERSION_BAD;
  ------------------
  |  | 1397|     43|#define DW_DLE_ELF_VERSION_BAD                 422
  ------------------
  293|     43|        return DW_DLV_ERROR;
  ------------------
  |  |   64|     43|#define DW_DLV_ERROR     1
  ------------------
  294|     43|    }
  295|  12.9k|    *endian = locendian;
  296|  12.9k|    *objoffsetsize = locoffsetsize;
  297|  12.9k|    return DW_DLV_OK;
  ------------------
  |  |   63|  12.9k|#define DW_DLV_OK        0
  ------------------
  298|  13.0k|}
dwarf_object_detector.c:is_mach_o_universal:
  431|  13.7k|{
  432|  13.7k|    unsigned long magicval = 0;
  433|  13.7k|    unsigned locendian = 0;
  434|  13.7k|    unsigned locoffsetsize = 0;
  435|       |
  436|       |    /*  No swapping here. Need to match size of
  437|       |        the universal-object  magic field. */
  438|  13.7k|    magicval = magic_copy(h->e_ident,4);
  439|  13.7k|    if (magicval == FAT_MAGIC) {
  ------------------
  |  |   84|  13.7k|#define FAT_MAGIC   0xcafebabe
  ------------------
  |  Branch (439:9): [True: 144, False: 13.6k]
  ------------------
  440|    144|        locendian = DW_END_big;
  ------------------
  |  | 1104|    144|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  441|    144|        locoffsetsize = 32;
  442|  13.6k|    } else if (magicval == FAT_CIGAM) {
  ------------------
  |  |   85|  13.6k|#define FAT_CIGAM   0xbebafeca
  ------------------
  |  Branch (442:16): [True: 684, False: 12.9k]
  ------------------
  443|    684|        locendian = DW_END_little;
  ------------------
  |  | 1105|    684|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  444|    684|        locoffsetsize = 32;
  445|  12.9k|    }else if (magicval == FAT_MAGIC_64) {
  ------------------
  |  |   86|  12.9k|#define FAT_MAGIC_64    0xcafebabf
  ------------------
  |  Branch (445:15): [True: 300, False: 12.6k]
  ------------------
  446|    300|        locendian = DW_END_big;
  ------------------
  |  | 1104|    300|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  447|    300|        locoffsetsize = 64;
  448|  12.6k|    } else if (magicval == FAT_CIGAM_64) {
  ------------------
  |  |   87|  12.6k|#define FAT_CIGAM_64    0xbfbafeca
  ------------------
  |  Branch (448:16): [True: 744, False: 11.8k]
  ------------------
  449|    744|        locendian = DW_END_little;
  ------------------
  |  | 1105|    744|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  450|    744|        locoffsetsize = 64;
  451|  11.8k|    } else {
  452|  11.8k|        return FALSE;
  ------------------
  |  |   40|  11.8k|#define FALSE 0
  ------------------
  453|  11.8k|    }
  454|  1.87k|    *endian = locendian;
  455|  1.87k|    *offsetsize = locoffsetsize;
  456|  1.87k|    return TRUE;
  ------------------
  |  |   37|  1.87k|#define TRUE 1
  ------------------
  457|  13.7k|}
dwarf_object_detector.c:magic_copy:
  125|  28.7k|{
  126|  28.7k|    unsigned i = 0;
  127|  28.7k|    unsigned long v = 0;
  128|       |
  129|  28.7k|    v = d[0];
  130|   108k|    for (i = 1 ; i < len; ++i) {
  ------------------
  |  Branch (130:18): [True: 80.0k, False: 28.7k]
  ------------------
  131|  80.0k|        v <<= 8;
  132|  80.0k|        v |=  d[i];
  133|  80.0k|    }
  134|  28.7k|    return v;
  135|  28.7k|}
dwarf_object_detector.c:is_mach_o_magic:
  463|  11.8k|{
  464|  11.8k|    unsigned long magicval = 0;
  465|  11.8k|    unsigned locendian = 0;
  466|  11.8k|    unsigned locoffsetsize = 0;
  467|       |
  468|       |    /*  No swapping here. Need to match size of
  469|       |        Mach-o magic field. */
  470|  11.8k|    magicval = magic_copy(h->e_ident,4);
  471|  11.8k|    if (magicval == MH_MAGIC) {
  ------------------
  |  |  130|  11.8k|#define    MH_MAGIC    0xfeedface    /* the mach magic number */
  ------------------
  |  Branch (471:9): [True: 915, False: 10.9k]
  ------------------
  472|    915|        locendian = DW_END_big;
  ------------------
  |  | 1104|    915|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  473|    915|        locoffsetsize = 32;
  474|  10.9k|    } else if (magicval == MH_CIGAM) {
  ------------------
  |  |  131|  10.9k|#define MH_CIGAM    0xcefaedfe    /* NXSwapInt(MH_MAGIC) */
  ------------------
  |  Branch (474:16): [True: 5.07k, False: 5.88k]
  ------------------
  475|  5.07k|        locendian = DW_END_little;
  ------------------
  |  | 1105|  5.07k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  476|  5.07k|        locoffsetsize = 32;
  477|  5.88k|    }else if (magicval == MH_MAGIC_64) {
  ------------------
  |  |  151|  5.88k|#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
  ------------------
  |  Branch (477:15): [True: 165, False: 5.72k]
  ------------------
  478|    165|        locendian = DW_END_big;
  ------------------
  |  | 1104|    165|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  479|    165|        locoffsetsize = 64;
  480|  5.72k|    } else if (magicval == MH_CIGAM_64) {
  ------------------
  |  |  152|  5.72k|#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
  ------------------
  |  Branch (480:16): [True: 1.13k, False: 4.58k]
  ------------------
  481|  1.13k|        locendian = DW_END_little;
  ------------------
  |  | 1105|  1.13k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  482|  1.13k|        locoffsetsize = 64;
  483|  4.58k|    } else {
  484|  4.58k|        return FALSE;
  ------------------
  |  |   40|  4.58k|#define FALSE 0
  ------------------
  485|  4.58k|    }
  486|  7.29k|    *endian = locendian;
  487|  7.29k|    *offsetsize = locoffsetsize;
  488|  7.29k|    return TRUE;
  ------------------
  |  |   37|  7.29k|#define TRUE 1
  ------------------
  489|  11.8k|}
dwarf_object_detector.c:is_archive_magic:
  303|  4.58k|is_archive_magic(struct elf_header *h) {
  304|  4.58k|    int i = 0;
  305|  4.58k|    int len = sizeof(archive_magic);
  306|  4.58k|    const char *cp = (const char *)h;
  307|  4.68k|    for ( ; i < len; ++i) {
  ------------------
  |  Branch (307:13): [True: 4.68k, False: 3]
  ------------------
  308|  4.68k|        if (cp[i] != archive_magic[i]) {
  ------------------
  |  Branch (308:13): [True: 4.58k, False: 99]
  ------------------
  309|  4.58k|            return FALSE;
  ------------------
  |  |   40|  4.58k|#define FALSE 0
  ------------------
  310|  4.58k|        }
  311|  4.68k|    }
  312|      3|    return TRUE;
  ------------------
  |  |   37|      3|#define TRUE 1
  ------------------
  313|  4.58k|}
dwarf_object_detector.c:is_pe_object:
  323|  4.58k|{
  324|  4.58k|    unsigned dos_sig = 0;
  325|  4.58k|    unsigned locendian = 0;
  326|  4.58k|    void (*word_swap) (void *, const void *, unsigned long);
  327|  4.58k|    unsigned long nt_address = 0;
  328|  4.58k|    struct dos_header dhinmem;
  329|  4.58k|    char nt_sig_array[4];
  330|  4.58k|    unsigned long nt_sig = 0;
  331|  4.58k|    struct pe_image_file_header ifh;
  332|  4.58k|    int res = 0;
  333|       |
  334|  4.58k|    if (filesize < (sizeof (struct dos_header) +
  ------------------
  |  Branch (334:9): [True: 1.42k, False: 3.15k]
  ------------------
  335|  4.58k|        SIZEOFT32 + sizeof(struct pe_image_file_header))) {
  ------------------
  |  |   60|  4.58k|#define SIZEOFT32 4
  ------------------
  336|  1.42k|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|  1.42k|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  337|  1.42k|        return DW_DLV_ERROR;
  ------------------
  |  |   64|  1.42k|#define DW_DLV_ERROR     1
  ------------------
  338|  1.42k|    }
  339|  3.15k|    res = _dwarf_object_read_random(fd,(char *)&dhinmem,
  340|  3.15k|        0,sizeof(dhinmem),filesize,errcode);
  341|  3.15k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  3.15k|#define DW_DLV_OK        0
  ------------------
  |  Branch (341:9): [True: 0, False: 3.15k]
  ------------------
  342|      0|        return res;
  343|      0|    }
  344|       |    /* No swap here, want it as in the file */
  345|  3.15k|    dos_sig = magic_copy((unsigned char *)dhinmem.dh_mz,
  346|  3.15k|        sizeof(dhinmem.dh_mz));
  347|  3.15k|    if (dos_sig == IMAGE_DOS_SIGNATURE_dw) {
  ------------------
  |  |  190|  3.15k|#define IMAGE_DOS_SIGNATURE_dw      0x5A4D
  ------------------
  |  Branch (347:9): [True: 324, False: 2.82k]
  ------------------
  348|       |        /*  IMAGE_DOS_SIGNATURE_dw assumes bytes
  349|       |            reversed by little-endian
  350|       |            load, so we intrepet a match the other way. */
  351|       |        /* BIG ENDIAN. From looking at hex characters in object  */
  352|       |#ifdef WORDS_BIGENDIAN
  353|       |        word_swap = _dwarf_memcpy_noswap_bytes;
  354|       |#else  /* LITTLE ENDIAN */
  355|    324|        word_swap =  _dwarf_memcpy_swap_bytes;
  356|    324|#endif /* LITTLE- BIG-ENDIAN */
  357|    324|        locendian = DW_END_big;
  ------------------
  |  | 1104|    324|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  358|  2.82k|    } else if (dos_sig == IMAGE_DOS_REVSIGNATURE_dw) {
  ------------------
  |  |  191|  2.82k|#define IMAGE_DOS_REVSIGNATURE_dw   0x4D5A
  ------------------
  |  Branch (358:16): [True: 2.54k, False: 288]
  ------------------
  359|       |        /* raw load, so  intrepet a match the other way. */
  360|       |        /* LITTLE ENDIAN */
  361|       |#ifdef WORDS_BIGENDIAN
  362|       |        word_swap =  _dwarf_memcpy_swap_bytes;
  363|       |#else  /* LITTLE ENDIAN */
  364|  2.54k|        word_swap = _dwarf_memcpy_noswap_bytes;
  365|  2.54k|#endif /* LITTLE- BIG-ENDIAN */
  366|  2.54k|        locendian = DW_END_little;
  ------------------
  |  | 1105|  2.54k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  367|  2.54k|    } else {
  368|       |        /* Not dos header not a PE file we recognize */
  369|    288|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|    288|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
  370|    288|        return DW_DLV_ERROR;
  ------------------
  |  |   64|    288|#define DW_DLV_ERROR     1
  ------------------
  371|    288|    }
  372|  2.86k|    ASNAR(word_swap,nt_address, dhinmem.dh_image_offset);
  ------------------
  |  |   57|  2.86k|    do {                                        \
  |  |   58|  2.86k|        (t) = 0;                                \
  |  |   59|  2.86k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  2.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  373|  2.86k|    if (filesize < nt_address) {
  ------------------
  |  Branch (373:9): [True: 270, False: 2.59k]
  ------------------
  374|       |        /* Not dos header not a PE file we recognize */
  375|    270|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|    270|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  376|    270|        return DW_DLV_ERROR;
  ------------------
  |  |   64|    270|#define DW_DLV_ERROR     1
  ------------------
  377|    270|    }
  378|  2.59k|    if (filesize < (nt_address + SIZEOFT32 +
  ------------------
  |  |   60|  2.59k|#define SIZEOFT32 4
  ------------------
  |  Branch (378:9): [True: 24, False: 2.57k]
  ------------------
  379|  2.59k|        sizeof(struct pe_image_file_header))) {
  380|     24|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     24|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  381|       |        /* Not dos header not a PE file we recognize */
  382|     24|        return DW_DLV_ERROR;
  ------------------
  |  |   64|     24|#define DW_DLV_ERROR     1
  ------------------
  383|     24|    }
  384|  2.57k|    res =  _dwarf_object_read_random(fd,(char *)&nt_sig_array[0],
  385|  2.57k|        nt_address, sizeof(nt_sig_array),filesize,errcode);
  386|  2.57k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  2.57k|#define DW_DLV_OK        0
  ------------------
  |  Branch (386:9): [True: 0, False: 2.57k]
  ------------------
  387|      0|        return res;
  388|      0|    }
  389|  2.57k|    {   unsigned long lsig = 0;
  390|       |
  391|  2.57k|        ASNAR(word_swap,lsig,nt_sig_array);
  ------------------
  |  |   57|  2.57k|    do {                                        \
  |  |   58|  2.57k|        (t) = 0;                                \
  |  |   59|  2.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  2.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  392|  2.57k|        nt_sig = lsig;
  393|  2.57k|    }
  394|  2.57k|    if (nt_sig != IMAGE_NT_SIGNATURE_dw) {
  ------------------
  |  |  192|  2.57k|#define IMAGE_NT_SIGNATURE_dw       0x00004550
  ------------------
  |  Branch (394:9): [True: 234, False: 2.33k]
  ------------------
  395|    234|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|    234|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
  396|    234|        return DW_DLV_ERROR;
  ------------------
  |  |   64|    234|#define DW_DLV_ERROR     1
  ------------------
  397|    234|    }
  398|  2.33k|    res = _dwarf_object_read_random(fd,(char *)&ifh,
  399|  2.33k|        nt_address + SIZEOFT32,
  ------------------
  |  |   60|  2.33k|#define SIZEOFT32 4
  ------------------
  400|  2.33k|        sizeof(struct pe_image_file_header),
  401|  2.33k|        filesize,
  402|  2.33k|        errcode);
  403|  2.33k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   63|  2.33k|#define DW_DLV_OK        0
  ------------------
  |  Branch (403:9): [True: 0, False: 2.33k]
  ------------------
  404|      0|        return res;
  405|      0|    }
  406|  2.33k|    {
  407|  2.33k|        unsigned long machine = 0;
  408|       |
  409|  2.33k|        ASNAR(word_swap,machine,ifh.im_machine);
  ------------------
  |  |   57|  2.33k|    do {                                        \
  |  |   58|  2.33k|        (t) = 0;                                \
  |  |   59|  2.33k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  2.33k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  410|  2.33k|        switch(machine) {
  411|  1.63k|        case IMAGE_FILE_MACHINE_I386_dw:
  ------------------
  |  |  193|  1.63k|#define IMAGE_FILE_MACHINE_I386_dw  0x14c
  ------------------
  |  Branch (411:9): [True: 1.63k, False: 699]
  ------------------
  412|  1.63k|            *offsetsize = 32;
  413|  1.63k|            *endian = locendian;
  414|  1.63k|            return DW_DLV_OK;
  ------------------
  |  |   63|  1.63k|#define DW_DLV_OK        0
  ------------------
  415|     84|        case IMAGE_FILE_MACHINE_IA64_dw:
  ------------------
  |  |  194|     84|#define IMAGE_FILE_MACHINE_IA64_dw  0x200
  ------------------
  |  Branch (415:9): [True: 84, False: 2.25k]
  ------------------
  416|    345|        case IMAGE_FILE_MACHINE_AMD64_dw:
  ------------------
  |  |  195|    345|#define IMAGE_FILE_MACHINE_AMD64_dw 0x8664
  ------------------
  |  Branch (416:9): [True: 261, False: 2.07k]
  ------------------
  417|    345|            *offsetsize = 64;
  418|    345|            *endian = locendian;
  419|    345|            return DW_DLV_OK;
  ------------------
  |  |   63|    345|#define DW_DLV_OK        0
  ------------------
  420|    354|        default: break;
  ------------------
  |  Branch (420:9): [True: 354, False: 1.98k]
  ------------------
  421|  2.33k|        }
  422|  2.33k|    }
  423|    354|    *errcode = DW_DLE_IMAGE_FILE_UNKNOWN_TYPE;
  ------------------
  |  | 1404|    354|#define DW_DLE_IMAGE_FILE_UNKNOWN_TYPE         429
  ------------------
  424|    354|    return DW_DLV_ERROR;
  ------------------
  |  |   64|    354|#define DW_DLV_ERROR     1
  ------------------
  425|  2.33k|}
dwarf_object_detector.c:dw_stpcpy:
  239|  28.6k|{
  240|  28.6k|    const char *cp = src;
  241|  28.6k|    char *dp = dest;
  242|       |
  243|   611k|    for ( ; *cp; ++cp,++dp) {
  ------------------
  |  Branch (243:13): [True: 582k, False: 28.6k]
  ------------------
  244|   582k|        if (dp >= endpoint) {
  ------------------
  |  Branch (244:13): [True: 0, False: 582k]
  ------------------
  245|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  246|      0|        }
  247|   582k|        *dp = *cp;
  248|   582k|    }
  249|  28.6k|    if (dp >= endpoint) {
  ------------------
  |  Branch (249:9): [True: 0, False: 28.6k]
  ------------------
  250|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  251|      0|    }
  252|  28.6k|    *dp = 0;
  253|  28.6k|    *destend = dp;
  254|  28.6k|    return DW_DLV_OK;
  ------------------
  |  |   63|  28.6k|#define DW_DLV_OK        0
  ------------------
  255|  28.6k|}
dwarf_object_detector.c:getbasename:
  228|  8.45k|{
  229|  8.45k|    const char *pseparator = getseparator (f);
  230|  8.45k|    if (!pseparator) {
  ------------------
  |  Branch (230:9): [True: 0, False: 8.45k]
  ------------------
  231|      0|        return f;
  232|      0|    }
  233|  8.45k|    return pseparator;
  234|  8.45k|}
dwarf_object_detector.c:getseparator:
  210|  8.45k|{
  211|  8.45k|    const char *p = 0;
  212|  8.45k|    const char *q = 0;
  213|  8.45k|    char c = 0;;
  214|       |
  215|  8.45k|    p = NULL;
  216|  8.45k|    q = f;
  217|   160k|    do  {
  218|   160k|        c = *q++;
  219|   160k|        if (c == '\\' || c == '/' || c == ':') {
  ------------------
  |  Branch (219:13): [True: 0, False: 160k]
  |  Branch (219:26): [True: 16.9k, False: 143k]
  |  Branch (219:38): [True: 0, False: 143k]
  ------------------
  220|  16.9k|            p = q;
  221|  16.9k|        }
  222|   160k|    } while (c);
  ------------------
  |  Branch (222:14): [True: 152k, False: 8.45k]
  ------------------
  223|  8.45k|    return p;
  224|  8.45k|}
dwarf_object_detector.c:_dwarf_debuglink_finder_internal:
  820|  8.45k|{
  821|  8.45k|    int res = 0;
  822|       |    /*  This local dbg is opened and then dwarf_finish()
  823|       |        here.  No dbg in the arguments! */
  824|  8.45k|    Dwarf_Debug    dbg = 0;
  825|  8.45k|    char         * path = 0;
  826|  8.45k|    Dwarf_Error    error = 0;
  827|  8.45k|    unsigned int   p = 0;
  828|  8.45k|    char          *debuglinkpath = 0;
  829|  8.45k|    unsigned char *crc = 0;
  830|  8.45k|    char          *debuglinkfullpath = 0; /* must be freed*/
  831|  8.45k|    unsigned       debuglinkfullpath_strlen = 0;
  832|  8.45k|    unsigned       buildid_type = 0;
  833|  8.45k|    char         * buildidownername = 0;
  834|  8.45k|    unsigned char *buildid = 0;
  835|  8.45k|    unsigned       buildid_length = 0;
  836|  8.45k|    char        ** paths = 0; /* must be freed */
  837|  8.45k|    unsigned       paths_count = 0;
  838|  8.45k|    unsigned       i = 0;
  839|       |
  840|  8.45k|    path = path_in;
  841|       |    /*  This path will work.
  842|       |        Already know the file is there. */
  843|  8.45k|    res = dwarf_init_path(path,
  844|  8.45k|        0,0,
  845|  8.45k|        DW_GROUPNUMBER_ANY,
  ------------------
  |  |  126|  8.45k|#define DW_GROUPNUMBER_ANY  0
  ------------------
  846|  8.45k|        0,0, &dbg, &error);
  847|  8.45k|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|  8.45k|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (847:9): [True: 5.20k, False: 3.25k]
  ------------------
  848|       |        /* error codes all >=0 && < 2000 */
  849|  5.20k|        *errcode = (int)dwarf_errno(error);
  850|  5.20k|        dwarf_dealloc_error(dbg,error);
  851|  5.20k|        error = 0;
  852|  5.20k|        return res;
  853|  5.20k|    }
  854|  3.25k|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   62|  3.25k|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (854:9): [True: 2.39k, False: 854]
  ------------------
  855|  2.39k|        return res;
  856|  2.39k|    }
  857|    854|    for (p = 0;  p < gl_pathcount; ++p) {
  ------------------
  |  Branch (857:18): [True: 0, False: 854]
  ------------------
  858|      0|        const char *lpath = 0;
  859|       |
  860|      0|        lpath = (const char *)gl_pathnames[p];
  861|      0|        res = dwarf_add_debuglink_global_path(dbg,
  862|      0|            lpath, &error);
  863|      0|        if (res != DW_DLV_OK){
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  |  Branch (863:13): [True: 0, False: 0]
  ------------------
  864|      0|            if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                *errcode = (int)dwarf_errno(error);
  866|      0|                dwarf_dealloc_error(dbg,error);
  867|      0|                error = 0;
  868|      0|            }
  869|      0|            dwarf_finish(dbg);
  870|      0|            return res;
  871|      0|        }
  872|      0|    }
  873|    854|    res = dwarf_gnu_debuglink(dbg,
  874|    854|        &debuglinkpath,
  875|    854|        &crc, &debuglinkfullpath, &debuglinkfullpath_strlen,
  876|    854|        &buildid_type, &buildidownername,
  877|    854|        &buildid, &buildid_length,
  878|    854|        &paths, &paths_count, &error);
  879|    854|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|    854|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (879:9): [True: 440, False: 414]
  ------------------
  880|    440|        *errcode = (int)dwarf_errno(error);
  881|    440|        dwarf_dealloc_error(dbg,error);
  882|    440|        dwarf_finish(dbg);
  883|    440|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|    440|#define DW_DLV_NO_ENTRY -1
  ------------------
  884|    440|    }
  885|    414|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   62|    414|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (885:9): [True: 0, False: 414]
  ------------------
  886|       |        /*  There is no debuglink buildid   section? */
  887|      0|        dwarf_finish(dbg);
  888|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  889|      0|    }
  890|    825|    for (i =0; i < paths_count; ++i) {
  ------------------
  |  Branch (890:16): [True: 411, False: 414]
  ------------------
  891|    411|        char *pa =     paths[i];
  892|    411|        int pfd = 0;
  893|       |
  894|       |        /*  First, open the file to determine if it exists.
  895|       |            If not, loop again */
  896|       |
  897|    411|        pfd = _dwarf_openr(pa);
  898|    411|        if (pfd  < 0) {
  ------------------
  |  Branch (898:13): [True: 408, False: 3]
  ------------------
  899|       |            /*  This is the usual path. */
  900|    408|            continue;
  901|    408|        }
  902|      3|        _dwarf_closer(pfd);
  903|       |        /* ASSERT: never returns DW_DLV_ERROR */
  904|      3|        res = _dwarf_debuglink_finder_newpath(
  905|      3|            pa,crc,buildid_length, buildid,
  906|      3|            m,fd_out);
  907|      3|        if (res == DW_DLV_OK) {
  ------------------
  |  |   63|      3|#define DW_DLV_OK        0
  ------------------
  |  Branch (907:13): [True: 0, False: 3]
  ------------------
  908|      0|            free(debuglinkfullpath);
  909|      0|            free(paths);
  910|      0|            paths = 0;
  911|      0|            dwarf_finish(dbg);
  912|      0|            return DW_DLV_OK;
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  913|      0|        }
  914|      3|        *errcode = 0;
  915|      3|        continue;
  916|      3|    }
  917|    414|    free(debuglinkfullpath);
  918|    414|    free(paths);
  919|    414|    paths = 0;
  920|    414|    dwarf_finish(dbg);
  921|    414|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|    414|#define DW_DLV_NO_ENTRY -1
  ------------------
  922|    414|}
dwarf_object_detector.c:_dwarf_debuglink_finder_newpath:
  713|      3|{
  714|      3|    unsigned char  lcrc[4] = {0,0,0,0};
  715|      3|    unsigned char  newcrc[4] = {0,0,0,0};
  716|      3|    char          *debuglinkpath = 0; /* must be freed */
  717|      3|    unsigned char *crc = 0;
  718|      3|    char          *debuglinkfullpath = 0;
  719|      3|    unsigned       debuglinkfullpath_strlen = 0;
  720|      3|    unsigned       buildid_type = 0;
  721|      3|    char         * buildidownername = 0;
  722|      3|    unsigned char *buildid = 0;
  723|      3|    unsigned       buildid_length = 0;
  724|      3|    char        ** paths = 0; /* must be freed */
  725|      3|    unsigned       paths_count = 0;
  726|      3|    Dwarf_Debug dbg = 0;
  727|      3|    Dwarf_Error error = 0;
  728|      3|    char *path = path_in;
  729|      3|    Dwarf_Bool didmatch = FALSE;
  ------------------
  |  |   40|      3|#define FALSE 0
  ------------------
  730|      3|    int res = 0;
  731|       |
  732|      3|    res = dwarf_init_path(path,
  733|      3|        0,0,
  734|      3|        DW_GROUPNUMBER_ANY,
  ------------------
  |  |  126|      3|#define DW_GROUPNUMBER_ANY  0
  ------------------
  735|      3|        0,0, &dbg,&error);
  736|      3|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|      3|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (736:9): [True: 3, False: 0]
  ------------------
  737|       |        /* ASSERT:  dbg is NULL as init failed */
  738|      3|        dwarf_dealloc_error(dbg,error);
  739|      3|        error = 0;
  740|      3|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      3|#define DW_DLV_NO_ENTRY -1
  ------------------
  741|      3|    }
  742|      0|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (742:9): [True: 0, False: 0]
  ------------------
  743|       |        /* should never happen */
  744|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  745|      0|    }
  746|      0|    res = dwarf_gnu_debuglink(dbg,
  747|      0|        &debuglinkpath,
  748|      0|        &crc, &debuglinkfullpath, &debuglinkfullpath_strlen,
  749|      0|        &buildid_type, &buildidownername,
  750|      0|        &buildid, &buildid_length,
  751|      0|        &paths, &paths_count, &error);
  752|      0|    if (res == DW_DLV_ERROR) {
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (752:9): [True: 0, False: 0]
  ------------------
  753|      0|        dwarf_dealloc_error(dbg,error);
  754|      0|        dwarf_finish(dbg);
  755|      0|        error = 0;
  756|      0|        dbg = 0;
  757|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  758|      0|    }
  759|      0|    if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  |  Branch (759:9): [True: 0, False: 0]
  ------------------
  760|       |        /*  There is no debuglink section */
  761|      0|        dwarf_finish(dbg);
  762|      0|        dbg = 0;
  763|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  764|      0|    }
  765|      0|    free(paths);
  766|      0|    paths = 0;
  767|       |
  768|      0|    if (!_dwarf_get_suppress_debuglink_crc() &&crc_in && !crc) {
  ------------------
  |  Branch (768:9): [True: 0, False: 0]
  |  Branch (768:48): [True: 0, False: 0]
  |  Branch (768:58): [True: 0, False: 0]
  ------------------
  769|      0|        int res1 = 0;
  770|       |
  771|      0|        res1 = dwarf_crc32(dbg,lcrc,&error);
  772|      0|        if (res1 == DW_DLV_ERROR) {
  ------------------
  |  |   64|      0|#define DW_DLV_ERROR     1
  ------------------
  |  Branch (772:13): [True: 0, False: 0]
  ------------------
  773|      0|            paths = 0;
  774|      0|            free(debuglinkfullpath);
  775|      0|            dwarf_dealloc_error(dbg,error);
  776|      0|            dwarf_finish(dbg);
  777|      0|            error = 0;
  778|      0|            dbg = 0;
  779|       |            /*  Cannot match the crc_in, give up. */
  780|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  781|      0|        }
  782|      0|        if (res1 == DW_DLV_OK) {
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  |  Branch (782:13): [True: 0, False: 0]
  ------------------
  783|      0|            dbg->de_copy_word((void *)newcrc,(void *)lcrc,4);
  784|      0|            crc=&newcrc[0];
  785|      0|        }
  786|      0|    }
  787|      0|    free(debuglinkfullpath);
  788|      0|    didmatch = match_buildid(
  789|       |        /* This is about the executable */
  790|      0|        crc_in,buildid_len_in,buildid_in,
  791|       |        /* pass in local so we can calculate the missing crc */
  792|       |        /* following is the target, ie, debug */
  793|      0|        crc,buildid_length,buildid);
  794|      0|    if (error) {
  ------------------
  |  Branch (794:9): [True: 0, False: 0]
  ------------------
  795|       |        /*  This should never happen. It would mean
  796|       |            error was set without DW_DLV_ERROR */
  797|      0|        dwarf_dealloc_error(dbg,error);
  798|      0|        error = 0;
  799|      0|    }
  800|      0|    if (didmatch) {
  ------------------
  |  Branch (800:9): [True: 0, False: 0]
  ------------------
  801|      0|        dwarfstring_append(m,path);
  802|      0|        *fd_out = dbg->de_fd;
  803|      0|        dbg->de_owns_fd = FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  804|      0|        dwarf_finish(dbg);
  805|      0|        dbg = 0;
  806|      0|        return DW_DLV_OK;
  ------------------
  |  |   63|      0|#define DW_DLV_OK        0
  ------------------
  807|      0|    }
  808|      0|    dwarf_finish(dbg);
  809|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   62|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  810|      0|}

_dwarf_object_read_random:
   55|   340k|{
   56|   340k|    Dwarf_Unsigned endpoint = 0;
   57|   340k|    int res = 0;
   58|       |
   59|   340k|    if (loc >= filesize) {
  ------------------
  |  Branch (59:9): [True: 337, False: 339k]
  ------------------
   60|       |        /*  Seek can seek off the end. Lets not allow that.
   61|       |            The object is corrupt. */
   62|    337|        *errc = DW_DLE_SEEK_OFF_END;
  ------------------
  |  | 1419|    337|#define DW_DLE_SEEK_OFF_END                    444
  ------------------
   63|    337|        return DW_DLV_ERROR;
  ------------------
  |  |  123|    337|#define DW_DLV_ERROR     1
  ------------------
   64|    337|    }
   65|   339k|    endpoint = loc+size;
   66|   339k|    if (endpoint < loc) {
  ------------------
  |  Branch (66:9): [True: 0, False: 339k]
  ------------------
   67|       |        /*  Overflow!  The object is corrupt. */
   68|      0|        *errc = DW_DLE_READ_OFF_END;
  ------------------
  |  | 1420|      0|#define DW_DLE_READ_OFF_END                    445
  ------------------
   69|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
   70|      0|    }
   71|   339k|    if (endpoint > filesize) {
  ------------------
  |  Branch (71:9): [True: 324, False: 339k]
  ------------------
   72|       |        /*  Let us -not- try to read past end of object.
   73|       |            The object is corrupt. */
   74|    324|        *errc = DW_DLE_READ_OFF_END;
  ------------------
  |  | 1420|    324|#define DW_DLE_READ_OFF_END                    445
  ------------------
   75|    324|        return DW_DLV_ERROR;
  ------------------
  |  |  123|    324|#define DW_DLV_ERROR     1
  ------------------
   76|    324|    }
   77|   339k|    res = _dwarf_seekr(fd,loc,SEEK_SET,0);
   78|   339k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|   339k|#define DW_DLV_OK        0
  ------------------
  |  Branch (78:9): [True: 0, False: 339k]
  ------------------
   79|      0|        *errc = DW_DLE_SEEK_ERROR;
  ------------------
  |  | 1393|      0|#define DW_DLE_SEEK_ERROR                      418
  ------------------
   80|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
   81|      0|    }
   82|   339k|    res = _dwarf_readr(fd,buf,size,0);
   83|   339k|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|   339k|#define DW_DLV_OK        0
  ------------------
  |  Branch (83:9): [True: 0, False: 339k]
  ------------------
   84|      0|        *errc = DW_DLE_READ_ERROR;
  ------------------
  |  | 1394|      0|#define DW_DLE_READ_ERROR                      419
  ------------------
   85|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
   86|      0|    }
   87|   339k|    return DW_DLV_OK;
  ------------------
  |  |  122|   339k|#define DW_DLV_OK        0
  ------------------
   88|   339k|}

_dwarf_destruct_pe_access:
  426|  1.98k|{
  427|  1.98k|    dwarf_pe_object_access_internals_t *pep = 0;
  428|  1.98k|    Dwarf_Unsigned i = 0;
  429|       |
  430|  1.98k|    if (!aip) {
  ------------------
  |  Branch (430:9): [True: 0, False: 1.98k]
  ------------------
  431|      0|        return;
  432|      0|    }
  433|  1.98k|    pep = (dwarf_pe_object_access_internals_t*)(aip->ai_object);
  434|  1.98k|    if (pep->pe_destruct_close_fd && pep->pe_fd !=-1) {
  ------------------
  |  Branch (434:9): [True: 0, False: 1.98k]
  |  Branch (434:38): [True: 0, False: 0]
  ------------------
  435|      0|        _dwarf_closer(pep->pe_fd);
  436|      0|        pep->pe_fd = -1;
  437|      0|    }
  438|  1.98k|    free((char *)pep->pe_path);
  439|  1.98k|    pep->pe_path = 0;
  440|  1.98k|    if (pep->pe_sectionptr) {
  ------------------
  |  Branch (440:9): [True: 1.26k, False: 723]
  ------------------
  441|  1.26k|        struct dwarf_pe_generic_image_section_header  *sp = 0;
  442|       |
  443|  1.26k|        sp = pep->pe_sectionptr;
  444|   231k|        for (i=0; i < pep->pe_section_count; ++i,++sp) {
  ------------------
  |  Branch (444:19): [True: 230k, False: 1.26k]
  ------------------
  445|   230k|            if (sp->loaded_data) {
  ------------------
  |  Branch (445:17): [True: 159, False: 230k]
  ------------------
  446|    159|                free(sp->loaded_data);
  447|    159|                sp->loaded_data = 0;
  448|    159|            }
  449|   230k|            free(sp->name);
  450|   230k|            sp->name = 0;
  451|   230k|            free(sp->dwarfsectname);
  452|   230k|            sp->dwarfsectname = 0;
  453|   230k|        }
  454|  1.26k|        free(pep->pe_sectionptr);
  455|  1.26k|        pep->pe_section_count = 0;
  456|  1.26k|    }
  457|  1.98k|    free(pep->pe_string_table);
  458|  1.98k|    pep->pe_string_table = 0;
  459|  1.98k|    free(pep);
  460|  1.98k|    free(aip);
  461|  1.98k|    return;
  462|  1.98k|}
_dwarf_pe_setup:
  829|  1.98k|{
  830|  1.98k|    Dwarf_Obj_Access_Interface_a *binary_interface = 0;
  831|  1.98k|    dwarf_pe_object_access_internals_t *pep = 0;
  832|  1.98k|    int res = DW_DLV_OK;
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  833|  1.98k|    int localerrnum = 0;
  834|       |
  835|  1.98k|    res = _dwarf_pe_object_access_init(
  836|  1.98k|        fd,
  837|  1.98k|        ftype,endian,offsetsize,filesize,
  838|  1.98k|        &binary_interface,
  839|  1.98k|        &localerrnum);
  840|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (840:9): [True: 1.61k, False: 369]
  ------------------
  841|  1.61k|        if (res == DW_DLV_NO_ENTRY) {
  ------------------
  |  |   58|  1.61k|#define DW_DLV_NO_ENTRY  -1
  ------------------
  |  Branch (841:13): [True: 0, False: 1.61k]
  ------------------
  842|      0|            return res;
  843|      0|        }
  844|  1.61k|        _dwarf_error(NULL, error, localerrnum);
  845|  1.61k|        return DW_DLV_ERROR;
  ------------------
  |  |   60|  1.61k|#define DW_DLV_ERROR      1
  ------------------
  846|  1.61k|    }
  847|       |    /*  allocates and initializes Dwarf_Debug,
  848|       |        generic code */
  849|    369|    res = dwarf_object_init_b(binary_interface, errhand, errarg,
  850|    369|        groupnumber, dbg, error);
  851|    369|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|    369|#define DW_DLV_OK         0
  ------------------
  |  Branch (851:9): [True: 234, False: 135]
  ------------------
  852|    234|        _dwarf_destruct_pe_access(binary_interface);
  853|    234|        return res;
  854|    234|    }
  855|    135|    pep = binary_interface->ai_object;
  856|    135|    (*dbg)->de_obj_flags = pep->pe_flags;
  857|    135|    (*dbg)->de_obj_machine = pep->pe_machine;
  858|    135|    pep->pe_path = strdup(true_path);
  859|    135|    return res;
  860|    369|}
dwarf_peread.c:_dwarf_pe_object_access_init:
  947|  1.98k|{
  948|       |
  949|  1.98k|    int res = 0;
  950|  1.98k|    dwarf_pe_object_access_internals_t *internals = 0;
  951|  1.98k|    Dwarf_Obj_Access_Interface_a *intfc = 0;
  952|       |
  953|  1.98k|    internals = malloc(sizeof(dwarf_pe_object_access_internals_t));
  954|  1.98k|    if (!internals) {
  ------------------
  |  Branch (954:9): [True: 0, False: 1.98k]
  ------------------
  955|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  956|       |        /* Impossible case, we hope. Give up. */
  957|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  958|      0|    }
  959|  1.98k|    memset(internals,0,sizeof(*internals));
  960|  1.98k|    res = _dwarf_pe_object_access_internals_init(internals,
  961|  1.98k|        fd,
  962|  1.98k|        ftype, endian, offsetsize, filesize,
  963|  1.98k|        localerrnum);
  964|  1.98k|    if (res != DW_DLV_OK){
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (964:9): [True: 1.61k, False: 369]
  ------------------
  965|       |        /* *err is already set. and the call freed internals */
  966|  1.61k|        return DW_DLV_ERROR;
  ------------------
  |  |   60|  1.61k|#define DW_DLV_ERROR      1
  ------------------
  967|  1.61k|    }
  968|       |
  969|    369|    intfc = malloc(sizeof(Dwarf_Obj_Access_Interface_a));
  970|    369|    if (!intfc) {
  ------------------
  |  Branch (970:9): [True: 0, False: 369]
  ------------------
  971|       |        /* Impossible case, we hope. Give up. */
  972|      0|        free(internals);
  973|      0|        *localerrnum = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  974|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  975|      0|    }
  976|       |    /* Initialize the interface struct */
  977|    369|    intfc->ai_object = internals;
  978|    369|    intfc->ai_methods = &pe_methods;
  979|    369|    *binary_interface = intfc;
  980|    369|    return DW_DLV_OK;
  ------------------
  |  |   59|    369|#define DW_DLV_OK         0
  ------------------
  981|    369|}
dwarf_peread.c:_dwarf_pe_object_access_internals_init:
  883|  1.98k|{
  884|  1.98k|    dwarf_pe_object_access_internals_t * intfc = internals;
  885|  1.98k|    struct Dwarf_Obj_Access_Interface_a_s *localdoas = 0;
  886|  1.98k|    int res = 0;
  887|       |
  888|       |    /*  Must malloc as _dwarf_destruct_pe_access()
  889|       |        forces that due to other uses. */
  890|  1.98k|    localdoas = (struct Dwarf_Obj_Access_Interface_a_s *)
  891|  1.98k|        malloc(sizeof(struct Dwarf_Obj_Access_Interface_a_s));
  892|  1.98k|    if (!localdoas) {
  ------------------
  |  Branch (892:9): [True: 0, False: 1.98k]
  ------------------
  893|      0|        free(internals);
  894|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  895|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  896|      0|    }
  897|  1.98k|    memset(localdoas,0,sizeof(struct Dwarf_Obj_Access_Interface_a_s));
  898|  1.98k|    intfc->pe_ident[0]    = 'P';
  899|  1.98k|    intfc->pe_ident[1]    = '1';
  900|  1.98k|    intfc->pe_fd          = fd;
  901|  1.98k|    intfc->pe_is_64bit    = ((offsetsize==64)?TRUE:FALSE);
  ------------------
  |  |   37|    345|#define TRUE 1
  ------------------
                  intfc->pe_is_64bit    = ((offsetsize==64)?TRUE:FALSE);
  ------------------
  |  |   40|  1.63k|#define FALSE 0
  ------------------
  |  Branch (901:30): [True: 345, False: 1.63k]
  ------------------
  902|  1.98k|    intfc->pe_offsetsize  = offsetsize;
  903|  1.98k|    intfc->pe_pointersize = offsetsize;
  904|  1.98k|    intfc->pe_filesize    = filesize;
  905|  1.98k|    intfc->pe_ftype       = ftype;
  906|       |    /* pe_path set by caller */
  907|       |
  908|       |#ifdef WORDS_BIGENDIAN
  909|       |    if (endian == DW_END_little) {
  910|       |        intfc->pe_copy_word = _dwarf_memcpy_swap_bytes;
  911|       |        intfc->pe_endian = DW_END_little;
  912|       |    } else {
  913|       |        intfc->pe_copy_word = _dwarf_memcpy_noswap_bytes;
  914|       |        intfc->pe_endian = DW_END_big;
  915|       |    }
  916|       |#else  /* LITTLE ENDIAN */
  917|  1.98k|    if (endian == DW_END_little) {
  ------------------
  |  | 1105|  1.98k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  |  Branch (917:9): [True: 1.83k, False: 144]
  ------------------
  918|  1.83k|        intfc->pe_copy_word = _dwarf_memcpy_noswap_bytes;
  919|  1.83k|        intfc->pe_endian = DW_END_little;
  ------------------
  |  | 1105|  1.83k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  920|  1.83k|    } else {
  921|    144|        intfc->pe_copy_word = _dwarf_memcpy_swap_bytes;
  922|    144|        intfc->pe_endian = DW_END_big;
  ------------------
  |  | 1104|    144|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  923|    144|    }
  924|  1.98k|#endif /* LITTLE- BIG-ENDIAN */
  925|  1.98k|    res = _dwarf_load_pe_sections(intfc,errcode);
  926|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (926:9): [True: 1.61k, False: 369]
  ------------------
  927|  1.61k|        localdoas->ai_object = intfc;
  928|  1.61k|        localdoas->ai_methods = 0;
  929|  1.61k|        _dwarf_destruct_pe_access(localdoas);
  930|  1.61k|        localdoas = 0;
  931|  1.61k|        return res;
  932|  1.61k|    }
  933|    369|    free(localdoas);
  934|    369|    localdoas = 0;
  935|    369|    return DW_DLV_OK;
  ------------------
  |  |   59|    369|#define DW_DLV_OK         0
  ------------------
  936|  1.98k|}
dwarf_peread.c:_dwarf_load_pe_sections:
  610|  1.98k|{
  611|  1.98k|    struct dos_header_dw dhinmem;
  612|  1.98k|    IMAGE_FILE_HEADER_dw ifh;
  613|  1.98k|    void (*word_swap) (void *, const void *, unsigned long);
  614|  1.98k|    unsigned locendian = 0;
  615|  1.98k|    int res = 0;
  616|  1.98k|    Dwarf_Unsigned dos_sig = 0;
  617|  1.98k|    Dwarf_Unsigned nt_address = 0;
  618|  1.98k|    char nt_sig_array[4];
  619|  1.98k|    unsigned long nt_signature = 0;
  620|       |
  621|  1.98k|    if ( (sizeof(ifh) + sizeof(dhinmem))  >= pep->pe_filesize) {
  ------------------
  |  Branch (621:10): [True: 0, False: 1.98k]
  ------------------
  622|       |        /* corrupt object. */
  623|      0|        *errcode = DW_DLE_PE_SIZE_SMALL;
  ------------------
  |  | 1401|      0|#define DW_DLE_PE_SIZE_SMALL                   426
  ------------------
  624|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  625|      0|    }
  626|  1.98k|    res = _dwarf_object_read_random(pep->pe_fd,(char *)&dhinmem,
  627|  1.98k|        0, sizeof(dhinmem),pep->pe_filesize, errcode);
  628|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (628:9): [True: 0, False: 1.98k]
  ------------------
  629|      0|        return res;
  630|      0|    }
  631|  1.98k|    dos_sig = magic_copy((char *)dhinmem.dh_mz,
  632|  1.98k|        sizeof(dhinmem.dh_mz));
  633|  1.98k|    if (dos_sig == IMAGE_DOS_SIGNATURE_dw) {
  ------------------
  |  |   38|  1.98k|#define IMAGE_DOS_SIGNATURE_dw    0x5a4d /* le on disk 'M' 'Z' */
  ------------------
  |  Branch (633:9): [True: 144, False: 1.83k]
  ------------------
  634|       |        /*  IMAGE_DOS_SIGNATURE_dw assumes bytes
  635|       |            reversed by little-endian
  636|       |            load, so we intrepet a match the other way. */
  637|       |        /* BIG ENDIAN. From looking at hex characters in object  */
  638|       |#ifdef WORDS_BIGENDIAN
  639|       |        word_swap = _dwarf_memcpy_noswap_bytes;
  640|       |#else  /* LITTLE ENDIAN */
  641|    144|        word_swap = _dwarf_memcpy_swap_bytes;
  642|    144|#endif /* LITTLE- BIG-ENDIAN */
  643|    144|        locendian = DW_END_big;
  ------------------
  |  | 1104|    144|#define DW_END_big                      0x01 /* DWARF3f */
  ------------------
  644|  1.83k|    } else if (dos_sig == IMAGE_DOS_REVSIGNATURE_dw) {
  ------------------
  |  |   39|  1.83k|#define IMAGE_DOS_REVSIGNATURE_dw 0x4d5a /* be on disk */
  ------------------
  |  Branch (644:16): [True: 1.83k, False: 0]
  ------------------
  645|       |        /* raw load, so  intrepet a match the other way. */
  646|       |        /* LITTLE ENDIAN */
  647|       |#ifdef WORDS_BIGENDIAN
  648|       |        word_swap = _dwarf_memcpy_swap_bytes;
  649|       |#else  /* LITTLE ENDIAN */
  650|  1.83k|        word_swap = _dwarf_memcpy_noswap_bytes;
  651|  1.83k|#endif /* LITTLE- BIG-ENDIAN */
  652|  1.83k|        locendian = DW_END_little;
  ------------------
  |  | 1105|  1.83k|#define DW_END_little                   0x02 /* DWARF3f */
  ------------------
  653|  1.83k|    } else {
  654|       |        /* Not dos header not a PE file we recognize */
  655|      0|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|      0|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
  656|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  657|      0|    }
  658|  1.98k|    if (locendian != pep->pe_endian) {
  ------------------
  |  Branch (658:9): [True: 0, False: 1.98k]
  ------------------
  659|       |        /*  Really this is a coding botch somewhere here,
  660|       |            not an object corruption. */
  661|      0|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|      0|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
  662|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  663|      0|    }
  664|  1.98k|    pep->pe_copy_word = word_swap;
  665|  1.98k|    ASNAR(word_swap,nt_address,dhinmem.dh_image_offset);
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  666|  1.98k|    if (pep->pe_filesize < (nt_address + sizeof(nt_sig_array))) {
  ------------------
  |  Branch (666:9): [True: 0, False: 1.98k]
  ------------------
  667|       |        /*  The nt_address is really a file offset. */
  668|      0|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|      0|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  669|       |        /* Not dos header not a PE file we recognize */
  670|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  671|      0|    }
  672|       |
  673|  1.98k|    res =  _dwarf_object_read_random(pep->pe_fd,
  674|  1.98k|        (char *)&nt_sig_array[0],
  675|  1.98k|        nt_address, sizeof(nt_sig_array),
  676|  1.98k|        pep->pe_filesize,errcode);
  677|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (677:9): [True: 0, False: 1.98k]
  ------------------
  678|      0|        return res;
  679|      0|    }
  680|  1.98k|    {   unsigned long lsig = 0;
  681|       |
  682|  1.98k|        ASNAR(word_swap,lsig,nt_sig_array);
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  683|  1.98k|        nt_signature = lsig;
  684|  1.98k|    }
  685|  1.98k|    if (nt_signature != IMAGE_NT_SIGNATURE_dw) {
  ------------------
  |  |   40|  1.98k|#define IMAGE_NT_SIGNATURE_dw     0x00004550
  ------------------
  |  Branch (685:9): [True: 0, False: 1.98k]
  ------------------
  686|      0|        *errcode = DW_DLE_FILE_WRONG_TYPE;
  ------------------
  |  | 1387|      0|#define DW_DLE_FILE_WRONG_TYPE                 412
  ------------------
  687|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  688|      0|    }
  689|       |
  690|  1.98k|    pep->pe_nt_header_offset = nt_address  + SIZEOFT32;
  ------------------
  |  |   45|  1.98k|#define SIZEOFT32 4
  ------------------
  691|  1.98k|    if (pep->pe_filesize < (pep->pe_nt_header_offset +
  ------------------
  |  Branch (691:9): [True: 0, False: 1.98k]
  ------------------
  692|  1.98k|        sizeof(ifh))) {
  693|      0|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|      0|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  694|       |        /* Not image header not a PE file we recognize */
  695|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  696|      0|    }
  697|  1.98k|    res = _dwarf_object_read_random(pep->pe_fd,(char *)&ifh,
  698|  1.98k|        pep->pe_nt_header_offset, sizeof(ifh),
  699|  1.98k|        pep->pe_filesize,errcode);
  700|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (700:9): [True: 0, False: 1.98k]
  ------------------
  701|      0|        return res;
  702|      0|    }
  703|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.Machine,ifh.Machine);
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  704|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.NumberOfSections,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  705|  1.98k|        ifh.NumberOfSections);
  706|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.TimeDateStamp,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  707|  1.98k|        ifh.TimeDateStamp);
  708|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.PointerToSymbolTable,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  709|  1.98k|        ifh.PointerToSymbolTable);
  710|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.NumberOfSymbols,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  711|  1.98k|        ifh.NumberOfSymbols);
  712|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.SizeOfOptionalHeader,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  713|  1.98k|        ifh.SizeOfOptionalHeader);
  714|  1.98k|    ASNAR(word_swap,pep->pe_FileHeader.Characteristics,
  ------------------
  |  |   57|  1.98k|    do {                                        \
  |  |   58|  1.98k|        (t) = 0;                                \
  |  |   59|  1.98k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  715|  1.98k|        ifh.Characteristics);
  716|  1.98k|    pep->pe_machine = pep->pe_FileHeader.Machine;
  717|  1.98k|    pep->pe_flags = pep->pe_FileHeader.Characteristics;
  718|  1.98k|    pep->pe_optional_header_offset = pep->pe_nt_header_offset+
  719|  1.98k|        sizeof(ifh);
  720|  1.98k|    if (pep->pe_offsetsize == 32) {
  ------------------
  |  Branch (720:9): [True: 1.63k, False: 345]
  ------------------
  721|  1.63k|        res = load_optional_header32(pep,
  722|  1.63k|            pep->pe_optional_header_offset,errcode);
  723|  1.63k|        pep->pe_optional_header_size =
  724|  1.63k|            sizeof(IMAGE_OPTIONAL_HEADER32_dw);
  725|  1.63k|    } else if (pep->pe_offsetsize == 64) {
  ------------------
  |  Branch (725:16): [True: 345, False: 0]
  ------------------
  726|    345|        res = load_optional_header64(pep,
  727|    345|            pep->pe_optional_header_offset,errcode);
  728|    345|        pep->pe_optional_header_size =
  729|    345|            sizeof(IMAGE_OPTIONAL_HEADER64_dw);
  730|    345|    } else {
  731|      0|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|      0|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  732|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  733|      0|    }
  734|  1.98k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.98k|#define DW_DLV_OK         0
  ------------------
  |  Branch (734:9): [True: 114, False: 1.86k]
  ------------------
  735|    114|        return res;
  736|    114|    }
  737|       |
  738|  1.86k|    pep->pe_section_table_offset = pep->pe_optional_header_offset
  739|  1.86k|        + pep->pe_optional_header_size;
  740|  1.86k|    pep->pe_symbol_table_offset =
  741|  1.86k|        pep->pe_FileHeader.PointerToSymbolTable;
  742|  1.86k|    if (pep->pe_symbol_table_offset >= pep->pe_filesize) {
  ------------------
  |  Branch (742:9): [True: 126, False: 1.74k]
  ------------------
  743|    126|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|    126|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  744|    126|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    126|#define DW_DLV_ERROR      1
  ------------------
  745|    126|    }
  746|  1.74k|    if (pep->pe_symbol_table_offset) {
  ------------------
  |  Branch (746:9): [True: 1.30k, False: 438]
  ------------------
  747|  1.30k|        pep->pe_string_table_offset  =
  748|  1.30k|            pep->pe_symbol_table_offset +
  749|  1.30k|            (pep->pe_FileHeader.NumberOfSymbols *
  750|  1.30k|            IMAGE_SIZEOF_SYMBOL);
  ------------------
  |  |   53|  1.30k|#define IMAGE_SIZEOF_SYMBOL 18
  ------------------
  751|  1.30k|    }
  752|       |
  753|  1.74k|    if (pep->pe_string_table_offset >= pep->pe_filesize) {
  ------------------
  |  Branch (753:9): [True: 138, False: 1.60k]
  ------------------
  754|    138|        *errcode = DW_DLE_OFFSET_SIZE;
  ------------------
  |  | 1390|    138|#define DW_DLE_OFFSET_SIZE                     415
  ------------------
  755|    138|        pep->pe_string_table_size = 0;
  756|    138|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    138|#define DW_DLV_ERROR      1
  ------------------
  757|    138|    }
  758|  1.60k|    if (pep->pe_string_table_offset) {
  ------------------
  |  Branch (758:9): [True: 1.16k, False: 438]
  ------------------
  759|       |        /*  https://docs.microsoft.com/en-us/\
  760|       |            windows/desktop/debug/pe-format#coff-string-table  */
  761|       |        /* The first 4 bytes of the string table contain
  762|       |            the size of the string table. */
  763|  1.16k|        char size_field[4];
  764|       |
  765|  1.16k|        if ((pep->pe_string_table_offset+sizeof(size_field)) >
  ------------------
  |  Branch (765:13): [True: 33, False: 1.13k]
  ------------------
  766|  1.16k|            pep->pe_filesize) {
  767|     33|            *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     33|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  768|     33|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     33|#define DW_DLV_ERROR      1
  ------------------
  769|     33|        }
  770|  1.13k|        memset(size_field,0,sizeof(size_field));
  771|  1.13k|        res =  _dwarf_object_read_random(pep->pe_fd,
  772|  1.13k|            (char *)size_field, pep->pe_string_table_offset,
  773|  1.13k|            sizeof(size_field),
  774|  1.13k|            pep->pe_filesize,errcode);
  775|  1.13k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.13k|#define DW_DLV_OK         0
  ------------------
  |  Branch (775:13): [True: 0, False: 1.13k]
  ------------------
  776|      0|            return res;
  777|      0|        }
  778|  1.13k|        ASNAR(pep->pe_copy_word,pep->pe_string_table_size,
  ------------------
  |  |   57|  1.13k|    do {                                        \
  |  |   58|  1.13k|        (t) = 0;                                \
  |  |   59|  1.13k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  779|  1.13k|            size_field);
  780|  1.13k|        if (pep->pe_string_table_size >= pep->pe_filesize ) {
  ------------------
  |  Branch (780:13): [True: 156, False: 978]
  ------------------
  781|    156|            *errcode = DW_DLE_PE_OFFSET_BAD;
  ------------------
  |  | 1402|    156|#define DW_DLE_PE_OFFSET_BAD                   427
  ------------------
  782|    156|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    156|#define DW_DLV_ERROR      1
  ------------------
  783|    156|        }
  784|    978|        if ((pep->pe_string_table_offset+pep->pe_string_table_size) >
  ------------------
  |  Branch (784:13): [True: 36, False: 942]
  ------------------
  785|    978|            pep->pe_filesize) {
  786|     36|            *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     36|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  787|     36|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     36|#define DW_DLV_ERROR      1
  ------------------
  788|     36|        }
  789|       |        /*  size+1 to ensure there is a terminating null character
  790|       |            in memory so CoverityScan knows there is always a
  791|       |            final null.  CoverityScan is not aware
  792|       |            there may be multiple strings in the table.
  793|       |            If there is a compiler bug the final string
  794|       |            might be missing its intended null terminator! */
  795|    942|        pep->pe_string_table =
  796|    942|            (char *)calloc(1,(size_t)pep->pe_string_table_size+1);
  797|    942|        if (!pep->pe_string_table) {
  ------------------
  |  Branch (797:13): [True: 0, False: 942]
  ------------------
  798|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  799|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  800|      0|        }
  801|    942|        res = _dwarf_object_read_random(pep->pe_fd,
  802|    942|            (char *)pep->pe_string_table,
  803|    942|            pep->pe_string_table_offset,
  804|    942|            (size_t)pep->pe_string_table_size,
  805|    942|            pep->pe_filesize,errcode);
  806|    942|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    942|#define DW_DLV_OK         0
  ------------------
  |  Branch (806:13): [True: 0, False: 942]
  ------------------
  807|      0|            free(pep->pe_string_table);
  808|      0|            pep->pe_string_table = 0;
  809|      0|            return res;
  810|      0|        }
  811|       |        /*  Should pass coverity now. */
  812|    942|        pep->pe_string_table[pep->pe_string_table_size] = 0;
  813|    942|    }
  814|  1.38k|    res = _dwarf_pe_load_dwarf_section_headers(pep,errcode);
  815|  1.38k|    return res;
  816|  1.60k|}
dwarf_peread.c:magic_copy:
   83|  1.98k|{
   84|  1.98k|    unsigned i = 0;
   85|  1.98k|    unsigned long v = 0;
   86|       |
   87|  1.98k|    v = d[0];
   88|  3.96k|    for (i = 1 ; i < len; ++i) {
  ------------------
  |  Branch (88:18): [True: 1.98k, False: 1.98k]
  ------------------
   89|  1.98k|        v <<= 8;
   90|  1.98k|        v |=  0xff&d[i];
   91|  1.98k|    }
   92|  1.98k|    return v;
   93|  1.98k|}
dwarf_peread.c:load_optional_header32:
  233|  1.63k|{
  234|  1.63k|    int res = 0;
  235|  1.63k|    IMAGE_OPTIONAL_HEADER32_dw hdr;
  236|       |
  237|  1.63k|    pep->pe_optional_header_size = sizeof(IMAGE_OPTIONAL_HEADER32_dw);
  238|       |
  239|  1.63k|    if ((pep->pe_optional_header_size + offset) >
  ------------------
  |  Branch (239:9): [True: 60, False: 1.57k]
  ------------------
  240|  1.63k|        pep->pe_filesize) {
  241|     60|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     60|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  242|     60|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     60|#define DW_DLV_ERROR      1
  ------------------
  243|     60|    }
  244|       |
  245|  1.57k|    res =  _dwarf_object_read_random(pep->pe_fd,
  246|  1.57k|        (char *)&hdr,
  247|  1.57k|        offset, sizeof(IMAGE_OPTIONAL_HEADER32_dw),
  248|  1.57k|        pep->pe_filesize,
  249|  1.57k|        errcode);
  250|  1.57k|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  1.57k|#define DW_DLV_OK         0
  ------------------
  |  Branch (250:9): [True: 0, False: 1.57k]
  ------------------
  251|      0|        return res;
  252|      0|    }
  253|       |
  254|       |    /* This is a subset of fields. */
  255|  1.57k|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.Magic,
  ------------------
  |  |   57|  1.57k|    do {                                        \
  |  |   58|  1.57k|        (t) = 0;                                \
  |  |   59|  1.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  256|  1.57k|        hdr.Magic);
  257|  1.57k|    pep->pe_OptionalHeader.MajorLinkerVersion= hdr.MajorLinkerVersion;
  258|  1.57k|    pep->pe_OptionalHeader.MinorLinkerVersion= hdr.MinorLinkerVersion;
  259|  1.57k|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.ImageBase,
  ------------------
  |  |   57|  1.57k|    do {                                        \
  |  |   58|  1.57k|        (t) = 0;                                \
  |  |   59|  1.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  260|  1.57k|        hdr.ImageBase);
  261|  1.57k|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfCode,
  ------------------
  |  |   57|  1.57k|    do {                                        \
  |  |   58|  1.57k|        (t) = 0;                                \
  |  |   59|  1.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  262|  1.57k|        hdr.SizeOfCode);
  263|  1.57k|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfImage,
  ------------------
  |  |   57|  1.57k|    do {                                        \
  |  |   58|  1.57k|        (t) = 0;                                \
  |  |   59|  1.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  264|  1.57k|        hdr.SizeOfImage);
  265|  1.57k|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfHeaders,
  ------------------
  |  |   57|  1.57k|    do {                                        \
  |  |   58|  1.57k|        (t) = 0;                                \
  |  |   59|  1.57k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  266|  1.57k|        hdr.SizeOfHeaders);
  267|  1.57k|    pep->pe_OptionalHeader.SizeOfDataDirEntry =
  268|  1.57k|        sizeof(IMAGE_DATA_DIRECTORY_dw);
  269|  1.57k|    return DW_DLV_OK;
  ------------------
  |  |   59|  1.57k|#define DW_DLV_OK         0
  ------------------
  270|  1.57k|}
dwarf_peread.c:load_optional_header64:
  274|    345|{
  275|    345|    IMAGE_OPTIONAL_HEADER64_dw hdr;
  276|    345|    int res = 0;
  277|       |
  278|    345|    pep->pe_optional_header_size = sizeof(IMAGE_OPTIONAL_HEADER64_dw);
  279|    345|    if ((pep->pe_optional_header_size + offset) >
  ------------------
  |  Branch (279:9): [True: 54, False: 291]
  ------------------
  280|    345|        pep->pe_filesize) {
  281|     54|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|     54|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  282|     54|        return DW_DLV_ERROR;
  ------------------
  |  |   60|     54|#define DW_DLV_ERROR      1
  ------------------
  283|     54|    }
  284|    291|    res =  _dwarf_object_read_random(pep->pe_fd,
  285|    291|        (char *)&hdr,
  286|    291|        offset, sizeof(IMAGE_OPTIONAL_HEADER64_dw),
  287|    291|        pep->pe_filesize,
  288|    291|        errcode);
  289|    291|    if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    291|#define DW_DLV_OK         0
  ------------------
  |  Branch (289:9): [True: 0, False: 291]
  ------------------
  290|      0|        return res;
  291|      0|    }
  292|       |
  293|       |    /* This is a subset of fields. */
  294|    291|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.Magic,
  ------------------
  |  |   57|    291|    do {                                        \
  |  |   58|    291|        (t) = 0;                                \
  |  |   59|    291|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    291|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  295|    291|        hdr.Magic);
  296|    291|    pep->pe_OptionalHeader.MajorLinkerVersion= hdr.MajorLinkerVersion;
  297|    291|    pep->pe_OptionalHeader.MinorLinkerVersion= hdr.MinorLinkerVersion;
  298|    291|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.ImageBase,
  ------------------
  |  |   57|    291|    do {                                        \
  |  |   58|    291|        (t) = 0;                                \
  |  |   59|    291|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    291|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  299|    291|        hdr.ImageBase);
  300|    291|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfCode,
  ------------------
  |  |   57|    291|    do {                                        \
  |  |   58|    291|        (t) = 0;                                \
  |  |   59|    291|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    291|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  301|    291|        hdr.SizeOfCode);
  302|    291|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfImage,
  ------------------
  |  |   57|    291|    do {                                        \
  |  |   58|    291|        (t) = 0;                                \
  |  |   59|    291|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    291|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  303|    291|        hdr.SizeOfImage);
  304|    291|    ASNAR(pep->pe_copy_word,pep->pe_OptionalHeader.SizeOfHeaders,
  ------------------
  |  |   57|    291|    do {                                        \
  |  |   58|    291|        (t) = 0;                                \
  |  |   59|    291|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|    291|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  305|    291|        hdr.SizeOfHeaders);
  306|    291|    pep->pe_OptionalHeader.SizeOfDataDirEntry =
  307|    291|        sizeof(IMAGE_DATA_DIRECTORY_dw);
  308|    291|    return DW_DLV_OK;
  ------------------
  |  |   59|    291|#define DW_DLV_OK         0
  ------------------
  309|    291|}
dwarf_peread.c:_dwarf_pe_load_dwarf_section_headers:
  467|  1.38k|{
  468|  1.38k|    Dwarf_Unsigned i = 0;
  469|  1.38k|    Dwarf_Unsigned input_count =
  470|  1.38k|        pep->pe_FileHeader.NumberOfSections;
  471|  1.38k|    Dwarf_Unsigned offset_in_input = pep->pe_section_table_offset;
  472|  1.38k|    Dwarf_Unsigned section_hdr_size = sizeof(IMAGE_SECTION_HEADER_dw);
  473|  1.38k|    struct dwarf_pe_generic_image_section_header *sec_outp = 0;
  474|  1.38k|    Dwarf_Unsigned cur_offset = offset_in_input;
  475|  1.38k|    Dwarf_Unsigned past_end_hdrs = offset_in_input +
  476|  1.38k|        section_hdr_size*input_count;
  477|       |
  478|       |    /* internal sections include null initial section */
  479|  1.38k|    pep->pe_section_count = input_count+1;
  480|       |
  481|  1.38k|    if (past_end_hdrs > pep->pe_filesize) {
  ------------------
  |  Branch (481:9): [True: 120, False: 1.26k]
  ------------------
  482|    120|        *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|    120|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  483|    120|        return DW_DLV_ERROR;
  ------------------
  |  |   60|    120|#define DW_DLV_ERROR      1
  ------------------
  484|    120|    }
  485|       |
  486|  1.26k|    if (!offset_in_input) {
  ------------------
  |  Branch (486:9): [True: 0, False: 1.26k]
  ------------------
  487|      0|        *errcode = DW_DLE_PE_OFFSET_BAD;
  ------------------
  |  | 1402|      0|#define DW_DLE_PE_OFFSET_BAD                   427
  ------------------
  488|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  489|      0|    }
  490|  1.26k|    pep->pe_sectionptr =
  491|  1.26k|        (struct dwarf_pe_generic_image_section_header * )
  492|  1.26k|        calloc((size_t)pep->pe_section_count,
  493|  1.26k|        sizeof(struct dwarf_pe_generic_image_section_header));
  494|  1.26k|    if (!pep->pe_sectionptr) {
  ------------------
  |  Branch (494:9): [True: 0, False: 1.26k]
  ------------------
  495|      0|        *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  496|      0|        return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  497|      0|    }
  498|  1.26k|    sec_outp = pep->pe_sectionptr;
  499|  1.26k|    sec_outp->name = strdup("");
  500|  1.26k|    sec_outp->dwarfsectname = strdup("");
  501|  1.26k|    sec_outp++;
  502|   108k|    for ( ;  i < input_count;
  ------------------
  |  Branch (502:14): [True: 108k, False: 369]
  ------------------
  503|   108k|        ++i, cur_offset += section_hdr_size, sec_outp++) {
  504|       |
  505|   108k|        int res = 0;
  506|   108k|        IMAGE_SECTION_HEADER_dw filesect;
  507|   108k|        char        safe_name[IMAGE_SIZEOF_SHORT_NAME +1];
  508|   108k|        const char *expname = 0;
  509|   108k|        int irrelevant = 0;
  510|       |
  511|   108k|        res =  _dwarf_object_read_random(pep->pe_fd,
  512|   108k|            (char *)&filesect,cur_offset,
  513|   108k|            sizeof(filesect),
  514|   108k|            pep->pe_filesize,
  515|   108k|            errcode);
  516|   108k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|   108k|#define DW_DLV_OK         0
  ------------------
  |  Branch (516:13): [True: 0, False: 108k]
  ------------------
  517|      0|            return res;
  518|      0|        }
  519|       |        /*  The following is safe. filesect.Name is
  520|       |            IMAGE_SIZEOF_SHORT_NAME bytes long and may
  521|       |            not (not sure) have a NUL terminator. */
  522|   108k|        _dwarf_safe_strcpy(safe_name,
  523|   108k|            sizeof(safe_name),
  524|   108k|            filesect.Name,
  525|   108k|            IMAGE_SIZEOF_SHORT_NAME);
  ------------------
  |  |  193|   108k|#define IMAGE_SIZEOF_SHORT_NAME 8
  ------------------
  526|       |        /* Have NUL terminator now. */
  527|   108k|        sec_outp->name = strdup(safe_name);
  528|   108k|        res = pe_section_name_get(pep,
  529|   108k|            safe_name,(unsigned int)strlen(safe_name),
  530|   108k|            &expname,errcode);
  531|   108k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|   108k|#define DW_DLV_OK         0
  ------------------
  |  Branch (531:13): [True: 54, False: 107k]
  ------------------
  532|     54|            return res;
  533|     54|        }
  534|   107k|        if (expname) {
  ------------------
  |  Branch (534:13): [True: 107k, False: 0]
  ------------------
  535|   107k|            sec_outp->dwarfsectname = strdup(expname);
  536|   107k|        } else {
  537|      0|            sec_outp->dwarfsectname = strdup("<sec name missing>");
  538|      0|        }
  539|   107k|        if ( !sec_outp->name || !sec_outp->dwarfsectname) {
  ------------------
  |  Branch (539:14): [True: 0, False: 107k]
  |  Branch (539:33): [True: 0, False: 107k]
  ------------------
  540|      0|            *errcode = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  541|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  542|      0|        }
  543|   107k|        sec_outp->SecHeaderOffset = cur_offset;
  544|   107k|        ASNAR(pep->pe_copy_word,sec_outp->VirtualSize,
  ------------------
  |  |   57|   107k|    do {                                        \
  |  |   58|   107k|        (t) = 0;                                \
  |  |   59|   107k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   107k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  545|   107k|            filesect.Misc.VirtualSize);
  546|   107k|        ASNAR(pep->pe_copy_word,sec_outp->VirtualAddress,
  ------------------
  |  |   57|   107k|    do {                                        \
  |  |   58|   107k|        (t) = 0;                                \
  |  |   59|   107k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   107k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  547|   107k|            filesect.VirtualAddress);
  548|   107k|        ASNAR(pep->pe_copy_word,sec_outp->SizeOfRawData,
  ------------------
  |  |   57|   107k|    do {                                        \
  |  |   58|   107k|        (t) = 0;                                \
  |  |   59|   107k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|   107k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  549|   107k|            filesect.SizeOfRawData);
  550|   107k|        irrelevant = is_irrelevant_section(sec_outp->dwarfsectname,
  551|   107k|            sec_outp->VirtualSize);
  552|   107k|        sec_outp->section_irrelevant_to_dwarf = irrelevant;
  553|   107k|        if (irrelevant) {
  ------------------
  |  Branch (553:13): [True: 87.3k, False: 20.6k]
  ------------------
  554|  87.3k|            continue;
  555|  87.3k|        }
  556|  20.6k|        {
  557|       |            /*  A Heuristic, allowing large virtual size
  558|       |                but not unlimited as we will malloc it
  559|       |                later, as Virtualsize. */
  560|  20.6k|            Dwarf_Unsigned limit = 100*pep->pe_filesize;
  561|  20.6k|            if (limit < pep->pe_filesize) {
  ------------------
  |  Branch (561:17): [True: 0, False: 20.6k]
  ------------------
  562|       |                /* An overflow. Bad. */
  563|      0|                *errcode = DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL;
  ------------------
  |  | 1479|      0|#define DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL  504
  ------------------
  564|      0|                return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  565|      0|            }
  566|  20.6k|            if (sec_outp->VirtualSize >
  ------------------
  |  Branch (566:17): [True: 111, False: 20.5k]
  ------------------
  567|  20.6k|                ((Dwarf_Unsigned)2000*
  568|  20.6k|                (Dwarf_Unsigned)1000*
  569|  20.6k|                (Dwarf_Unsigned)1000)) {
  570|       |                /*  Likely unreasonable.
  571|       |                    the hard limit written this way
  572|       |                    simply for clarity.
  573|       |                    Hard to know what to set it to. */
  574|    111|                *errcode = DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL;
  ------------------
  |  | 1479|    111|#define DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL  504
  ------------------
  575|    111|                return DW_DLV_ERROR;
  ------------------
  |  |   60|    111|#define DW_DLV_ERROR      1
  ------------------
  576|    111|            }
  577|  20.5k|            if (sec_outp->VirtualSize > limit) {
  ------------------
  |  Branch (577:17): [True: 354, False: 20.1k]
  ------------------
  578|       |                /* Likely totally unreasonable. Bad. */
  579|    354|                *errcode = DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL;
  ------------------
  |  | 1479|    354|#define DW_DLE_PE_SECTION_SIZE_HEURISTIC_FAIL  504
  ------------------
  580|    354|                return DW_DLV_ERROR;
  ------------------
  |  |   60|    354|#define DW_DLV_ERROR      1
  ------------------
  581|    354|            }
  582|  20.5k|        }
  583|  20.1k|        ASNAR(pep->pe_copy_word,sec_outp->PointerToRawData,
  ------------------
  |  |   57|  20.1k|    do {                                        \
  |  |   58|  20.1k|        (t) = 0;                                \
  |  |   59|  20.1k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  20.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  584|  20.1k|            filesect.PointerToRawData);
  585|  20.1k|        if (sec_outp->SizeOfRawData > pep->pe_filesize ||
  ------------------
  |  Branch (585:13): [True: 159, False: 19.9k]
  ------------------
  586|  20.1k|            sec_outp->PointerToRawData > pep->pe_filesize ||
  ------------------
  |  Branch (586:13): [True: 201, False: 19.7k]
  ------------------
  587|  20.1k|            (sec_outp->SizeOfRawData+
  ------------------
  |  Branch (587:13): [True: 12, False: 19.7k]
  ------------------
  588|  19.7k|                sec_outp->PointerToRawData > pep->pe_filesize)) {
  589|    372|            *errcode = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|    372|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  590|    372|            return DW_DLV_ERROR;
  ------------------
  |  |   60|    372|#define DW_DLV_ERROR      1
  ------------------
  591|    372|        }
  592|  19.7k|        ASNAR(pep->pe_copy_word,sec_outp->PointerToRelocations,
  ------------------
  |  |   57|  19.7k|    do {                                        \
  |  |   58|  19.7k|        (t) = 0;                                \
  |  |   59|  19.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  593|  19.7k|            filesect.PointerToRelocations);
  594|  19.7k|        ASNAR(pep->pe_copy_word,sec_outp->PointerToLinenumbers,
  ------------------
  |  |   57|  19.7k|    do {                                        \
  |  |   58|  19.7k|        (t) = 0;                                \
  |  |   59|  19.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  595|  19.7k|            filesect.PointerToLinenumbers);
  596|  19.7k|        ASNAR(pep->pe_copy_word,sec_outp->NumberOfRelocations,
  ------------------
  |  |   57|  19.7k|    do {                                        \
  |  |   58|  19.7k|        (t) = 0;                                \
  |  |   59|  19.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  597|  19.7k|            filesect.NumberOfRelocations);
  598|  19.7k|        ASNAR(pep->pe_copy_word,sec_outp->NumberOfLinenumbers,
  ------------------
  |  |   57|  19.7k|    do {                                        \
  |  |   58|  19.7k|        (t) = 0;                                \
  |  |   59|  19.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  599|  19.7k|            filesect.NumberOfLinenumbers);
  600|  19.7k|        ASNAR(pep->pe_copy_word,sec_outp->Characteristics,
  ------------------
  |  |   57|  19.7k|    do {                                        \
  |  |   58|  19.7k|        (t) = 0;                                \
  |  |   59|  19.7k|        (func)(&(t),&(s)[0],sizeof(s));           \
  |  |   60|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  601|  19.7k|            filesect.Characteristics);
  602|       |        /* sec_outp->loaded data set when we load a section */
  603|  19.7k|    }
  604|    369|    return DW_DLV_OK;
  ------------------
  |  |   59|    369|#define DW_DLV_OK         0
  ------------------
  605|  1.26k|}
dwarf_peread.c:pe_section_name_get:
  118|   108k|{
  119|   108k|    if (name_array[0] == '/') {
  ------------------
  |  Branch (119:9): [True: 4.21k, False: 103k]
  ------------------
  120|  4.21k|        long v = 0;
  121|  4.21k|        unsigned long u = 0;
  122|  4.21k|        const char *s = 0;
  123|  4.21k|        char temp_array[9];
  124|  4.21k|        int res = 0;
  125|       |
  126|       |        /*  The value is an integer after the /,
  127|       |            and we want the value */
  128|  4.21k|        _dwarf_safe_strcpy(temp_array,sizeof(temp_array),
  129|  4.21k|            name_array+1,size_name-1);
  130|  4.21k|        v = atoi(temp_array);
  131|  4.21k|        if (v < 0) {
  ------------------
  |  Branch (131:13): [True: 3, False: 4.20k]
  ------------------
  132|      3|            *errcode = DW_DLE_STRING_OFFSET_BAD;
  ------------------
  |  | 1027|      3|#define DW_DLE_STRING_OFFSET_BAD                53
  ------------------
  133|      3|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
  134|      3|        }
  135|  4.20k|        u = v;
  136|  4.20k|        if (!pep->pe_string_table) {
  ------------------
  |  Branch (136:13): [True: 3, False: 4.20k]
  ------------------
  137|      3|            *errcode = DW_DLE_STRING_OFFSET_BAD;
  ------------------
  |  | 1027|      3|#define DW_DLE_STRING_OFFSET_BAD                53
  ------------------
  138|      3|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
  139|      3|        }
  140|  4.20k|        if (u >= pep->pe_string_table_size) {
  ------------------
  |  Branch (140:13): [True: 45, False: 4.16k]
  ------------------
  141|     45|            *errcode = DW_DLE_STRING_OFFSET_BAD;
  ------------------
  |  | 1027|     45|#define DW_DLE_STRING_OFFSET_BAD                53
  ------------------
  142|     45|            return DW_DLV_ERROR;
  ------------------
  |  |   60|     45|#define DW_DLV_ERROR      1
  ------------------
  143|     45|        }
  144|  4.16k|        res = check_valid_string(pep->pe_string_table,
  145|  4.16k|            pep->pe_string_table_size,u);
  146|  4.16k|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|  4.16k|#define DW_DLV_OK         0
  ------------------
  |  Branch (146:13): [True: 3, False: 4.15k]
  ------------------
  147|      3|            *errcode = DW_DLE_STRING_OFFSET_BAD;
  ------------------
  |  | 1027|      3|#define DW_DLE_STRING_OFFSET_BAD                53
  ------------------
  148|      3|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
  149|      3|        }
  150|  4.15k|        s = pep->pe_string_table +u;
  151|  4.15k|        *name_out = s;
  152|  4.15k|        return DW_DLV_OK;
  ------------------
  |  |   59|  4.15k|#define DW_DLV_OK         0
  ------------------
  153|  4.16k|    }
  154|   103k|    *name_out = name_array;
  155|   103k|    return DW_DLV_OK;
  ------------------
  |  |   59|   103k|#define DW_DLV_OK         0
  ------------------
  156|   108k|}
dwarf_peread.c:check_valid_string:
   98|  4.16k|{
   99|  4.16k|    Dwarf_Unsigned i = startindex;
  100|  35.0k|    for ( ; i < size; ++i) {
  ------------------
  |  Branch (100:13): [True: 35.0k, False: 3]
  ------------------
  101|  35.0k|        if (!tab[i]) {
  ------------------
  |  Branch (101:13): [True: 4.15k, False: 30.8k]
  ------------------
  102|  4.15k|            return DW_DLV_OK;
  ------------------
  |  |   59|  4.15k|#define DW_DLV_OK         0
  ------------------
  103|  4.15k|        }
  104|  35.0k|    }
  105|      3|    return DW_DLV_ERROR;
  ------------------
  |  |   60|      3|#define DW_DLV_ERROR      1
  ------------------
  106|  4.16k|}
dwarf_peread.c:is_irrelevant_section:
  341|   107k|{
  342|   107k|    int res = FALSE;
  ------------------
  |  |   40|   107k|#define FALSE 0
  ------------------
  343|       |
  344|   107k|    res = in_name_list(name);
  345|   107k|    if (res) {
  ------------------
  |  Branch (345:9): [True: 1.68k, False: 106k]
  ------------------
  346|  1.68k|        return TRUE;
  ------------------
  |  |   37|  1.68k|#define TRUE 1
  ------------------
  347|  1.68k|    }
  348|   106k|    if (!virtsz) {
  ------------------
  |  Branch (348:9): [True: 85.6k, False: 20.6k]
  ------------------
  349|  85.6k|        return TRUE;
  ------------------
  |  |   37|  85.6k|#define TRUE 1
  ------------------
  350|  85.6k|    }
  351|  20.6k|    return FALSE;
  ------------------
  |  |   40|  20.6k|#define FALSE 0
  ------------------
  352|   106k|}
dwarf_peread.c:in_name_list:
  321|   107k|{
  322|   107k|    int i = 0;
  323|       |
  324|   107k|    if (!name) {
  ------------------
  |  Branch (324:9): [True: 0, False: 107k]
  ------------------
  325|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  326|      0|    }
  327|   535k|    for ( ; ; ++i) {
  328|   535k|        if (!boringname[i]) {
  ------------------
  |  Branch (328:13): [True: 106k, False: 429k]
  ------------------
  329|   106k|            break;
  330|   106k|        }
  331|   429k|        if (!strcmp(name,boringname[i])) {
  ------------------
  |  Branch (331:13): [True: 1.68k, False: 427k]
  ------------------
  332|  1.68k|            return TRUE;
  ------------------
  |  |   37|  1.68k|#define TRUE 1
  ------------------
  333|  1.68k|        }
  334|   429k|    }
  335|   106k|    return FALSE;
  ------------------
  |  |   40|   106k|#define FALSE 0
  ------------------
  336|   107k|}
dwarf_peread.c:pe_get_section_info:
  203|   160k|{
  204|   160k|    dwarf_pe_object_access_internals_t *pep =
  205|   160k|        (dwarf_pe_object_access_internals_t*)(obj);
  206|       |
  207|   160k|    (void)error;
  208|   160k|    if (section_index < pep->pe_section_count) {
  ------------------
  |  Branch (208:9): [True: 160k, False: 0]
  ------------------
  209|   160k|        struct dwarf_pe_generic_image_section_header *sp = 0;
  210|   160k|        sp = pep->pe_sectionptr + section_index;
  211|   160k|        return_section->as_name = sp->dwarfsectname;
  212|   160k|        return_section->as_type = 0;
  213|   160k|        return_section->as_flags = sp->Characteristics;
  214|   160k|        return_section->as_addr = pep->pe_OptionalHeader.ImageBase +
  215|   160k|            sp->VirtualAddress;
  216|   160k|        return_section->as_offset = sp->PointerToRawData;
  217|       |        /*  SizeOfRawData can be rounded or truncated,
  218|       |            use VirtualSize for the real analog of Elf
  219|       |            section size. */
  220|   160k|        return_section->as_size = sp->VirtualSize;
  221|   160k|        return_section->as_link = 0;
  222|   160k|        return_section->as_info = 0;
  223|   160k|        return_section->as_addralign = 0;
  224|   160k|        return_section->as_entrysize = 0;
  225|   160k|        return DW_DLV_OK;
  ------------------
  |  |   59|   160k|#define DW_DLV_OK         0
  ------------------
  226|   160k|    }
  227|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  228|   160k|}
dwarf_peread.c:pe_get_byte_order:
  160|    369|{
  161|    369|    dwarf_pe_object_access_internals_t *pep =
  162|    369|        (dwarf_pe_object_access_internals_t*)(obj);
  163|    369|    return pep->pe_endian;
  164|    369|}
dwarf_peread.c:pe_get_length_size:
  168|    369|{
  169|    369|    dwarf_pe_object_access_internals_t *pep =
  170|    369|        (dwarf_pe_object_access_internals_t*)(obj);
  171|    369|    return pep->pe_offsetsize/8;
  172|    369|}
dwarf_peread.c:pe_get_pointer_size:
  184|    369|{
  185|    369|    dwarf_pe_object_access_internals_t *pep =
  186|    369|        (dwarf_pe_object_access_internals_t*)(obj);
  187|    369|    return pep->pe_pointersize/8;
  188|    369|}
dwarf_peread.c:pe_get_file_size:
  176|    369|{
  177|    369|    dwarf_pe_object_access_internals_t *pep =
  178|    369|        (dwarf_pe_object_access_internals_t*)(obj);
  179|    369|    return pep->pe_filesize;
  180|    369|}
dwarf_peread.c:pe_get_section_count:
  192|    369|{
  193|    369|    dwarf_pe_object_access_internals_t *pep =
  194|    369|        (dwarf_pe_object_access_internals_t*)(obj);
  195|    369|    return pep->pe_section_count;
  196|    369|}
dwarf_peread.c:pe_load_section:
  357|    167|{
  358|    167|    dwarf_pe_object_access_internals_t *pep =
  359|    167|        (dwarf_pe_object_access_internals_t*)(obj);
  360|       |
  361|    167|    if (0 < section_index &&
  ------------------
  |  Branch (361:9): [True: 167, False: 0]
  ------------------
  362|    167|        section_index < pep->pe_section_count) {
  ------------------
  |  Branch (362:9): [True: 167, False: 0]
  ------------------
  363|    167|        int res = 0;
  364|    167|        struct dwarf_pe_generic_image_section_header *sp =
  365|    167|            pep->pe_sectionptr + section_index;
  366|    167|        Dwarf_Unsigned read_length = 0;
  367|       |
  368|    167|        if (sp->loaded_data) {
  ------------------
  |  Branch (368:13): [True: 0, False: 167]
  ------------------
  369|      0|            *return_data = sp->loaded_data;
  370|      0|            return DW_DLV_OK;
  ------------------
  |  |   59|      0|#define DW_DLV_OK         0
  ------------------
  371|      0|        }
  372|    167|        if (sp->section_irrelevant_to_dwarf) {
  ------------------
  |  Branch (372:13): [True: 0, False: 167]
  ------------------
  373|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  374|      0|        }
  375|    167|        if (!sp->VirtualSize) {
  ------------------
  |  Branch (375:13): [True: 0, False: 167]
  ------------------
  376|      0|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  377|      0|        }
  378|    167|        if (sp->SizeOfRawData >= pep->pe_filesize) {
  ------------------
  |  Branch (378:13): [True: 4, False: 163]
  ------------------
  379|      4|            *error = DW_DLE_PE_SECTION_SIZE_ERROR;
  ------------------
  |  | 1466|      4|#define DW_DLE_PE_SECTION_SIZE_ERROR           491
  ------------------
  380|      4|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      4|#define DW_DLV_ERROR      1
  ------------------
  381|      4|        }
  382|    163|        read_length = sp->SizeOfRawData;
  383|    163|        if (sp->VirtualSize < read_length) {
  ------------------
  |  Branch (383:13): [True: 17, False: 146]
  ------------------
  384|       |            /* Don't read padding that wasn't allocated in memory */
  385|     17|            read_length = sp->VirtualSize;
  386|     17|        }
  387|    163|        if ((read_length + sp->PointerToRawData) >
  ------------------
  |  Branch (387:13): [True: 0, False: 163]
  ------------------
  388|    163|            pep->pe_filesize) {
  389|      0|            *error = DW_DLE_FILE_TOO_SMALL;
  ------------------
  |  | 1398|      0|#define DW_DLE_FILE_TOO_SMALL                  423
  ------------------
  390|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  391|      0|        }
  392|       |        /*  VirtualSize > SizeOfRawData  if trailing zeros
  393|       |            in the section were not written to disc.
  394|       |            Malloc enough for the whole section, read in
  395|       |            the bytes we have. */
  396|    163|        sp->loaded_data = malloc((size_t)sp->VirtualSize);
  397|    163|        if (!sp->loaded_data) {
  ------------------
  |  Branch (397:13): [True: 0, False: 163]
  ------------------
  398|      0|            *error = DW_DLE_ALLOC_FAIL;
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  399|      0|            return DW_DLV_ERROR;
  ------------------
  |  |   60|      0|#define DW_DLV_ERROR      1
  ------------------
  400|      0|        }
  401|    163|        res = _dwarf_object_read_random(pep->pe_fd,
  402|    163|            (char *)sp->loaded_data,
  403|    163|            sp->PointerToRawData, (size_t)read_length,
  404|    163|            pep->pe_filesize,
  405|    163|            error);
  406|    163|        if (res != DW_DLV_OK) {
  ------------------
  |  |   59|    163|#define DW_DLV_OK         0
  ------------------
  |  Branch (406:13): [True: 4, False: 159]
  ------------------
  407|      4|            free(sp->loaded_data);
  408|      4|            sp->loaded_data = 0;
  409|      4|            return res;
  410|      4|        }
  411|    159|        if (sp->VirtualSize > read_length) {
  ------------------
  |  Branch (411:13): [True: 141, False: 18]
  ------------------
  412|       |            /*  Zero space that was allocated but
  413|       |                truncated from the file */
  414|    141|            memset(sp->loaded_data + read_length, 0,
  415|    141|                (size_t)(sp->VirtualSize - read_length));
  416|    141|        }
  417|    159|        *return_data = sp->loaded_data;
  418|    159|        return DW_DLV_OK;
  ------------------
  |  |   59|    159|#define DW_DLV_OK         0
  ------------------
  419|    163|    }
  420|      0|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |   58|      0|#define DW_DLV_NO_ENTRY  -1
  ------------------
  421|    167|}

_dwarf_dealloc_rnglists_context:
  728|  10.6k|{
  729|  10.6k|    Dwarf_Unsigned i = 0;
  730|  10.6k|    Dwarf_Rnglists_Context * rngcon = 0;
  731|       |
  732|  10.6k|    if (IS_INVALID_DBG(dbg)) {
  ------------------
  |  |  159|  10.6k|    ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |  538|  10.6k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   37|      0|#define TRUE 1
  |  |  ------------------
  |  |                   ((!(d) || ((d)->de_magic != DBG_IS_VALID))?TRUE:FALSE)
  |  |  ------------------
  |  |  |  |   40|  10.6k|#define FALSE 0
  |  |  ------------------
  |  |  |  Branch (159:5): [True: 0, False: 10.6k]
  |  |  |  Branch (159:7): [True: 0, False: 10.6k]
  |  |  |  Branch (159:15): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  733|      0|        return;
  734|      0|    }
  735|  10.6k|    if (!dbg->de_rnglists_context) {
  ------------------
  |  Branch (735:9): [True: 10.6k, False: 0]
  ------------------
  736|  10.6k|        return;
  737|  10.6k|    }
  738|      0|    rngcon = dbg->de_rnglists_context;
  739|      0|    for ( ; i < dbg->de_rnglists_context_count; ++i) {
  ------------------
  |  Branch (739:13): [True: 0, False: 0]
  ------------------
  740|      0|        Dwarf_Rnglists_Context con = rngcon[i];
  741|      0|        free_rnglists_context(con);
  742|      0|        rngcon[i] = 0;
  743|      0|    }
  744|      0|    free(dbg->de_rnglists_context);
  745|      0|    dbg->de_rnglists_context = 0;
  746|      0|    dbg->de_rnglists_context_count = 0;
  747|      0|}

_dwarf_safe_strcpy:
   76|   307k|{
   77|   307k|    size_t      full_inlen = inlen+1;
   78|   307k|    char       *cpo = 0;
   79|   307k|    const char *cpi= 0;
   80|   307k|    const char *cpiend = 0;
   81|       |
   82|   307k|    if (full_inlen >= outlen) {
  ------------------
  |  Branch (82:9): [True: 108k, False: 199k]
  ------------------
   83|   108k|        if (!outlen) {
  ------------------
  |  Branch (83:13): [True: 0, False: 108k]
  ------------------
   84|      0|            return;
   85|      0|        }
   86|   108k|        cpo = out;
   87|   108k|        cpi= in_s;
   88|   108k|        cpiend = in_s +(outlen-1);
   89|   199k|    } else {
   90|       |        /*  If outlen is very large
   91|       |            strncpy is very wasteful. */
   92|   199k|        cpo = out;
   93|   199k|        cpi= in_s;
   94|   199k|        cpiend = in_s +inlen;
   95|   199k|    }
   96|   677k|    for ( ; *cpi && cpi < cpiend ; ++cpo, ++cpi) {
  ------------------
  |  Branch (96:13): [True: 372k, False: 305k]
  |  Branch (96:21): [True: 369k, False: 2.61k]
  ------------------
   97|   369k|        *cpo = *cpi;
   98|   369k|    }
   99|   307k|    *cpo = 0;
  100|   307k|}

_dwarf_startswith:
   48|  4.39M|{
   49|  4.39M|    size_t cklen = strlen(ckfor);
   50|       |
   51|  4.39M|    if (! strncmp(input,ckfor,cklen)) {
  ------------------
  |  Branch (51:9): [True: 621k, False: 3.77M]
  ------------------
   52|   621k|        return TRUE;
  ------------------
  |  |   37|   621k|#define TRUE 1
  ------------------
   53|   621k|    }
   54|  3.77M|    return FALSE;
  ------------------
  |  |   40|  3.77M|#define FALSE 0
  ------------------
   55|  4.39M|}
_dwarf_ignorethissection:
   99|   628k|{
  100|   628k|    int l = 0;
  101|   628k|    int h = sizeof(nonsec)/sizeof(const char *) -1;
  102|   628k|    int res = 0;
  103|       |
  104|  3.28M|    while (l <= h) {
  ------------------
  |  Branch (104:12): [True: 2.68M, False: 599k]
  ------------------
  105|  2.68M|        int m = (l+h)/2;
  106|  2.68M|        const char *s = nonsec[m];
  107|       |
  108|  2.68M|        res  = _dwarf_startswithx(scn_name,s);
  109|  2.68M|        if (res < 0) {
  ------------------
  |  Branch (109:13): [True: 1.62M, False: 1.05M]
  ------------------
  110|  1.62M|            h =  m -1;
  111|  1.62M|        } else if (res > 0) {
  ------------------
  |  Branch (111:20): [True: 1.03M, False: 28.3k]
  ------------------
  112|  1.03M|            l =  m + 1;
  113|  1.03M|        } else {
  114|  28.3k|            return TRUE;
  ------------------
  |  |   37|  28.3k|#define TRUE 1
  ------------------
  115|  28.3k|        }
  116|  2.68M|    }
  117|   599k|    return FALSE;
  ------------------
  |  |   40|   599k|#define FALSE 0
  ------------------
  118|   628k|}
dwarf_secname_ck.c:_dwarf_startswithx:
   59|  2.68M|{
   60|  2.68M|    size_t cklen =  strlen(ckfor);
   61|  2.68M|    int res = 0;
   62|       |
   63|  2.68M|    res = strncmp(input,ckfor,cklen);
   64|  2.68M|    return res;
   65|  2.68M|}

_dwarf_readr:
  104|   366k|{
  105|       |
  106|   366k|    Dwarf_Signed rcode = 0;
  107|       |#ifdef _WIN64
  108|       |    Dwarf_Unsigned max_single_read = 0x1ffff000;
  109|       |#elif defined(_WIN32)
  110|       |    Dwarf_Unsigned max_single_read = 0xffff;
  111|       |#else
  112|   366k|    Dwarf_Unsigned max_single_read = 0x1ffff000;
  113|   366k|#endif
  114|   366k|    Dwarf_Unsigned remaining_bytes = 0;
  115|   366k|    Dwarf_Unsigned totalsize = size;
  116|       |
  117|   366k|    remaining_bytes = size;
  118|   731k|    while(remaining_bytes > 0) {
  ------------------
  |  Branch (118:11): [True: 365k, False: 366k]
  ------------------
  119|   365k|        if (remaining_bytes > max_single_read) {
  ------------------
  |  Branch (119:13): [True: 0, False: 365k]
  ------------------
  120|      0|            size = max_single_read;
  121|      0|        }
  122|       |#ifdef _WIN64
  123|       |        rcode = (Dwarf_Signed)_read(fd,buf,(unsigned const)size);
  124|       |#elif defined(_WIN32)
  125|       |        rcode = (Dwarf_Signed)_read(fd,buf,(unsigned const)size);
  126|       |#else /* linux */
  127|   365k|        rcode = (Dwarf_Signed)read(fd,buf,(size_t)size);
  128|   365k|#endif
  129|   365k|        if (rcode < 0 || rcode != (Dwarf_Signed)size) {
  ------------------
  |  Branch (129:13): [True: 0, False: 365k]
  |  Branch (129:26): [True: 0, False: 365k]
  ------------------
  130|      0|            return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  131|      0|        }
  132|   365k|        remaining_bytes -= size;
  133|   365k|        buf += size;
  134|   365k|        size = remaining_bytes;
  135|   365k|    }
  136|   366k|    if (sizeread_out) {
  ------------------
  |  Branch (136:9): [True: 0, False: 366k]
  ------------------
  137|      0|        *sizeread_out = totalsize;
  138|      0|    }
  139|   366k|    return DW_DLV_OK;
  ------------------
  |  |  122|   366k|#define DW_DLV_OK        0
  ------------------
  140|   366k|}
_dwarf_seekr:
  147|   393k|{
  148|   393k|    Dwarf_Signed fsize = 0;
  149|   393k|    Dwarf_Signed sloc = 0;
  150|       |
  151|   393k|    sloc = (Dwarf_Signed)loc;
  152|   393k|    if (sloc < 0) {
  ------------------
  |  Branch (152:9): [True: 0, False: 393k]
  ------------------
  153|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  154|      0|    }
  155|       |#ifdef _WIN64
  156|       |    fsize = (Dwarf_Signed)lseek(fd,(__int64)loc,seektype);
  157|       |#elif defined(_WIN32)
  158|       |    fsize = (Dwarf_Signed)lseek(fd,(off_t)loc,seektype);
  159|       |#else /* linux */
  160|   393k|    fsize = (Dwarf_Signed)lseek(fd,(off_t)loc,seektype);
  161|   393k|#endif
  162|   393k|    if (fsize < 0) {
  ------------------
  |  Branch (162:9): [True: 6, False: 393k]
  ------------------
  163|      6|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      6|#define DW_DLV_ERROR     1
  ------------------
  164|      6|    }
  165|   393k|    if (out_loc) {
  ------------------
  |  Branch (165:9): [True: 26.9k, False: 366k]
  ------------------
  166|  26.9k|        *out_loc = (Dwarf_Unsigned)fsize;
  167|  26.9k|    }
  168|   393k|    return DW_DLV_OK;
  ------------------
  |  |  122|   393k|#define DW_DLV_OK        0
  ------------------
  169|   393k|}
_dwarf_closer:
  173|  50.7k|{
  174|       |#ifdef _WIN64
  175|       |    _close(fd);
  176|       |#elif defined(_WIN32)
  177|       |    _close(fd);
  178|       |#else /* linux */
  179|  50.7k|    close(fd);
  180|  50.7k|#endif
  181|  50.7k|}
_dwarf_openr:
  185|  59.5k|{
  186|       |
  187|  59.5k|    int fd = -1;
  188|       |#ifdef _WIN64
  189|       |    fd = _open(name, O_RDONLY | O_BINARY|O_CLOEXEC);
  190|       |#elif defined(_WIN32)
  191|       |    fd = _open(name, O_RDONLY | O_BINARY|O_CLOEXEC);
  192|       |#else /* linux */
  193|  59.5k|    fd = open(name, O_RDONLY | O_BINARY|O_CLOEXEC);
  ------------------
  |  |   75|  59.5k|#define O_BINARY 0
  ------------------
  194|  59.5k|#endif
  195|  59.5k|    return fd;
  196|       |
  197|  59.5k|}

_dwarf_enter_section_in_de_debug_sections_array:
  237|  56.8k|{
  238|       |    /*  Setup the table that contains the basic information about the
  239|       |        sections that are DWARF related. The entries are very unlikely
  240|       |        to change very often. */
  241|  56.8k|    SET_UP_SECTION(dbg,scn_name,".debug_info",
  ------------------
  |  |  210|  56.8k|    {                                           \
  |  |  211|  56.8k|    int lerr = 0;                               \
  |  |  212|  56.8k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.8k|        (mname),  /* actual section name */     \
  |  |  214|  56.8k|        (mtarg),    /* std section name */      \
  |  |  215|  56.8k|        /* scn_number from macro use context */ \
  |  |  216|  56.8k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.8k|        (minfo),                                \
  |  |  218|  56.8k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.8k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.8k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 75, False: 56.7k]
  |  |  ------------------
  |  |  220|     75|        return lerr;                            \
  |  |  221|     75|    }    /* else fall through. */               \
  |  |  222|  56.8k|    }
  ------------------
  242|  56.8k|        group_number,
  243|  56.8k|        &dbg->de_debug_info,
  244|  56.8k|        DW_DLE_DEBUG_INFO_DUPLICATE,DW_DLE_DEBUG_INFO_NULL,
  245|  56.8k|        TRUE,err);
  246|  56.7k|    SET_UP_SECTION(dbg,scn_name,".debug_info.dwo",
  ------------------
  |  |  210|  56.7k|    {                                           \
  |  |  211|  56.7k|    int lerr = 0;                               \
  |  |  212|  56.7k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.7k|        (mname),  /* actual section name */     \
  |  |  214|  56.7k|        (mtarg),    /* std section name */      \
  |  |  215|  56.7k|        /* scn_number from macro use context */ \
  |  |  216|  56.7k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.7k|        (minfo),                                \
  |  |  218|  56.7k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.7k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.7k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 474, False: 56.2k]
  |  |  ------------------
  |  |  220|    474|        return lerr;                            \
  |  |  221|    474|    }    /* else fall through. */               \
  |  |  222|  56.7k|    }
  ------------------
  247|  56.7k|        DW_GROUPNUMBER_DWO,
  248|  56.7k|        &dbg->de_debug_info,
  249|  56.7k|        DW_DLE_DEBUG_INFO_DUPLICATE,DW_DLE_DEBUG_INFO_NULL,
  250|  56.7k|        TRUE,err);
  251|  56.2k|    SET_UP_SECTION(dbg,scn_name,".debug_types",
  ------------------
  |  |  210|  56.2k|    {                                           \
  |  |  211|  56.2k|    int lerr = 0;                               \
  |  |  212|  56.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.2k|        (mname),  /* actual section name */     \
  |  |  214|  56.2k|        (mtarg),    /* std section name */      \
  |  |  215|  56.2k|        /* scn_number from macro use context */ \
  |  |  216|  56.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.2k|        (minfo),                                \
  |  |  218|  56.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 60, False: 56.2k]
  |  |  ------------------
  |  |  220|     60|        return lerr;                            \
  |  |  221|     60|    }    /* else fall through. */               \
  |  |  222|  56.2k|    }
  ------------------
  252|  56.2k|        group_number,
  253|  56.2k|        &dbg->de_debug_types,
  254|  56.2k|        DW_DLE_DEBUG_TYPES_DUPLICATE,DW_DLE_DEBUG_TYPES_NULL,
  255|  56.2k|        TRUE,err);
  256|       |    /* types.dwo  is non-standard. DWARF4 GNU maybe. */
  257|  56.2k|    SET_UP_SECTION(dbg,scn_name,".debug_types.dwo",
  ------------------
  |  |  210|  56.2k|    {                                           \
  |  |  211|  56.2k|    int lerr = 0;                               \
  |  |  212|  56.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.2k|        (mname),  /* actual section name */     \
  |  |  214|  56.2k|        (mtarg),    /* std section name */      \
  |  |  215|  56.2k|        /* scn_number from macro use context */ \
  |  |  216|  56.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.2k|        (minfo),                                \
  |  |  218|  56.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 90, False: 56.1k]
  |  |  ------------------
  |  |  220|     90|        return lerr;                            \
  |  |  221|     90|    }    /* else fall through. */               \
  |  |  222|  56.2k|    }
  ------------------
  258|  56.2k|        DW_GROUPNUMBER_DWO,
  259|  56.2k|        &dbg->de_debug_types,
  260|  56.2k|        DW_DLE_DEBUG_TYPES_DUPLICATE,DW_DLE_DEBUG_TYPES_NULL,
  261|  56.2k|        TRUE,err);
  262|  56.1k|    SET_UP_SECTION(dbg,scn_name,".debug_abbrev",
  ------------------
  |  |  210|  56.1k|    {                                           \
  |  |  211|  56.1k|    int lerr = 0;                               \
  |  |  212|  56.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.1k|        (mname),  /* actual section name */     \
  |  |  214|  56.1k|        (mtarg),    /* std section name */      \
  |  |  215|  56.1k|        /* scn_number from macro use context */ \
  |  |  216|  56.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.1k|        (minfo),                                \
  |  |  218|  56.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 111, False: 56.0k]
  |  |  ------------------
  |  |  220|    111|        return lerr;                            \
  |  |  221|    111|    }    /* else fall through. */               \
  |  |  222|  56.1k|    }
  ------------------
  263|  56.1k|        group_number,
  264|  56.1k|        &dbg->de_debug_abbrev, /*03*/
  265|  56.1k|        DW_DLE_DEBUG_ABBREV_DUPLICATE,DW_DLE_DEBUG_ABBREV_NULL,
  266|  56.1k|        TRUE,err);
  267|  56.0k|    SET_UP_SECTION(dbg,scn_name,".debug_abbrev.dwo",
  ------------------
  |  |  210|  56.0k|    {                                           \
  |  |  211|  56.0k|    int lerr = 0;                               \
  |  |  212|  56.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.0k|        (mname),  /* actual section name */     \
  |  |  214|  56.0k|        (mtarg),    /* std section name */      \
  |  |  215|  56.0k|        /* scn_number from macro use context */ \
  |  |  216|  56.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.0k|        (minfo),                                \
  |  |  218|  56.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 24, False: 56.0k]
  |  |  ------------------
  |  |  220|     24|        return lerr;                            \
  |  |  221|     24|    }    /* else fall through. */               \
  |  |  222|  56.0k|    }
  ------------------
  268|  56.0k|        DW_GROUPNUMBER_DWO,
  269|  56.0k|        &dbg->de_debug_abbrev, /*03*/
  270|  56.0k|        DW_DLE_DEBUG_ABBREV_DUPLICATE,DW_DLE_DEBUG_ABBREV_NULL,
  271|  56.0k|        TRUE,err);
  272|  56.0k|    SET_UP_SECTION(dbg,scn_name,".debug_aranges",
  ------------------
  |  |  210|  56.0k|    {                                           \
  |  |  211|  56.0k|    int lerr = 0;                               \
  |  |  212|  56.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  56.0k|        (mname),  /* actual section name */     \
  |  |  214|  56.0k|        (mtarg),    /* std section name */      \
  |  |  215|  56.0k|        /* scn_number from macro use context */ \
  |  |  216|  56.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  56.0k|        (minfo),                                \
  |  |  218|  56.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  56.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  56.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 42, False: 55.9k]
  |  |  ------------------
  |  |  220|     42|        return lerr;                            \
  |  |  221|     42|    }    /* else fall through. */               \
  |  |  222|  56.0k|    }
  ------------------
  273|  56.0k|        group_number,
  274|  56.0k|        &dbg->de_debug_aranges,
  275|  56.0k|        DW_DLE_DEBUG_ARANGES_DUPLICATE,0,
  276|  56.0k|        FALSE,err);
  277|  55.9k|    SET_UP_SECTION(dbg,scn_name,".debug_line",
  ------------------
  |  |  210|  55.9k|    {                                           \
  |  |  211|  55.9k|    int lerr = 0;                               \
  |  |  212|  55.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  55.9k|        (mname),  /* actual section name */     \
  |  |  214|  55.9k|        (mtarg),    /* std section name */      \
  |  |  215|  55.9k|        /* scn_number from macro use context */ \
  |  |  216|  55.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  55.9k|        (minfo),                                \
  |  |  218|  55.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  55.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  55.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 711, False: 55.2k]
  |  |  ------------------
  |  |  220|    711|        return lerr;                            \
  |  |  221|    711|    }    /* else fall through. */               \
  |  |  222|  55.9k|    }
  ------------------
  278|  55.9k|        group_number,
  279|  55.9k|        &dbg->de_debug_line,
  280|  55.9k|        DW_DLE_DEBUG_LINE_DUPLICATE,0,
  281|  55.9k|        TRUE,err);
  282|       |    /* DWARF5 */
  283|  55.2k|    SET_UP_SECTION(dbg,scn_name,".debug_line_str",
  ------------------
  |  |  210|  55.2k|    {                                           \
  |  |  211|  55.2k|    int lerr = 0;                               \
  |  |  212|  55.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  55.2k|        (mname),  /* actual section name */     \
  |  |  214|  55.2k|        (mtarg),    /* std section name */      \
  |  |  215|  55.2k|        /* scn_number from macro use context */ \
  |  |  216|  55.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  55.2k|        (minfo),                                \
  |  |  218|  55.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  55.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  55.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 27, False: 55.2k]
  |  |  ------------------
  |  |  220|     27|        return lerr;                            \
  |  |  221|     27|    }    /* else fall through. */               \
  |  |  222|  55.2k|    }
  ------------------
  284|  55.2k|        group_number,
  285|  55.2k|        &dbg->de_debug_line_str,
  286|  55.2k|        DW_DLE_DEBUG_LINE_DUPLICATE,0,
  287|  55.2k|        FALSE,err);
  288|  55.2k|    SET_UP_SECTION(dbg,scn_name,".debug_line.dwo",
  ------------------
  |  |  210|  55.2k|    {                                           \
  |  |  211|  55.2k|    int lerr = 0;                               \
  |  |  212|  55.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  55.2k|        (mname),  /* actual section name */     \
  |  |  214|  55.2k|        (mtarg),    /* std section name */      \
  |  |  215|  55.2k|        /* scn_number from macro use context */ \
  |  |  216|  55.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  55.2k|        (minfo),                                \
  |  |  218|  55.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  55.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  55.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 69, False: 55.1k]
  |  |  ------------------
  |  |  220|     69|        return lerr;                            \
  |  |  221|     69|    }    /* else fall through. */               \
  |  |  222|  55.2k|    }
  ------------------
  289|  55.2k|        DW_GROUPNUMBER_DWO,
  290|  55.2k|        &dbg->de_debug_line,
  291|  55.2k|        DW_DLE_DEBUG_LINE_DUPLICATE,0,
  292|  55.2k|        TRUE,err);
  293|  55.1k|    SET_UP_SECTION(dbg,scn_name,".debug_frame",
  ------------------
  |  |  210|  55.1k|    {                                           \
  |  |  211|  55.1k|    int lerr = 0;                               \
  |  |  212|  55.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  55.1k|        (mname),  /* actual section name */     \
  |  |  214|  55.1k|        (mtarg),    /* std section name */      \
  |  |  215|  55.1k|        /* scn_number from macro use context */ \
  |  |  216|  55.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  55.1k|        (minfo),                                \
  |  |  218|  55.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  55.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  55.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 33, False: 55.1k]
  |  |  ------------------
  |  |  220|     33|        return lerr;                            \
  |  |  221|     33|    }    /* else fall through. */               \
  |  |  222|  55.1k|    }
  ------------------
  294|  55.1k|        group_number,
  295|  55.1k|        &dbg->de_debug_frame,
  296|  55.1k|        DW_DLE_DEBUG_FRAME_DUPLICATE,0,
  297|  55.1k|        TRUE,err);
  298|       |    /* gnu egcs-1.1.2 data */
  299|  55.1k|    SET_UP_SECTION(dbg,scn_name,".eh_frame",
  ------------------
  |  |  210|  55.1k|    {                                           \
  |  |  211|  55.1k|    int lerr = 0;                               \
  |  |  212|  55.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  55.1k|        (mname),  /* actual section name */     \
  |  |  214|  55.1k|        (mtarg),    /* std section name */      \
  |  |  215|  55.1k|        /* scn_number from macro use context */ \
  |  |  216|  55.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  55.1k|        (minfo),                                \
  |  |  218|  55.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  55.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  55.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 408, False: 54.7k]
  |  |  ------------------
  |  |  220|    408|        return lerr;                            \
  |  |  221|    408|    }    /* else fall through. */               \
  |  |  222|  55.1k|    }
  ------------------
  300|  55.1k|        group_number,
  301|  55.1k|        &dbg->de_debug_frame_eh_gnu,
  302|  55.1k|        DW_DLE_DEBUG_FRAME_DUPLICATE,0,
  303|  55.1k|        TRUE,err);
  304|  54.7k|    SET_UP_SECTION(dbg,scn_name,".debug_loc",
  ------------------
  |  |  210|  54.7k|    {                                           \
  |  |  211|  54.7k|    int lerr = 0;                               \
  |  |  212|  54.7k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.7k|        (mname),  /* actual section name */     \
  |  |  214|  54.7k|        (mtarg),    /* std section name */      \
  |  |  215|  54.7k|        /* scn_number from macro use context */ \
  |  |  216|  54.7k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.7k|        (minfo),                                \
  |  |  218|  54.7k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.7k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.7k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 60, False: 54.6k]
  |  |  ------------------
  |  |  220|     60|        return lerr;                            \
  |  |  221|     60|    }    /* else fall through. */               \
  |  |  222|  54.7k|    }
  ------------------
  305|  54.7k|        group_number,
  306|  54.7k|        &dbg->de_debug_loc,
  307|  54.7k|        DW_DLE_DEBUG_LOC_DUPLICATE,0,
  308|  54.7k|        FALSE,err);
  309|       |    /*  .debug_loc.dwo would be non-standard. */
  310|  54.6k|    SET_UP_SECTION(dbg,scn_name,".debug_loc.dwo",
  ------------------
  |  |  210|  54.6k|    {                                           \
  |  |  211|  54.6k|    int lerr = 0;                               \
  |  |  212|  54.6k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.6k|        (mname),  /* actual section name */     \
  |  |  214|  54.6k|        (mtarg),    /* std section name */      \
  |  |  215|  54.6k|        /* scn_number from macro use context */ \
  |  |  216|  54.6k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.6k|        (minfo),                                \
  |  |  218|  54.6k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.6k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.6k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 27, False: 54.6k]
  |  |  ------------------
  |  |  220|     27|        return lerr;                            \
  |  |  221|     27|    }    /* else fall through. */               \
  |  |  222|  54.6k|    }
  ------------------
  311|  54.6k|        DW_GROUPNUMBER_DWO,
  312|  54.6k|        &dbg->de_debug_loc,
  313|  54.6k|        DW_DLE_DEBUG_LOC_DUPLICATE,0,
  314|  54.6k|        FALSE,err);
  315|  54.6k|    SET_UP_SECTION(dbg,scn_name,".debug_pubnames",
  ------------------
  |  |  210|  54.6k|    {                                           \
  |  |  211|  54.6k|    int lerr = 0;                               \
  |  |  212|  54.6k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.6k|        (mname),  /* actual section name */     \
  |  |  214|  54.6k|        (mtarg),    /* std section name */      \
  |  |  215|  54.6k|        /* scn_number from macro use context */ \
  |  |  216|  54.6k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.6k|        (minfo),                                \
  |  |  218|  54.6k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.6k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.6k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 66, False: 54.5k]
  |  |  ------------------
  |  |  220|     66|        return lerr;                            \
  |  |  221|     66|    }    /* else fall through. */               \
  |  |  222|  54.6k|    }
  ------------------
  316|  54.6k|        group_number,
  317|  54.6k|        &dbg->de_debug_pubnames,
  318|  54.6k|        DW_DLE_DEBUG_PUBNAMES_DUPLICATE,0,
  319|  54.6k|        FALSE,err);
  320|  54.5k|    SET_UP_SECTION(dbg,scn_name,".debug_str",
  ------------------
  |  |  210|  54.5k|    {                                           \
  |  |  211|  54.5k|    int lerr = 0;                               \
  |  |  212|  54.5k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.5k|        (mname),  /* actual section name */     \
  |  |  214|  54.5k|        (mtarg),    /* std section name */      \
  |  |  215|  54.5k|        /* scn_number from macro use context */ \
  |  |  216|  54.5k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.5k|        (minfo),                                \
  |  |  218|  54.5k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.5k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.5k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 93, False: 54.4k]
  |  |  ------------------
  |  |  220|     93|        return lerr;                            \
  |  |  221|     93|    }    /* else fall through. */               \
  |  |  222|  54.5k|    }
  ------------------
  321|  54.5k|        group_number,
  322|  54.5k|        &dbg->de_debug_str,
  323|  54.5k|        DW_DLE_DEBUG_STR_DUPLICATE,0,
  324|  54.5k|        FALSE,err);
  325|  54.4k|    SET_UP_SECTION(dbg,scn_name,".debug_str.dwo",
  ------------------
  |  |  210|  54.4k|    {                                           \
  |  |  211|  54.4k|    int lerr = 0;                               \
  |  |  212|  54.4k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.4k|        (mname),  /* actual section name */     \
  |  |  214|  54.4k|        (mtarg),    /* std section name */      \
  |  |  215|  54.4k|        /* scn_number from macro use context */ \
  |  |  216|  54.4k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.4k|        (minfo),                                \
  |  |  218|  54.4k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.4k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.4k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 30, False: 54.4k]
  |  |  ------------------
  |  |  220|     30|        return lerr;                            \
  |  |  221|     30|    }    /* else fall through. */               \
  |  |  222|  54.4k|    }
  ------------------
  326|  54.4k|        DW_GROUPNUMBER_DWO,
  327|  54.4k|        &dbg->de_debug_str,
  328|  54.4k|        DW_DLE_DEBUG_STR_DUPLICATE,0,
  329|  54.4k|        FALSE,err);
  330|       |    /* Section new in DWARF3.  */
  331|  54.4k|    SET_UP_SECTION(dbg,scn_name,".debug_pubtypes",
  ------------------
  |  |  210|  54.4k|    {                                           \
  |  |  211|  54.4k|    int lerr = 0;                               \
  |  |  212|  54.4k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.4k|        (mname),  /* actual section name */     \
  |  |  214|  54.4k|        (mtarg),    /* std section name */      \
  |  |  215|  54.4k|        /* scn_number from macro use context */ \
  |  |  216|  54.4k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.4k|        (minfo),                                \
  |  |  218|  54.4k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.4k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.4k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 45, False: 54.3k]
  |  |  ------------------
  |  |  220|     45|        return lerr;                            \
  |  |  221|     45|    }    /* else fall through. */               \
  |  |  222|  54.4k|    }
  ------------------
  332|  54.4k|        group_number,
  333|  54.4k|        &dbg->de_debug_pubtypes,
  334|  54.4k|        /*13*/ DW_DLE_DEBUG_PUBTYPES_DUPLICATE,0,
  335|  54.4k|        FALSE,err);
  336|       |    /* DWARF5 */
  337|  54.3k|    SET_UP_SECTION(dbg,scn_name,".debug_loclists",
  ------------------
  |  |  210|  54.3k|    {                                           \
  |  |  211|  54.3k|    int lerr = 0;                               \
  |  |  212|  54.3k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.3k|        (mname),  /* actual section name */     \
  |  |  214|  54.3k|        (mtarg),    /* std section name */      \
  |  |  215|  54.3k|        /* scn_number from macro use context */ \
  |  |  216|  54.3k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.3k|        (minfo),                                \
  |  |  218|  54.3k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.3k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.3k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 39, False: 54.3k]
  |  |  ------------------
  |  |  220|     39|        return lerr;                            \
  |  |  221|     39|    }    /* else fall through. */               \
  |  |  222|  54.3k|    }
  ------------------
  338|  54.3k|        group_number,
  339|  54.3k|        &dbg->de_debug_loclists,
  340|  54.3k|        /*13*/ DW_DLE_DEBUG_LOClISTS_DUPLICATE,0,
  341|  54.3k|        FALSE,err);
  342|       |    /* DWARF5 */
  343|  54.3k|    SET_UP_SECTION(dbg,scn_name,".debug_loclists.dwo",
  ------------------
  |  |  210|  54.3k|    {                                           \
  |  |  211|  54.3k|    int lerr = 0;                               \
  |  |  212|  54.3k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.3k|        (mname),  /* actual section name */     \
  |  |  214|  54.3k|        (mtarg),    /* std section name */      \
  |  |  215|  54.3k|        /* scn_number from macro use context */ \
  |  |  216|  54.3k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.3k|        (minfo),                                \
  |  |  218|  54.3k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.3k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.3k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 18, False: 54.3k]
  |  |  ------------------
  |  |  220|     18|        return lerr;                            \
  |  |  221|     18|    }    /* else fall through. */               \
  |  |  222|  54.3k|    }
  ------------------
  344|  54.3k|        DW_GROUPNUMBER_DWO,
  345|  54.3k|        &dbg->de_debug_loclists,
  346|  54.3k|        /*13*/ DW_DLE_DEBUG_LOClISTS_DUPLICATE,0,
  347|  54.3k|        FALSE,err);
  348|       |    /* DWARF5 */
  349|  54.3k|    SET_UP_SECTION(dbg,scn_name,".debug_rnglists",
  ------------------
  |  |  210|  54.3k|    {                                           \
  |  |  211|  54.3k|    int lerr = 0;                               \
  |  |  212|  54.3k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.3k|        (mname),  /* actual section name */     \
  |  |  214|  54.3k|        (mtarg),    /* std section name */      \
  |  |  215|  54.3k|        /* scn_number from macro use context */ \
  |  |  216|  54.3k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.3k|        (minfo),                                \
  |  |  218|  54.3k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.3k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.3k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 54, False: 54.2k]
  |  |  ------------------
  |  |  220|     54|        return lerr;                            \
  |  |  221|     54|    }    /* else fall through. */               \
  |  |  222|  54.3k|    }
  ------------------
  350|  54.3k|        group_number,
  351|  54.3k|        &dbg->de_debug_rnglists,
  352|  54.3k|        /*13*/ DW_DLE_DEBUG_RNGLISTS_DUPLICATE,0,
  353|  54.3k|        FALSE,err);
  354|       |    /* DWARF5 */
  355|  54.2k|    SET_UP_SECTION(dbg,scn_name,".debug_rnglists.dwo",
  ------------------
  |  |  210|  54.2k|    {                                           \
  |  |  211|  54.2k|    int lerr = 0;                               \
  |  |  212|  54.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.2k|        (mname),  /* actual section name */     \
  |  |  214|  54.2k|        (mtarg),    /* std section name */      \
  |  |  215|  54.2k|        /* scn_number from macro use context */ \
  |  |  216|  54.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.2k|        (minfo),                                \
  |  |  218|  54.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 27, False: 54.2k]
  |  |  ------------------
  |  |  220|     27|        return lerr;                            \
  |  |  221|     27|    }    /* else fall through. */               \
  |  |  222|  54.2k|    }
  ------------------
  356|  54.2k|        DW_GROUPNUMBER_DWO,
  357|  54.2k|        &dbg->de_debug_rnglists,
  358|  54.2k|        /*13*/ DW_DLE_DEBUG_RNGLISTS_DUPLICATE,0,
  359|  54.2k|        FALSE,err);
  360|       |    /* DWARF5 */
  361|  54.2k|    SET_UP_SECTION(dbg,scn_name,".debug_str_offsets",
  ------------------
  |  |  210|  54.2k|    {                                           \
  |  |  211|  54.2k|    int lerr = 0;                               \
  |  |  212|  54.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.2k|        (mname),  /* actual section name */     \
  |  |  214|  54.2k|        (mtarg),    /* std section name */      \
  |  |  215|  54.2k|        /* scn_number from macro use context */ \
  |  |  216|  54.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.2k|        (minfo),                                \
  |  |  218|  54.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 12, False: 54.2k]
  |  |  ------------------
  |  |  220|     12|        return lerr;                            \
  |  |  221|     12|    }    /* else fall through. */               \
  |  |  222|  54.2k|    }
  ------------------
  362|  54.2k|        group_number,
  363|  54.2k|        &dbg->de_debug_str_offsets,
  364|  54.2k|        DW_DLE_DEBUG_STR_OFFSETS_DUPLICATE,0,
  365|  54.2k|        FALSE,err);
  366|       |    /* DWARF5 */
  367|  54.2k|    SET_UP_SECTION(dbg,scn_name,".debug_str_offsets.dwo",
  ------------------
  |  |  210|  54.2k|    {                                           \
  |  |  211|  54.2k|    int lerr = 0;                               \
  |  |  212|  54.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.2k|        (mname),  /* actual section name */     \
  |  |  214|  54.2k|        (mtarg),    /* std section name */      \
  |  |  215|  54.2k|        /* scn_number from macro use context */ \
  |  |  216|  54.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.2k|        (minfo),                                \
  |  |  218|  54.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 18, False: 54.2k]
  |  |  ------------------
  |  |  220|     18|        return lerr;                            \
  |  |  221|     18|    }    /* else fall through. */               \
  |  |  222|  54.2k|    }
  ------------------
  368|  54.2k|        DW_GROUPNUMBER_DWO,
  369|  54.2k|        &dbg->de_debug_str_offsets,
  370|  54.2k|        DW_DLE_DEBUG_STR_OFFSETS_DUPLICATE,0,
  371|  54.2k|        FALSE,err);
  372|       |
  373|       |    /* SGI IRIX-only. */
  374|  54.2k|    SET_UP_SECTION(dbg,scn_name,".debug_funcnames",
  ------------------
  |  |  210|  54.2k|    {                                           \
  |  |  211|  54.2k|    int lerr = 0;                               \
  |  |  212|  54.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.2k|        (mname),  /* actual section name */     \
  |  |  214|  54.2k|        (mtarg),    /* std section name */      \
  |  |  215|  54.2k|        /* scn_number from macro use context */ \
  |  |  216|  54.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.2k|        (minfo),                                \
  |  |  218|  54.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 24, False: 54.2k]
  |  |  ------------------
  |  |  220|     24|        return lerr;                            \
  |  |  221|     24|    }    /* else fall through. */               \
  |  |  222|  54.2k|    }
  ------------------
  375|  54.2k|        group_number,
  376|  54.2k|        &dbg->de_debug_funcnames,
  377|  54.2k|        /*11*/ DW_DLE_DEBUG_FUNCNAMES_DUPLICATE,0,
  378|  54.2k|        FALSE,err);
  379|       |    /*  SGI IRIX-only, created years before DWARF3. Content
  380|       |        essentially identical to .debug_pubtypes.  */
  381|  54.2k|    SET_UP_SECTION(dbg,scn_name,".debug_typenames",
  ------------------
  |  |  210|  54.2k|    {                                           \
  |  |  211|  54.2k|    int lerr = 0;                               \
  |  |  212|  54.2k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.2k|        (mname),  /* actual section name */     \
  |  |  214|  54.2k|        (mtarg),    /* std section name */      \
  |  |  215|  54.2k|        /* scn_number from macro use context */ \
  |  |  216|  54.2k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.2k|        (minfo),                                \
  |  |  218|  54.2k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.2k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.2k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 12, False: 54.1k]
  |  |  ------------------
  |  |  220|     12|        return lerr;                            \
  |  |  221|     12|    }    /* else fall through. */               \
  |  |  222|  54.2k|    }
  ------------------
  382|  54.2k|        group_number,
  383|  54.2k|        &dbg->de_debug_typenames,
  384|  54.2k|        /*12*/ DW_DLE_DEBUG_TYPENAMES_DUPLICATE,0,
  385|  54.2k|        FALSE,err);
  386|       |    /* SGI IRIX-only.  */
  387|  54.1k|    SET_UP_SECTION(dbg,scn_name,".debug_varnames",
  ------------------
  |  |  210|  54.1k|    {                                           \
  |  |  211|  54.1k|    int lerr = 0;                               \
  |  |  212|  54.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.1k|        (mname),  /* actual section name */     \
  |  |  214|  54.1k|        (mtarg),    /* std section name */      \
  |  |  215|  54.1k|        /* scn_number from macro use context */ \
  |  |  216|  54.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.1k|        (minfo),                                \
  |  |  218|  54.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 12, False: 54.1k]
  |  |  ------------------
  |  |  220|     12|        return lerr;                            \
  |  |  221|     12|    }    /* else fall through. */               \
  |  |  222|  54.1k|    }
  ------------------
  388|  54.1k|        group_number,
  389|  54.1k|        &dbg->de_debug_varnames,
  390|  54.1k|        DW_DLE_DEBUG_VARNAMES_DUPLICATE,0,
  391|  54.1k|        FALSE,err);
  392|       |    /* SGI IRIX-only. */
  393|  54.1k|    SET_UP_SECTION(dbg,scn_name,".debug_weaknames",
  ------------------
  |  |  210|  54.1k|    {                                           \
  |  |  211|  54.1k|    int lerr = 0;                               \
  |  |  212|  54.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.1k|        (mname),  /* actual section name */     \
  |  |  214|  54.1k|        (mtarg),    /* std section name */      \
  |  |  215|  54.1k|        /* scn_number from macro use context */ \
  |  |  216|  54.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.1k|        (minfo),                                \
  |  |  218|  54.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 9, False: 54.1k]
  |  |  ------------------
  |  |  220|      9|        return lerr;                            \
  |  |  221|      9|    }    /* else fall through. */               \
  |  |  222|  54.1k|    }
  ------------------
  394|  54.1k|        group_number,
  395|  54.1k|        &dbg->de_debug_weaknames,
  396|  54.1k|        DW_DLE_DEBUG_WEAKNAMES_DUPLICATE,0,
  397|  54.1k|        FALSE,err);
  398|       |
  399|  54.1k|    SET_UP_SECTION(dbg,scn_name,".debug_macinfo",
  ------------------
  |  |  210|  54.1k|    {                                           \
  |  |  211|  54.1k|    int lerr = 0;                               \
  |  |  212|  54.1k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  54.1k|        (mname),  /* actual section name */     \
  |  |  214|  54.1k|        (mtarg),    /* std section name */      \
  |  |  215|  54.1k|        /* scn_number from macro use context */ \
  |  |  216|  54.1k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  54.1k|        (minfo),                                \
  |  |  218|  54.1k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  54.1k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  54.1k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 333, False: 53.8k]
  |  |  ------------------
  |  |  220|    333|        return lerr;                            \
  |  |  221|    333|    }    /* else fall through. */               \
  |  |  222|  54.1k|    }
  ------------------
  400|  54.1k|        group_number,
  401|  54.1k|        &dbg->de_debug_macinfo,
  402|  54.1k|        DW_DLE_DEBUG_MACINFO_DUPLICATE,0,
  403|  54.1k|        TRUE,err);
  404|       |    /*  ".debug_macinfo.dwo" is not allowed.  */
  405|       |
  406|       |    /* DWARF5 */
  407|  53.8k|    SET_UP_SECTION(dbg,scn_name,".debug_macro",
  ------------------
  |  |  210|  53.8k|    {                                           \
  |  |  211|  53.8k|    int lerr = 0;                               \
  |  |  212|  53.8k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  53.8k|        (mname),  /* actual section name */     \
  |  |  214|  53.8k|        (mtarg),    /* std section name */      \
  |  |  215|  53.8k|        /* scn_number from macro use context */ \
  |  |  216|  53.8k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  53.8k|        (minfo),                                \
  |  |  218|  53.8k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  53.8k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  53.8k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 147, False: 53.6k]
  |  |  ------------------
  |  |  220|    147|        return lerr;                            \
  |  |  221|    147|    }    /* else fall through. */               \
  |  |  222|  53.8k|    }
  ------------------
  408|  53.8k|        group_number,
  409|  53.8k|        &dbg->de_debug_macro,
  410|  53.8k|        DW_DLE_DEBUG_MACRO_DUPLICATE,0,
  411|  53.8k|        TRUE,err);
  412|       |    /* DWARF5 */
  413|  53.6k|    SET_UP_SECTION(dbg,scn_name,".debug_macro.dwo",
  ------------------
  |  |  210|  53.6k|    {                                           \
  |  |  211|  53.6k|    int lerr = 0;                               \
  |  |  212|  53.6k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  53.6k|        (mname),  /* actual section name */     \
  |  |  214|  53.6k|        (mtarg),    /* std section name */      \
  |  |  215|  53.6k|        /* scn_number from macro use context */ \
  |  |  216|  53.6k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  53.6k|        (minfo),                                \
  |  |  218|  53.6k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  53.6k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  53.6k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 81, False: 53.6k]
  |  |  ------------------
  |  |  220|     81|        return lerr;                            \
  |  |  221|     81|    }    /* else fall through. */               \
  |  |  222|  53.6k|    }
  ------------------
  414|  53.6k|        DW_GROUPNUMBER_DWO,
  415|  53.6k|        &dbg->de_debug_macro,
  416|  53.6k|        DW_DLE_DEBUG_MACRO_DUPLICATE,0,
  417|  53.6k|        TRUE,err);
  418|  53.6k|    SET_UP_SECTION(dbg,scn_name,".debug_ranges",
  ------------------
  |  |  210|  53.6k|    {                                           \
  |  |  211|  53.6k|    int lerr = 0;                               \
  |  |  212|  53.6k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  53.6k|        (mname),  /* actual section name */     \
  |  |  214|  53.6k|        (mtarg),    /* std section name */      \
  |  |  215|  53.6k|        /* scn_number from macro use context */ \
  |  |  216|  53.6k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  53.6k|        (minfo),                                \
  |  |  218|  53.6k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  53.6k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  53.6k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 27, False: 53.5k]
  |  |  ------------------
  |  |  220|     27|        return lerr;                            \
  |  |  221|     27|    }    /* else fall through. */               \
  |  |  222|  53.6k|    }
  ------------------
  419|  53.6k|        group_number,
  420|  53.6k|        &dbg->de_debug_ranges,
  421|  53.6k|        DW_DLE_DEBUG_RANGES_DUPLICATE,0,
  422|  53.6k|        TRUE,err);
  423|       |    /*  No .debug_ranges.dwo allowed. */
  424|       |
  425|       |    /* New DWARF5 */
  426|  53.5k|    SET_UP_SECTION(dbg,scn_name,".debug_sup",
  ------------------
  |  |  210|  53.5k|    {                                           \
  |  |  211|  53.5k|    int lerr = 0;                               \
  |  |  212|  53.5k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  53.5k|        (mname),  /* actual section name */     \
  |  |  214|  53.5k|        (mtarg),    /* std section name */      \
  |  |  215|  53.5k|        /* scn_number from macro use context */ \
  |  |  216|  53.5k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  53.5k|        (minfo),                                \
  |  |  218|  53.5k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  53.5k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  53.5k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 1.81k, False: 51.7k]
  |  |  ------------------
  |  |  220|  1.81k|        return lerr;                            \
  |  |  221|  1.81k|    }    /* else fall through. */               \
  |  |  222|  53.5k|    }
  ------------------
  427|  53.5k|        group_number,
  428|  53.5k|        &dbg->de_debug_sup,
  429|  53.5k|        DW_DLE_DEBUG_SUP_DUPLICATE,0,
  430|  53.5k|        TRUE,err);
  431|       |    /* No .debug_sup.dwo allowed. */
  432|       |
  433|       |    /*  .symtab and .strtab have to be in any group.  */
  434|  51.7k|    SET_UP_SECTION(dbg,scn_name,".symtab",
  ------------------
  |  |  210|  51.7k|    {                                           \
  |  |  211|  51.7k|    int lerr = 0;                               \
  |  |  212|  51.7k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  51.7k|        (mname),  /* actual section name */     \
  |  |  214|  51.7k|        (mtarg),    /* std section name */      \
  |  |  215|  51.7k|        /* scn_number from macro use context */ \
  |  |  216|  51.7k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  51.7k|        (minfo),                                \
  |  |  218|  51.7k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  51.7k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  51.7k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 261, False: 51.5k]
  |  |  ------------------
  |  |  220|    261|        return lerr;                            \
  |  |  221|    261|    }    /* else fall through. */               \
  |  |  222|  51.7k|    }
  ------------------
  435|  51.7k|        group_number,
  436|  51.7k|        &dbg->de_elf_symtab,
  437|  51.7k|        DW_DLE_DEBUG_SYMTAB_ERR,0,
  438|  51.7k|        FALSE,err);
  439|  51.5k|    SET_UP_SECTION(dbg,scn_name,".strtab",
  ------------------
  |  |  210|  51.5k|    {                                           \
  |  |  211|  51.5k|    int lerr = 0;                               \
  |  |  212|  51.5k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  51.5k|        (mname),  /* actual section name */     \
  |  |  214|  51.5k|        (mtarg),    /* std section name */      \
  |  |  215|  51.5k|        /* scn_number from macro use context */ \
  |  |  216|  51.5k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  51.5k|        (minfo),                                \
  |  |  218|  51.5k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  51.5k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  51.5k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 408, False: 51.0k]
  |  |  ------------------
  |  |  220|    408|        return lerr;                            \
  |  |  221|    408|    }    /* else fall through. */               \
  |  |  222|  51.5k|    }
  ------------------
  440|  51.5k|        group_number,
  441|  51.5k|        &dbg->de_elf_strtab,
  442|  51.5k|        DW_DLE_DEBUG_STRTAB_ERR,0,
  443|  51.5k|        FALSE,err);
  444|       |
  445|       |    /* New DWARF5 */
  446|  51.0k|    SET_UP_SECTION(dbg,scn_name,".debug_addr",
  ------------------
  |  |  210|  51.0k|    {                                           \
  |  |  211|  51.0k|    int lerr = 0;                               \
  |  |  212|  51.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  51.0k|        (mname),  /* actual section name */     \
  |  |  214|  51.0k|        (mtarg),    /* std section name */      \
  |  |  215|  51.0k|        /* scn_number from macro use context */ \
  |  |  216|  51.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  51.0k|        (minfo),                                \
  |  |  218|  51.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  51.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  51.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 63, False: 51.0k]
  |  |  ------------------
  |  |  220|     63|        return lerr;                            \
  |  |  221|     63|    }    /* else fall through. */               \
  |  |  222|  51.0k|    }
  ------------------
  447|  51.0k|        group_number,
  448|  51.0k|        &dbg->de_debug_addr,
  449|  51.0k|        DW_DLE_DEBUG_ADDR_DUPLICATE,0,
  450|  51.0k|        TRUE,err);
  451|       |    /*  No .debug_addr.dwo allowed.  */
  452|       |
  453|       |    /* gdb added this. */
  454|  51.0k|    SET_UP_SECTION(dbg,scn_name,".gdb_index",
  ------------------
  |  |  210|  51.0k|    {                                           \
  |  |  211|  51.0k|    int lerr = 0;                               \
  |  |  212|  51.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  51.0k|        (mname),  /* actual section name */     \
  |  |  214|  51.0k|        (mtarg),    /* std section name */      \
  |  |  215|  51.0k|        /* scn_number from macro use context */ \
  |  |  216|  51.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  51.0k|        (minfo),                                \
  |  |  218|  51.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  51.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  51.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 63, False: 50.9k]
  |  |  ------------------
  |  |  220|     63|        return lerr;                            \
  |  |  221|     63|    }    /* else fall through. */               \
  |  |  222|  51.0k|    }
  ------------------
  455|  51.0k|        group_number,
  456|  51.0k|        &dbg->de_debug_gdbindex,
  457|  51.0k|        DW_DLE_DUPLICATE_GDB_INDEX,0,
  458|  51.0k|        FALSE,err);
  459|       |
  460|       |    /* New DWARF5 */
  461|  50.9k|    SET_UP_SECTION(dbg,scn_name,".debug_names",
  ------------------
  |  |  210|  50.9k|    {                                           \
  |  |  211|  50.9k|    int lerr = 0;                               \
  |  |  212|  50.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  50.9k|        (mname),  /* actual section name */     \
  |  |  214|  50.9k|        (mtarg),    /* std section name */      \
  |  |  215|  50.9k|        /* scn_number from macro use context */ \
  |  |  216|  50.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  50.9k|        (minfo),                                \
  |  |  218|  50.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  50.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  50.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 9, False: 50.9k]
  |  |  ------------------
  |  |  220|      9|        return lerr;                            \
  |  |  221|      9|    }    /* else fall through. */               \
  |  |  222|  50.9k|    }
  ------------------
  462|  50.9k|        group_number,
  463|  50.9k|        &dbg->de_debug_names,
  464|  50.9k|        /*13*/ DW_DLE_DEBUG_NAMES_DUPLICATE,0,
  465|  50.9k|        FALSE,err);
  466|       |    /* No .debug_names.dwo allowed. */
  467|       |
  468|       |    /* gdb added this in DW4. It is in standard DWARF5  */
  469|  50.9k|    SET_UP_SECTION(dbg,scn_name,".debug_cu_index",
  ------------------
  |  |  210|  50.9k|    {                                           \
  |  |  211|  50.9k|    int lerr = 0;                               \
  |  |  212|  50.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  50.9k|        (mname),  /* actual section name */     \
  |  |  214|  50.9k|        (mtarg),    /* std section name */      \
  |  |  215|  50.9k|        /* scn_number from macro use context */ \
  |  |  216|  50.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  50.9k|        (minfo),                                \
  |  |  218|  50.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  50.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  50.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 1.06k, False: 49.8k]
  |  |  ------------------
  |  |  220|  1.06k|        return lerr;                            \
  |  |  221|  1.06k|    }    /* else fall through. */               \
  |  |  222|  50.9k|    }
  ------------------
  470|  50.9k|        DW_GROUPNUMBER_DWO,
  471|  50.9k|        &dbg->de_debug_cu_index,
  472|  50.9k|        DW_DLE_DUPLICATE_CU_INDEX,0,
  473|  50.9k|        FALSE,err);
  474|       |    /* gdb added this in DW4. It is in standard DWARF5 */
  475|  49.8k|    SET_UP_SECTION(dbg,scn_name,".debug_tu_index",
  ------------------
  |  |  210|  49.8k|    {                                           \
  |  |  211|  49.8k|    int lerr = 0;                               \
  |  |  212|  49.8k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  49.8k|        (mname),  /* actual section name */     \
  |  |  214|  49.8k|        (mtarg),    /* std section name */      \
  |  |  215|  49.8k|        /* scn_number from macro use context */ \
  |  |  216|  49.8k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  49.8k|        (minfo),                                \
  |  |  218|  49.8k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  49.8k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  49.8k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 798, False: 49.0k]
  |  |  ------------------
  |  |  220|    798|        return lerr;                            \
  |  |  221|    798|    }    /* else fall through. */               \
  |  |  222|  49.8k|    }
  ------------------
  476|  49.8k|        DW_GROUPNUMBER_DWO,
  477|  49.8k|        &dbg->de_debug_tu_index,
  478|  49.8k|        DW_DLE_DUPLICATE_TU_INDEX,0,
  479|  49.8k|        FALSE,err);
  480|       |
  481|       |    /* GNU added this. It is not part of DWARF */
  482|  49.0k|    SET_UP_SECTION(dbg,scn_name,".gnu_debuglink",
  ------------------
  |  |  210|  49.0k|    {                                           \
  |  |  211|  49.0k|    int lerr = 0;                               \
  |  |  212|  49.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  49.0k|        (mname),  /* actual section name */     \
  |  |  214|  49.0k|        (mtarg),    /* std section name */      \
  |  |  215|  49.0k|        /* scn_number from macro use context */ \
  |  |  216|  49.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  49.0k|        (minfo),                                \
  |  |  218|  49.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  49.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  49.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 1.14k, False: 47.9k]
  |  |  ------------------
  |  |  220|  1.14k|        return lerr;                            \
  |  |  221|  1.14k|    }    /* else fall through. */               \
  |  |  222|  49.0k|    }
  ------------------
  483|  49.0k|        DW_GROUPNUMBER_DWO,
  484|  49.0k|        &dbg->de_gnu_debuglink,
  485|  49.0k|        DW_DLE_DUPLICATE_GNU_DEBUGLINK,0,
  486|  49.0k|        FALSE,err);
  487|       |
  488|       |    /* GNU added this. It is not part of DWARF */
  489|  47.9k|    SET_UP_SECTION(dbg,scn_name,".note.gnu.build-id",
  ------------------
  |  |  210|  47.9k|    {                                           \
  |  |  211|  47.9k|    int lerr = 0;                               \
  |  |  212|  47.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  47.9k|        (mname),  /* actual section name */     \
  |  |  214|  47.9k|        (mtarg),    /* std section name */      \
  |  |  215|  47.9k|        /* scn_number from macro use context */ \
  |  |  216|  47.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  47.9k|        (minfo),                                \
  |  |  218|  47.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  47.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  47.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 921, False: 47.0k]
  |  |  ------------------
  |  |  220|    921|        return lerr;                            \
  |  |  221|    921|    }    /* else fall through. */               \
  |  |  222|  47.9k|    }
  ------------------
  490|  47.9k|        DW_GROUPNUMBER_DWO,
  491|  47.9k|        &dbg->de_note_gnu_buildid,
  492|  47.9k|        DW_DLE_DUPLICATE_GNU_DEBUGLINK,0,
  493|  47.9k|        FALSE,err);
  494|       |    /* GNU added this. It is not part of DWARF */
  495|  47.0k|    SET_UP_SECTION(dbg,scn_name,".debug_gnu_pubtypes.dwo",
  ------------------
  |  |  210|  47.0k|    {                                           \
  |  |  211|  47.0k|    int lerr = 0;                               \
  |  |  212|  47.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  47.0k|        (mname),  /* actual section name */     \
  |  |  214|  47.0k|        (mtarg),    /* std section name */      \
  |  |  215|  47.0k|        /* scn_number from macro use context */ \
  |  |  216|  47.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  47.0k|        (minfo),                                \
  |  |  218|  47.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  47.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  47.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 18, False: 47.0k]
  |  |  ------------------
  |  |  220|     18|        return lerr;                            \
  |  |  221|     18|    }    /* else fall through. */               \
  |  |  222|  47.0k|    }
  ------------------
  496|  47.0k|        DW_GROUPNUMBER_DWO,
  497|  47.0k|        &dbg->de_debug_gnu_pubtypes,
  498|  47.0k|        DW_DLE_DUPLICATE_GNU_DEBUG_PUBTYPES,0,
  499|  47.0k|        FALSE,err);
  500|  47.0k|    SET_UP_SECTION(dbg,scn_name,".debug_gnu_pubtypes",
  ------------------
  |  |  210|  47.0k|    {                                           \
  |  |  211|  47.0k|    int lerr = 0;                               \
  |  |  212|  47.0k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  47.0k|        (mname),  /* actual section name */     \
  |  |  214|  47.0k|        (mtarg),    /* std section name */      \
  |  |  215|  47.0k|        /* scn_number from macro use context */ \
  |  |  216|  47.0k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  47.0k|        (minfo),                                \
  |  |  218|  47.0k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  47.0k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  47.0k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 48, False: 46.9k]
  |  |  ------------------
  |  |  220|     48|        return lerr;                            \
  |  |  221|     48|    }    /* else fall through. */               \
  |  |  222|  47.0k|    }
  ------------------
  501|  47.0k|        group_number,
  502|  47.0k|        &dbg->de_debug_gnu_pubtypes,
  503|  47.0k|        DW_DLE_DUPLICATE_GNU_DEBUG_PUBTYPES,0,
  504|  47.0k|        FALSE,err);
  505|  46.9k|    SET_UP_SECTION(dbg,scn_name,".debug_gnu_pubnames.dwo",
  ------------------
  |  |  210|  46.9k|    {                                           \
  |  |  211|  46.9k|    int lerr = 0;                               \
  |  |  212|  46.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  46.9k|        (mname),  /* actual section name */     \
  |  |  214|  46.9k|        (mtarg),    /* std section name */      \
  |  |  215|  46.9k|        /* scn_number from macro use context */ \
  |  |  216|  46.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  46.9k|        (minfo),                                \
  |  |  218|  46.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  46.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  46.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 15, False: 46.9k]
  |  |  ------------------
  |  |  220|     15|        return lerr;                            \
  |  |  221|     15|    }    /* else fall through. */               \
  |  |  222|  46.9k|    }
  ------------------
  506|  46.9k|        DW_GROUPNUMBER_DWO,
  507|  46.9k|        &dbg->de_debug_gnu_pubnames,
  508|  46.9k|        DW_DLE_DUPLICATE_GNU_DEBUG_PUBNAMES,0,
  509|  46.9k|        FALSE,err);
  510|  46.9k|    SET_UP_SECTION(dbg,scn_name,".debug_gnu_pubnames",
  ------------------
  |  |  210|  46.9k|    {                                           \
  |  |  211|  46.9k|    int lerr = 0;                               \
  |  |  212|  46.9k|    lerr =  set_up_section((mdbg),              \
  |  |  213|  46.9k|        (mname),  /* actual section name */     \
  |  |  214|  46.9k|        (mtarg),    /* std section name */      \
  |  |  215|  46.9k|        /* scn_number from macro use context */ \
  |  |  216|  46.9k|        scn_number,(mtarg),(mgrp),              \
  |  |  217|  46.9k|        (minfo),                                \
  |  |  218|  46.9k|        (me1),(me2),(mdw),(mer));               \
  |  |  219|  46.9k|    if (lerr != DW_DLV_NO_ENTRY) {              \
  |  |  ------------------
  |  |  |  |  121|  46.9k|#define DW_DLV_NO_ENTRY -1
  |  |  ------------------
  |  |  |  Branch (219:9): [True: 66, False: 46.8k]
  |  |  ------------------
  |  |  220|     66|        return lerr;                            \
  |  |  221|     66|    }    /* else fall through. */               \
  |  |  222|  46.9k|    }
  ------------------
  511|  46.9k|        group_number,
  512|  46.9k|        &dbg->de_debug_gnu_pubnames,
  513|  46.9k|        DW_DLE_DUPLICATE_GNU_DEBUG_PUBNAMES,0,
  514|  46.9k|        FALSE,err);
  515|  46.8k|    return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  46.8k|#define DW_DLV_NO_ENTRY -1
  ------------------
  516|  46.9k|}
dwarf_setup_sections.c:set_up_section:
  126|  2.45M|{
  127|       |    /*  Here accommodate the .debug or .zdebug version, (and of
  128|       |        course non- .debug too, but those never zlib) .
  129|       |        SECNAMEMAX should be a little bigger than any section
  130|       |        name we care about as possibly compressed, which
  131|       |        is to say bigger than any standard section name. */
  132|  2.45M|#define SECNAMEMAX 30
  133|  2.45M|    size_t secnamelen = strlen(secname);
  134|       |    /* static const char *dprefix = ".debug_"; */
  135|  2.45M|#define DPREFIXLEN 7
  136|  2.45M|    static const char *zprefix = ".zdebug_";
  137|  2.45M|#define ZPREFIXLEN 8
  138|  2.45M|    int havezdebug = FALSE;
  ------------------
  |  |   40|  2.45M|#define FALSE 0
  ------------------
  139|  2.45M|    int namesmatch = FALSE;
  ------------------
  |  |   40|  2.45M|#define FALSE 0
  ------------------
  140|  2.45M|    const char *postzprefix = 0;
  141|       |
  142|       |    /*  For example, if the secname is .zdebug_info
  143|       |        we update the finaltargname to .debug_info
  144|       |        to match with the particular (known, predefined)
  145|       |        object section name.
  146|       |        We add one character, so check
  147|       |        to see if it will, in the end, fit.
  148|       |        See the SET_UP_SECTION macro.  */
  149|       |
  150|  2.45M|    if (secnamelen >= SECNAMEMAX) {
  ------------------
  |  |  132|  2.45M|#define SECNAMEMAX 30
  ------------------
  |  Branch (150:9): [True: 91.2k, False: 2.36M]
  ------------------
  151|       |        /*  This is not the target section.
  152|       |            our caller will keep looking. */
  153|  91.2k|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  91.2k|#define DW_DLV_NO_ENTRY -1
  ------------------
  154|  91.2k|    }
  155|  2.36M|    havezdebug = !strncmp(secname,zprefix,ZPREFIXLEN);
  ------------------
  |  |  137|  2.36M|#define ZPREFIXLEN 8
  ------------------
  156|  2.36M|    if (havezdebug) {
  ------------------
  |  Branch (156:9): [True: 132k, False: 2.22M]
  ------------------
  157|   132k|        postzprefix = secname+ZPREFIXLEN;
  ------------------
  |  |  137|   132k|#define ZPREFIXLEN 8
  ------------------
  158|   132k|    }
  159|       |    /*  With Alpine gcc
  160|       |        12.2.1_git20220924-r4) 12.2.1 20220924
  161|       |        and some other gcc versions when compiling
  162|       |        with -Werror and -fsanitize:
  163|       |        we get
  164|       |        error: 'strcmp' reading 1 or more bytes
  165|       |        from a region of size 0 [-Werror=stringop-overread]
  166|       |        So we add -Wnostringop-overread to the build as the error is
  167|       |        a false positive. We had to drop stringop-overread
  168|       |        references in compiler options, such turned off
  169|       |        valuable warnings. */
  170|  2.36M|    if (postzprefix &&
  ------------------
  |  Branch (170:9): [True: 132k, False: 2.22M]
  ------------------
  171|  2.36M|        !strcmp(postzprefix,targname+DPREFIXLEN)) {
  ------------------
  |  |  135|   132k|#define DPREFIXLEN 7
  ------------------
  |  Branch (171:9): [True: 378, False: 132k]
  ------------------
  172|       |            /*  zprefix version matches the object section
  173|       |                name so the section is compressed and is
  174|       |                the section this targname applies to. */
  175|    378|        namesmatch = TRUE;
  ------------------
  |  |   37|    378|#define TRUE 1
  ------------------
  176|  2.36M|    } else if (!strcmp(secname,targname)) {
  ------------------
  |  Branch (176:16): [True: 9.57k, False: 2.35M]
  ------------------
  177|  9.57k|        namesmatch = TRUE;
  ------------------
  |  |   37|  9.57k|#define TRUE 1
  ------------------
  178|  2.35M|    } else { /*  Fall to next statement */ }
  179|  2.36M|#undef ZPREFIXLEN
  180|  2.36M|#undef DPREFIXLEN
  181|  2.36M|#undef SECNAMEMAX
  182|  2.36M|    if (!namesmatch) {
  ------------------
  |  Branch (182:9): [True: 2.35M, False: 9.95k]
  ------------------
  183|       |        /*  This is not the target section.
  184|       |            our caller will keep looking. */
  185|  2.35M|            return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|  2.35M|#define DW_DLV_NO_ENTRY -1
  ------------------
  186|  2.35M|    }
  187|       |
  188|       |    /* SETUP_SECTION. See also BUILDING_SECTIONS, BUILDING_MAP  */
  189|  9.95k|    {
  190|       |        /*  The section name is a match with targname, or
  191|       |            the .zdebug version of targname. */
  192|  9.95k|        int sectionerr = 0;
  193|       |
  194|  9.95k|        sectionerr = add_debug_section_info(dbg,secname,
  195|  9.95k|            sec_standard_name,
  196|  9.95k|            obj_sec_num,
  197|  9.95k|            secdata,
  198|  9.95k|            groupnum_of_sec,
  199|  9.95k|            duperr,emptyerr, have_dwarf,
  200|  9.95k|            havezdebug,err);
  201|  9.95k|        if (sectionerr != DW_DLV_OK) {
  ------------------
  |  |  122|  9.95k|#define DW_DLV_OK        0
  ------------------
  |  Branch (201:13): [True: 153, False: 9.80k]
  ------------------
  202|       |            /* *err is set already */
  203|    153|            return sectionerr;
  204|    153|        }
  205|  9.95k|    }
  206|  9.80k|    return DW_DLV_OK;
  ------------------
  |  |  122|  9.80k|#define DW_DLV_OK        0
  ------------------
  207|  9.95k|}
dwarf_setup_sections.c:add_debug_section_info:
   73|  9.95k|{
   74|  9.95k|    unsigned total_entries = dbg->de_debug_sections_total_entries;
   75|  9.95k|    if (secdata->dss_is_in_use) {
  ------------------
  |  Branch (75:9): [True: 153, False: 9.80k]
  ------------------
   76|    153|        *err = duperr;
   77|    153|        return DW_DLV_ERROR;
  ------------------
  |  |  123|    153|#define DW_DLV_ERROR     1
  ------------------
   78|    153|    }
   79|  9.80k|    if (total_entries < DWARF_MAX_DEBUG_SECTIONS) {
  ------------------
  |  |  534|  9.80k|#define DWARF_MAX_DEBUG_SECTIONS 50
  ------------------
  |  Branch (79:9): [True: 9.80k, False: 0]
  ------------------
   80|  9.80k|        struct Dwarf_dbg_sect_s *debug_section =
   81|  9.80k|            &dbg->de_debug_sections[total_entries];
   82|  9.80k|        secdata->dss_is_in_use = TRUE;
  ------------------
  |  |   37|  9.80k|#define TRUE 1
  ------------------
   83|  9.80k|        debug_section->ds_name = name;
   84|  9.80k|        debug_section->ds_number = obj_sec_num;
   85|  9.80k|        debug_section->ds_secdata = secdata;
   86|  9.80k|        debug_section->ds_groupnumber =  groupnum;
   87|  9.80k|        secdata->dss_name = name; /* Actual name from object file. */
   88|  9.80k|        secdata->dss_standard_name = standard_section_name;
   89|  9.80k|        secdata->dss_number = obj_sec_num;
   90|  9.80k|        secdata->dss_zdebug_requires_decompress = havezdebug;
   91|       |        /* We don't yet know about SHF_COMPRESSED */
   92|  9.80k|        debug_section->ds_duperr = duperr;
   93|  9.80k|        debug_section->ds_emptyerr = emptyerr;
   94|  9.80k|        debug_section->ds_have_dwarf = have_dwarf;
   95|  9.80k|        debug_section->ds_have_zdebug = havezdebug;
   96|  9.80k|        ++dbg->de_debug_sections_total_entries;
   97|  9.80k|        return DW_DLV_OK;
  ------------------
  |  |  122|  9.80k|#define DW_DLV_OK        0
  ------------------
   98|  9.80k|    }
   99|       |    /*  This represents a bug in libdwarf.
  100|       |        Mis-setup-DWARF_MAX_DEBUG_SECTIONS.
  101|       |        Or possibly a use of section groups that is
  102|       |        not supported.  */
  103|      0|    *err = DW_DLE_TOO_MANY_DEBUG;
  ------------------
  |  | 1219|      0|#define DW_DLE_TOO_MANY_DEBUG                  245
  ------------------
  104|      0|    return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  105|  9.80k|}

dwarfstring_constructor:
   64|  28.2k|{
   65|  28.2k|    g->s_data = "";
   66|  28.2k|    g->s_size = 0;
   67|  28.2k|    g->s_avail = 0;
   68|  28.2k|    g->s_malloc = FALSE;
  ------------------
  |  |   40|  28.2k|#define FALSE 0
  ------------------
   69|  28.2k|    return TRUE;
  ------------------
  |  |   37|  28.2k|#define TRUE 1
  ------------------
   70|  28.2k|}
dwarfstring_reset:
  119|    929|{
  120|    929|    if (!g->s_size) {
  ------------------
  |  Branch (120:9): [True: 184, False: 745]
  ------------------
  121|       |        /* In initial condition, nothing to do. */
  122|    184|        return TRUE;
  ------------------
  |  |   37|    184|#define TRUE 1
  ------------------
  123|    184|    }
  124|    745|    g->s_avail   = g->s_size;
  125|    745|    g->s_data[0] = 0;
  126|    745|    return TRUE;
  ------------------
  |  |   37|    745|#define TRUE 1
  ------------------
  127|    929|}
dwarfstring_destructor:
  162|  13.3k|{
  163|  13.3k|    if (g->s_malloc) {
  ------------------
  |  Branch (163:9): [True: 4.40k, False: 8.97k]
  ------------------
  164|  4.40k|        free(g->s_data);
  165|  4.40k|        g->s_data   = 0;
  166|  4.40k|        g->s_malloc = 0;
  167|  4.40k|    }
  168|       |    /*  The constructor sets all the fields, most to zero.
  169|       |        s_data is set to point to static string ""
  170|       |        s_malloc set to FALSE. */
  171|  13.3k|    dwarfstring_constructor(g);
  172|  13.3k|}
dwarfstring_append_length:
  181|   267k|{
  182|       |    /*  lastpos is the length of characters
  183|       |        without the null-terminator  we call it strlen */
  184|   267k|    size_t lastpos = g->s_size - g->s_avail;
  185|   267k|    int r          = 0;
  186|       |
  187|   267k|    if (!str  || slen ==0) {
  ------------------
  |  Branch (187:9): [True: 0, False: 267k]
  |  Branch (187:18): [True: 97.8k, False: 169k]
  ------------------
  188|  97.8k|        return TRUE;
  ------------------
  |  |   37|  97.8k|#define TRUE 1
  ------------------
  189|  97.8k|    }
  190|   169k|    if (slen >= g->s_avail) {
  ------------------
  |  Branch (190:9): [True: 66.9k, False: 102k]
  ------------------
  191|  66.9k|        size_t newlen = 0;
  192|       |
  193|  66.9k|        newlen = g->s_size + slen+2;
  194|  66.9k|        r = dwarfstring_add_to(g,newlen);
  195|  66.9k|        if (!r) {
  ------------------
  |  Branch (195:13): [True: 0, False: 66.9k]
  ------------------
  196|       |            /* Unable to resize, dare not do anything. */
  197|      0|            return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  198|      0|        }
  199|  66.9k|    }
  200|   169k|    memcpy(g->s_data + lastpos,str,slen);
  201|   169k|    g->s_avail -= slen;
  202|       |    /*  Adding string terminating null byte.
  203|       |        Space is guaranteed available to do this.*/
  204|   169k|    g->s_data[g->s_size - g->s_avail] = 0;
  205|   169k|    return TRUE;
  ------------------
  |  |   37|   169k|#define TRUE 1
  ------------------
  206|   169k|}
dwarfstring_append:
  210|  5.89k|{
  211|  5.89k|    size_t dlenszt = 0;
  212|       |
  213|  5.89k|    if (!str) {
  ------------------
  |  Branch (213:9): [True: 0, False: 5.89k]
  ------------------
  214|      0|        return TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  215|      0|    }
  216|  5.89k|    dlenszt = strlen(str);
  217|  5.89k|    return dwarfstring_append_length(g,str,dlenszt);
  218|  5.89k|}
dwarfstring_string:
  222|  6.94k|{
  223|  6.94k|    return g->s_data;
  224|  6.94k|}
dwarfstring_strlen:
  228|  2.30k|{
  229|  2.30k|    return g->s_size - g->s_avail;
  230|  2.30k|}
dwarfstring_append_printf_s:
  274|    336|{
  275|    336|    size_t stringlenszt = 0;
  276|    336|    size_t next = 0;
  277|    336|    long val = 0;
  278|    336|    char *endptr = 0;
  279|    336|    const char *numptr = 0;
  280|       |    /* was %[-]fixedlen.  Zero means no len provided. */
  281|    336|    size_t fixedlen = 0;
  282|       |    /* was %-, nonzero means left-justify */
  283|    336|    long leftjustify = 0;
  284|    336|    size_t prefixlen = 0;
  285|    336|    int res = 0;
  286|       |
  287|    336|    if (!s) {
  ------------------
  |  Branch (287:9): [True: 0, False: 336]
  ------------------
  288|      0|        DWSERR("<DWARFSTRINGERR: null string pointer to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  289|      0|            "dwarfstring_append_printf_s>");
  290|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  291|      0|    }
  292|    336|    stringlenszt = strlen(s);
  293|    336|    if (!format) {
  ------------------
  |  Branch (293:9): [True: 0, False: 336]
  ------------------
  294|      0|        DWSERR("<DWARFSTRINGERR: null format pointer to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  295|      0|            "dwarfstring_append_printf_s>");
  296|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  297|      0|    }
  298|  15.4k|    while (format[next] && format[next] != '%') {
  ------------------
  |  Branch (298:12): [True: 15.4k, False: 0]
  |  Branch (298:28): [True: 15.1k, False: 336]
  ------------------
  299|  15.1k|        ++next;
  300|  15.1k|        ++prefixlen;
  301|  15.1k|    }
  302|    336|    if (prefixlen) {
  ------------------
  |  Branch (302:9): [True: 336, False: 0]
  ------------------
  303|    336|        dwarfstring_append_length(data,format,prefixlen);
  304|       |        /*  Fall through whether return value TRUE or FALSE */
  305|    336|    }
  306|    336|    if (format[next] != '%') {
  ------------------
  |  Branch (306:9): [True: 0, False: 336]
  ------------------
  307|       |        /*   No % operator found, we are done */
  308|      0|        DWSERR("<DWARFSTRINGERR: no percent passed to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  309|      0|            "dwarfstring_append_printf_s>");
  310|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  311|      0|    }
  312|    336|    next++;
  313|    336|    if (!format[next]) {
  ------------------
  |  Branch (313:9): [True: 0, False: 336]
  ------------------
  314|      0|        DWSERR("<DWARFSTRINGERR: empty percent  to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  315|      0|            "dwarfstring_append_printf_s>");
  316|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  317|      0|    }
  318|    336|    if (format[next] == ' ') {
  ------------------
  |  Branch (318:9): [True: 0, False: 336]
  ------------------
  319|      0|        DWSERR("<DWARFSTRINGERR: empty percent  to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  320|      0|            "dwarfstring_append_printf_s>");
  321|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  322|      0|    }
  323|       |
  324|    336|    if (format[next] == '-') {
  ------------------
  |  Branch (324:9): [True: 0, False: 336]
  ------------------
  325|      0|        leftjustify++;
  326|      0|        next++;
  327|      0|    }
  328|    336|    numptr = format+next;
  329|    336|    val = strtol(numptr,&endptr,10);
  330|    336|    if ( endptr != numptr) {
  ------------------
  |  Branch (330:10): [True: 0, False: 336]
  ------------------
  331|      0|        fixedlen = val;
  332|      0|    }
  333|    336|    next = (endptr - format);
  334|    336|    if (format[next] != 's') {
  ------------------
  |  Branch (334:9): [True: 0, False: 336]
  ------------------
  335|      0|        DWSERR("<DWARFSTRINGERR: no percent-s to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  336|      0|            "dwarfstring_append_printf_s>");
  337|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  338|      0|    }
  339|    336|    next++;
  340|       |
  341|    336|    if (fixedlen && (stringlenszt >= fixedlen)) {
  ------------------
  |  Branch (341:9): [True: 0, False: 336]
  |  Branch (341:21): [True: 0, False: 0]
  ------------------
  342|       |        /*  Ignore  leftjustify (if any) and the stringlenszt
  343|       |            as the actual string overrides those. */
  344|      0|        leftjustify = 0;
  345|      0|    }
  346|    336|    if (leftjustify) {
  ------------------
  |  Branch (346:9): [True: 0, False: 336]
  ------------------
  347|       |
  348|      0|        dwarfstring_append_length(data,s,stringlenszt);
  349|       |        /*  Ignore return value */
  350|      0|        if (fixedlen) {
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|            size_t trailingspaces = fixedlen - stringlenszt;
  352|       |
  353|      0|            _dwarfstring_append_spaces(data,trailingspaces);
  354|      0|        }
  355|    336|    } else {
  356|    336|        if (fixedlen && fixedlen < stringlenszt) {
  ------------------
  |  Branch (356:13): [True: 0, False: 336]
  |  Branch (356:25): [True: 0, False: 0]
  ------------------
  357|       |            /*  This lets us have fixedlen < stringlenszt by
  358|       |                taking all the chars from s*/
  359|      0|            dwarfstring_append_length(data,s,stringlenszt);
  360|       |            /*  Ignore return value, just keep going */
  361|    336|        } else {
  362|    336|            if (fixedlen) {
  ------------------
  |  Branch (362:17): [True: 0, False: 336]
  ------------------
  363|      0|                size_t leadingspaces = fixedlen - stringlenszt;
  364|      0|                size_t k = 0;
  365|       |
  366|      0|                for ( ; k < leadingspaces; ++k) {
  ------------------
  |  Branch (366:25): [True: 0, False: 0]
  ------------------
  367|      0|                    dwarfstring_append_length(data," ",1);
  368|      0|                }
  369|      0|            }
  370|    336|            res = dwarfstring_append_length(data,s,stringlenszt);
  371|    336|            if (res == FALSE) {
  ------------------
  |  |   40|    336|#define FALSE 0
  ------------------
  |  Branch (371:17): [True: 0, False: 336]
  ------------------
  372|      0|                return res;
  373|      0|            }
  374|    336|        }
  375|    336|    }
  376|    336|    if (!format[next]) {
  ------------------
  |  Branch (376:9): [True: 0, False: 336]
  ------------------
  377|      0|        return TRUE;
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  378|      0|    }
  379|    336|    {
  380|    336|        char * startpt = format+next;
  381|    336|        size_t suffixlen = strlen(startpt);
  382|       |
  383|    336|        res = dwarfstring_append_length(data,startpt,suffixlen);
  384|    336|    }
  385|    336|    return res;
  386|    336|}
dwarfstring_append_printf_u:
  686|  98.8k|{
  687|       |
  688|  98.8k|    size_t next = 0;
  689|  98.8k|    long val = 0;
  690|  98.8k|    char *endptr = 0;
  691|  98.8k|    const char *numptr = 0;
  692|  98.8k|    size_t fixedlen = 0;
  693|  98.8k|    int leadingzero = 0;
  694|  98.8k|    int lcount = 0;
  695|  98.8k|    int ucount = 0;
  696|  98.8k|    int dcount = 0;
  697|  98.8k|    int xcount = 0;
  698|  98.8k|    int Xcount = 0;
  699|  98.8k|    char *ctable = 0;
  700|  98.8k|    size_t divisor = 0;
  701|  98.8k|    size_t prefixlen = 0;
  702|       |
  703|  98.8k|    if (!format) {
  ------------------
  |  Branch (703:9): [True: 0, False: 98.8k]
  ------------------
  704|      0|        DWSERR("<DWARFSTRINGERR: null format pointer to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  705|      0|            "dwarfstring_append_printf_u>");
  706|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  707|      0|    }
  708|   130k|    while (format[next] && format[next] != '%') {
  ------------------
  |  Branch (708:12): [True: 130k, False: 0]
  |  Branch (708:28): [True: 31.3k, False: 98.8k]
  ------------------
  709|  31.3k|        ++next;
  710|  31.3k|        ++prefixlen;
  711|  31.3k|    }
  712|  98.8k|    dwarfstring_append_length(data,format,prefixlen);
  713|  98.8k|    if (format[next] != '%') {
  ------------------
  |  Branch (713:9): [True: 0, False: 98.8k]
  ------------------
  714|       |        /*   No % operator found, we are done */
  715|      0|        DWSERR("<DWARFSTRINGERR: no percent passed to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  716|      0|            "dwarfstring_append_printf_u>");
  717|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  718|      0|    }
  719|  98.8k|    next++;
  720|  98.8k|    if (!format[next]) {
  ------------------
  |  Branch (720:9): [True: 0, False: 98.8k]
  ------------------
  721|      0|        DWSERR("<DWARFSTRINGERR: empty percent  to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  722|      0|            "dwarfstring_append_printf_u>");
  723|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  724|      0|    }
  725|  98.8k|    if (format[next] == ' ') {
  ------------------
  |  Branch (725:9): [True: 0, False: 98.8k]
  ------------------
  726|      0|        DWSERR("<DWARFSTRINGERR: empty percent  to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  727|      0|            "dwarfstring_append_printf_u>");
  728|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  729|      0|    }
  730|  98.8k|    if (format[next] == '-') {
  ------------------
  |  Branch (730:9): [True: 0, False: 98.8k]
  ------------------
  731|      0|        DWSERR("<DWARFSTRINGERR: format - passed to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  732|      0|            "dwarfstring_append_printf_u "
  733|      0|            "cannot be handled>");
  734|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  735|      0|    }
  736|  98.8k|    if (format[next] == '0') {
  ------------------
  |  Branch (736:9): [True: 97.8k, False: 981]
  ------------------
  737|  97.8k|        leadingzero = 1;
  738|  97.8k|        next++;
  739|  97.8k|    }
  740|  98.8k|    numptr = format+next;
  741|  98.8k|    val = strtol(numptr,&endptr,10);
  742|  98.8k|    if ( endptr != numptr) {
  ------------------
  |  Branch (742:10): [True: 97.8k, False: 981]
  ------------------
  743|  97.8k|        fixedlen = val;
  744|  97.8k|    }
  745|  98.8k|    next = (endptr - format);
  746|       |    /*  Following is lx lu or u or llx llu , we take
  747|       |        all this to mean 64 bits, */
  748|       |#ifdef _WIN32
  749|       |    if (format[next] == 'I') {
  750|       |        /*lcount++;*/
  751|       |        next++;
  752|       |    }
  753|       |    if (format[next] == '6') {
  754|       |        /*lcount++;*/
  755|       |        next++;
  756|       |    }
  757|       |    if (format[next] == '4') {
  758|       |        /*lcount++;*/
  759|       |        next++;
  760|       |    }
  761|       |#endif /* _WIN32 */
  762|  98.8k|    if (format[next] == 'l') {
  ------------------
  |  Branch (762:9): [True: 378, False: 98.4k]
  ------------------
  763|    378|        lcount++;
  764|    378|        next++;
  765|    378|    }
  766|  98.8k|    if (format[next] == 'l') {
  ------------------
  |  Branch (766:9): [True: 0, False: 98.8k]
  ------------------
  767|      0|        lcount++;
  768|      0|        next++;
  769|      0|    }
  770|  98.8k|    if (format[next] == 'l') {
  ------------------
  |  Branch (770:9): [True: 0, False: 98.8k]
  ------------------
  771|      0|        lcount++;
  772|      0|        next++;
  773|      0|    }
  774|  98.8k|    if (format[next] == 'u') {
  ------------------
  |  Branch (774:9): [True: 603, False: 98.2k]
  ------------------
  775|    603|        ucount++;
  776|    603|        next++;
  777|    603|    }
  778|  98.8k|    if (format[next] == 'd') {
  ------------------
  |  Branch (778:9): [True: 0, False: 98.8k]
  ------------------
  779|      0|        dcount++;
  780|      0|        next++;
  781|      0|    }
  782|  98.8k|    if (format[next] == 'x') {
  ------------------
  |  Branch (782:9): [True: 98.2k, False: 603]
  ------------------
  783|  98.2k|        xcount++;
  784|  98.2k|        next++;
  785|  98.2k|    }
  786|  98.8k|    if (format[next] == 'X') {
  ------------------
  |  Branch (786:9): [True: 0, False: 98.8k]
  ------------------
  787|      0|        Xcount++;
  788|      0|        next++;
  789|      0|    }
  790|  98.8k|    if (format[next] == 's') {
  ------------------
  |  Branch (790:9): [True: 0, False: 98.8k]
  ------------------
  791|      0|        DWSERR("<DWARFSTRINGERR: format percent-s passed to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  792|      0|            "dwarfstring_append_printf_u "
  793|      0|            "cannot be handled>");
  794|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  795|      0|    }
  796|  98.8k|    if ( (Xcount +xcount+dcount+ucount) > 1) {
  ------------------
  |  Branch (796:10): [True: 0, False: 98.8k]
  ------------------
  797|      0|        DWSERR("<DWARFSTRINGERR: format  percent -x X d u repeats to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  798|      0|            "dwarfstring_append_printf_u "
  799|      0|            "cannot be handled>");
  800|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  801|      0|    }
  802|  98.8k|    if ( (Xcount +xcount+dcount+ucount) == 0) {
  ------------------
  |  Branch (802:10): [True: 0, False: 98.8k]
  ------------------
  803|      0|        DWSERR("<DWARFSTRINGERR: format percent x X d u missing to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  804|      0|            "dwarfstring_append_printf_u "
  805|      0|            "cannot be handled>");
  806|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  807|      0|    }
  808|  98.8k|    if (lcount > 2) {
  ------------------
  |  Branch (808:9): [True: 0, False: 98.8k]
  ------------------
  809|      0|        DWSERR("<DWARFSTRINGERR: format percent lll to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  810|      0|            "dwarfstring_append_printf_u "
  811|      0|            "cannot be handled>");
  812|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  813|      0|    }
  814|  98.8k|    if (dcount > 0) {
  ------------------
  |  Branch (814:9): [True: 0, False: 98.8k]
  ------------------
  815|      0|        DWSERR("<DWARFSTRINGERR: format  percent-d to "
  ------------------
  |  |   56|      0|#define DWSERR(m) dwarfstring_append_length(data,(m),sizeof(m)-1)
  ------------------
  816|      0|            "dwarfstring_append_printf_u "
  817|      0|            "cannot be handled>");
  818|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
  819|      0|    }
  820|  98.8k|    if (ucount) {
  ------------------
  |  Branch (820:9): [True: 603, False: 98.2k]
  ------------------
  821|    603|        divisor = 10;
  822|    603|        ctable = dtable;
  823|  98.2k|    } else {
  824|  98.2k|        divisor = 16;
  825|  98.2k|        if (xcount) {
  ------------------
  |  Branch (825:13): [True: 98.2k, False: 0]
  ------------------
  826|  98.2k|            ctable = xtable;
  827|  98.2k|        } else {
  828|      0|            ctable = Xtable;
  829|      0|        }
  830|  98.2k|    }
  831|  98.8k|    {
  832|  98.8k|        char digbuf[36];
  833|  98.8k|        char *digptr = 0;
  834|  98.8k|        unsigned digcharlen = 0;
  835|  98.8k|        dwarfstring_u remaining = v;
  836|       |
  837|  98.8k|        if (divisor == 16) {
  ------------------
  |  Branch (837:13): [True: 98.2k, False: 603]
  ------------------
  838|  98.2k|            digptr = digbuf+sizeof(digbuf) -1;
  839|   136k|            for ( ;; ) {
  840|   136k|                dwarfstring_u dig;
  841|   136k|                dig = remaining & 0xf;
  842|   136k|                remaining = remaining >> 4;
  843|   136k|                *digptr = ctable[dig];
  844|   136k|                ++digcharlen;
  845|   136k|                if (!remaining) {
  ------------------
  |  Branch (845:21): [True: 98.2k, False: 38.1k]
  ------------------
  846|  98.2k|                    break;
  847|  98.2k|                }
  848|  38.1k|                --digptr;
  849|  38.1k|            }
  850|  98.2k|        } else {
  851|    603|            digptr = digbuf+sizeof(digbuf) -1;
  852|    603|            *digptr = 0;
  853|    603|            --digptr;
  854|  3.10k|            for ( ;; ) {
  855|  3.10k|                dwarfstring_u dig;
  856|  3.10k|                dig = remaining % divisor;
  857|  3.10k|                remaining /= divisor;
  858|  3.10k|                *digptr = ctable[dig];
  859|  3.10k|                ++digcharlen;
  860|  3.10k|                if (!remaining) {
  ------------------
  |  Branch (860:21): [True: 603, False: 2.50k]
  ------------------
  861|    603|                    break;
  862|    603|                }
  863|  2.50k|                --digptr;
  864|  2.50k|            }
  865|    603|        }
  866|  98.8k|        if (fixedlen <= digcharlen) {
  ------------------
  |  Branch (866:13): [True: 37.7k, False: 61.0k]
  ------------------
  867|  37.7k|            dwarfstring_append_length(data,digptr,digcharlen);
  868|  61.0k|        } else {
  869|  61.0k|            if (!leadingzero) {
  ------------------
  |  Branch (869:17): [True: 0, False: 61.0k]
  ------------------
  870|      0|                size_t justcount = fixedlen - digcharlen;
  871|      0|                _dwarfstring_append_spaces(data,justcount);
  872|      0|                dwarfstring_append_length(data,digptr,digcharlen);
  873|  61.0k|            } else {
  874|  61.0k|                size_t prefixcount = fixedlen - digcharlen;
  875|  61.0k|                _dwarfstring_append_zeros(data,prefixcount);
  876|  61.0k|                dwarfstring_append_length(data,digptr,digcharlen);
  877|  61.0k|            }
  878|  61.0k|        }
  879|  98.8k|    }
  880|  98.8k|    if (format[next]) {
  ------------------
  |  Branch (880:9): [True: 981, False: 97.8k]
  ------------------
  881|    981|        size_t trailinglen = strlen(format+next);
  882|    981|        dwarfstring_append_length(data,format+next,trailinglen);
  883|    981|    }
  884|  98.8k|    return FALSE;
  ------------------
  |  |   40|  98.8k|#define FALSE 0
  ------------------
  885|  98.8k|}
dwarf_string.c:dwarfstring_add_to:
   77|  66.9k|{
   78|  66.9k|    char *b          = 0;
   79|       |    /*  s_size - s_avail is the string without counting
   80|       |        the null following the string. So, is  strlen()  */
   81|  66.9k|    size_t lastpos   = g->s_size - g->s_avail;
   82|  66.9k|    size_t malloclen = newlen+1;
   83|       |
   84|       |    /*  ASSERT: newlen as well as malloclen  are
   85|       |        greater than g->s_size at both call points */
   86|  66.9k|    if (malloclen < minimumnewlen) {
  ------------------
  |  Branch (86:9): [True: 3.53k, False: 63.4k]
  ------------------
   87|  3.53k|        malloclen = minimumnewlen;
   88|  3.53k|    }
   89|       |    /*  Not zeroing the new buffer block. */
   90|  66.9k|    b = malloc(malloclen);
   91|  66.9k|    if (!b) {
  ------------------
  |  Branch (91:9): [True: 0, False: 66.9k]
  ------------------
   92|      0|        return FALSE;
  ------------------
  |  |   40|      0|#define FALSE 0
  ------------------
   93|      0|    }
   94|  66.9k|    if (lastpos > 0) {
  ------------------
  |  Branch (94:9): [True: 62.5k, False: 4.45k]
  ------------------
   95|       |        /* Copying the non-null bytes in s_data. */
   96|  62.5k|        memcpy(b,g->s_data,lastpos);
   97|  62.5k|    }
   98|  66.9k|    if (g->s_malloc) {
  ------------------
  |  Branch (98:9): [True: 62.5k, False: 4.40k]
  ------------------
   99|  62.5k|        free(g->s_data);
  100|  62.5k|        g->s_data = 0;
  101|  62.5k|    }
  102|  66.9k|    g->s_data = b;
  103|       |    /*  s_data[lastpos] is one past the end of anything
  104|       |        counted as string
  105|       |        in s_data at the point of call, and is guaranteed
  106|       |        to be safe as we increased the size of s_data, we did not
  107|       |        shrink.  And, too, we add 1 to newlen, always,
  108|       |        so space for a terminating null byte is guaranteed
  109|       |        available. */
  110|  66.9k|    g->s_data[lastpos] = 0;
  111|  66.9k|    g->s_size = newlen;
  112|  66.9k|    g->s_avail = newlen - lastpos;
  113|  66.9k|    g->s_malloc = TRUE;
  ------------------
  |  |   37|  66.9k|#define TRUE 1
  ------------------
  114|  66.9k|    return TRUE;
  ------------------
  |  |   37|  66.9k|#define TRUE 1
  ------------------
  115|  66.9k|}
dwarf_string.c:_dwarfstring_append_zeros:
  254|  61.0k|{
  255|  61.0k|    int res = 0;
  256|  61.0k|    static char zeros[] = {
  257|  61.0k|        "0000000000000000000000000000000000000000"};
  258|  61.0k|    size_t charct = sizeof(zeros)-1;
  259|       |
  260|  61.0k|    while (l > charct) {
  ------------------
  |  Branch (260:12): [True: 0, False: 61.0k]
  ------------------
  261|      0|        res = dwarfstring_append_length(data,zeros,charct);
  262|      0|        l -= charct;
  263|      0|        if (res != TRUE) {
  ------------------
  |  |   37|      0|#define TRUE 1
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            return res;
  265|      0|        }
  266|      0|    }
  267|       |    /* ASSERT: l > 0 */
  268|  61.0k|    dwarfstring_append_length(data,zeros,l);
  269|  61.0k|    return res;
  270|  61.0k|}

_dwarf_initialize_search_hash:
  182|  16.6k|{
  183|  16.6k|    unsigned long prime_to_use = primes[0];
  184|  16.6k|    unsigned entry_index = 0;
  185|  16.6k|    unsigned k = 0;
  186|  16.6k|    struct hs_base *base = 0;
  187|       |
  188|  16.6k|    base = *(struct hs_base **)treeptr;
  189|  16.6k|    if (base) {
  ------------------
  |  Branch (189:9): [True: 0, False: 16.6k]
  ------------------
  190|       |        /* initialized already. */
  191|      0|        return base ;
  192|      0|    }
  193|  16.6k|    base = calloc(sizeof(struct hs_base),1);
  194|  16.6k|    if (!base) {
  ------------------
  |  Branch (194:9): [True: 0, False: 16.6k]
  ------------------
  195|       |        /* Out of memory. */
  196|      0|        return NULL ;
  197|      0|    }
  198|  16.6k|    prime_to_use = primes[0];
  199|  18.6k|    while(size_estimate && (size_estimate > prime_to_use)) {
  ------------------
  |  Branch (199:11): [True: 18.5k, False: 114]
  |  Branch (199:28): [True: 2.03k, False: 16.5k]
  ------------------
  200|  2.03k|        k = k +1;
  201|  2.03k|        prime_to_use = primes[k];
  202|  2.03k|        if (prime_to_use == 0) {
  ------------------
  |  Branch (202:13): [True: 0, False: 2.03k]
  ------------------
  203|       |            /* Oops. Too large. */
  204|      0|            free(base);
  205|      0|            return NULL;
  206|      0|        }
  207|  2.03k|        entry_index = k;
  208|  2.03k|    }
  209|       |#ifdef TESTINGHASHTAB
  210|       |printf("debugging: initial alloc size estimate %lu\n",size_estimate);
  211|       |printf("debugging: initial alloc prime to use %lu\n",prime_to_use);
  212|       |#endif
  213|  16.6k|    base->tablesize_ = prime_to_use;
  214|  16.6k|    base->allowed_fill_ = calculate_allowed_fill(allowed_fill_percent,
  215|  16.6k|        prime_to_use);
  216|  16.6k|    if (base->allowed_fill_< (base->tablesize_/2)) {
  ------------------
  |  Branch (216:9): [True: 0, False: 16.6k]
  ------------------
  217|      0|        free(base);
  218|       |        /* Oops. We are in trouble. Coding mistake here.  */
  219|      0|        return NULL;
  220|      0|    }
  221|  16.6k|    base->record_count_ = 0;
  222|  16.6k|    base->tablesize_entry_index_ = entry_index;
  223|       |    /*  hashtab_ is an array of hs_entry,
  224|       |        indexes 0 through tablesize_ -1. */
  225|  16.6k|    base->hashfunc_ = hashfunc;
  226|  16.6k|    base->hashtab_ = calloc(sizeof(struct ts_entry),base->tablesize_);
  227|  16.6k|    if (!base->hashtab_) {
  ------------------
  |  Branch (227:9): [True: 0, False: 16.6k]
  ------------------
  228|      0|        free(base);
  229|      0|        return NULL;
  230|      0|    }
  231|  16.6k|    *treeptr = base;
  232|  16.6k|    return base;
  233|  16.6k|}
_dwarf_tsearch:
  516|   260k|{
  517|   260k|    struct hs_base **rootp = (struct hs_base **)headin;
  518|   260k|    struct hs_base *head = *rootp;
  519|   260k|    struct ts_entry *r = 0;
  520|   260k|    int inserted = 0;
  521|       |    /* nullme won't be set. */
  522|   260k|    struct ts_entry *nullme = 0;
  523|       |
  524|   260k|    if (!head) {
  ------------------
  |  Branch (524:9): [True: 0, False: 260k]
  ------------------
  525|       |        /* something is wrong here, not initialized. */
  526|      0|        return NULL;
  527|      0|    }
  528|   260k|    r = _tsearch_inner(key,head,compar,want_insert,&inserted,&nullme);
  529|   260k|    if (!r) {
  ------------------
  |  Branch (529:9): [True: 0, False: 260k]
  ------------------
  530|      0|        return NULL;
  531|      0|    }
  532|   260k|    return (void *)&(r->keyptr);
  533|   260k|}
_dwarf_tfind:
  539|   591k|{
  540|       |    /*  Nothing will change, but we discard const
  541|       |        so we can use tsearch_inner(). */
  542|   591k|    struct hs_base **proot = (struct hs_base **)rootp;
  543|   591k|    struct hs_base *head = *proot;
  544|   591k|    struct ts_entry *r = 0;
  545|       |    /* inserted flag won't be set. */
  546|   591k|    int inserted = 0;
  547|       |    /* nullme won't be set. */
  548|   591k|    struct ts_entry * nullme = 0;
  549|       |    /* Get to actual tree. */
  550|       |
  551|   591k|    if (!head) {
  ------------------
  |  Branch (551:9): [True: 0, False: 591k]
  ------------------
  552|      0|        return NULL;
  553|      0|    }
  554|       |
  555|   591k|    r = _tsearch_inner(key,head,compar,only_find,&inserted,&nullme);
  556|   591k|    if (!r) {
  ------------------
  |  Branch (556:9): [True: 335k, False: 256k]
  ------------------
  557|   335k|        return NULL;
  558|   335k|    }
  559|   256k|    return (void *)(&(r->keyptr));
  560|   591k|}
_dwarf_tdelete:
  568|  1.45k|{
  569|  1.45k|    struct hs_base **proot = (struct hs_base **)rootp;
  570|  1.45k|    struct hs_base *head = *proot;
  571|  1.45k|    struct ts_entry *found = 0;
  572|       |    /* inserted flag won't be set. */
  573|  1.45k|    int inserted = 0;
  574|  1.45k|    struct ts_entry * parentp = 0;
  575|       |
  576|  1.45k|    if (!head) {
  ------------------
  |  Branch (576:9): [True: 0, False: 1.45k]
  ------------------
  577|      0|        return NULL;
  578|      0|    }
  579|       |
  580|  1.45k|    found = _tsearch_inner(key,head,compar,want_delete,&inserted,
  581|  1.45k|        &parentp);
  582|  1.45k|    if (found) {
  ------------------
  |  Branch (582:9): [True: 1.45k, False: 0]
  ------------------
  583|  1.45k|        if (parentp) {
  ------------------
  |  Branch (583:13): [True: 0, False: 1.45k]
  ------------------
  584|       |            /* Delete a chain entry. */
  585|      0|            head->record_count_--;
  586|      0|            parentp->next = found->next;
  587|       |            /*  We free our storage. It would be up
  588|       |                to caller to do a tfind to find
  589|       |                a record and delete content if necessary. */
  590|      0|            free(found);
  591|      0|            return (void *)&(parentp->keyptr);
  592|      0|        }
  593|       |        /* So found is the head of a chain. */
  594|  1.45k|        if (found->next) {
  ------------------
  |  Branch (594:13): [True: 0, False: 1.45k]
  ------------------
  595|       |            /*  Delete a chain entry, pull up to hash tab, freeing
  596|       |                up the chain entry. */
  597|      0|            struct ts_entry *pullup = found->next;
  598|      0|            *found = *pullup;
  599|      0|            free(pullup);
  600|      0|            head->record_count_--;
  601|      0|            return (void *)&(found->keyptr);
  602|  1.45k|        } else {
  603|       |            /*  Delete a main hash table entry.
  604|       |                Problem: what the heck to return as a keyptr pointer?
  605|       |                Well, we return NULL. As in the standard
  606|       |                tsearch, returning NULL does not mean
  607|       |                failure! Here it just means 'empty chain somewhere'.
  608|       |            */
  609|  1.45k|            head->record_count_--;
  610|  1.45k|            found->next = 0;
  611|  1.45k|            found->keyptr = 0;
  612|  1.45k|            found->entryused = 0;
  613|  1.45k|            return NULL;
  614|  1.45k|        }
  615|  1.45k|    }
  616|      0|    return NULL;
  617|  1.45k|}
_dwarf_twalk:
  644|  4.84k|{
  645|  4.84k|    const struct hs_base *head = (const struct hs_base *)rootp;
  646|  4.84k|    struct ts_entry *root = 0;
  647|  4.84k|    if (!head) {
  ------------------
  |  Branch (647:9): [True: 1.13k, False: 3.71k]
  ------------------
  648|  1.13k|        return;
  649|  1.13k|    }
  650|  3.71k|    root = head->hashtab_;
  651|       |    /* Get to actual tree. */
  652|  3.71k|    _dwarf_twalk_inner(head,root,action);
  653|  3.71k|}
_dwarf_tdestroy:
  698|  21.3k|{
  699|  21.3k|    struct hs_base *head = (struct hs_base *)rootp;
  700|  21.3k|    struct ts_entry *root = 0;
  701|  21.3k|    if (!head) {
  ------------------
  |  Branch (701:9): [True: 4.72k, False: 16.6k]
  ------------------
  702|  4.72k|        return;
  703|  4.72k|    }
  704|  16.6k|    root = head->hashtab_;
  705|  16.6k|    _dwarf_tdestroy_inner(head,free_node);
  706|  16.6k|    free(root);
  707|  16.6k|    free(head);
  708|  16.6k|}
dwarf_tsearchhash.c:calculate_allowed_fill:
  158|  16.6k|{
  159|  16.6k|    unsigned long v = 0;
  160|  16.6k|    if (ct < 100000) {
  ------------------
  |  Branch (160:9): [True: 16.6k, False: 0]
  ------------------
  161|  16.6k|        unsigned long v2 = (ct *fill_percent)/100;
  162|  16.6k|        return v2;
  163|  16.6k|    }
  164|      0|    v = (ct /100)*fill_percent;
  165|      0|    return v;
  166|  16.6k|}
dwarf_tsearchhash.c:_tsearch_inner:
  443|   990k|{
  444|   990k|    struct ts_entry *s =0;
  445|   990k|    struct ts_entry *c =0;
  446|   990k|    struct ts_entry *q =0;
  447|   990k|    int kc = 0;
  448|   990k|    DW_TSHASHTYPE keyhash =  0;
  ------------------
  |  |   54|   990k|#define DW_TSHASHTYPE uintptr_t
  ------------------
  449|   990k|    DW_TSHASHTYPE hindx = 0;
  ------------------
  |  |   54|   990k|#define DW_TSHASHTYPE uintptr_t
  ------------------
  450|   990k|    struct ts_entry *chain_parent = 0;
  451|       |
  452|   990k|    if (! head->hashfunc_) {
  ------------------
  |  Branch (452:9): [True: 0, False: 990k]
  ------------------
  453|       |        /* Not fully initialized. */
  454|      0|        return NULL;
  455|      0|    }
  456|   990k|    keyhash =  head->hashfunc_(key);
  457|   990k|    if (intent == want_insert) {
  ------------------
  |  Branch (457:9): [True: 397k, False: 593k]
  ------------------
  458|   397k|        if (head->record_count_ > head->allowed_fill_) {
  ------------------
  |  Branch (458:13): [True: 24, False: 396k]
  ------------------
  459|     24|            resize_table(head,compar);
  460|     24|        }
  461|   397k|    }
  462|   990k|    hindx = keyhash%head->tablesize_;
  463|   990k|    s = &head->hashtab_[hindx];
  464|   990k|    if (!s->entryused) {
  ------------------
  |  Branch (464:9): [True: 732k, False: 257k]
  ------------------
  465|       |        /* Not found. */
  466|   732k|        if (intent != want_insert) {
  ------------------
  |  Branch (466:13): [True: 335k, False: 396k]
  ------------------
  467|   335k|            return NULL;
  468|   335k|        }
  469|       |        /*  Insert in the base hash table in an
  470|       |            empty slot. */
  471|   396k|        *inserted = 1;
  472|   396k|        head->record_count_++;
  473|   396k|        s->keyptr = (const void *)key;
  474|   396k|        s->entryused = 1;
  475|   396k|        s->next = 0;
  476|   396k|        return s;
  477|   732k|    }
  478|   257k|    kc = compar(key,s->keyptr);
  479|   257k|    if (kc == 0 ) {
  ------------------
  |  Branch (479:9): [True: 257k, False: 0]
  ------------------
  480|       |        /* found! */
  481|   257k|        if (intent == want_delete) {
  ------------------
  |  Branch (481:13): [True: 1.45k, False: 256k]
  ------------------
  482|  1.45k|            *owner_ptr = 0;
  483|  1.45k|        }
  484|   257k|        return (void *)&(s->keyptr);
  485|   257k|    }
  486|      0|    chain_parent = s;
  487|      0|    for (c = s->next; c; c = c->next)  {
  ------------------
  |  Branch (487:23): [True: 0, False: 0]
  ------------------
  488|      0|        kc = compar(key,c->keyptr);
  489|      0|        if (kc == 0 ) {
  ------------------
  |  Branch (489:13): [True: 0, False: 0]
  ------------------
  490|       |            /* found! */
  491|      0|            if (intent == want_delete) {
  ------------------
  |  Branch (491:17): [True: 0, False: 0]
  ------------------
  492|      0|                *owner_ptr = chain_parent;
  493|      0|            }
  494|      0|            return (void *)&(c->keyptr);
  495|      0|        }
  496|      0|        chain_parent = c;
  497|      0|    }
  498|      0|    if (intent != want_insert) {
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|        return NULL;
  500|      0|    }
  501|       |    /* Insert following head record of the chain. */
  502|      0|    q = allocate_ts_entry(key);
  503|      0|    if (!q) {
  ------------------
  |  Branch (503:9): [True: 0, False: 0]
  ------------------
  504|      0|        return q;
  505|      0|    }
  506|      0|    q->next = s->next;
  507|      0|    s->next = q;
  508|      0|    head->record_count_++;
  509|      0|    *inserted = 1;
  510|      0|    return q;
  511|      0|}
dwarf_tsearchhash.c:resize_table:
  346|     24|{
  347|     24|    struct hs_base newhead;
  348|     24|    unsigned new_entry_index = 0;
  349|     24|    unsigned long prime_to_use = 0;
  350|       |
  351|       |    /* Copy the values we have. */
  352|     24|    newhead = *head;
  353|       |    /* But drop the hashtab_ from new. calloc below. */
  354|     24|    newhead.hashtab_ = 0;
  355|     24|    newhead.record_count_ = 0;
  356|     24|    new_entry_index = head->tablesize_entry_index_ +1;
  357|     24|    prime_to_use = primes[new_entry_index];
  358|     24|    if (!prime_to_use) {
  ------------------
  |  Branch (358:9): [True: 0, False: 24]
  ------------------
  359|       |        /*  Oops, too large. Leave table size as is, though
  360|       |            it will get slow as it overfills. */
  361|      0|        return;
  362|      0|    }
  363|     24|    newhead.tablesize_ = prime_to_use;
  364|     24|    newhead.allowed_fill_ = calculate_allowed_fill(
  365|     24|        allowed_fill_percent, prime_to_use);
  366|     24|    if (newhead.allowed_fill_< (newhead.tablesize_/2)) {
  ------------------
  |  Branch (366:9): [True: 0, False: 24]
  ------------------
  367|       |        /* Oops. We are in trouble.  */
  368|      0|        return;
  369|      0|    }
  370|     24|    newhead.tablesize_entry_index_ = new_entry_index;
  371|     24|    newhead.hashtab_ = calloc(sizeof(struct ts_entry),
  372|     24|        newhead.tablesize_);
  373|     24|    if (!newhead.hashtab_) {
  ------------------
  |  Branch (373:9): [True: 0, False: 24]
  ------------------
  374|       |        /*  Oops, too large. Leave table size as is, though
  375|       |            things will get slow as it overfills. */
  376|      0|        free(newhead.hashtab_);
  377|      0|        return;
  378|      0|    }
  379|     24|    {
  380|       |        /*  Insert all the records from the old table into
  381|       |            the new table. */
  382|     24|        int fillnewfail = 0;
  383|     24|        unsigned long ix = 0;
  384|     24|        unsigned long tsize = head->tablesize_;
  385|     24|        struct ts_entry *p = &head->hashtab_[0];
  386|       |#ifdef TESTINGHASHTAB
  387|       |printf("debugging: Resize %lu to %lu\n",tsize,prime_to_use);
  388|       |#endif
  389|   151k|        for ( ; ix < tsize; ix++,p++) {
  ------------------
  |  Branch (389:17): [True: 151k, False: 24]
  ------------------
  390|   151k|            int inserted = 0;
  391|   151k|            struct ts_entry*n = 0;
  392|   151k|            if (fillnewfail) {
  ------------------
  |  Branch (392:17): [True: 0, False: 151k]
  ------------------
  393|      0|                break;
  394|      0|            }
  395|   151k|            if (p->keyptr) {
  ------------------
  |  Branch (395:17): [True: 136k, False: 15.1k]
  ------------------
  396|   136k|                _tsearch_inner(p->keyptr,
  397|   136k|                    &newhead,compar,
  398|   136k|                    want_insert,
  399|   136k|                    &inserted,
  400|   136k|                    0);
  401|   136k|                if (!inserted) {
  ------------------
  |  Branch (401:21): [True: 0, False: 136k]
  ------------------
  402|      0|                    fillnewfail = 1;
  403|      0|                    break;
  404|      0|                }
  405|   136k|            }
  406|   151k|            for (n = p->next; n ; n = n->next) {
  ------------------
  |  Branch (406:31): [True: 0, False: 151k]
  ------------------
  407|      0|                inserted = 0;
  408|      0|                _tsearch_inner(n->keyptr,
  409|      0|                    &newhead,compar,
  410|      0|                    want_insert,
  411|      0|                    &inserted,
  412|      0|                    0);
  413|      0|                if (!inserted) {
  ------------------
  |  Branch (413:21): [True: 0, False: 0]
  ------------------
  414|      0|                    fillnewfail = 1;
  415|      0|                    break;
  416|      0|                }
  417|      0|            }
  418|   151k|        }
  419|     24|        if (fillnewfail) {
  ------------------
  |  Branch (419:13): [True: 0, False: 24]
  ------------------
  420|      0|            free(newhead.hashtab_);
  421|      0|            return;
  422|      0|        }
  423|     24|    }
  424|       |    /* Now get rid of the chain entries of the old table. */
  425|     24|    _dwarf_tdestroy_inner(head,0);
  426|       |    /* Now get rid of the old table itself. */
  427|     24|    free(head->hashtab_);
  428|     24|    head->hashtab_ = 0;
  429|     24|    *head = newhead;
  430|     24|    return;
  431|     24|}
dwarf_tsearchhash.c:_dwarf_twalk_inner:
  625|  3.71k|{
  626|  3.71k|    unsigned long ix = 0;
  627|  3.71k|    int depth = 0;
  628|  3.71k|    unsigned long tsize = h->tablesize_;
  629|  2.02M|    for ( ; ix < tsize; ix++,p++) {
  ------------------
  |  Branch (629:13): [True: 2.02M, False: 3.71k]
  ------------------
  630|  2.02M|        struct ts_entry*n = 0;
  631|  2.02M|        if (p->keyptr) {
  ------------------
  |  Branch (631:13): [True: 6.44k, False: 2.01M]
  ------------------
  632|  6.44k|            action((void *)(&(p->keyptr)),dwarf_leaf,depth);
  633|  6.44k|        }
  634|  2.02M|        for (n = p->next; n ; n = n->next) {
  ------------------
  |  Branch (634:27): [True: 0, False: 2.02M]
  ------------------
  635|      0|            action((void *)(&(n->keyptr)),dwarf_leaf,depth);
  636|      0|        }
  637|  2.02M|    }
  638|  3.71k|}
dwarf_tsearchhash.c:_dwarf_tdestroy_inner:
  658|  16.6k|{
  659|  16.6k|    unsigned long ix = 0;
  660|  16.6k|    unsigned long tsize = h->tablesize_;
  661|  16.6k|    struct ts_entry *p = &h->hashtab_[0];
  662|       |#ifdef TESTINGHASHTAB
  663|       |    printf("debugging: destroyhashtable blocks      %lu\n",tsize);
  664|       |    printf("debugging: destroyhashtable recordcount %lu\n",
  665|       |        h->record_count_);
  666|       |#endif
  667|  17.0M|    for ( ; ix < tsize; ix++,p++) {
  ------------------
  |  Branch (667:13): [True: 17.0M, False: 16.6k]
  ------------------
  668|  17.0M|        struct ts_entry*n = 0;
  669|  17.0M|        struct ts_entry*prev = 0;
  670|  17.0M|        if (p->keyptr && p->entryused) {
  ------------------
  |  Branch (670:13): [True: 395k, False: 16.6M]
  |  Branch (670:26): [True: 395k, False: 0]
  ------------------
  671|   395k|            if (free_node) {
  ------------------
  |  Branch (671:17): [True: 259k, False: 136k]
  ------------------
  672|   259k|                free_node((void *)(p->keyptr));
  673|   259k|            }
  674|   395k|            --h->record_count_;
  675|   395k|        }
  676|       |        /* Now walk and free up the chain entries. */
  677|  17.0M|        for (n = p->next; n ; ) {
  ------------------
  |  Branch (677:27): [True: 0, False: 17.0M]
  ------------------
  678|      0|            if (free_node) {
  ------------------
  |  Branch (678:17): [True: 0, False: 0]
  ------------------
  679|      0|                free_node((void *)(n->keyptr));
  680|      0|            }
  681|      0|            --h->record_count_;
  682|      0|            prev = n;
  683|      0|            n = n->next;
  684|      0|            free(prev);
  685|      0|        }
  686|  17.0M|    }
  687|  16.6k|}

_dwarf_check_string_valid:
  981|    297|{
  982|    297|    Dwarf_Small *start = areaptr;
  983|    297|    Dwarf_Small *p = strptr;
  984|    297|    Dwarf_Small *end = areaendptr;
  985|       |
  986|    297|    if (p < start) {
  ------------------
  |  Branch (986:9): [True: 0, False: 297]
  ------------------
  987|      0|        _dwarf_error(dbg,error,suggested_error);
  988|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  989|      0|    }
  990|    297|    if (p >= end) {
  ------------------
  |  Branch (990:9): [True: 0, False: 297]
  ------------------
  991|      0|        _dwarf_error(dbg,error,suggested_error);
  992|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  993|      0|    }
  994|    297|    if (dbg->de_assume_string_in_bounds) {
  ------------------
  |  Branch (994:9): [True: 0, False: 297]
  ------------------
  995|       |        /* This NOT the default. But folks can choose
  996|       |            to live dangerously and just assume strings ok. */
  997|      0|        return DW_DLV_OK;
  ------------------
  |  |  122|      0|#define DW_DLV_OK        0
  ------------------
  998|      0|    }
  999|  4.05k|    while (p < end) {
  ------------------
  |  Branch (999:12): [True: 4.04k, False: 15]
  ------------------
 1000|  4.04k|        if (*p == 0) {
  ------------------
  |  Branch (1000:13): [True: 282, False: 3.76k]
  ------------------
 1001|    282|            return DW_DLV_OK;
  ------------------
  |  |  122|    282|#define DW_DLV_OK        0
  ------------------
 1002|    282|        }
 1003|  3.76k|        ++p;
 1004|  3.76k|    }
 1005|     15|    _dwarf_error(dbg,error,DW_DLE_STRING_NOT_TERMINATED);
  ------------------
  |  | 1278|     15|#define DW_DLE_STRING_NOT_TERMINATED           303
  ------------------
 1006|     15|    return DW_DLV_ERROR;
  ------------------
  |  |  123|     15|#define DW_DLV_ERROR     1
  ------------------
 1007|    297|}

dwarf_get_xu_index_header:
  181|  1.80k|{
  182|  1.80k|    Dwarf_Xu_Index_Header indexptr = 0;
  183|  1.80k|    int res = DW_DLV_ERROR;
  ------------------
  |  |  123|  1.80k|#define DW_DLV_ERROR     1
  ------------------
  184|  1.80k|    struct Dwarf_Section_s *sect = 0;
  185|  1.80k|    Dwarf_Unsigned local_version = 0;
  186|  1.80k|    Dwarf_Unsigned num_secs  = 0;
  187|  1.80k|    Dwarf_Unsigned num_CUs  = 0;
  188|  1.80k|    Dwarf_Unsigned num_slots  = 0;
  189|  1.80k|    Dwarf_Small *data = 0;
  190|  1.80k|    Dwarf_Unsigned tables_end_offset = 0;
  191|  1.80k|    Dwarf_Unsigned hash_tab_offset = 0;
  192|  1.80k|    Dwarf_Unsigned indexes_tab_offset = 0;
  193|  1.80k|    Dwarf_Unsigned section_offsets_tab_offset = 0;
  194|  1.80k|    Dwarf_Unsigned section_offsets_headerline_offset = 0;
  195|  1.80k|    Dwarf_Unsigned section_sizes_tab_offset = 0;
  196|  1.80k|    unsigned datalen32 = SIZEOFT32;
  ------------------
  |  |   45|  1.80k|#define SIZEOFT32 4
  ------------------
  197|  1.80k|    Dwarf_Small *section_end = 0;
  198|       |
  199|  1.80k|    CHECK_DBG(dbg,error,"dwarf_get_xu_index_header()");
  ------------------
  |  |  190|  1.80k|    do {                                                      \
  |  |  191|  1.80k|        if (!(cd_dbg) || (cd_dbg)->de_magic != DBG_IS_VALID) {    \
  |  |  ------------------
  |  |  |  |  538|  1.80k|#define DBG_IS_VALID 0xebfdebfd
  |  |  ------------------
  |  |  |  Branch (191:13): [True: 0, False: 1.80k]
  |  |  |  Branch (191:26): [True: 0, False: 1.80k]
  |  |  ------------------
  |  |  192|      0|            _dwarf_error_string(NULL, (cd_er), DW_DLE_DBG_NULL, \
  |  |  ------------------
  |  |  |  | 1055|      0|#define DW_DLE_DBG_NULL                         81
  |  |  ------------------
  |  |  193|      0|                "DW_DLE_DBG_NULL: "                           \
  |  |  194|      0|                "dbg argument to " cd_funcname                \
  |  |  195|      0|                "either null or it contains"                  \
  |  |  196|      0|                "a stale Dwarf_Debug pointer");               \
  |  |  197|      0|            return DW_DLV_ERROR;                              \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  198|      0|        }                                                     \
  |  |  199|  1.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (199:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  200|  1.80k|    if (!section_type || !xuptr) {
  ------------------
  |  Branch (200:9): [True: 0, False: 1.80k]
  |  Branch (200:26): [True: 0, False: 1.80k]
  ------------------
  201|      0|        _dwarf_error_string(0,error,DW_DLE_XU_TYPE_ARG_ERROR,
  ------------------
  |  | 1242|      0|#define DW_DLE_XU_TYPE_ARG_ERROR               268
  ------------------
  202|      0|            "DW_DLE_XU_TYPE_ARG_ERROR: section type or header "
  203|      0|            "return pointer is not valid");
  204|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  205|      0|    }
  206|       |
  207|  1.80k|    if (!strcmp(section_type,"cu") ) {
  ------------------
  |  Branch (207:9): [True: 1.04k, False: 759]
  ------------------
  208|  1.04k|        sect = &dbg->de_debug_cu_index;
  209|  1.04k|    } else if (!strcmp(section_type,"tu") ) {
  ------------------
  |  Branch (209:16): [True: 759, False: 0]
  ------------------
  210|    759|        sect = &dbg->de_debug_tu_index;
  211|    759|    } else {
  212|      0|        _dwarf_error(dbg, error, DW_DLE_XU_TYPE_ARG_ERROR);
  ------------------
  |  | 1242|      0|#define DW_DLE_XU_TYPE_ARG_ERROR               268
  ------------------
  213|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  214|      0|    }
  215|  1.80k|    if (!sect->dss_size) {
  ------------------
  |  Branch (215:9): [True: 0, False: 1.80k]
  ------------------
  216|      0|        return DW_DLV_NO_ENTRY;
  ------------------
  |  |  121|      0|#define DW_DLV_NO_ENTRY -1
  ------------------
  217|      0|    }
  218|  1.80k|    if (!sect->dss_data) {
  ------------------
  |  Branch (218:9): [True: 1.80k, False: 0]
  ------------------
  219|  1.80k|        res = _dwarf_load_section(dbg, sect,error);
  220|  1.80k|        if (res != DW_DLV_OK) {
  ------------------
  |  |  122|  1.80k|#define DW_DLV_OK        0
  ------------------
  |  Branch (220:13): [True: 993, False: 810]
  ------------------
  221|    993|            return res;
  222|    993|        }
  223|  1.80k|    }
  224|       |
  225|    810|    data = sect->dss_data;
  226|    810|    section_end = data + sect->dss_size;
  227|       |
  228|    810|    if (sect->dss_size < (4*datalen32) ) {
  ------------------
  |  Branch (228:9): [True: 36, False: 774]
  ------------------
  229|     36|        dwarfstring m;
  230|       |
  231|     36|        dwarfstring_constructor(&m);
  232|     36|        dwarfstring_append_printf_s(&m,
  233|     36|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION: "
  234|     36|            "The size of the %s ",
  235|     36|            (char *)section_type);
  236|     36|        dwarfstring_append_printf_u(&m,
  237|     36|            "is just %u bytes, much to small to be "
  238|     36|            " a correct section",
  239|     36|            sect->dss_size);
  240|     36|        _dwarf_error_string(dbg, error,
  241|     36|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|     36|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  242|     36|            dwarfstring_string(&m));
  243|     36|        dwarfstring_destructor(&m);
  244|     36|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     36|#define DW_DLV_ERROR     1
  ------------------
  245|     36|    }
  246|    774|    READ_UNALIGNED_CK(dbg,local_version, Dwarf_Unsigned,
  ------------------
  |  |  245|    774|    do  {                                        \
  |  |  246|    774|        desttype _ltmp = 0;                      \
  |  |  247|    774|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|    774|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 774]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|    774|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 774]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|    774|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|    774|            (source), (unsigned long)(length)) ; \
  |  |  264|    774|        (dest) = _ltmp;                          \
  |  |  265|    774|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  247|    774|        data,datalen32,
  248|    774|        error,section_end);
  249|    774|    data += datalen32;
  250|       |
  251|       |    /* reading N */
  252|    774|    READ_UNALIGNED_CK(dbg,num_secs, Dwarf_Unsigned,
  ------------------
  |  |  245|    774|    do  {                                        \
  |  |  246|    774|        desttype _ltmp = 0;                      \
  |  |  247|    774|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|    774|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 774]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|    774|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 774]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|    774|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|    774|            (source), (unsigned long)(length)) ; \
  |  |  264|    774|        (dest) = _ltmp;                          \
  |  |  265|    774|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  253|    774|        data,datalen32,
  254|    774|        error,section_end);
  255|    774|    if (num_secs > DW_SECT_RNGLISTS) {
  ------------------
  |  | 1093|    774|#define DW_SECT_RNGLISTS    8  /* .debug_rnglists.dwo    DWARF5 */
  ------------------
  |  Branch (255:9): [True: 84, False: 690]
  ------------------
  256|     84|        dwarfstring m;
  257|       |
  258|     84|        dwarfstring_constructor(&m);
  259|     84|        dwarfstring_append_printf_s(&m,
  260|     84|            "DW_DLE_XU_NAME_COL_ERROR: "
  261|     84|            " %s index section header ",
  262|     84|            (char *)section_type);
  263|     84|        dwarfstring_append_printf_u(&m,
  264|     84|            "shows N, the sections count, "
  265|     84|            "as %u but only values "
  266|     84|            " 1 through 8 (DW_SECT_RNGLISTS) are valid.",
  267|     84|            num_secs);
  268|     84|        _dwarf_error_string(dbg,error,DW_DLE_XU_NAME_COL_ERROR,
  ------------------
  |  | 1244|     84|#define DW_DLE_XU_NAME_COL_ERROR               270
  ------------------
  269|     84|            dwarfstring_string(&m));
  270|     84|        dwarfstring_destructor(&m);
  271|     84|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     84|#define DW_DLV_ERROR     1
  ------------------
  272|     84|    }
  273|    690|    data += datalen32;
  274|       |    /* reading U */
  275|    690|    READ_UNALIGNED_CK(dbg,num_CUs, Dwarf_Unsigned,
  ------------------
  |  |  245|    690|    do  {                                        \
  |  |  246|    690|        desttype _ltmp = 0;                      \
  |  |  247|    690|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|    690|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 690]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|    690|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 690]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|    690|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|    690|            (source), (unsigned long)(length)) ; \
  |  |  264|    690|        (dest) = _ltmp;                          \
  |  |  265|    690|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  276|    690|        data,datalen32,
  277|    690|        error,section_end);
  278|    690|    data += datalen32;
  279|       |    /* reading S */
  280|    690|    READ_UNALIGNED_CK(dbg,num_slots, Dwarf_Unsigned,
  ------------------
  |  |  245|    690|    do  {                                        \
  |  |  246|    690|        desttype _ltmp = 0;                      \
  |  |  247|    690|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|    690|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 690]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|    690|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 690]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|    690|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|    690|            (source), (unsigned long)(length)) ; \
  |  |  264|    690|        (dest) = _ltmp;                          \
  |  |  265|    690|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  281|    690|        data,datalen32,
  282|    690|        error,section_end);
  283|    690|    hash_tab_offset = datalen32*4;
  284|    690|    indexes_tab_offset = hash_tab_offset +
  285|    690|        (num_slots * HASHSIGNATURELEN);
  ------------------
  |  |   86|    690|#define  HASHSIGNATURELEN 8
  ------------------
  286|       |    /*  Look for corrupt section data. */
  287|    690|    if (num_slots > sect->dss_size) {
  ------------------
  |  Branch (287:9): [True: 132, False: 558]
  ------------------
  288|    132|        dwarfstring m;
  289|       |
  290|    132|        dwarfstring_constructor(&m);
  291|    132|        dwarfstring_append_printf_s(&m,
  292|    132|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION: "
  293|    132|            "The size of the %s ",(char *)section_type);
  294|    132|        dwarfstring_append_printf_u(&m,
  295|    132|            " is just %u bytes,",sect->dss_size);
  296|    132|        dwarfstring_append_printf_u(&m,
  297|    132|            "while the number of slots (S) is %u. "
  298|    132|            "which is clearly wrong",num_slots );
  299|    132|        _dwarf_error_string(dbg, error,
  300|    132|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|    132|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  301|    132|            dwarfstring_string(&m));
  302|    132|        dwarfstring_destructor(&m);
  303|    132|        return DW_DLV_ERROR;
  ------------------
  |  |  123|    132|#define DW_DLV_ERROR     1
  ------------------
  304|    132|    }
  305|    558|    if ( (4*num_slots) > sect->dss_size) {
  ------------------
  |  Branch (305:10): [True: 69, False: 489]
  ------------------
  306|     69|        dwarfstring m;
  307|       |
  308|     69|        dwarfstring_constructor(&m);
  309|     69|        dwarfstring_append_printf_s(&m,
  310|     69|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION: "
  311|     69|            "The size of the %s ",(char *)section_type);
  312|     69|        dwarfstring_append_printf_u(&m,
  313|     69|            " is just %u bytes,",sect->dss_size);
  314|     69|        dwarfstring_append_printf_u(&m,
  315|     69|            "while the number of slots bytes (S) is at least %u. "
  316|     69|            "which is clearly wrong",num_slots*4);
  317|     69|        _dwarf_error_string(dbg, error,
  318|     69|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|     69|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  319|     69|            dwarfstring_string(&m));
  320|     69|        dwarfstring_destructor(&m);
  321|     69|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     69|#define DW_DLV_ERROR     1
  ------------------
  322|     69|    }
  323|       |
  324|       |    /*  This offset is to  1 row of N columns, each 32bit. */
  325|    489|    section_offsets_headerline_offset = indexes_tab_offset +
  326|    489|        (num_slots *datalen32);
  327|       |    /*  Now we can make the real table part index normally.
  328|       |        This offset is to  U row of N columns, each 32bit. */
  329|    489|    section_offsets_tab_offset = section_offsets_headerline_offset
  330|    489|        + (num_secs*datalen32);
  331|    489|    if ( num_secs > sect->dss_size) {
  ------------------
  |  Branch (331:10): [True: 0, False: 489]
  ------------------
  332|      0|        dwarfstring m;
  333|       |
  334|      0|        dwarfstring_constructor(&m);
  335|      0|        dwarfstring_append_printf_s(&m,
  336|      0|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION: "
  337|      0|            "The size of the %s ",(char *)section_type);
  338|      0|        dwarfstring_append_printf_u(&m,
  339|      0|            " is just %u bytes,",sect->dss_size);
  340|      0|        dwarfstring_append_printf_u(&m,
  341|      0|            "while the number of sections/columns (S) is %u. "
  342|      0|            "which is clearly wrong",num_secs );
  343|      0|        _dwarf_error_string(dbg, error,
  344|      0|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|      0|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  345|      0|            dwarfstring_string(&m));
  346|      0|        dwarfstring_destructor(&m);
  347|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  348|      0|    }
  349|    489|    if ( (datalen32*num_secs) > sect->dss_size) {
  ------------------
  |  Branch (349:10): [True: 15, False: 474]
  ------------------
  350|     15|        dwarfstring m;
  351|       |
  352|     15|        dwarfstring_constructor(&m);
  353|     15|        dwarfstring_append_printf_s(&m,
  354|     15|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION: "
  355|     15|            "The size of the %s ",(char *)section_type);
  356|     15|        dwarfstring_append_printf_u(&m,
  357|     15|            " is just %u bytes,",sect->dss_size);
  358|     15|        dwarfstring_append_printf_u(&m,
  359|     15|            "while the number of sections/columns bytes (S)"
  360|     15|            " is at least %u. "
  361|     15|            "which is clearly wrong",num_secs*4);
  362|     15|        _dwarf_error_string(dbg, error,
  363|     15|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|     15|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  364|     15|            dwarfstring_string(&m));
  365|     15|        dwarfstring_destructor(&m);
  366|     15|        return DW_DLV_ERROR;
  ------------------
  |  |  123|     15|#define DW_DLV_ERROR     1
  ------------------
  367|     15|    }
  368|    474|    section_sizes_tab_offset = section_offsets_tab_offset +
  369|    474|        (num_CUs *num_secs* datalen32) ;
  370|    474|    tables_end_offset = section_sizes_tab_offset +
  371|    474|        (num_CUs * num_secs * datalen32);
  372|    474|    if ( tables_end_offset > sect->dss_size) {
  ------------------
  |  Branch (372:10): [True: 189, False: 285]
  ------------------
  373|       |        /* Something is badly wrong here. */
  374|    189|        dwarfstring m;
  375|       |
  376|    189|        dwarfstring_constructor(&m);
  377|    189|        dwarfstring_append_printf_u(&m,"ERROR: "
  378|    189|            "DW_DLE_ERRONEOUS_XU_INDEX_SECTION as the end offset "
  379|    189|            "0x%lx is greater than ",tables_end_offset);
  380|    189|        dwarfstring_append_printf_u(&m,"the section size "
  381|    189|            "0x%lx.",sect->dss_size);
  382|    189|        _dwarf_error_string(dbg, error,
  383|    189|            DW_DLE_ERRONEOUS_XU_INDEX_SECTION,
  ------------------
  |  | 1320|    189|#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
  ------------------
  384|    189|            dwarfstring_string(&m));
  385|    189|        dwarfstring_destructor(&m);
  386|    189|        return DW_DLV_ERROR;
  ------------------
  |  |  123|    189|#define DW_DLV_ERROR     1
  ------------------
  387|    189|    }
  388|    285|    indexptr = (Dwarf_Xu_Index_Header)
  389|    285|        _dwarf_get_alloc(dbg,DW_DLA_XU_INDEX,1);
  ------------------
  |  |  947|    285|#define DW_DLA_XU_INDEX        0x38  /* Dwarf_Xu_Index_Header */
  ------------------
  390|    285|    if (indexptr == NULL) {
  ------------------
  |  Branch (390:9): [True: 0, False: 285]
  ------------------
  391|      0|        _dwarf_error(dbg, error, DW_DLE_ALLOC_FAIL);
  ------------------
  |  | 1036|      0|#define DW_DLE_ALLOC_FAIL                       62
  ------------------
  392|      0|        return DW_DLV_ERROR;
  ------------------
  |  |  123|      0|#define DW_DLV_ERROR     1
  ------------------
  393|      0|    }
  394|       |    /*  Only "cu" or "tu" allowed, that is checked above.
  395|       |        But for safety we just copy the allowed bytes*/
  396|    285|    indexptr->gx_type[0] = section_type[0];
  397|    285|    indexptr->gx_type[1] = section_type[1];
  398|    285|    indexptr->gx_type[2] = 0;
  399|    285|    indexptr->gx_dbg = dbg;
  400|    285|    indexptr->gx_section_length = sect->dss_size;
  401|    285|    indexptr->gx_section_data   = sect->dss_data;
  402|    285|    indexptr->gx_section_name   = sect->dss_name;
  403|    285|    indexptr->gx_version        = local_version;
  404|    285|    indexptr->gx_column_count_sections = num_secs;
  405|    285|    indexptr->gx_units_in_index = num_CUs;
  406|    285|    indexptr->gx_slots_in_hash  = num_slots;
  407|    285|    indexptr->gx_hash_table_offset  =  hash_tab_offset;
  408|    285|    indexptr->gx_index_table_offset = indexes_tab_offset;
  409|    285|    indexptr->gx_section_offsets_headerline_offset=
  410|    285|        section_offsets_headerline_offset;
  411|    285|    indexptr->gx_section_offsets_offset= section_offsets_tab_offset;
  412|    285|    indexptr->gx_section_sizes_offset  = section_sizes_tab_offset;
  413|    285|    res = fill_in_offsets_headerline(dbg,indexptr,
  414|    285|        section_offsets_headerline_offset,
  415|    285|        num_secs,error);
  416|    285|    if (res != DW_DLV_OK) {
  ------------------
  |  |  122|    285|#define DW_DLV_OK        0
  ------------------
  |  Branch (416:9): [True: 51, False: 234]
  ------------------
  417|     51|        dwarf_dealloc(dbg,indexptr,DW_DLA_XU_INDEX);
  ------------------
  |  |  947|     51|#define DW_DLA_XU_INDEX        0x38  /* Dwarf_Xu_Index_Header */
  ------------------
  418|     51|        return res;
  419|     51|    }
  420|    234|    *xuptr             =     indexptr;
  421|    234|    *version           = indexptr->gx_version;
  422|    234|    *number_of_columns = indexptr->gx_column_count_sections;
  423|    234|    *number_of_CUs     = indexptr->gx_units_in_index;
  424|    234|    *number_of_slots   = indexptr->gx_slots_in_hash;
  425|    234|    *section_name      = indexptr->gx_section_name;
  426|    234|    return DW_DLV_OK;
  ------------------
  |  |  122|    234|#define DW_DLV_OK        0
  ------------------
  427|    285|}
dwarf_dealloc_xu_header:
  988|    234|{
  989|    234|    if (indexptr) {
  ------------------
  |  Branch (989:9): [True: 234, False: 0]
  ------------------
  990|    234|        Dwarf_Debug dbg = indexptr->gx_dbg;
  991|    234|        dwarf_dealloc(dbg,indexptr,DW_DLA_XU_INDEX);
  ------------------
  |  |  947|    234|#define DW_DLA_XU_INDEX        0x38  /* Dwarf_Xu_Index_Header */
  ------------------
  992|    234|    }
  993|    234|}
dwarf_xu_index.c:fill_in_offsets_headerline:
  114|    285|{
  115|    285|    Dwarf_Small *section_start = xuhdr->gx_section_data;
  116|    285|    Dwarf_Small *section_end = xuhdr->gx_section_data+
  117|    285|        xuhdr->gx_section_length;
  118|    285|    Dwarf_Small *data = 0;
  119|    285|    unsigned i = 0;
  120|       |
  121|    285|    data = section_start +headerline_offset;
  122|    570|    for ( ; i < num_sects ; ++i) {
  ------------------
  |  Branch (122:13): [True: 336, False: 234]
  ------------------
  123|    336|        Dwarf_Unsigned v = 0;
  124|       |
  125|    336|        READ_UNALIGNED_CK(dbg,v, Dwarf_Unsigned,
  ------------------
  |  |  245|    336|    do  {                                        \
  |  |  246|    336|        desttype _ltmp = 0;                      \
  |  |  247|    336|        Dwarf_Byte_Ptr readend = (source)+(length); \
  |  |  248|    336|        if (readend < (source)) {                \
  |  |  ------------------
  |  |  |  Branch (248:13): [True: 0, False: 336]
  |  |  ------------------
  |  |  249|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  250|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  251|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  252|      0|                "Read starts past the end of section");\
  |  |  253|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  254|      0|        }                                        \
  |  |  255|    336|        if (readend > (endptr)) {                \
  |  |  ------------------
  |  |  |  Branch (255:13): [True: 0, False: 336]
  |  |  ------------------
  |  |  256|      0|            _dwarf_error_string((dbg), (error),  \
  |  |  257|      0|                DW_DLE_READ_LITTLEENDIAN_ERROR,  \
  |  |  ------------------
  |  |  |  | 1306|      0|#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
  |  |  ------------------
  |  |  258|      0|                "DW_DLE_READ_LITTLEENDIAN_ERROR "\
  |  |  259|      0|                "Read would end past the end of section");\
  |  |  260|      0|            return DW_DLV_ERROR;                 \
  |  |  ------------------
  |  |  |  |  123|      0|#define DW_DLV_ERROR     1
  |  |  ------------------
  |  |  261|      0|        }                                        \
  |  |  262|    336|        (dbg)->de_copy_word((char *)(&_ltmp),      \
  |  |  263|    336|            (source), (unsigned long)(length)) ; \
  |  |  264|    336|        (dest) = _ltmp;                          \
  |  |  265|    336|    } while (0)
  |  |  ------------------
  |  |  |  Branch (265:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  126|    336|            data,SIZEOFT32,
  127|    336|            error,section_end);
  128|    336|        data += SIZEOFT32;
  ------------------
  |  |   45|    336|#define SIZEOFT32 4
  ------------------
  129|    336|        if (v > DW_SECT_RNGLISTS) {
  ------------------
  |  | 1093|    336|#define DW_SECT_RNGLISTS    8  /* .debug_rnglists.dwo    DWARF5 */
  ------------------
  |  Branch (129:13): [True: 51, False: 285]
  ------------------
  130|     51|            dwarfstring s;
  131|       |
  132|     51|            dwarfstring_constructor(&s);
  133|     51|            dwarfstring_append_printf_u(&s,
  134|     51|                "ERROR: DW_DLE_XU_NAME_COL_ERROR  The "
  135|     51|                "section number of %u ",v);
  136|     51|            dwarfstring_append(&s," is too high. "
  137|     51|                "Sections 1-8 are listed in "
  138|     51|                "DWARF5 Table 7.1.");
  139|     51|            _dwarf_error_string(dbg, error, DW_DLE_XU_NAME_COL_ERROR,
  ------------------
  |  | 1244|     51|#define DW_DLE_XU_NAME_COL_ERROR               270
  ------------------
  140|     51|                dwarfstring_string(&s));
  141|     51|            dwarfstring_destructor(&s);
  142|     51|            return DW_DLV_ERROR;
  ------------------
  |  |  123|     51|#define DW_DLV_ERROR     1
  ------------------
  143|     51|        }
  144|    285|        xuhdr->gx_section_id[i] = (unsigned long)v;
  145|    285|    }
  146|    234|    return DW_DLV_OK;
  ------------------
  |  |  122|    234|#define DW_DLV_OK        0
  ------------------
  147|    285|}

