get_save_loc:
   34|    498|void get_save_loc(int regnum) {
   35|    498|  unw_cursor_t cursor;
   36|    498|  unw_context_t uc;
   37|    498|  unw_word_t reference_reg;
   38|       |
   39|    498|  unw_getcontext(&uc);
  ------------------
  |  |  131|    498|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|    498|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    498|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|    498|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|    498|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|    498|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|    498|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|    498|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|    498|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|    498|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|    498|  unw_save_loc_t loc;
   42|  4.48k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  4.48k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  4.48k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.48k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.48k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (42:10): [True: 3.98k, False: 498]
  ------------------
   43|  3.98k|    unw_get_save_loc(&cursor, regnum, &loc);
  ------------------
  |  |  293|  3.98k|#define unw_get_save_loc		UNW_OBJ(get_save_loc)
  |  |  ------------------
  |  |  |  |   48|  3.98k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  3.98k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.98k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|  3.98k|  }
   45|    498|}
get_random_reg:
   47|  1.49k|void get_random_reg(int regnum) {
   48|  1.49k|  unw_cursor_t cursor;
   49|  1.49k|  unw_context_t uc;
   50|  1.49k|  unw_word_t reference_reg;
   51|       |
   52|  1.49k|  unw_getcontext(&uc);
  ------------------
  |  |  131|  1.49k|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|  1.49k|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  1.49k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  1.49k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  1.49k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|  1.49k|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|  1.49k|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|  1.49k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  1.49k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.49k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  13.4k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  13.4k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  13.4k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  13.4k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  13.4k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (54:10): [True: 11.9k, False: 1.49k]
  ------------------
   55|  11.9k|    unw_get_reg(&cursor, regnum, &reference_reg);
  ------------------
  |  |  289|  11.9k|#define unw_get_reg			UNW_OBJ(get_reg)
  |  |  ------------------
  |  |  |  |   48|  11.9k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  11.9k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  11.9k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|  11.9k|  }
   57|  1.49k|}
check_is_signal:
   59|    158|void check_is_signal() {
   60|    158|  unw_cursor_t cursor;
   61|    158|  unw_context_t uc;
   62|    158|  unw_word_t reference_reg;
   63|       |
   64|    158|  unw_getcontext(&uc);
  ------------------
  |  |  131|    158|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|    158|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    158|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|    158|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|    158|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|    158|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|    158|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|    158|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|    158|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|    158|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|  1.42k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  1.42k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  1.42k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  1.42k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.42k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:10): [True: 1.26k, False: 158]
  ------------------
   67|  1.26k|    if (unw_is_signal_frame(&cursor)) {
  ------------------
  |  |  294|  1.26k|#define unw_is_signal_frame		UNW_OBJ(is_signal_frame)
  |  |  ------------------
  |  |  |  |   48|  1.26k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  1.26k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.26k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 1.26k]
  ------------------
   68|      0|      return;
   69|      0|    }
   70|  1.26k|  }
   71|    158|}
get_proc_name:
   73|  4.65k|void get_proc_name() {
   74|  4.65k|  unw_cursor_t cursor;
   75|  4.65k|  unw_context_t uc;
   76|       |
   77|  4.65k|  unw_getcontext(&uc);
  ------------------
  |  |  131|  4.65k|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|  4.65k|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  4.65k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  4.65k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  4.65k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|  4.65k|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|  4.65k|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|  4.65k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.65k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.65k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|  41.8k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  41.8k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  41.8k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  41.8k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  41.8k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (79:10): [True: 37.2k, False: 4.65k]
  ------------------
   80|  37.2k|    unw_word_t offset;
   81|  37.2k|    char buf[512];
   82|  37.2k|    unw_get_proc_name(&cursor, buf, sizeof(buf), &offset);
  ------------------
  |  |  296|  37.2k|#define unw_get_proc_name		UNW_OBJ(get_proc_name)
  |  |  ------------------
  |  |  |  |   48|  37.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  37.2k|  }
   84|  4.65k|}
dispatch:
   86|  8.59k|void dispatch(const uint8_t *data, size_t size) {
   87|  8.59k|  if (size < 8) {
  ------------------
  |  Branch (87:7): [True: 317, False: 8.27k]
  ------------------
   88|    317|    return;
   89|    317|  }
   90|  8.27k|  uint8_t decider = data[0] % 4;
   91|  8.27k|  data += 2;
   92|  8.27k|  size -= 2;
   93|  8.27k|  if (decider == 0) {
  ------------------
  |  Branch (93:7): [True: 4.97k, False: 3.30k]
  ------------------
   94|  4.97k|    recurse1(data, size);
   95|  4.97k|  } else if (decider == 1) {
  ------------------
  |  Branch (95:14): [True: 1.91k, False: 1.38k]
  ------------------
   96|  1.91k|    recurse2(data, size);
   97|  1.91k|  } else if (decider == 2) {
  ------------------
  |  Branch (97:14): [True: 615, False: 769]
  ------------------
   98|    615|    recurse3(data, size);
   99|    769|  } else {
  100|    769|    recurse4(data, size);
  101|    769|  }
  102|  8.27k|}
recurse1:
  104|  4.97k|void recurse1(const uint8_t *data, size_t size) {
  105|  4.97k|  if (data[0] == 0x01) {
  ------------------
  |  Branch (105:7): [True: 4.65k, False: 327]
  ------------------
  106|  4.65k|    get_proc_name();
  107|  4.65k|  }
  108|  4.97k|  data += 2;
  109|  4.97k|  size -= 2;
  110|       |
  111|  4.97k|  dispatch(data, size);
  112|  4.97k|  return;
  113|  4.97k|}
recurse2:
  115|  1.91k|void recurse2(const uint8_t *data, size_t size) {
  116|  1.91k|  if (data[0] == 0x01) {
  ------------------
  |  Branch (116:7): [True: 1.49k, False: 418]
  ------------------
  117|  1.49k|    get_random_reg((int)data[1]);
  118|  1.49k|  }
  119|  1.91k|  data += 2;
  120|  1.91k|  size -= 2;
  121|       |
  122|  1.91k|  dispatch(data, size);
  123|  1.91k|  return;
  124|  1.91k|}
recurse3:
  126|    615|void recurse3(const uint8_t *data, size_t size) {
  127|    615|  if (data[0] == 0x01) {
  ------------------
  |  Branch (127:7): [True: 158, False: 457]
  ------------------
  128|    158|    check_is_signal((int)data[1]);
  129|    158|  }
  130|    615|  data += 2;
  131|    615|  size -= 2;
  132|       |
  133|    615|  dispatch(data, size);
  134|    615|  return;
  135|    615|}
recurse4:
  137|    769|void recurse4(const uint8_t *data, size_t size) {
  138|    769|  if (data[0] == 0x01) {
  ------------------
  |  Branch (138:7): [True: 498, False: 271]
  ------------------
  139|    498|    get_save_loc((int)data[1]);
  140|    498|  }
  141|    769|  data += 2;
  142|    769|  size -= 2;
  143|       |
  144|    769|  dispatch(data, size);
  145|    769|  return;
  146|    769|}
LLVMFuzzerTestOneInput:
  148|    343|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  149|       |  // Ensure we have a bit of data but not too much to cause stackoverflows.
  150|    343|  if (size < 12 || size > 512) {
  ------------------
  |  Branch (150:7): [True: 6, False: 337]
  |  Branch (150:20): [True: 20, False: 317]
  ------------------
  151|     26|    return 0;
  152|     26|  }
  153|       |
  154|    317|  dispatch(data, size);
  155|    317|  return 0;
  156|    343|}

Lparser.c:dwarf_read_uleb128:
  297|    142|{
  298|    142|  unw_word_t val = 0, shift = 0;
  299|    142|  unsigned char byte;
  300|    142|  int ret;
  301|       |
  302|    142|  do
  303|    143|    {
  304|    143|      if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0)
  ------------------
  |  Branch (304:11): [True: 0, False: 143]
  ------------------
  305|      0|        return ret;
  306|       |
  307|    143|      val |= ((unw_word_t) byte & 0x7f) << shift;
  308|    143|      shift += 7;
  309|    143|    }
  310|    143|  while (byte & 0x80);
  ------------------
  |  Branch (310:10): [True: 1, False: 142]
  ------------------
  311|       |
  312|    142|  *valp = val;
  313|    142|  return 0;
  314|    142|}
Lparser.c:dwarf_readu8:
   92|    370|{
   93|    370|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   94|       |
   95|    370|  *val = mvp->u8;
   96|    370|  *addr += sizeof (mvp->u8);
   97|    370|  return 0;
   98|    370|}
Lparser.c:dwarf_readu16:
  103|      7|{
  104|      7|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
  105|       |
  106|      7|  *val = mvp->u16;
  107|      7|  *addr += sizeof (mvp->u16);
  108|      7|  return 0;
  109|      7|}
Lpe.c:dwarf_read_encoded_pointer_inlined:
  350|     75|{
  351|     75|  unw_word_t val, initial_addr = *addr;
  352|     75|  uint16_t uval16;
  353|     75|  uint32_t uval32;
  354|     75|  uint64_t uval64;
  355|     75|  int16_t sval16 = 0;
  356|     75|  int32_t sval32 = 0;
  357|     75|  int64_t sval64 = 0;
  358|     75|  int ret;
  359|       |
  360|       |  /* DW_EH_PE_omit and DW_EH_PE_aligned don't follow the normal
  361|       |     format/application encoding.  Handle them first.  */
  362|     75|  if (encoding == DW_EH_PE_omit)
  ------------------
  |  |  201|     75|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (362:7): [True: 15, False: 60]
  ------------------
  363|     15|    {
  364|     15|      *valp = 0;
  365|     15|      return 0;
  366|     15|    }
  367|     60|  else if (encoding == DW_EH_PE_aligned)
  ------------------
  |  |  221|     60|#define DW_EH_PE_aligned        0x50    /* aligned pointer */
  ------------------
  |  Branch (367:12): [True: 0, False: 60]
  ------------------
  368|      0|    {
  369|      0|      int size = dwarf_addr_size (as);
  ------------------
  |  |   15|      0|# define dwarf_addr_size(as) (sizeof (unw_word_t))
  ------------------
  370|      0|      *addr = (initial_addr + size - 1) & -size;
  371|      0|      return dwarf_readw (as, a, addr, valp, arg);
  372|      0|    }
  373|       |
  374|     60|  switch (encoding & DW_EH_PE_FORMAT_MASK)
  ------------------
  |  |  194|     60|#define DW_EH_PE_FORMAT_MASK    0x0f    /* format of the encoded value */
  ------------------
  375|     60|    {
  376|      0|    case DW_EH_PE_ptr:
  ------------------
  |  |  202|      0|#define DW_EH_PE_ptr            0x00    /* pointer-sized unsigned value */
  ------------------
  |  Branch (376:5): [True: 0, False: 60]
  ------------------
  377|      0|      if ((ret = dwarf_readw (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (377:11): [True: 0, False: 0]
  ------------------
  378|      0|        return ret;
  379|      0|      break;
  380|       |
  381|      0|    case DW_EH_PE_uleb128:
  ------------------
  |  |  203|      0|#define DW_EH_PE_uleb128        0x01    /* unsigned LE base-128 value */
  ------------------
  |  Branch (381:5): [True: 0, False: 60]
  ------------------
  382|      0|      if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (382:11): [True: 0, False: 0]
  ------------------
  383|      0|        return ret;
  384|      0|      break;
  385|       |
  386|      0|    case DW_EH_PE_udata2:
  ------------------
  |  |  204|      0|#define DW_EH_PE_udata2         0x02    /* unsigned 16-bit value */
  ------------------
  |  Branch (386:5): [True: 0, False: 60]
  ------------------
  387|      0|      if ((ret = dwarf_readu16 (as, a, addr, &uval16, arg)) < 0)
  ------------------
  |  Branch (387:11): [True: 0, False: 0]
  ------------------
  388|      0|        return ret;
  389|      0|      val = uval16;
  390|      0|      break;
  391|       |
  392|     15|    case DW_EH_PE_udata4:
  ------------------
  |  |  205|     15|#define DW_EH_PE_udata4         0x03    /* unsigned 32-bit value */
  ------------------
  |  Branch (392:5): [True: 15, False: 45]
  ------------------
  393|     15|      if ((ret = dwarf_readu32 (as, a, addr, &uval32, arg)) < 0)
  ------------------
  |  Branch (393:11): [True: 0, False: 15]
  ------------------
  394|      0|        return ret;
  395|     15|      val = uval32;
  396|     15|      break;
  397|       |
  398|      0|    case DW_EH_PE_udata8:
  ------------------
  |  |  206|      0|#define DW_EH_PE_udata8         0x04    /* unsigned 64-bit value */
  ------------------
  |  Branch (398:5): [True: 0, False: 60]
  ------------------
  399|      0|      if ((ret = dwarf_readu64 (as, a, addr, &uval64, arg)) < 0)
  ------------------
  |  Branch (399:11): [True: 0, False: 0]
  ------------------
  400|      0|        return ret;
  401|      0|      val = (unw_word_t) uval64;
  402|      0|      break;
  403|       |
  404|      0|    case DW_EH_PE_sleb128:
  ------------------
  |  |  207|      0|#define DW_EH_PE_sleb128        0x09    /* signed LE base-128 value */
  ------------------
  |  Branch (404:5): [True: 0, False: 60]
  ------------------
  405|      0|      if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (405:11): [True: 0, False: 0]
  ------------------
  406|      0|        return ret;
  407|      0|      break;
  408|       |
  409|      0|    case DW_EH_PE_sdata2:
  ------------------
  |  |  208|      0|#define DW_EH_PE_sdata2         0x0a    /* signed 16-bit value */
  ------------------
  |  Branch (409:5): [True: 0, False: 60]
  ------------------
  410|      0|      if ((ret = dwarf_reads16 (as, a, addr, &sval16, arg)) < 0)
  ------------------
  |  Branch (410:11): [True: 0, False: 0]
  ------------------
  411|      0|        return ret;
  412|      0|      val = sval16;
  413|      0|      break;
  414|       |
  415|     45|    case DW_EH_PE_sdata4:
  ------------------
  |  |  209|     45|#define DW_EH_PE_sdata4         0x0b    /* signed 32-bit value */
  ------------------
  |  Branch (415:5): [True: 45, False: 15]
  ------------------
  416|     45|      if ((ret = dwarf_reads32 (as, a, addr, &sval32, arg)) < 0)
  ------------------
  |  Branch (416:11): [True: 0, False: 45]
  ------------------
  417|      0|        return ret;
  418|     45|      val = sval32;
  419|     45|      break;
  420|       |
  421|      0|    case DW_EH_PE_sdata8:
  ------------------
  |  |  210|      0|#define DW_EH_PE_sdata8         0x0c    /* signed 64-bit value */
  ------------------
  |  Branch (421:5): [True: 0, False: 60]
  ------------------
  422|      0|      if ((ret = dwarf_reads64 (as, a, addr, &sval64, arg)) < 0)
  ------------------
  |  Branch (422:11): [True: 0, False: 0]
  ------------------
  423|      0|        return ret;
  424|      0|      val = (unw_word_t) sval64;
  425|      0|      break;
  426|       |
  427|      0|    default:
  ------------------
  |  Branch (427:5): [True: 0, False: 60]
  ------------------
  428|      0|      Debug (1, "unexpected encoding format 0x%x\n",
  429|      0|             encoding & DW_EH_PE_FORMAT_MASK);
  430|      0|      return -UNW_EINVAL;
  431|     60|    }
  432|       |
  433|     60|  if (val == 0)
  ------------------
  |  Branch (433:7): [True: 0, False: 60]
  ------------------
  434|      0|    {
  435|       |      /* 0 is a special value and always absolute.  */
  436|      0|      *valp = 0;
  437|      0|      return 0;
  438|      0|    }
  439|       |
  440|     60|  switch (encoding & DW_EH_PE_APPL_MASK)
  ------------------
  |  |  195|     60|#define DW_EH_PE_APPL_MASK      0x70    /* how the value is to be applied */
  ------------------
  441|     60|    {
  442|     30|    case DW_EH_PE_absptr:
  ------------------
  |  |  213|     30|#define DW_EH_PE_absptr         0x00    /* absolute value */
  ------------------
  |  Branch (442:5): [True: 30, False: 30]
  ------------------
  443|     30|      break;
  444|       |
  445|     30|    case DW_EH_PE_pcrel:
  ------------------
  |  |  214|     30|#define DW_EH_PE_pcrel          0x10    /* rel. to addr. of encoded value */
  ------------------
  |  Branch (445:5): [True: 30, False: 30]
  ------------------
  446|     30|      val += initial_addr;
  447|     30|      break;
  448|       |
  449|      0|    case DW_EH_PE_datarel:
  ------------------
  |  |  216|      0|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
  |  Branch (449:5): [True: 0, False: 60]
  ------------------
  450|       |      /* XXX For now, assume that data-relative addresses are relative
  451|       |         to the global pointer.  */
  452|      0|      val += pi->gp;
  453|      0|      break;
  454|       |
  455|      0|    case DW_EH_PE_funcrel:
  ------------------
  |  |  220|      0|#define DW_EH_PE_funcrel        0x40    /* start-of-procedure-relative */
  ------------------
  |  Branch (455:5): [True: 0, False: 60]
  ------------------
  456|      0|      val += pi->start_ip;
  457|      0|      break;
  458|       |
  459|      0|    case DW_EH_PE_textrel:
  ------------------
  |  |  215|      0|#define DW_EH_PE_textrel        0x20    /* text-relative (GCC-specific???) */
  ------------------
  |  Branch (459:5): [True: 0, False: 60]
  ------------------
  460|       |      /* XXX For now we don't support text-rel values.  If there is a
  461|       |         platform which needs this, we probably would have to add a
  462|       |         "segbase" member to unw_proc_info_t.  */
  463|      0|    default:
  ------------------
  |  Branch (463:5): [True: 0, False: 60]
  ------------------
  464|      0|      Debug (1, "unexpected application type 0x%x\n",
  465|      0|             encoding & DW_EH_PE_APPL_MASK);
  466|      0|      return -UNW_EINVAL;
  467|     60|    }
  468|       |
  469|       |  /* Trim off any extra bits.  Assume that sign extension isn't
  470|       |     required; the only place it is needed is MIPS kernel space
  471|       |     addresses.  */
  472|     60|  if (sizeof (val) > dwarf_addr_size (as))
  ------------------
  |  |   15|     60|# define dwarf_addr_size(as) (sizeof (unw_word_t))
  ------------------
  |  Branch (472:7): [Folded, False: 60]
  ------------------
  473|      0|    {
  474|      0|      assert (dwarf_addr_size (as) == 4);
  ------------------
  |  Branch (474:7): [Folded, False: 0]
  |  Branch (474:7): [Folded, False: 0]
  ------------------
  475|      0|      val = (uint32_t) val;
  476|      0|    }
  477|       |
  478|     60|  if (encoding & DW_EH_PE_indirect)
  ------------------
  |  |  198|     60|#define DW_EH_PE_indirect       0x80
  ------------------
  |  Branch (478:7): [True: 0, False: 60]
  ------------------
  479|      0|    {
  480|      0|      unw_word_t indirect_addr = val;
  481|       |
  482|      0|      if ((ret = dwarf_readw (as, a, &indirect_addr, &val, arg)) < 0)
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|        return ret;
  484|      0|    }
  485|       |
  486|     60|  *valp = val;
  487|     60|  return 0;
  488|     60|}
Lpe.c:dwarf_readu32:
  114|     15|{
  115|     15|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
  116|       |
  117|     15|  *val = mvp->u32;
  118|     15|  *addr += sizeof (mvp->u32);
  119|     15|  return 0;
  120|     15|}
Lpe.c:dwarf_reads32:
   70|     45|{
   71|     45|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   72|       |
   73|     45|  *val = mvp->s32;
   74|     45|  *addr += sizeof (mvp->s32);
   75|     45|  return 0;
   76|     45|}
Lfde.c:dwarf_readu32:
  114|     45|{
  115|     45|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
  116|       |
  117|     45|  *val = mvp->u32;
  118|     45|  *addr += sizeof (mvp->u32);
  119|     45|  return 0;
  120|     45|}
Lfde.c:dwarf_reads32:
   70|     15|{
   71|     15|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   72|       |
   73|     15|  *val = mvp->s32;
   74|     15|  *addr += sizeof (mvp->s32);
   75|     15|  return 0;
   76|     15|}
Lfde.c:dwarf_readu8:
   92|    150|{
   93|    150|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   94|       |
   95|    150|  *val = mvp->u8;
   96|    150|  *addr += sizeof (mvp->u8);
   97|    150|  return 0;
   98|    150|}
Lfde.c:dwarf_read_sleb128:
  322|     15|{
  323|     15|  unw_word_t val = 0, shift = 0;
  324|     15|  unsigned char byte;
  325|     15|  int ret;
  326|       |
  327|     15|  do
  328|     15|    {
  329|     15|      if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0)
  ------------------
  |  Branch (329:11): [True: 0, False: 15]
  ------------------
  330|      0|        return ret;
  331|       |
  332|     15|      val |= ((unw_word_t) byte & 0x7f) << shift;
  333|     15|      shift += 7;
  334|     15|    }
  335|     15|  while (byte & 0x80);
  ------------------
  |  Branch (335:10): [True: 0, False: 15]
  ------------------
  336|       |
  337|     15|  if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0)
  ------------------
  |  Branch (337:7): [True: 15, False: 0]
  |  Branch (337:42): [True: 15, False: 0]
  ------------------
  338|       |    /* sign-extend negative value */
  339|     15|    val |= ((unw_word_t) -1) << shift;
  340|       |
  341|     15|  *valp = val;
  342|     15|  return 0;
  343|     15|}
Lfde.c:dwarf_read_uleb128:
  297|     45|{
  298|     45|  unw_word_t val = 0, shift = 0;
  299|     45|  unsigned char byte;
  300|     45|  int ret;
  301|       |
  302|     45|  do
  303|     45|    {
  304|     45|      if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0)
  ------------------
  |  Branch (304:11): [True: 0, False: 45]
  ------------------
  305|      0|        return ret;
  306|       |
  307|     45|      val |= ((unw_word_t) byte & 0x7f) << shift;
  308|     45|      shift += 7;
  309|     45|    }
  310|     45|  while (byte & 0x80);
  ------------------
  |  Branch (310:10): [True: 0, False: 45]
  ------------------
  311|       |
  312|     45|  *valp = val;
  313|     45|  return 0;
  314|     45|}

elf64.c:mi_munmap:
  249|  37.2k|{
  250|  37.2k|#ifdef SYS_munmap
  251|  37.2k|  return syscall (SYS_munmap, addr, len);
  252|       |#else
  253|       |  return munmap (addr, len);
  254|       |#endif
  255|  37.2k|}
mempool.c:mi_mmap:
  227|      2|{
  228|      2|#if defined(SYS_mmap) && !defined(__i386__) && !defined(__s390x__)
  229|       |  /* Where supported, bypass libc and invoke the syscall directly. */
  230|       |# if defined(__FreeBSD__) // prefer over syscall on *BSD
  231|       |  long int ret = __syscall (SYS_mmap, addr, len, prot, flags, fd, offset);
  232|       |# else
  233|      2|  long int ret = syscall (SYS_mmap, addr, len, prot, flags, fd, offset);
  234|      2|# endif
  235|       |  // @todo this is very likely Linux specific
  236|      2|  if ((unsigned long int)ret > -4096UL)
  ------------------
  |  Branch (236:7): [True: 0, False: 2]
  ------------------
  237|      0|    return MAP_FAILED;
  238|      2|  else
  239|      2|    return (void *)ret;
  240|       |#else
  241|       |  /* Where direct syscalls are not supported, forward to the libc call. */
  242|       |  return mmap (addr, len, prot, flags, fd, offset);
  243|       |#endif
  244|      2|}
os-linux.c:mi_mmap:
  227|  74.4k|{
  228|  74.4k|#if defined(SYS_mmap) && !defined(__i386__) && !defined(__s390x__)
  229|       |  /* Where supported, bypass libc and invoke the syscall directly. */
  230|       |# if defined(__FreeBSD__) // prefer over syscall on *BSD
  231|       |  long int ret = __syscall (SYS_mmap, addr, len, prot, flags, fd, offset);
  232|       |# else
  233|  74.4k|  long int ret = syscall (SYS_mmap, addr, len, prot, flags, fd, offset);
  234|  74.4k|# endif
  235|       |  // @todo this is very likely Linux specific
  236|  74.4k|  if ((unsigned long int)ret > -4096UL)
  ------------------
  |  Branch (236:7): [True: 0, False: 74.4k]
  ------------------
  237|      0|    return MAP_FAILED;
  238|  74.4k|  else
  239|  74.4k|    return (void *)ret;
  240|       |#else
  241|       |  /* Where direct syscalls are not supported, forward to the libc call. */
  242|       |  return mmap (addr, len, prot, flags, fd, offset);
  243|       |#endif
  244|  74.4k|}
os-linux.c:mi_munmap:
  249|  37.2k|{
  250|  37.2k|#ifdef SYS_munmap
  251|  37.2k|  return syscall (SYS_munmap, addr, len);
  252|       |#else
  253|       |  return munmap (addr, len);
  254|       |#endif
  255|  37.2k|}
Laddress_validator.c:unw_page_start:
  361|   223k|{
  362|   223k|  return addr & ~(unw_page_size - 1);
  363|   223k|}

Linit_local.c:dwarf_build_as_arg:
  132|  6.80k|dwarf_build_as_arg(const ucontext_t *uc, const int validate) {
  133|  6.80k|  uintptr_t packed_args = (uintptr_t) uc;
  134|  6.80k|  assert((packed_args & AS_ARG_VALIDATE_MASK) == 0);
  ------------------
  |  Branch (134:3): [True: 0, False: 6.80k]
  |  Branch (134:3): [True: 6.80k, False: 0]
  ------------------
  135|  6.80k|  packed_args |= (AS_ARG_VALIDATE_MASK & validate);
  ------------------
  |  |  102|  6.80k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  136|  6.80k|  return (void *) packed_args;
  137|  6.80k|}
Linit_local.c:dwarf_get_uc:
  111|   122k|{
  112|   122k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (112:3): [True: 0, False: 122k]
  |  Branch (112:3): [True: 122k, False: 0]
  ------------------
  113|   122k|  return AS_ARG_GET_UC_PTR(cursor->as_arg);
  ------------------
  |  |  105|   122k|  ((ucontext_t *) ((uintptr_t) arg & AS_ARG_UCONTEXT_MASK))
  |  |  ------------------
  |  |  |  |  101|   122k|#define AS_ARG_UCONTEXT_MASK ~0x1UL
  |  |  ------------------
  ------------------
  114|   122k|}
Linit_local.c:dwarf_get:
  199|  13.6k|{
  200|  13.6k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  156|  13.6k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  13.6k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
  201|      0|    return -UNW_EBADREG;
  202|       |
  203|  13.6k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  145|  13.6k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  142|  13.6k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (145:33): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
  204|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  422|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  205|      0|                                     0, c->as_arg);
  206|  13.6k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  147|  13.6k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  140|  13.6k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (147:33): [True: 13.6k, False: 0]
  |  |  ------------------
  ------------------
  207|  13.6k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  421|  13.6k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  139|  13.6k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  208|  13.6k|                                     0, c->as_arg);
  209|  13.6k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (209:3): [True: 0, False: 0]
  |  Branch (209:3): [True: 0, False: 0]
  ------------------
  210|      0|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  211|      0|  return 0;
  212|      0|}
Lregs.c:dwarf_get:
  199|  70.9k|{
  200|  70.9k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  156|  70.9k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  70.9k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 0, False: 70.9k]
  |  |  ------------------
  ------------------
  201|      0|    return -UNW_EBADREG;
  202|       |
  203|  70.9k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  145|  70.9k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  142|  70.9k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (145:33): [True: 0, False: 70.9k]
  |  |  ------------------
  ------------------
  204|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  422|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  205|      0|                                     0, c->as_arg);
  206|  70.9k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  147|  70.9k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  140|  70.9k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (147:33): [True: 57.1k, False: 13.8k]
  |  |  ------------------
  ------------------
  207|  57.1k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  421|  57.1k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  139|  57.1k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  208|  57.1k|                                     0, c->as_arg);
  209|  70.9k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (209:3): [True: 0, False: 13.8k]
  |  Branch (209:3): [True: 13.8k, False: 0]
  ------------------
  210|  13.8k|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  139|  13.8k|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  211|  13.8k|  return 0;
  212|  13.8k|}
Lstep.c:dwarf_get_validate:
  118|  61.2k|{
  119|  61.2k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (119:3): [True: 0, False: 61.2k]
  |  Branch (119:3): [True: 61.2k, False: 0]
  ------------------
  120|  61.2k|  return AS_ARG_GET_VALIDATE(cursor->as_arg);
  ------------------
  |  |  107|  61.2k|  ((int) ((uintptr_t) arg & AS_ARG_VALIDATE_MASK))
  |  |  ------------------
  |  |  |  |  102|  61.2k|#define AS_ARG_VALIDATE_MASK 0x1UL
  |  |  ------------------
  ------------------
  121|  61.2k|}
Lstep.c:dwarf_set_validate:
  125|   122k|{
  126|   122k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (126:3): [True: 0, False: 122k]
  |  Branch (126:3): [True: 122k, False: 0]
  ------------------
  127|   122k|  uintptr_t *packed_args = (uintptr_t *) &cursor->as_arg;
  128|   122k|  *packed_args |= (AS_ARG_VALIDATE_MASK & validate);
  ------------------
  |  |  102|   122k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  129|   122k|}
Lparser.c:dwarf_get:
  199|  54.4k|{
  200|  54.4k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  156|  54.4k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  54.4k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 0, False: 54.4k]
  |  |  ------------------
  ------------------
  201|      0|    return -UNW_EBADREG;
  202|       |
  203|  54.4k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  145|  54.4k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  142|  54.4k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (145:33): [True: 0, False: 54.4k]
  |  |  ------------------
  ------------------
  204|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  422|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  205|      0|                                     0, c->as_arg);
  206|  54.4k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  147|  54.4k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  140|  54.4k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (147:33): [True: 54.4k, False: 0]
  |  |  ------------------
  ------------------
  207|  54.4k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  421|  54.4k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  139|  54.4k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  208|  54.4k|                                     0, c->as_arg);
  209|  54.4k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (209:3): [True: 0, False: 0]
  |  Branch (209:3): [True: 0, False: 0]
  ------------------
  210|      0|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  211|      0|  return 0;
  212|      0|}

_ULx86_64_dwarf_extract_proc_info_from_fde:
  237|     15|{
  238|     15|  unw_word_t fde_end_addr, cie_addr, cie_offset_addr, aug_end_addr = 0;
  239|     15|  unw_word_t start_ip, ip_range, aug_size, addr = *addrp;
  240|     15|  int ret;
  241|     15|  uint8_t ip_range_encoding;
  242|     15|  struct dwarf_cie_info dci;
  243|     15|  uint64_t u64val;
  244|     15|  uint32_t u32val;
  245|       |
  246|     15|  Debug (12, "FDE @ 0x%lx\n", (long) addr);
  247|       |
  248|     15|  memset (&dci, 0, sizeof (dci));
  249|       |
  250|     15|  if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0)
  ------------------
  |  Branch (250:7): [True: 0, False: 15]
  ------------------
  251|      0|    return ret;
  252|       |
  253|     15|  if (u32val != 0xffffffff)
  ------------------
  |  Branch (253:7): [True: 15, False: 0]
  ------------------
  254|     15|    {
  255|     15|      int32_t cie_offset = 0;
  256|       |
  257|       |      /* In some configurations, an FDE with a 0 length indicates the
  258|       |         end of the FDE-table.  */
  259|     15|      if (u32val == 0)
  ------------------
  |  Branch (259:11): [True: 0, False: 15]
  ------------------
  260|      0|        return -UNW_ENOINFO;
  261|       |
  262|       |      /* the FDE is in the 32-bit DWARF format */
  263|       |
  264|     15|      *addrp = fde_end_addr = addr + u32val;
  265|     15|      cie_offset_addr = addr;
  266|       |
  267|     15|      if ((ret = dwarf_reads32 (as, a, &addr, &cie_offset, arg)) < 0)
  ------------------
  |  Branch (267:11): [True: 0, False: 15]
  ------------------
  268|      0|        return ret;
  269|       |
  270|     15|      if (is_cie_id (cie_offset, is_debug_frame))
  ------------------
  |  Branch (270:11): [True: 0, False: 15]
  ------------------
  271|       |        /* ignore CIEs (happens during linear searches) */
  272|      0|        return 0;
  273|       |
  274|     15|      if (is_debug_frame)
  ------------------
  |  Branch (274:11): [True: 0, False: 15]
  ------------------
  275|      0|        cie_addr = base + cie_offset;
  276|     15|      else
  277|       |        /* DWARF says that the CIE_pointer in the FDE is a
  278|       |           .debug_frame-relative offset, but the GCC-generated .eh_frame
  279|       |           sections instead store a "pcrelative" offset, which is just
  280|       |           as fine as it's self-contained.  */
  281|     15|        cie_addr = cie_offset_addr - cie_offset;
  282|     15|    }
  283|      0|  else
  284|      0|    {
  285|      0|      int64_t cie_offset = 0;
  286|       |
  287|       |      /* the FDE is in the 64-bit DWARF format */
  288|       |
  289|      0|      if ((ret = dwarf_readu64 (as, a, &addr, &u64val, arg)) < 0)
  ------------------
  |  Branch (289:11): [True: 0, False: 0]
  ------------------
  290|      0|        return ret;
  291|       |
  292|      0|      *addrp = fde_end_addr = (unw_word_t) (addr + u64val);
  293|      0|      cie_offset_addr = addr;
  294|       |
  295|      0|      if ((ret = dwarf_reads64 (as, a, &addr, &cie_offset, arg)) < 0)
  ------------------
  |  Branch (295:11): [True: 0, False: 0]
  ------------------
  296|      0|        return ret;
  297|       |
  298|      0|      if (is_cie_id ((unw_word_t) cie_offset, is_debug_frame))
  ------------------
  |  Branch (298:11): [True: 0, False: 0]
  ------------------
  299|       |        /* ignore CIEs (happens during linear searches) */
  300|      0|        return 0;
  301|       |
  302|      0|      if (is_debug_frame)
  ------------------
  |  Branch (302:11): [True: 0, False: 0]
  ------------------
  303|      0|        cie_addr = (unw_word_t) (base + cie_offset);
  304|      0|      else
  305|       |        /* DWARF says that the CIE_pointer in the FDE is a
  306|       |           .debug_frame-relative offset, but the GCC-generated .eh_frame
  307|       |           sections instead store a "pcrelative" offset, which is just
  308|       |           as fine as it's self-contained.  */
  309|      0|        cie_addr = (unw_word_t) ((uint64_t) cie_offset_addr - cie_offset);
  310|      0|    }
  311|       |
  312|     15|  Debug (15, "looking for CIE at address %lx\n", (long) cie_addr);
  313|       |
  314|     15|  if ((ret = parse_cie (as, a, cie_addr, pi, &dci, is_debug_frame, arg)) < 0)
  ------------------
  |  Branch (314:7): [True: 0, False: 15]
  ------------------
  315|      0|    return ret;
  316|       |
  317|       |  /* IP-range has same encoding as FDE pointers, except that it's
  318|       |     always an absolute value: */
  319|     15|  ip_range_encoding = dci.fde_encoding & DW_EH_PE_FORMAT_MASK;
  ------------------
  |  |  194|     15|#define DW_EH_PE_FORMAT_MASK    0x0f    /* format of the encoded value */
  ------------------
  320|       |
  321|     15|  if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.fde_encoding,
  ------------------
  |  |  401|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (321:7): [True: 0, False: 15]
  ------------------
  322|     15|                                         pi, &start_ip, arg)) < 0
  323|     15|      || (ret = dwarf_read_encoded_pointer (as, a, &addr, ip_range_encoding,
  ------------------
  |  |  401|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (323:10): [True: 0, False: 15]
  ------------------
  324|     15|                                            pi, &ip_range, arg)) < 0)
  325|      0|    return ret;
  326|     15|  pi->start_ip = start_ip;
  327|     15|  pi->end_ip = start_ip + ip_range;
  328|     15|  pi->handler = dci.handler;
  329|       |
  330|     15|  if (dci.sized_augmentation)
  ------------------
  |  Branch (330:7): [True: 15, False: 0]
  ------------------
  331|     15|    {
  332|     15|      if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0)
  ------------------
  |  Branch (332:11): [True: 0, False: 15]
  ------------------
  333|      0|        return ret;
  334|     15|      aug_end_addr = addr + aug_size;
  335|     15|    }
  336|       |
  337|     15|  if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.lsda_encoding,
  ------------------
  |  |  401|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (337:7): [True: 0, False: 15]
  ------------------
  338|     15|                                         pi, &pi->lsda, arg)) < 0)
  339|      0|    return ret;
  340|       |
  341|     15|  Debug (15, "FDE covers IP 0x%lx-0x%lx, LSDA=0x%lx\n",
  342|     15|         (long) pi->start_ip, (long) pi->end_ip, (long) pi->lsda);
  343|       |
  344|     15|  if (need_unwind_info)
  ------------------
  |  Branch (344:7): [True: 15, False: 0]
  ------------------
  345|     15|    {
  346|     15|      pi->format = UNW_INFO_FORMAT_TABLE;
  347|     15|      pi->unwind_info_size = sizeof (dci);
  348|     15|      pi->unwind_info = mempool_alloc (&dwarf_cie_info_pool);
  ------------------
  |  |   56|     15|#define mempool_alloc(p)        UNWI_ARCH_OBJ(_mempool_alloc)(p)
  |  |  ------------------
  |  |  |  |  174|     15|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|     15|      if (!pi->unwind_info)
  ------------------
  |  Branch (349:11): [True: 0, False: 15]
  ------------------
  350|      0|        return -UNW_ENOMEM;
  351|       |
  352|     15|      if (dci.have_abi_marker)
  ------------------
  |  Branch (352:11): [True: 0, False: 15]
  ------------------
  353|      0|        {
  354|      0|          if ((ret = dwarf_readu16 (as, a, &addr, &dci.abi, arg)) < 0
  ------------------
  |  Branch (354:15): [True: 0, False: 0]
  ------------------
  355|      0|              || (ret = dwarf_readu16 (as, a, &addr, &dci.tag, arg)) < 0)
  ------------------
  |  Branch (355:18): [True: 0, False: 0]
  ------------------
  356|      0|            return ret;
  357|      0|          Debug (13, "Found ABI marker = (abi=%u, tag=%u)\n",
  358|      0|                 dci.abi, dci.tag);
  359|      0|        }
  360|       |
  361|     15|      if (dci.sized_augmentation)
  ------------------
  |  Branch (361:11): [True: 15, False: 0]
  ------------------
  362|     15|        dci.fde_instr_start = aug_end_addr;
  363|      0|      else
  364|      0|        dci.fde_instr_start = addr;
  365|     15|      dci.fde_instr_end = fde_end_addr;
  366|       |
  367|     15|      memcpy (pi->unwind_info, &dci, sizeof (dci));
  368|     15|    }
  369|     15|  return 0;
  370|     15|}
Lfde.c:is_cie_id:
   30|     15|{
   31|       |  /* The CIE ID is normally 0xffffffff (for 32-bit ELF) or
   32|       |     0xffffffffffffffff (for 64-bit ELF).  However, .eh_frame
   33|       |     uses 0.  */
   34|     15|  if (is_debug_frame)
  ------------------
  |  Branch (34:7): [True: 0, False: 15]
  ------------------
   35|      0|      return val == (unw_word_t)(-1);
   36|     15|  else
   37|     15|    return (val == 0);
   38|     15|}
Lfde.c:parse_cie:
   49|     15|{
   50|     15|  uint8_t version, ch, augstr[5], fde_encoding, handler_encoding;
   51|     15|  uint8_t address_size, segment_size;
   52|     15|  unw_word_t len, cie_end_addr, aug_size;
   53|     15|  uint32_t u32val;
   54|     15|  uint64_t u64val;
   55|     15|  size_t i;
   56|     15|  int ret;
   57|     15|# define STR2(x)        #x
   58|     15|# define STR(x)         STR2(x)
   59|       |
   60|       |  /* Pick appropriate default for FDE-encoding.  DWARF spec says
   61|       |     start-IP (initial_location) and the code-size (address_range) are
   62|       |     "address-unit sized constants".  The `R' augmentation can be used
   63|       |     to override this, but by default, we pick an address-sized unit
   64|       |     for fde_encoding.  */
   65|     15|  switch (dwarf_addr_size (as))
  ------------------
  |  |   15|     15|# define dwarf_addr_size(as) (sizeof (unw_word_t))
  ------------------
   66|     15|    {
   67|      0|    case 4:     fde_encoding = DW_EH_PE_udata4; break;
  ------------------
  |  |  205|      0|#define DW_EH_PE_udata4         0x03    /* unsigned 32-bit value */
  ------------------
  |  Branch (67:5): [True: 0, False: 15]
  ------------------
   68|     15|    case 8:     fde_encoding = DW_EH_PE_udata8; break;
  ------------------
  |  |  206|     15|#define DW_EH_PE_udata8         0x04    /* unsigned 64-bit value */
  ------------------
  |  Branch (68:5): [True: 15, False: 0]
  ------------------
   69|      0|    default:    fde_encoding = DW_EH_PE_omit; break;
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (69:5): [True: 0, False: 15]
  ------------------
   70|     15|    }
   71|       |
   72|     15|  dci->lsda_encoding = DW_EH_PE_omit;
  ------------------
  |  |  201|     15|#define DW_EH_PE_omit           0xff
  ------------------
   73|     15|  dci->handler = 0;
   74|       |
   75|     15|  if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0)
  ------------------
  |  Branch (75:7): [True: 0, False: 15]
  ------------------
   76|      0|    return ret;
   77|       |
   78|     15|  if (u32val != 0xffffffff)
  ------------------
  |  Branch (78:7): [True: 15, False: 0]
  ------------------
   79|     15|    {
   80|       |      /* the CIE is in the 32-bit DWARF format */
   81|     15|      uint32_t cie_id;
   82|       |      /* DWARF says CIE id should be 0xffffffff, but in .eh_frame, it's 0 */
   83|     15|      const uint32_t expected_id = (is_debug_frame) ? 0xffffffff : 0;
  ------------------
  |  Branch (83:36): [True: 0, False: 15]
  ------------------
   84|       |
   85|     15|      len = u32val;
   86|     15|      cie_end_addr = addr + len;
   87|     15|      if ((ret = dwarf_readu32 (as, a, &addr, &cie_id, arg)) < 0)
  ------------------
  |  Branch (87:11): [True: 0, False: 15]
  ------------------
   88|      0|        return ret;
   89|     15|      if (cie_id != expected_id)
  ------------------
  |  Branch (89:11): [True: 0, False: 15]
  ------------------
   90|      0|        {
   91|      0|          Debug (1, "Unexpected CIE id %x\n", cie_id);
   92|      0|          return -UNW_EINVAL;
   93|      0|        }
   94|     15|    }
   95|      0|  else
   96|      0|    {
   97|       |      /* the CIE is in the 64-bit DWARF format */
   98|      0|      uint64_t cie_id;
   99|       |      /* DWARF says CIE id should be 0xffffffffffffffff, but in
  100|       |         .eh_frame, it's 0 */
  101|      0|      const uint64_t expected_id = (is_debug_frame) ? 0xffffffffffffffffull : 0;
  ------------------
  |  Branch (101:36): [True: 0, False: 0]
  ------------------
  102|       |
  103|      0|      if ((ret = dwarf_readu64 (as, a, &addr, &u64val, arg)) < 0)
  ------------------
  |  Branch (103:11): [True: 0, False: 0]
  ------------------
  104|      0|        return ret;
  105|      0|      len = (unw_word_t) u64val;
  106|      0|      cie_end_addr = addr + len;
  107|      0|      if ((ret = dwarf_readu64 (as, a, &addr, &cie_id, arg)) < 0)
  ------------------
  |  Branch (107:11): [True: 0, False: 0]
  ------------------
  108|      0|        return ret;
  109|      0|      if (cie_id != expected_id)
  ------------------
  |  Branch (109:11): [True: 0, False: 0]
  ------------------
  110|      0|        {
  111|      0|          Debug (1, "Unexpected CIE id %llx\n", (long long) cie_id);
  112|      0|          return -UNW_EINVAL;
  113|      0|        }
  114|      0|    }
  115|     15|  dci->cie_instr_end = cie_end_addr;
  116|       |
  117|     15|  if ((ret = dwarf_readu8 (as, a, &addr, &version, arg)) < 0)
  ------------------
  |  Branch (117:7): [True: 0, False: 15]
  ------------------
  118|      0|    return ret;
  119|       |
  120|       |  /* GCC emits version 1??? */
  121|     15|  if (version != 1 && (version < DWARF_CIE_VERSION || version > DWARF_CIE_VERSION_MAX))
  ------------------
  |  |  142|      0|#define DWARF_CIE_VERSION       3
  ------------------
                if (version != 1 && (version < DWARF_CIE_VERSION || version > DWARF_CIE_VERSION_MAX))
  ------------------
  |  |  143|      0|#define DWARF_CIE_VERSION_MAX   4
  ------------------
  |  Branch (121:7): [True: 0, False: 15]
  |  Branch (121:24): [True: 0, False: 0]
  |  Branch (121:55): [True: 0, False: 0]
  ------------------
  122|      0|    {
  123|      0|      Debug (1, "Got CIE version %u, expected version 1 or between "
  124|      0|             STR (DWARF_CIE_VERSION) " and " STR (DWARF_CIE_VERSION_MAX) "\n", version);
  125|      0|      return -UNW_EBADVERSION;
  126|      0|    }
  127|       |
  128|       |  /* read and parse the augmentation string: */
  129|     15|  memset (augstr, 0, sizeof (augstr));
  130|     15|  for (i = 0;;)
  131|     45|    {
  132|     45|      if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0)
  ------------------
  |  Branch (132:11): [True: 0, False: 45]
  ------------------
  133|      0|        return ret;
  134|       |
  135|     45|      if (!ch)
  ------------------
  |  Branch (135:11): [True: 15, False: 30]
  ------------------
  136|     15|        break;  /* end of augmentation string */
  137|       |
  138|     30|      if (i < sizeof (augstr) - 1)
  ------------------
  |  Branch (138:11): [True: 30, False: 0]
  ------------------
  139|     30|        augstr[i++] = ch;
  140|     30|    }
  141|       |
  142|     15|  if (version > 3)
  ------------------
  |  Branch (142:7): [True: 0, False: 15]
  ------------------
  143|      0|    {
  144|      0|      if((ret = dwarf_readu8(as, a, &addr, &address_size, arg)) < 0)
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  ------------------
  145|      0|	return ret;
  146|       |
  147|      0|      if((ret = dwarf_readu8(as, a, &addr, &segment_size, arg)) < 0)
  ------------------
  |  Branch (147:10): [True: 0, False: 0]
  ------------------
  148|      0|	return ret;
  149|      0|    }
  150|       |
  151|     15|  if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->code_align, arg)) < 0
  ------------------
  |  Branch (151:7): [True: 0, False: 15]
  ------------------
  152|     15|      || (ret = dwarf_read_sleb128 (as, a, &addr, &dci->data_align, arg)) < 0)
  ------------------
  |  Branch (152:10): [True: 0, False: 15]
  ------------------
  153|      0|    return ret;
  154|       |
  155|       |  /* Read the return-address column either as a u8 or as a uleb128.  */
  156|     15|  if (version == 1)
  ------------------
  |  Branch (156:7): [True: 15, False: 0]
  ------------------
  157|     15|    {
  158|     15|      if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0)
  ------------------
  |  Branch (158:11): [True: 0, False: 15]
  ------------------
  159|      0|        return ret;
  160|     15|      dci->ret_addr_column = ch;
  161|     15|    }
  162|      0|  else if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->ret_addr_column,
  ------------------
  |  Branch (162:12): [True: 0, False: 0]
  ------------------
  163|      0|                                      arg)) < 0)
  164|      0|    return ret;
  165|       |
  166|     15|  i = 0;
  167|     15|  if (augstr[0] == 'z')
  ------------------
  |  Branch (167:7): [True: 15, False: 0]
  ------------------
  168|     15|    {
  169|     15|      dci->sized_augmentation = 1;
  170|     15|      if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0)
  ------------------
  |  Branch (170:11): [True: 0, False: 15]
  ------------------
  171|      0|        return ret;
  172|     15|      i++;
  173|     15|    }
  174|       |
  175|     30|  for (; i < sizeof (augstr) && augstr[i]; ++i)
  ------------------
  |  Branch (175:10): [True: 30, False: 0]
  |  Branch (175:33): [True: 15, False: 15]
  ------------------
  176|     15|    switch (augstr[i])
  177|     15|      {
  178|      0|      case 'L':
  ------------------
  |  Branch (178:7): [True: 0, False: 15]
  ------------------
  179|       |        /* read the LSDA pointer-encoding format.  */
  180|      0|        if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0)
  ------------------
  |  Branch (180:13): [True: 0, False: 0]
  ------------------
  181|      0|          return ret;
  182|      0|        dci->lsda_encoding = ch;
  183|      0|        break;
  184|       |
  185|     15|      case 'R':
  ------------------
  |  Branch (185:7): [True: 15, False: 0]
  ------------------
  186|       |        /* read the FDE pointer-encoding format.  */
  187|     15|        if ((ret = dwarf_readu8 (as, a, &addr, &fde_encoding, arg)) < 0)
  ------------------
  |  Branch (187:13): [True: 0, False: 15]
  ------------------
  188|      0|          return ret;
  189|     15|        break;
  190|       |
  191|     15|      case 'P':
  ------------------
  |  Branch (191:7): [True: 0, False: 15]
  ------------------
  192|       |        /* read the personality-routine pointer-encoding format.  */
  193|      0|        if ((ret = dwarf_readu8 (as, a, &addr, &handler_encoding, arg)) < 0)
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  ------------------
  194|      0|          return ret;
  195|      0|        if ((ret = dwarf_read_encoded_pointer (as, a, &addr, handler_encoding,
  ------------------
  |  |  401|      0|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|                                               pi, &dci->handler, arg)) < 0)
  197|      0|          return ret;
  198|      0|        break;
  199|       |
  200|      0|      case 'S':
  ------------------
  |  Branch (200:7): [True: 0, False: 15]
  ------------------
  201|       |        /* This is a signal frame. */
  202|      0|        dci->signal_frame = 1;
  203|       |
  204|       |        /* Temporarily set it to one so dwarf_parse_fde() knows that
  205|       |           it should fetch the actual ABI/TAG pair from the FDE.  */
  206|      0|        dci->have_abi_marker = 1;
  207|      0|        break;
  208|       |
  209|      0|      default:
  ------------------
  |  Branch (209:7): [True: 0, False: 15]
  ------------------
  210|      0|        Debug (1, "Unexpected augmentation string `%s'\n", augstr);
  211|      0|        if (dci->sized_augmentation)
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|       |          /* If we have the size of the augmentation body, we can skip
  213|       |             over the parts that we don't understand, so we're OK. */
  214|      0|          goto done;
  215|      0|        else
  216|      0|          return -UNW_EINVAL;
  217|     15|      }
  218|     15| done:
  219|     15|  dci->fde_encoding = fde_encoding;
  220|     15|  dci->cie_instr_start = addr;
  221|     15|  Debug (15, "CIE parsed OK, augmentation = \"%s\", handler=0x%lx\n",
  222|     15|         augstr, (long) dci->handler);
  223|     15|  return 0;
  224|     15|}

_ULx86_64_dwarf_callback:
  549|     23|{
  550|     23|  struct dwarf_callback_data *cb_data = ptr;
  551|     23|  unw_dyn_info_t *di = &cb_data->di;
  552|     23|  const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text;
  553|     23|  unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip;
  554|     23|  Elf_W(Addr) load_base, max_load_addr = 0;
  ------------------
  |  |   41|     23|# define Elf_W(x)       Elf64_##x
  ------------------
  555|     23|  int ret, need_unwind_info = cb_data->need_unwind_info;
  556|     23|  unw_proc_info_t *pi = cb_data->pi;
  557|     23|  struct dwarf_eh_frame_hdr *hdr = NULL;
  558|     23|  unw_accessors_t *a;
  559|     23|  long n;
  560|     23|  int found = 0;
  561|     23|  struct dwarf_eh_frame_hdr synth_eh_frame_hdr;
  562|       |#ifdef CONFIG_DEBUG_FRAME
  563|       |  unw_word_t start, end;
  564|       |#endif /* CONFIG_DEBUG_FRAME*/
  565|       |
  566|     23|  ip = cb_data->ip;
  567|       |
  568|       |  /* Make sure struct dl_phdr_info is at least as big as we need.  */
  569|     23|  if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
  ------------------
  |  Branch (569:7): [True: 0, False: 23]
  ------------------
  570|     23|             + sizeof (info->dlpi_phnum))
  571|      0|    return -1;
  572|       |
  573|     23|  Debug (15, "checking %s, base=0x%lx)\n",
  574|     23|         info->dlpi_name, (long) info->dlpi_addr);
  575|       |
  576|     23|  phdr = info->dlpi_phdr;
  577|     23|  load_base = info->dlpi_addr;
  578|     23|  p_text = NULL;
  579|     23|  p_eh_hdr = NULL;
  580|     23|  p_dynamic = NULL;
  581|       |
  582|       |  /* See if PC falls into one of the loaded segments.  Find the
  583|       |     eh-header segment at the same time.  */
  584|    289|  for (n = info->dlpi_phnum; --n >= 0; phdr++)
  ------------------
  |  Branch (584:30): [True: 266, False: 23]
  ------------------
  585|    266|    {
  586|    266|      if (phdr->p_type == PT_LOAD)
  ------------------
  |  Branch (586:11): [True: 89, False: 177]
  ------------------
  587|     89|        {
  588|     89|          Elf_W(Addr) vaddr = phdr->p_vaddr + load_base;
  ------------------
  |  |   41|     89|# define Elf_W(x)       Elf64_##x
  ------------------
  589|       |
  590|     89|          if (ip >= vaddr && ip < vaddr + phdr->p_memsz)
  ------------------
  |  Branch (590:15): [True: 34, False: 55]
  |  Branch (590:30): [True: 15, False: 19]
  ------------------
  591|     15|            p_text = phdr;
  592|       |
  593|     89|          if (vaddr + phdr->p_filesz > max_load_addr)
  ------------------
  |  Branch (593:15): [True: 89, False: 0]
  ------------------
  594|     89|            max_load_addr = vaddr + phdr->p_filesz;
  595|     89|        }
  596|    177|      else if (phdr->p_type == PT_GNU_EH_FRAME)
  ------------------
  |  Branch (596:16): [True: 23, False: 154]
  ------------------
  597|     23|        p_eh_hdr = phdr;
  598|       |#if defined __sun
  599|       |      else if (phdr->p_type == PT_SUNW_UNWIND)
  600|       |        p_eh_hdr = phdr;
  601|       |#endif
  602|    154|      else if (phdr->p_type == PT_DYNAMIC)
  ------------------
  |  Branch (602:16): [True: 23, False: 131]
  ------------------
  603|     23|        p_dynamic = phdr;
  604|    266|    }
  605|       |
  606|     23|  if (!p_text)
  ------------------
  |  Branch (606:7): [True: 8, False: 15]
  ------------------
  607|      8|    return 0;
  608|       |
  609|     15|  if (p_eh_hdr)
  ------------------
  |  Branch (609:7): [True: 15, False: 0]
  ------------------
  610|     15|    {
  611|     15|      hdr = (struct dwarf_eh_frame_hdr *) (p_eh_hdr->p_vaddr + load_base);
  612|     15|    }
  613|      0|  else
  614|      0|    {
  615|      0|      Elf_W (Addr) eh_frame;
  ------------------
  |  |   41|      0|# define Elf_W(x)       Elf64_##x
  ------------------
  616|      0|      Debug (1, "no .eh_frame_hdr section found\n");
  617|      0|      eh_frame = dwarf_find_eh_frame_section (info);
  618|      0|      if (eh_frame)
  ------------------
  |  Branch (618:11): [True: 0, False: 0]
  ------------------
  619|      0|        {
  620|      0|          Debug (1, "using synthetic .eh_frame_hdr section for %s\n",
  621|      0|                 info->dlpi_name);
  622|      0|	  synth_eh_frame_hdr.version = DW_EH_VERSION;
  ------------------
  |  |  108|      0|#define DW_EH_VERSION           1       /* The version we're implementing */
  ------------------
  623|      0|	  synth_eh_frame_hdr.eh_frame_ptr_enc = DW_EH_PE_absptr |
  ------------------
  |  |  213|      0|#define DW_EH_PE_absptr         0x00    /* absolute value */
  ------------------
  624|      0|	    ((sizeof(Elf_W (Addr)) == 4) ? DW_EH_PE_udata4 : DW_EH_PE_udata8);
  ------------------
  |  |  205|      0|#define DW_EH_PE_udata4         0x03    /* unsigned 32-bit value */
  ------------------
              	    ((sizeof(Elf_W (Addr)) == 4) ? DW_EH_PE_udata4 : DW_EH_PE_udata8);
  ------------------
  |  |  206|      0|#define DW_EH_PE_udata8         0x04    /* unsigned 64-bit value */
  ------------------
  |  Branch (624:7): [Folded, False: 0]
  ------------------
  625|      0|          synth_eh_frame_hdr.fde_count_enc = DW_EH_PE_omit;
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  626|      0|          synth_eh_frame_hdr.table_enc = DW_EH_PE_omit;
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  627|      0|	  synth_eh_frame_hdr.eh_frame = eh_frame;
  628|      0|          hdr = &synth_eh_frame_hdr;
  629|      0|        }
  630|      0|    }
  631|       |
  632|     15|  if (hdr)
  ------------------
  |  Branch (632:7): [True: 15, False: 0]
  ------------------
  633|     15|    {
  634|     15|      if (p_dynamic)
  ------------------
  |  Branch (634:11): [True: 15, False: 0]
  ------------------
  635|     15|        {
  636|       |          /* For dynamically linked executables and shared libraries,
  637|       |             DT_PLTGOT is the value that data-relative addresses are
  638|       |             relative to for that object.  We call this the "gp".  */
  639|     15|          Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(p_dynamic->p_vaddr + load_base);
  ------------------
  |  |   41|     15|# define Elf_W(x)       Elf64_##x
  ------------------
  640|    334|          for (; dyn->d_tag != DT_NULL; ++dyn)
  ------------------
  |  Branch (640:18): [True: 334, False: 0]
  ------------------
  641|    334|            if (dyn->d_tag == DT_PLTGOT)
  ------------------
  |  Branch (641:17): [True: 15, False: 319]
  ------------------
  642|     15|              {
  643|       |                /* Assume that _DYNAMIC is writable and GLIBC has
  644|       |                   relocated it (true for x86 at least).  */
  645|     15|                di->gp = dyn->d_un.d_ptr;
  646|     15|                break;
  647|     15|              }
  648|     15|        }
  649|      0|      else
  650|       |        /* Otherwise this is a static executable with no _DYNAMIC.  Assume
  651|       |           that data-relative addresses are relative to 0, i.e.,
  652|       |           absolute.  */
  653|      0|        di->gp = 0;
  654|     15|      pi->gp = di->gp;
  655|       |
  656|     15|      if (hdr->version != DW_EH_VERSION)
  ------------------
  |  |  108|     15|#define DW_EH_VERSION           1       /* The version we're implementing */
  ------------------
  |  Branch (656:11): [True: 0, False: 15]
  ------------------
  657|      0|        {
  658|      0|          Debug (1, "table `%s' has unexpected version %d\n",
  659|      0|                 info->dlpi_name, hdr->version);
  660|      0|          return 0;
  661|      0|        }
  662|       |
  663|     15|      a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  278|     15|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     15|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  664|     15|      addr = (unw_word_t) (uintptr_t) (&hdr->eh_frame);
  665|       |
  666|       |      /* (Optionally) read eh_frame_ptr: */
  667|     15|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  401|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (667:11): [True: 0, False: 15]
  ------------------
  668|     15|                                             &addr, hdr->eh_frame_ptr_enc, pi,
  669|     15|                                             &eh_frame_start, NULL)) < 0)
  670|      0|        return ret;
  671|       |
  672|       |      /* (Optionally) read fde_count: */
  673|     15|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  401|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (673:11): [True: 0, False: 15]
  ------------------
  674|     15|                                             &addr, hdr->fde_count_enc, pi,
  675|     15|                                             &fde_count, NULL)) < 0)
  676|      0|        return ret;
  677|       |
  678|     15|      if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  216|     15|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                    if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  209|     15|#define DW_EH_PE_sdata4         0x0b    /* signed 32-bit value */
  ------------------
  |  Branch (678:11): [True: 0, False: 15]
  ------------------
  679|      0|          && hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata8))
  ------------------
  |  |  216|      0|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                        && hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata8))
  ------------------
  |  |  210|      0|#define DW_EH_PE_sdata8         0x0c    /* signed 64-bit value */
  ------------------
  |  Branch (679:14): [True: 0, False: 0]
  ------------------
  680|      0|        {
  681|       |          /* If there is no search table or it has an unsupported
  682|       |             encoding, fall back on linear search.  */
  683|      0|          if (hdr->table_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (683:15): [True: 0, False: 0]
  ------------------
  684|      0|            {
  685|      0|              Debug (4, "table `%s' lacks search table; doing linear search\n",
  686|      0|                     info->dlpi_name);
  687|      0|            }
  688|      0|          else
  689|      0|            {
  690|      0|              Debug (4, "table `%s' has encoding 0x%x; doing linear search\n",
  691|      0|                     info->dlpi_name, hdr->table_enc);
  692|      0|            }
  693|       |
  694|      0|          eh_frame_end = max_load_addr; /* XXX can we do better? */
  695|       |
  696|      0|          if (hdr->fde_count_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (696:15): [True: 0, False: 0]
  ------------------
  697|      0|            fde_count = ~0UL;
  698|      0|          if (hdr->eh_frame_ptr_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (698:15): [True: 0, False: 0]
  ------------------
  699|      0|            abort ();
  700|       |
  701|      0|          Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n",
  702|      0|                 eh_frame_start, eh_frame_end);
  703|       |
  704|       |          /* XXX we know how to build a local binary search table for
  705|       |             .debug_frame, so we could do that here too.  */
  706|      0|          found = linear_search (unw_local_addr_space, ip,
  ------------------
  |  |  274|      0|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|      0|                                 eh_frame_start, eh_frame_end, fde_count,
  708|      0|                                 pi, need_unwind_info, NULL);
  709|      0|          if (found != 1)
  ------------------
  |  Branch (709:15): [True: 0, False: 0]
  ------------------
  710|      0|            found = 0;
  711|      0|	  else
  712|      0|	    cb_data->single_fde = 1;
  713|      0|        }
  714|     15|      else
  715|     15|        {
  716|     15|          int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  216|     15|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                        int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  210|     15|#define DW_EH_PE_sdata8         0x0c    /* signed 64-bit value */
  ------------------
  717|     15|          size_t entry_size = is_sdata8 ? sizeof (struct table_entry64)
  ------------------
  |  Branch (717:31): [True: 0, False: 15]
  ------------------
  718|     15|                                        : sizeof (struct table_entry);
  719|     15|          di->format = is_sdata8 ? UNW_INFO_FORMAT_REMOTE_TABLE_64
  ------------------
  |  Branch (719:24): [True: 0, False: 15]
  ------------------
  720|     15|                                 : UNW_INFO_FORMAT_REMOTE_TABLE;
  721|     15|          di->start_ip = p_text->p_vaddr + load_base;
  722|     15|          di->end_ip = p_text->p_vaddr + load_base + p_text->p_memsz;
  723|     15|          di->u.rti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name;
  724|     15|          di->u.rti.table_data = addr;
  725|     15|          assert (entry_size % sizeof (unw_word_t) == 0);
  ------------------
  |  Branch (725:11): [True: 0, False: 15]
  |  Branch (725:11): [True: 15, False: 0]
  ------------------
  726|     15|          di->u.rti.table_len = (fde_count * entry_size
  727|     15|                                 / sizeof (unw_word_t));
  728|       |          /* For the binary-search table in the eh_frame_hdr, data-relative
  729|       |             means relative to the start of that section... */
  730|     15|          di->u.rti.segbase = (unw_word_t) (uintptr_t) hdr;
  731|       |
  732|     15|          found = 1;
  733|     15|          Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, "
  734|     15|                 "table_data=0x%lx\n", (char *) (uintptr_t) di->u.rti.name_ptr,
  735|     15|                 (long) di->u.rti.segbase, (long) di->u.rti.table_len,
  736|     15|                 (long) di->gp, (long) di->u.rti.table_data);
  737|     15|        }
  738|     15|    }
  739|       |
  740|       |#ifdef CONFIG_DEBUG_FRAME
  741|       |  /* Find the start/end of the described region by parsing the phdr_info
  742|       |     structure.  */
  743|       |  start = (unw_word_t) -1;
  744|       |  end = 0;
  745|       |
  746|       |  for (n = 0; n < info->dlpi_phnum; n++)
  747|       |    {
  748|       |      if (info->dlpi_phdr[n].p_type == PT_LOAD)
  749|       |        {
  750|       |          unw_word_t seg_start = info->dlpi_addr + info->dlpi_phdr[n].p_vaddr;
  751|       |          unw_word_t seg_end = seg_start + info->dlpi_phdr[n].p_memsz;
  752|       |
  753|       |          if (seg_start < start)
  754|       |            start = seg_start;
  755|       |
  756|       |          if (seg_end > end)
  757|       |            end = seg_end;
  758|       |        }
  759|       |    }
  760|       |
  761|       |  found = dwarf_find_debug_frame (found, &cb_data->di_debug, ip,
  762|       |                                  info->dlpi_addr, info->dlpi_name, start,
  763|       |                                  end);
  764|       |#endif  /* CONFIG_DEBUG_FRAME */
  765|       |
  766|     15|  return found;
  767|     15|}
_ULx86_64_dwarf_find_proc_info:
  772|     15|{
  773|     15|  struct dwarf_callback_data cb_data;
  774|     15|  intrmask_t saved_mask;
  775|     15|  int ret;
  776|       |
  777|     15|  Debug (14, "looking for IP=0x%lx\n", (long) ip);
  778|       |
  779|     15|  memset (&cb_data, 0, sizeof (cb_data));
  780|     15|  cb_data.ip = ip;
  781|     15|  cb_data.pi = pi;
  782|     15|  cb_data.need_unwind_info = need_unwind_info;
  783|     15|  cb_data.di.format = -1;
  784|     15|  cb_data.di_debug.format = -1;
  785|       |
  786|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
  ------------------
  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  ------------------
  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  787|     15|  ret = as->iterate_phdr_function (dwarf_callback, &cb_data);
  ------------------
  |  |  386|     15|#define dwarf_callback                  UNW_OBJ (dwarf_callback)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|     15|  SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  ------------------
  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  ------------------
  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  789|       |
  790|     15|  if (ret > 0)
  ------------------
  |  Branch (790:7): [True: 15, False: 0]
  ------------------
  791|     15|    {
  792|     15|      if (cb_data.single_fde)
  ------------------
  |  Branch (792:11): [True: 0, False: 15]
  ------------------
  793|       |	/* already got the result in *pi */
  794|      0|	return 0;
  795|       |
  796|       |      /* search the table: */
  797|     15|      if (cb_data.di.format != -1)
  ------------------
  |  Branch (797:11): [True: 15, False: 0]
  ------------------
  798|     15|	ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di,
  ------------------
  |  |   60|     15|#define dwarf_search_unwind_table_int dwarf_search_unwind_table
  |  |  ------------------
  |  |  |  |  389|     15|#define dwarf_search_unwind_table       UNW_OBJ (dwarf_search_unwind_table)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|     15|					     pi, need_unwind_info, arg);
  800|      0|      else
  801|      0|	ret = -UNW_ENOINFO;
  802|       |
  803|     15|      if (ret == -UNW_ENOINFO && cb_data.di_debug.format != -1)
  ------------------
  |  Branch (803:11): [True: 0, False: 15]
  |  Branch (803:34): [True: 0, False: 0]
  ------------------
  804|      0|	ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di_debug, pi,
  ------------------
  |  |   60|      0|#define dwarf_search_unwind_table_int dwarf_search_unwind_table
  |  |  ------------------
  |  |  |  |  389|      0|#define dwarf_search_unwind_table       UNW_OBJ (dwarf_search_unwind_table)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|      0|					     need_unwind_info, arg);
  806|     15|    }
  807|      0|  else
  808|      0|    ret = -UNW_ENOINFO;
  809|       |
  810|     15|  return ret;
  811|     15|}
_ULx86_64_dwarf_search_unwind_table:
  887|     15|{
  888|     15|  unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr;
  889|     15|  unw_word_t found_start_ip_offset = 0, found_fde_offset = 0;
  890|     15|  int found_entry = 0;
  891|     15|  unw_accessors_t *a;
  892|     15|  int ret;
  893|     15|  unw_word_t debug_frame_base = 0;
  894|     15|  size_t table_len = 0;
  895|     15|  const void *table_data = NULL;
  896|     15|  int is_table64 = (di->format == UNW_INFO_FORMAT_REMOTE_TABLE_64);
  897|       |
  898|       |#ifdef UNW_REMOTE_ONLY
  899|       |  assert (is_remote_table(di->format));
  900|       |#else
  901|     15|  assert (is_remote_table(di->format)
  ------------------
  |  Branch (901:3): [True: 15, False: 0]
  |  Branch (901:3): [True: 0, False: 0]
  |  Branch (901:3): [True: 15, False: 0]
  |  Branch (901:3): [True: 0, False: 0]
  ------------------
  902|     15|          || di->format == UNW_INFO_FORMAT_TABLE);
  903|     15|#endif
  904|     15|  assert (ip >= di->start_ip && ip < di->end_ip);
  ------------------
  |  Branch (904:3): [True: 0, False: 15]
  |  Branch (904:3): [True: 0, False: 0]
  |  Branch (904:3): [True: 15, False: 0]
  |  Branch (904:3): [True: 15, False: 0]
  ------------------
  905|       |
  906|     15|  if (is_remote_table(di->format))
  ------------------
  |  Branch (906:7): [True: 15, False: 0]
  ------------------
  907|     15|    {
  908|     15|      table_data = (const void *) (uintptr_t) di->u.rti.table_data;
  909|     15|      table_len = di->u.rti.table_len * sizeof (unw_word_t);
  910|     15|      debug_frame_base = 0;
  911|     15|    }
  912|      0|  else
  913|      0|    {
  914|      0|      assert(di->format == UNW_INFO_FORMAT_TABLE);
  ------------------
  |  Branch (914:7): [True: 0, False: 0]
  |  Branch (914:7): [True: 0, False: 0]
  ------------------
  915|      0|#ifndef UNW_REMOTE_ONLY
  916|      0|      struct unw_debug_frame_list *fdesc = (void *) di->u.ti.table_data;
  917|       |
  918|       |      /* UNW_INFO_FORMAT_TABLE (i.e. .debug_frame) is read from local address
  919|       |         space.  Both the index and the unwind tables live in local memory, but
  920|       |         the address space to check for properties like the address size and
  921|       |         endianness is the target one.  */
  922|      0|      as = unw_local_addr_space;
  ------------------
  |  |  274|      0|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|      0|      table_data = fdesc->index;
  924|      0|      table_len = fdesc->index_size;
  925|      0|      debug_frame_base = (uintptr_t) fdesc->debug_frame;
  926|      0|#endif
  927|      0|    }
  928|       |
  929|     15|  a = unw_get_accessors_int (as);
  ------------------
  |  |  278|     15|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     15|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|       |
  931|     15|  segbase = di->u.rti.segbase;
  932|     15|  if (di->format == UNW_INFO_FORMAT_IP_OFFSET) {
  ------------------
  |  Branch (932:7): [True: 0, False: 15]
  ------------------
  933|      0|    ip_base = di->start_ip;
  934|     15|  } else {
  935|     15|    ip_base = segbase;
  936|     15|  }
  937|       |
  938|     15|#ifndef UNW_REMOTE_ONLY
  939|     15|  if (as == unw_local_addr_space)
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (939:7): [True: 15, False: 0]
  ------------------
  940|     15|    {
  941|     15|      if (is_table64)
  ------------------
  |  Branch (941:11): [True: 0, False: 15]
  ------------------
  942|      0|        {
  943|      0|          const struct table_entry64 *table64 = (const struct table_entry64 *) table_data;
  944|      0|          const struct table_entry64 *e64;
  945|      0|          e64 = lookup64 (table64, table_len, ip - ip_base);
  946|      0|          if (e64)
  ------------------
  |  Branch (946:15): [True: 0, False: 0]
  ------------------
  947|      0|            {
  948|      0|              found_entry = 1;
  949|      0|              found_start_ip_offset = (unw_word_t) e64->start_ip_offset;
  950|      0|              found_fde_offset = (unw_word_t) e64->fde_offset;
  951|      0|              if (&e64[1] < &table64[table_len / sizeof (struct table_entry64)])
  ------------------
  |  Branch (951:19): [True: 0, False: 0]
  ------------------
  952|      0|                last_ip = (unw_word_t) e64[1].start_ip_offset + ip_base;
  953|      0|              else
  954|      0|                last_ip = di->end_ip;
  955|      0|            }
  956|      0|        }
  957|     15|      else
  958|     15|        {
  959|     15|          const struct table_entry *table = (const struct table_entry *) table_data;
  960|     15|          const struct table_entry *e;
  961|     15|          e = lookup (table, table_len, ip - ip_base);
  962|     15|          if (e)
  ------------------
  |  Branch (962:15): [True: 15, False: 0]
  ------------------
  963|     15|            {
  964|     15|              found_entry = 1;
  965|     15|              found_start_ip_offset = (unw_word_t) e->start_ip_offset;
  966|     15|              found_fde_offset = (unw_word_t) e->fde_offset;
  967|     15|              if (&e[1] < &table[table_len / sizeof (struct table_entry)])
  ------------------
  |  Branch (967:19): [True: 15, False: 0]
  ------------------
  968|     15|                last_ip = e[1].start_ip_offset + ip_base;
  969|      0|              else
  970|      0|                last_ip = di->end_ip;
  971|     15|            }
  972|     15|        }
  973|     15|    }
  974|      0|  else
  975|      0|#endif
  976|      0|    {
  977|       |#ifndef UNW_LOCAL_ONLY
  978|       |      int64_t found_start = 0, found_fde = 0;
  979|       |      int64_t last_ip_offset64 = di->end_ip - ip_base;
  980|       |      segbase = di->u.rti.segbase;
  981|       |      if ((ret = remote_lookup (as, (uintptr_t) table_data, table_len,
  982|       |                                ip - ip_base, &found_start, &found_fde,
  983|       |                                &last_ip_offset64, is_table64, arg)) < 0)
  984|       |        return ret;
  985|       |      if (ret)
  986|       |        {
  987|       |          found_entry = 1;
  988|       |          found_start_ip_offset = (unw_word_t) found_start;
  989|       |          found_fde_offset = (unw_word_t) found_fde;
  990|       |          last_ip = (unw_word_t) last_ip_offset64 + ip_base;
  991|       |        }
  992|       |#endif
  993|      0|    }
  994|     15|  if (!found_entry)
  ------------------
  |  Branch (994:7): [True: 0, False: 15]
  ------------------
  995|      0|    {
  996|      0|      Debug (1, "IP %lx inside range %lx-%lx, but no explicit unwind info found\n",
  997|      0|             (long) ip, (long) di->start_ip, (long) di->end_ip);
  998|       |      /* IP is inside this table's range, but there is no explicit
  999|       |         unwind info.  */
 1000|      0|      return -UNW_ENOINFO;
 1001|      0|    }
 1002|     15|  Debug (15, "ip=0x%lx, start_ip=0x%lx\n",
 1003|     15|         (long) ip, (long) found_start_ip_offset);
 1004|     15|  if (debug_frame_base)
  ------------------
  |  Branch (1004:7): [True: 0, False: 15]
  ------------------
 1005|      0|    fde_addr = found_fde_offset + debug_frame_base;
 1006|     15|  else
 1007|     15|    fde_addr = found_fde_offset + segbase;
 1008|     15|  Debug (1, "fde_offset = %lx, segbase = %lx, debug_frame_base = %lx, "
 1009|     15|            "fde_addr = %lx\n", (long) found_fde_offset, (long) segbase,
 1010|     15|            (long) debug_frame_base, (long) fde_addr);
 1011|     15|  if ((ret = dwarf_extract_proc_info_from_fde (as, a, &fde_addr, pi,
  ------------------
  |  |  396|     15|                UNW_OBJ (dwarf_extract_proc_info_from_fde)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1011:7): [True: 0, False: 15]
  ------------------
 1012|     15|                                               debug_frame_base ?
  ------------------
  |  Branch (1012:48): [True: 0, False: 15]
  ------------------
 1013|     15|                                               debug_frame_base : segbase,
 1014|     15|                                               need_unwind_info,
 1015|     15|                                               debug_frame_base != 0, arg)) < 0)
 1016|      0|    return ret;
 1017|       |
 1018|       |  /* .debug_frame uses an absolute encoding that does not know about any
 1019|       |     shared library relocation.  */
 1020|     15|  if (di->format == UNW_INFO_FORMAT_TABLE)
  ------------------
  |  Branch (1020:7): [True: 0, False: 15]
  ------------------
 1021|      0|    {
 1022|      0|      pi->start_ip += segbase;
 1023|      0|      pi->end_ip += segbase;
 1024|      0|      pi->flags = UNW_PI_FLAG_DEBUG_FRAME;
  ------------------
  |  |  146|      0|#define UNW_PI_FLAG_DEBUG_FRAME	32
  ------------------
 1025|      0|    }
 1026|       |
 1027|       |#if defined(NEED_LAST_IP)
 1028|       |  pi->last_ip = last_ip;
 1029|       |#else
 1030|     15|  (void)last_ip;
 1031|     15|#endif
 1032|     15|  if (ip < pi->start_ip || ip >= pi->end_ip)
  ------------------
  |  Branch (1032:7): [True: 0, False: 15]
  |  Branch (1032:28): [True: 0, False: 15]
  ------------------
 1033|      0|    return -UNW_ENOINFO;
 1034|       |
 1035|     15|  return 0;
 1036|     15|}
Lfind_proc_info-lsb.c:is_remote_table:
  877|     30|{
  878|     30|  return (format == UNW_INFO_FORMAT_REMOTE_TABLE ||
  ------------------
  |  Branch (878:11): [True: 30, False: 0]
  ------------------
  879|      0|          format == UNW_INFO_FORMAT_REMOTE_TABLE_64 ||
  ------------------
  |  Branch (879:11): [True: 0, False: 0]
  ------------------
  880|      0|          format == UNW_INFO_FORMAT_IP_OFFSET);
  ------------------
  |  Branch (880:11): [True: 0, False: 0]
  ------------------
  881|     30|}

Lfind_proc_info-lsb.c:lookup:
   25|     15|{
   26|     15|  size_t table_len = table_size / sizeof (struct table_entry);
   27|     15|  const struct table_entry *e = NULL;
   28|     15|  size_t lo, hi, mid;
   29|       |
   30|       |  /* do a binary search for right entry: */
   31|    191|  for (lo = 0, hi = table_len; lo < hi;)
  ------------------
  |  Branch (31:32): [True: 176, False: 15]
  ------------------
   32|    176|    {
   33|    176|      mid = (lo + hi) / 2U;
   34|    176|      e = table + mid;
   35|    176|      Debug (15, "e->start_ip_offset = %lx\n", (long) e->start_ip_offset);
   36|    176|      if (rel_ip < e->start_ip_offset)
  ------------------
  |  Branch (36:11): [True: 87, False: 89]
  ------------------
   37|     87|        hi = mid;
   38|     89|      else
   39|     89|        lo = mid + 1U;
   40|    176|    }
   41|     15|  if (hi <= 0)
  ------------------
  |  Branch (41:7): [True: 0, False: 15]
  ------------------
   42|      0|        return NULL;
   43|     15|  e = table + hi - 1U;
   44|     15|  return e;
   45|     15|}

_ULx86_64_dwarf_flush_rs_cache:
  570|      1|{
  571|      1|  int i;
  572|       |
  573|      1|  if (cache->log_size == DWARF_DEFAULT_LOG_UNW_CACHE_SIZE
  ------------------
  |  |  336|      2|#define DWARF_DEFAULT_LOG_UNW_CACHE_SIZE        7
  ------------------
  |  Branch (573:7): [True: 0, False: 1]
  ------------------
  574|      1|      || !cache->hash) {
  ------------------
  |  Branch (574:10): [True: 1, False: 0]
  ------------------
  575|      1|    cache->hash = cache->default_hash;
  576|      1|    cache->buckets = cache->default_buckets;
  577|      1|    cache->links = cache->default_links;
  578|      1|    cache->log_size = DWARF_DEFAULT_LOG_UNW_CACHE_SIZE;
  ------------------
  |  |  336|      1|#define DWARF_DEFAULT_LOG_UNW_CACHE_SIZE        7
  ------------------
  579|      1|  } else {
  580|      0|    if (cache->hash && cache->hash != cache->default_hash)
  ------------------
  |  Branch (580:9): [True: 0, False: 0]
  |  Branch (580:24): [True: 0, False: 0]
  ------------------
  581|      0|      mi_munmap(cache->hash, DWARF_UNW_HASH_SIZE(cache->prev_log_size)
  ------------------
  |  |   35|      0|#define DWARF_UNW_HASH_SIZE(log_size)    (1 << (log_size + 1))
  ------------------
  582|      0|                              * sizeof (cache->hash[0]));
  583|      0|    if (cache->buckets && cache->buckets != cache->default_buckets)
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  |  Branch (583:27): [True: 0, False: 0]
  ------------------
  584|      0|      mi_munmap(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->prev_log_size)
  ------------------
  |  |   34|      0|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  585|      0|                              * sizeof (cache->buckets[0]));
  586|      0|    if (cache->links && cache->links != cache->default_links)
  ------------------
  |  Branch (586:9): [True: 0, False: 0]
  |  Branch (586:25): [True: 0, False: 0]
  ------------------
  587|      0|      mi_munmap(cache->links, DWARF_UNW_CACHE_SIZE(cache->prev_log_size)
  ------------------
  |  |   34|      0|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  588|      0|                              * sizeof (cache->links[0]));
  589|      0|    GET_MEMORY(cache->hash, DWARF_UNW_HASH_SIZE(cache->log_size)
  ------------------
  |  |  260|      0|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      0|do {                                                                        \
  |  |  262|      0|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      0|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      0|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  265|      0|    mem = NULL;                                                             \
  |  |  266|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  590|      0|                             * sizeof (cache->hash[0]));
  591|      0|    GET_MEMORY(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->log_size)
  ------------------
  |  |  260|      0|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      0|do {                                                                        \
  |  |  262|      0|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      0|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      0|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  265|      0|    mem = NULL;                                                             \
  |  |  266|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  592|      0|                                * sizeof (cache->buckets[0]));
  593|      0|    GET_MEMORY(cache->links, DWARF_UNW_CACHE_SIZE(cache->log_size)
  ------------------
  |  |  260|      0|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      0|do {                                                                        \
  |  |  262|      0|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      0|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      0|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  265|      0|    mem = NULL;                                                             \
  |  |  266|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  594|      0|                                * sizeof (cache->links[0]));
  595|      0|    if (!cache->hash || !cache->buckets || !cache->links)
  ------------------
  |  Branch (595:9): [True: 0, False: 0]
  |  Branch (595:25): [True: 0, False: 0]
  |  Branch (595:44): [True: 0, False: 0]
  ------------------
  596|      0|      {
  597|      0|        Debug (1, "Unable to allocate cache memory");
  598|      0|        return -UNW_ENOMEM;
  599|      0|      }
  600|      0|    cache->prev_log_size = cache->log_size;
  601|      0|  }
  602|       |
  603|      1|  cache->rr_head = 0;
  604|       |
  605|    129|  for (i = 0; i < DWARF_UNW_CACHE_SIZE(cache->log_size); ++i)
  ------------------
  |  |   34|    129|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  |  Branch (605:15): [True: 128, False: 1]
  ------------------
  606|    128|    {
  607|    128|      cache->links[i].coll_chain = -1;
  608|    128|      cache->links[i].ip = 0;
  609|    128|      cache->links[i].valid = 0;
  610|    128|    }
  611|    257|  for (i = 0; i< DWARF_UNW_HASH_SIZE(cache->log_size); ++i)
  ------------------
  |  |   35|    257|#define DWARF_UNW_HASH_SIZE(log_size)    (1 << (log_size + 1))
  ------------------
  |  Branch (611:15): [True: 256, False: 1]
  ------------------
  612|    256|    cache->hash[i] = -1;
  613|       |
  614|      1|  return 0;
  615|      1|}
_ULx86_64_dwarf_step:
 1056|  61.2k|{
 1057|  61.2k|  int ret;
 1058|  61.2k|  dwarf_state_record_t sr;
 1059|  61.2k|  if ((ret = find_reg_state (c, &sr)) < 0)
  ------------------
  |  Branch (1059:7): [True: 0, False: 61.2k]
  ------------------
 1060|      0|    return ret;
 1061|  61.2k|  return apply_reg_state (c, &sr.rs_current);
 1062|  61.2k|}
Lparser.c:find_reg_state:
  970|  61.2k|{
  971|  61.2k|  dwarf_reg_state_t *rs = NULL;
  972|  61.2k|  struct dwarf_rs_cache *cache;
  973|  61.2k|  int ret = 0;
  974|  61.2k|  intrmask_t saved_mask;
  975|       |
  976|  61.2k|  if ((cache = get_rs_cache(c->as, &saved_mask)) &&
  ------------------
  |  Branch (976:7): [True: 61.2k, False: 0]
  ------------------
  977|  61.2k|      (rs = rs_lookup(cache, c)))
  ------------------
  |  Branch (977:7): [True: 61.2k, False: 15]
  ------------------
  978|  61.2k|    {
  979|       |      /* update hint; no locking needed: single-word writes are atomic */
  980|  61.2k|      unsigned short index = (unsigned short) (rs - cache->buckets);
  981|  61.2k|      c->use_prev_instr = ! cache->links[index].signal_frame;
  982|  61.2k|      memcpy (&sr->rs_current, rs, sizeof (*rs));
  983|  61.2k|    }
  984|     15|  else
  985|     15|    {
  986|       |      /* Release the cache lock before looking up the saved locations.
  987|       |       * If we do not release the lock we risk deadlock if the lookup
  988|       |       * causes libunwind to be reentered.  */
  989|     15|      if (cache)
  ------------------
  |  Branch (989:11): [True: 15, False: 0]
  ------------------
  990|     15|	{
  991|     15|	  put_rs_cache (c->as, cache, &saved_mask);
  992|     15|	  cache = NULL;
  993|     15|	}
  994|       |
  995|     15|      assert (!cache);
  ------------------
  |  Branch (995:7): [True: 0, False: 15]
  |  Branch (995:7): [True: 15, False: 0]
  ------------------
  996|       |
  997|     15|      ret = fetch_proc_info (c, c->ip);
  998|     15|      int next_use_prev_instr = c->use_prev_instr;
  999|     15|      if (ret >= 0)
  ------------------
  |  Branch (999:11): [True: 15, False: 0]
  ------------------
 1000|     15|	{
 1001|       |	  /* Update use_prev_instr for the next frame. */
 1002|     15|	  assert(c->pi.unwind_info);
  ------------------
  |  Branch (1002:4): [True: 0, False: 15]
  |  Branch (1002:4): [True: 15, False: 0]
  ------------------
 1003|     15|	  struct dwarf_cie_info *dci = c->pi.unwind_info;
 1004|     15|	  next_use_prev_instr = ! dci->signal_frame;
 1005|     15|	  ret = create_state_record_for (c, sr, c->ip);
 1006|     15|	}
 1007|     15|      put_unwind_info (c, &c->pi);
 1008|     15|      c->use_prev_instr = next_use_prev_instr;
 1009|       |
 1010|       |      /* Reacquire the cache lock.  We repeat the lookup in case the
 1011|       |       * cache was updated by another thread while we did not hold the
 1012|       |       * lock.  */
 1013|     15|      if (ret >= 0)
  ------------------
  |  Branch (1013:11): [True: 15, False: 0]
  ------------------
 1014|     15|	cache = get_rs_cache (c->as, &saved_mask);
 1015|       |
 1016|     15|      if (cache)
  ------------------
  |  Branch (1016:11): [True: 15, False: 0]
  ------------------
 1017|     15|	{
 1018|     15|	  rs = rs_lookup (cache, c);
 1019|     15|	  if (rs)
  ------------------
  |  Branch (1019:8): [True: 0, False: 15]
  ------------------
 1020|      0|	    {
 1021|      0|	      memcpy (&sr->rs_current, rs, sizeof(*rs));
 1022|      0|	    }
 1023|     15|	  else
 1024|     15|	    {
 1025|     15|	      rs = rs_new (cache, c);
 1026|     15|	      cache->links[rs - cache->buckets].hint = 0;
 1027|     15|	      memcpy (rs, &sr->rs_current, sizeof(*rs));
 1028|     15|	    }
 1029|     15|	}
 1030|     15|    }
 1031|       |
 1032|  61.2k|  unsigned short index = -1;
 1033|  61.2k|  if (cache)
  ------------------
  |  Branch (1033:7): [True: 61.2k, False: 0]
  ------------------
 1034|  61.2k|    {
 1035|  61.2k|      if (rs)
  ------------------
  |  Branch (1035:11): [True: 61.2k, False: 0]
  ------------------
 1036|  61.2k|	{
 1037|  61.2k|	  index = (unsigned short) (rs - cache->buckets);
 1038|  61.2k|	  c->hint = cache->links[index].hint;
 1039|  61.2k|	  cache->links[c->prev_rs].hint = index + 1;
 1040|  61.2k|	  c->prev_rs = index;
 1041|  61.2k|	}
 1042|  61.2k|      if (ret >= 0)
  ------------------
  |  Branch (1042:11): [True: 61.2k, False: 0]
  ------------------
 1043|  61.2k|	{
 1044|  61.2k|	  assert (rs);
  ------------------
  |  Branch (1044:4): [True: 0, False: 61.2k]
  |  Branch (1044:4): [True: 61.2k, False: 0]
  ------------------
 1045|  61.2k|	  tdep_reuse_frame (c, cache->links[index].signal_frame);
  ------------------
  |  |  244|  61.2k|# define tdep_reuse_frame               UNW_OBJ(reuse_frame)
  |  |  ------------------
  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|  61.2k|	}
 1047|  61.2k|      put_rs_cache (c->as, cache, &saved_mask);
 1048|  61.2k|    }
 1049|  61.2k|  return ret;
 1050|  61.2k|}
Lparser.c:get_rs_cache:
  619|  61.2k|{
  620|  61.2k|  struct dwarf_rs_cache *cache = &as->global_cache;
  621|  61.2k|  unw_caching_policy_t caching = as->caching_policy;
  622|       |
  623|  61.2k|  if (caching == UNW_CACHE_NONE)
  ------------------
  |  Branch (623:7): [True: 0, False: 61.2k]
  ------------------
  624|      0|    return NULL;
  625|       |
  626|       |#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD
  627|       |  if (likely (caching == UNW_CACHE_PER_THREAD))
  628|       |    {
  629|       |      static thread_local struct dwarf_rs_cache tls_cache __attribute__((tls_model("initial-exec")));
  630|       |      Debug (16, "using TLS cache\n");
  631|       |      cache = &tls_cache;
  632|       |    }
  633|       |  else
  634|       |#else
  635|  61.2k|  if (likely (caching == UNW_CACHE_GLOBAL))
  ------------------
  |  |   67|  61.2k|#  define likely(x)     __builtin_expect ((x), 1)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 61.2k, False: 0]
  |  |  ------------------
  ------------------
  636|  61.2k|#endif
  637|  61.2k|    {
  638|  61.2k|      Debug (16, "acquiring lock\n");
  639|  61.2k|      lock_acquire (&cache->lock, *saved_maskp);
  ------------------
  |  |  211|  61.2k|#define lock_acquire(l,m)                               \
  |  |  212|  61.2k|do {                                                    \
  |  |  213|  61.2k|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|  61.2k|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 61.2k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|  61.2k|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|  61.2k|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|  61.2k|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 61.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|  61.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 61.2k]
  |  |  ------------------
  ------------------
  640|  61.2k|    }
  641|       |
  642|  61.2k|  if ((atomic_load (&as->cache_generation) != atomic_load (&cache->generation))
  ------------------
  |  Branch (642:7): [True: 1, False: 61.2k]
  ------------------
  643|  61.2k|       || !cache->hash)
  ------------------
  |  Branch (643:11): [True: 0, False: 61.2k]
  ------------------
  644|      1|    {
  645|       |      /* cache_size is only set in the global_cache, copy it over before flushing */
  646|      1|      cache->log_size = as->global_cache.log_size;
  647|      1|      if (dwarf_flush_rs_cache (cache) < 0)
  ------------------
  |  |  403|      1|#define dwarf_flush_rs_cache            UNW_OBJ (dwarf_flush_rs_cache)
  |  |  ------------------
  |  |  |  |   48|      1|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (647:11): [True: 0, False: 1]
  ------------------
  648|      0|        return NULL;
  649|      1|      atomic_store (&cache->generation, atomic_load (&as->cache_generation));
  650|      1|    }
  651|       |
  652|  61.2k|  return cache;
  653|  61.2k|}
Lparser.c:rs_lookup:
  683|  61.2k|{
  684|  61.2k|  unsigned short index;
  685|  61.2k|  unw_word_t ip = c->ip;
  686|       |
  687|  61.2k|  if (c->hint > 0)
  ------------------
  |  Branch (687:7): [True: 54.4k, False: 6.83k]
  ------------------
  688|  54.4k|    {
  689|  54.4k|      index = c->hint - 1;
  690|  54.4k|      if (cache_match (cache, index, ip))
  ------------------
  |  Branch (690:11): [True: 53.9k, False: 498]
  ------------------
  691|  53.9k|	return &cache->buckets[index];
  692|  54.4k|    }
  693|       |
  694|  7.33k|  for (index = cache->hash[hash (ip, cache->log_size)];
  695|  7.33k|       index < DWARF_UNW_CACHE_SIZE(cache->log_size);
  ------------------
  |  |   34|  7.33k|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  |  Branch (695:8): [True: 7.30k, False: 30]
  ------------------
  696|  7.33k|       index = cache->links[index].coll_chain)
  697|  7.30k|    {
  698|  7.30k|      if (cache_match (cache, index, ip))
  ------------------
  |  Branch (698:11): [True: 7.30k, False: 0]
  ------------------
  699|  7.30k|	return &cache->buckets[index];
  700|  7.30k|    }
  701|     30|  return NULL;
  702|  7.33k|}
Lparser.c:cache_match:
  677|  61.7k|{
  678|  61.7k|  return (cache->links[index].valid && (ip == cache->links[index].ip));
  ------------------
  |  Branch (678:11): [True: 61.7k, False: 0]
  |  Branch (678:40): [True: 61.2k, False: 498]
  ------------------
  679|  61.7k|}
Lparser.c:hash:
  668|  7.34k|{
  669|       |  /* based on (sqrt(5)/2-1)*2^64 */
  670|  7.34k|# define magic  ((unw_word_t) 0x9e3779b97f4a7c16ULL)
  671|       |
  672|  7.34k|  return (unw_hash_index_t) (ip * magic >> ((sizeof(unw_word_t) * 8) - (log_size + 1)));
  ------------------
  |  |  670|  7.34k|# define magic  ((unw_word_t) 0x9e3779b97f4a7c16ULL)
  ------------------
  673|  7.34k|}
Lparser.c:put_rs_cache:
  658|  61.2k|{
  659|  61.2k|  assert (as->caching_policy != UNW_CACHE_NONE);
  ------------------
  |  Branch (659:3): [True: 0, False: 61.2k]
  |  Branch (659:3): [True: 61.2k, False: 0]
  ------------------
  660|       |
  661|  61.2k|  Debug (16, "unmasking signals/interrupts and releasing lock\n");
  662|  61.2k|  if (likely (as->caching_policy == UNW_CACHE_GLOBAL))
  ------------------
  |  |   67|  61.2k|#  define likely(x)     __builtin_expect ((x), 1)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 61.2k, False: 0]
  |  |  ------------------
  ------------------
  663|       |    lock_release (&cache->lock, *saved_maskp);
  ------------------
  |  |  216|  61.2k|#define lock_release(l,m)                       \
  |  |  217|  61.2k|do {                                            \
  |  |  218|  61.2k|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|  61.2k|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 61.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|  61.2k|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|  61.2k|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 61.2k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|  61.2k|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|  61.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 61.2k]
  |  |  ------------------
  ------------------
  664|  61.2k|}
Lparser.c:rs_new:
  706|     15|{
  707|     15|  unw_hash_index_t index;
  708|     15|  unsigned short head;
  709|       |
  710|     15|  head = cache->rr_head;
  711|     15|  cache->rr_head = (head + 1) & (DWARF_UNW_CACHE_SIZE(cache->log_size) - 1);
  ------------------
  |  |   34|     15|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  712|       |
  713|       |  /* remove the old rs from the hash table (if it's there): */
  714|     15|  if (cache->links[head].ip)
  ------------------
  |  Branch (714:7): [True: 0, False: 15]
  ------------------
  715|      0|    {
  716|      0|      unsigned short *pindex;
  717|      0|      for (pindex = &cache->hash[hash (cache->links[head].ip, cache->log_size)];
  718|      0|	   *pindex < DWARF_UNW_CACHE_SIZE(cache->log_size);
  ------------------
  |  |   34|      0|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  |  Branch (718:5): [True: 0, False: 0]
  ------------------
  719|      0|	   pindex = &cache->links[*pindex].coll_chain)
  720|      0|	{
  721|      0|	  if (*pindex == head)
  ------------------
  |  Branch (721:8): [True: 0, False: 0]
  ------------------
  722|      0|	    {
  723|      0|	      *pindex = cache->links[*pindex].coll_chain;
  724|      0|	      break;
  725|      0|	    }
  726|      0|	}
  727|      0|    }
  728|       |
  729|       |  /* enter new rs in the hash table */
  730|     15|  index = hash (c->ip, cache->log_size);
  731|     15|  cache->links[head].coll_chain = cache->hash[index];
  732|     15|  cache->hash[index] = head;
  733|       |
  734|     15|  cache->links[head].ip = c->ip;
  735|     15|  cache->links[head].valid = 1;
  736|     15|  cache->links[head].signal_frame = tdep_cache_frame(c) ? 1 : 0;
  ------------------
  |  |  243|     15|# define tdep_cache_frame               UNW_OBJ(cache_frame)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (736:37): [True: 0, False: 15]
  ------------------
  737|     15|  return cache->buckets + head;
  738|     15|}
Lparser.c:apply_reg_state:
  811|  61.2k|{
  812|  61.2k|  unw_regnum_t regnum;
  813|  61.2k|  unw_word_t addr, cfa, ip;
  814|  61.2k|  unw_word_t prev_ip, prev_cfa;
  815|  61.2k|  unw_addr_space_t as;
  816|  61.2k|  dwarf_loc_t cfa_loc;
  817|  61.2k|  unw_accessors_t *a;
  818|  61.2k|  int i, ret;
  819|  61.2k|  void *arg;
  820|       |
  821|       |  /* In the case that we have incorrect CFI, the return address column may be
  822|       |   * outside the valid range of data and will read invalid data.  Protect
  823|       |   * against the errant read and indicate that we have a bad frame.  */
  824|  61.2k|  if (rs->ret_addr_column >= DWARF_NUM_PRESERVED_REGS) {
  ------------------
  |  |   38|  61.2k|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (824:7): [True: 0, False: 61.2k]
  ------------------
  825|      0|    Dprintf ("%s: return address entry %zu is outside of range of CIE",
  826|      0|             __FUNCTION__, rs->ret_addr_column);
  827|      0|    return -UNW_EBADFRAME;
  828|      0|  }
  829|       |
  830|  61.2k|  prev_ip = c->ip;
  831|  61.2k|  prev_cfa = c->cfa;
  832|       |
  833|  61.2k|  as = c->as;
  834|  61.2k|  arg = c->as_arg;
  835|  61.2k|  a = unw_get_accessors_int (as);
  ------------------
  |  |  278|  61.2k|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|  61.2k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  836|       |
  837|       |  /* Evaluate the CFA first, because it may be referred to by other
  838|       |     expressions.  */
  839|       |
  840|  61.2k|  if (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG)
  ------------------
  |  |  248|  61.2k|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|  61.2k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  |  Branch (840:7): [True: 61.2k, False: 0]
  ------------------
  841|  61.2k|    {
  842|       |      /* CFA is equal to [reg] + offset: */
  843|       |
  844|       |      /* As a special-case, if the stack-pointer is the CFA and the
  845|       |         stack-pointer wasn't saved, popping the CFA implicitly pops
  846|       |         the stack-pointer as well.  */
  847|  61.2k|      if ((rs->reg.val[DWARF_CFA_REG_COLUMN] == TDEP_DWARF_SP)
  ------------------
  |  |  248|  61.2k|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|  61.2k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
                    if ((rs->reg.val[DWARF_CFA_REG_COLUMN] == TDEP_DWARF_SP)
  ------------------
  |  |  427|  61.2k|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
  |  Branch (847:11): [True: 13.6k, False: 47.6k]
  ------------------
  848|  13.6k|          && (TDEP_DWARF_SP < ARRAY_SIZE(rs->reg.val))
  ------------------
  |  |  427|  13.6k|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
                        && (TDEP_DWARF_SP < ARRAY_SIZE(rs->reg.val))
  ------------------
  |  |   98|  13.6k|#define ARRAY_SIZE(a)   (sizeof (a) / sizeof ((a)[0]))
  ------------------
  |  Branch (848:14): [True: 0, Folded]
  ------------------
  849|  13.6k|          && (DWARF_IS_NULL_LOC(c->loc[TDEP_DWARF_SP])))
  ------------------
  |  |  156|  13.6k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  13.6k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  |  Branch (849:14): [True: 0, False: 13.6k]
  ------------------
  850|      0|          cfa = c->cfa;
  851|  61.2k|      else
  852|  61.2k|        {
  853|  61.2k|          regnum = dwarf_to_unw_regnum ((unw_regnum_t) rs->reg.val[DWARF_CFA_REG_COLUMN]);
  ------------------
  |  |   23|  61.2k|  (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
  |  |  ------------------
  |  |  |  |   41|  61.2k|#define DWARF_REGNUM_MAP_LENGTH         DWARF_NUM_PRESERVED_REGS
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  61.2k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
  |  |  ------------------
  |  |  |  |   19|  61.2k|# define dwarf_to_unw_regnum_map                UNW_OBJ (dwarf_to_unw_regnum_map)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (23:4): [True: 61.2k, False: 0]
  |  |  ------------------
  ------------------
  854|  61.2k|          if ((ret = unw_get_reg (dwarf_to_cursor(c), regnum, &cfa)) < 0)
  ------------------
  |  |  289|  61.2k|#define unw_get_reg			UNW_OBJ(get_reg)
  |  |  ------------------
  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                        if ((ret = unw_get_reg (dwarf_to_cursor(c), regnum, &cfa)) < 0)
  ------------------
  |  |   48|  61.2k|#define dwarf_to_cursor(c)      ((unw_cursor_t *) (c))
  ------------------
  |  Branch (854:15): [True: 0, False: 61.2k]
  ------------------
  855|      0|            return ret;
  856|  61.2k|        }
  857|  61.2k|      cfa += rs->reg.val[DWARF_CFA_OFF_COLUMN];
  ------------------
  |  |  249|  61.2k|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|  61.2k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  858|  61.2k|    }
  859|      0|  else
  860|      0|    {
  861|       |      /* CFA is equal to EXPR: */
  862|       |
  863|      0|      assert (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_EXPR);
  ------------------
  |  Branch (863:7): [True: 0, False: 0]
  |  Branch (863:7): [True: 0, False: 0]
  ------------------
  864|       |
  865|      0|      addr = rs->reg.val[DWARF_CFA_REG_COLUMN];
  ------------------
  |  |  248|      0|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  866|       |      /* The dwarf standard doesn't specify an initial value to be pushed on */
  867|       |      /* the stack before DW_CFA_def_cfa_expression evaluation. We push on a */
  868|       |      /* dummy value (0) to keep the eval_location_expr function consistent. */
  869|      0|      if ((ret = eval_location_expr (c, 0, as, a, addr, &cfa_loc, arg)) < 0)
  ------------------
  |  Branch (869:11): [True: 0, False: 0]
  ------------------
  870|      0|        return ret;
  871|       |      /* the returned location better be a memory location... */
  872|      0|      if (DWARF_IS_REG_LOC (cfa_loc))
  ------------------
  |  |  145|      0|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  142|      0|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (145:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  873|      0|        return -UNW_EBADFRAME;
  874|      0|      cfa = DWARF_GET_LOC (cfa_loc);
  ------------------
  |  |  139|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  875|      0|    }
  876|       |
  877|  61.2k|  dwarf_loc_t new_loc[DWARF_NUM_PRESERVED_REGS];
  878|  61.2k|  memcpy(new_loc, c->loc, sizeof(new_loc));
  879|       |
  880|  1.10M|  for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
  ------------------
  |  |   38|  1.10M|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (880:15): [True: 1.04M, False: 61.2k]
  ------------------
  881|  1.04M|    {
  882|  1.04M|      switch ((dwarf_where_t) rs->reg.where[i])
  ------------------
  |  Branch (882:15): [True: 1.04M, False: 0]
  ------------------
  883|  1.04M|        {
  884|  6.80k|        case DWARF_WHERE_UNDEF:
  ------------------
  |  Branch (884:9): [True: 6.80k, False: 1.03M]
  ------------------
  885|  6.80k|          new_loc[i] = DWARF_NULL_LOC;
  ------------------
  |  |  155|  6.80k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  886|  6.80k|          break;
  887|       |
  888|   673k|        case DWARF_WHERE_SAME:
  ------------------
  |  Branch (888:9): [True: 673k, False: 367k]
  ------------------
  889|   673k|          break;
  890|       |
  891|  61.2k|        case DWARF_WHERE_CFA:
  ------------------
  |  Branch (891:9): [True: 61.2k, False: 979k]
  ------------------
  892|  61.2k|          new_loc[i] = DWARF_VAL_LOC (c, cfa);
  ------------------
  |  |  151|  61.2k|# define DWARF_VAL_LOC(c,v)     DWARF_LOC ((v), DWARF_LOC_TYPE_VAL)
  |  |  ------------------
  |  |  |  |  150|  61.2k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  893|  61.2k|          break;
  894|       |
  895|   299k|        case DWARF_WHERE_CFAREL:
  ------------------
  |  Branch (895:9): [True: 299k, False: 741k]
  ------------------
  896|   299k|          new_loc[i] = DWARF_MEM_LOC (c, cfa + rs->reg.val[i]);
  ------------------
  |  |  152|   299k|# define DWARF_MEM_LOC(c,m)     DWARF_LOC ((m), DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  150|   299k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  897|   299k|          break;
  898|       |
  899|      0|        case DWARF_WHERE_REG:
  ------------------
  |  Branch (899:9): [True: 0, False: 1.04M]
  ------------------
  900|       |#ifdef __s390x__
  901|       |          /* GPRs can be saved in FPRs on s390x */
  902|       |          if (unw_is_fpreg (dwarf_to_unw_regnum (rs->reg.val[i])))
  903|       |            {
  904|       |              new_loc[i] = DWARF_FPREG_LOC (c, dwarf_to_unw_regnum (rs->reg.val[i]));
  905|       |              break;
  906|       |            }
  907|       |#endif
  908|      0|          new_loc[i] = new_loc[rs->reg.val[i]];
  909|      0|          break;
  910|       |
  911|      0|        case DWARF_WHERE_EXPR:
  ------------------
  |  Branch (911:9): [True: 0, False: 1.04M]
  ------------------
  912|      0|          addr = rs->reg.val[i];
  913|       |          /* The dwarf standard requires the current CFA to be pushed on the */
  914|       |          /* stack before DW_CFA_expression evaluation. */
  915|      0|          if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0)
  ------------------
  |  Branch (915:15): [True: 0, False: 0]
  ------------------
  916|      0|            return ret;
  917|      0|          break;
  918|       |
  919|      0|        case DWARF_WHERE_VAL_EXPR:
  ------------------
  |  Branch (919:9): [True: 0, False: 1.04M]
  ------------------
  920|      0|          addr = rs->reg.val[i];
  921|       |          /* The dwarf standard requires the current CFA to be pushed on the */
  922|       |          /* stack before DW_CFA_val_expression evaluation. */
  923|      0|          if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0)
  ------------------
  |  Branch (923:15): [True: 0, False: 0]
  ------------------
  924|      0|            return ret;
  925|      0|          new_loc[i] = DWARF_VAL_LOC (c, DWARF_GET_LOC (new_loc[i]));
  ------------------
  |  |  151|      0|# define DWARF_VAL_LOC(c,v)     DWARF_LOC ((v), DWARF_LOC_TYPE_VAL)
  |  |  ------------------
  |  |  |  |  150|      0|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  926|      0|          break;
  927|  1.04M|        }
  928|  1.04M|    }
  929|       |
  930|  61.2k|  memcpy(c->loc, new_loc, sizeof(new_loc));
  931|       |
  932|  61.2k|  c->cfa = cfa;
  933|       |  /* DWARF spec says undefined return address location means end of stack. */
  934|  61.2k|  if (DWARF_IS_NULL_LOC (c->loc[rs->ret_addr_column]))
  ------------------
  |  |  156|  61.2k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  61.2k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 6.80k, False: 54.4k]
  |  |  ------------------
  ------------------
  935|  6.80k|    {
  936|  6.80k|      c->ip = 0;
  937|  6.80k|    }
  938|  54.4k|  else
  939|  54.4k|  {
  940|  54.4k|    ret = dwarf_get (c, c->loc[rs->ret_addr_column], &ip);
  941|  54.4k|    if (ret < 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 54.4k]
  ------------------
  942|      0|      return ret;
  943|       |#ifdef UNW_TARGET_AARCH64
  944|       |    if (aarch64_get_ra_sign_state(rs))
  945|       |      {
  946|       |        ip = tdep_strip_ptrauth_insn_mask ((unw_cursor_t*)c, ip);
  947|       |      }
  948|       |#endif
  949|  54.4k|    c->ip = ip;
  950|  54.4k|  }
  951|  61.2k|  ret = (c->ip != 0) ? 1 : 0;
  ------------------
  |  Branch (951:9): [True: 54.4k, False: 6.80k]
  ------------------
  952|       |
  953|       |  /* XXX: check for ip to be code_aligned */
  954|  61.2k|  if (c->ip == prev_ip && c->cfa == prev_cfa)
  ------------------
  |  Branch (954:7): [True: 0, False: 61.2k]
  |  Branch (954:27): [True: 0, False: 0]
  ------------------
  955|      0|    {
  956|      0|      Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n",
  957|      0|               __FUNCTION__, (long) c->ip);
  958|      0|      return -UNW_EBADFRAME;
  959|      0|    }
  960|       |
  961|  61.2k|  if (c->stash_frames)
  ------------------
  |  Branch (961:7): [True: 0, False: 61.2k]
  ------------------
  962|      0|    tdep_stash_frame (c, rs);
  ------------------
  |  |  250|      0|#define tdep_stash_frame                UNW_OBJ(stash_frame)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|       |
  964|  61.2k|  return ret;
  965|  61.2k|}
Lparser.c:fetch_proc_info:
  437|     15|{
  438|     15|  int ret, dynamic = 1;
  439|       |
  440|       |  /* The 'ip' can point either to the previous or next instruction
  441|       |     depending on what type of frame we have: normal call or a place
  442|       |     to resume execution (e.g. after signal frame).
  443|       |
  444|       |     For a normal call frame we need to back up so we point within the
  445|       |     call itself; this is important because a) the call might be the
  446|       |     very last instruction of the function and the edge of the FDE,
  447|       |     and b) so that run_cfi_program() runs locations up to the call
  448|       |     but not more.
  449|       |
  450|       |     For signal frame, we need to do the exact opposite and look
  451|       |     up using the current 'ip' value.  That is where execution will
  452|       |     continue, and it's important we get this right, as 'ip' could be
  453|       |     right at the function entry and hence FDE edge, or at instruction
  454|       |     that manipulates CFA (push/pop). */
  455|       |
  456|     15|  if (c->use_prev_instr)
  ------------------
  |  Branch (456:7): [True: 15, False: 0]
  ------------------
  457|     15|    {
  458|       |#if defined(__arm__)
  459|       |      /* On arm, the least bit denotes thumb/arm mode, clear it. */
  460|       |      ip &= ~(unw_word_t)0x1;
  461|       |#endif
  462|     15|      --ip;
  463|     15|    }
  464|       |
  465|     15|  memset (&c->pi, 0, sizeof (c->pi));
  466|       |
  467|       |  /* check dynamic info first --- it overrides everything else */
  468|     15|  ret = unwi_find_dynamic_proc_info (c->as, ip, &c->pi, 1,
  ------------------
  |  |  268|     15|#define unwi_find_dynamic_proc_info     UNWI_OBJ(find_dynamic_proc_info)
  |  |  ------------------
  |  |  |  |  173|     15|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|     15|                                     c->as_arg);
  470|     15|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (470:7): [True: 15, False: 0]
  ------------------
  471|     15|    {
  472|     15|      dynamic = 0;
  473|     15|      if ((ret = tdep_find_proc_info (c, ip, 1)) < 0)
  ------------------
  |  |  256|     15|        dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n),      \
  |  |  ------------------
  |  |  |  |  387|     15|#define dwarf_find_proc_info            UNW_OBJ (dwarf_find_proc_info)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  257|     15|                                       (c)->as_arg)
  ------------------
  |  Branch (473:11): [True: 0, False: 15]
  ------------------
  474|      0|        return ret;
  475|     15|    }
  476|       |
  477|     15|  if (c->pi.format != UNW_INFO_FORMAT_DYNAMIC
  ------------------
  |  Branch (477:7): [True: 15, False: 0]
  ------------------
  478|     15|      && c->pi.format != UNW_INFO_FORMAT_TABLE
  ------------------
  |  Branch (478:10): [True: 0, False: 15]
  ------------------
  479|      0|      && c->pi.format != UNW_INFO_FORMAT_REMOTE_TABLE)
  ------------------
  |  Branch (479:10): [True: 0, False: 0]
  ------------------
  480|      0|    return -UNW_ENOINFO;
  481|       |
  482|     15|  c->pi_valid = 1;
  483|     15|  c->pi_is_dynamic = dynamic;
  484|       |
  485|       |  /* Let system/machine-dependent code determine frame-specific attributes. */
  486|     15|  if (ret >= 0)
  ------------------
  |  Branch (486:7): [True: 15, False: 0]
  ------------------
  487|     15|    tdep_fetch_frame (c, ip, 1);
  ------------------
  |  |  242|     15|# define tdep_fetch_frame               UNW_OBJ(fetch_frame)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|       |
  489|     15|  return ret;
  490|     15|}
Lparser.c:create_state_record_for:
  743|     15|{
  744|     15|  int ret;
  745|     15|  switch (c->pi.format)
  746|     15|    {
  747|     15|    case UNW_INFO_FORMAT_TABLE:
  ------------------
  |  Branch (747:5): [True: 15, False: 0]
  ------------------
  748|     15|    case UNW_INFO_FORMAT_REMOTE_TABLE:
  ------------------
  |  Branch (748:5): [True: 0, False: 15]
  ------------------
  749|     15|      if ((ret = setup_fde(c, sr)) < 0)
  ------------------
  |  Branch (749:11): [True: 0, False: 15]
  ------------------
  750|      0|	return ret;
  751|     15|      ret = parse_fde (c, ip, sr);
  752|     15|      break;
  753|       |
  754|      0|    case UNW_INFO_FORMAT_DYNAMIC:
  ------------------
  |  Branch (754:5): [True: 0, False: 15]
  ------------------
  755|      0|      ret = parse_dynamic (c, ip, sr);
  756|      0|      break;
  757|       |
  758|      0|    default:
  ------------------
  |  Branch (758:5): [True: 0, False: 15]
  ------------------
  759|      0|      Debug (1, "Unexpected unwind-info format %d\n", c->pi.format);
  760|      0|      ret = -UNW_EINVAL;
  761|     15|    }
  762|     15|  return ret;
  763|     15|}
Lparser.c:setup_fde:
  516|     15|{
  517|     15|  int i, ret;
  518|       |
  519|     15|  assert (c->pi_valid);
  ------------------
  |  Branch (519:3): [True: 0, False: 15]
  |  Branch (519:3): [True: 15, False: 0]
  ------------------
  520|       |
  521|     15|  memset (sr, 0, sizeof (*sr));
  522|    300|  for (i = 0; i < DWARF_NUM_PRESERVED_REGS + 2; ++i)
  ------------------
  |  |   38|    300|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (522:15): [True: 285, False: 15]
  ------------------
  523|    285|    set_reg (sr, i, DWARF_WHERE_SAME, 0);
  524|       |
  525|     15|#if !(defined(UNW_TARGET_MIPS) && _MIPS_SIM == _ABI64) \
  526|     15|    && !defined(UNW_TARGET_S390X)
  527|       |  /* SP defaults to CFA. s390x excluded: CFA = R15+160, so this default gives
  528|       |     caller's R15 = CFA instead of R15, breaking frameless functions like kill
  529|       |     that never emit DW_CFA_offset for R15. */
  530|     15|  set_reg (sr, TDEP_DWARF_SP, DWARF_WHERE_CFA, 0);
  ------------------
  |  |  427|     15|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
  531|     15|#endif
  532|       |
  533|     15|  struct dwarf_cie_info *dci = c->pi.unwind_info;
  534|     15|  sr->rs_current.ret_addr_column  = dci->ret_addr_column;
  535|     15|  unw_word_t addr = dci->cie_instr_start;
  536|     15|  unw_word_t curr_ip = 0;
  537|     15|  dwarf_stackable_reg_state_t *rs_stack = NULL;
  538|     15|  ret = run_cfi_program (c, sr, &curr_ip, ~(unw_word_t) 0, &addr,
  539|     15|			 dci->cie_instr_end,
  540|     15|			 &rs_stack, dci);
  541|     15|  empty_rstate_stack(&rs_stack);
  542|     15|  if (ret < 0)
  ------------------
  |  Branch (542:7): [True: 0, False: 15]
  ------------------
  543|      0|    return ret;
  544|       |
  545|     15|  memcpy (&sr->rs_initial, &sr->rs_current, sizeof (sr->rs_initial));
  546|     15|  return 0;
  547|     15|}
Lparser.c:set_reg:
   57|    442|{
   58|    442|  sr->rs_current.reg.where[regnum] = where;
   59|    442|  sr->rs_current.reg.val[regnum] = val;
   60|    442|}
Lparser.c:run_cfi_program:
  104|     30|{
  105|     30|  unw_addr_space_t as;
  106|     30|  void *arg;
  107|       |
  108|     30|  if (c->pi.flags & UNW_PI_FLAG_DEBUG_FRAME)
  ------------------
  |  |  146|     30|#define UNW_PI_FLAG_DEBUG_FRAME	32
  ------------------
  |  Branch (108:7): [True: 0, False: 30]
  ------------------
  109|      0|    {
  110|       |      /* .debug_frame CFI is stored in local address space.  */
  111|      0|      as = unw_local_addr_space;
  ------------------
  |  |  274|      0|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|      0|      arg = NULL;
  113|      0|    }
  114|     30|  else
  115|     30|    {
  116|     30|      as = c->as;
  117|     30|      arg = c->as_arg;
  118|     30|    }
  119|     30|  unw_accessors_t *a = unw_get_accessors_int (as);
  ------------------
  |  |  278|     30|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     30|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     30|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     30|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|     30|  int ret = 0;
  121|       |
  122|    252|  while (*ip <= end_ip && *addr < end_addr && ret >= 0)
  ------------------
  |  Branch (122:10): [True: 240, False: 12]
  |  Branch (122:27): [True: 222, False: 18]
  |  Branch (122:47): [True: 222, False: 0]
  ------------------
  123|    222|    {
  124|    222|      unw_word_t operand = 0, regnum, val, len;
  125|    222|      uint8_t u8, op;
  126|    222|      uint16_t u16;
  127|    222|      uint32_t u32;
  128|       |
  129|    222|      if ((ret = dwarf_readu8 (as, a, addr, &op, arg)) < 0)
  ------------------
  |  Branch (129:11): [True: 0, False: 222]
  ------------------
  130|      0|        break;
  131|       |
  132|    222|      if (op & DWARF_CFA_OPCODE_MASK)
  ------------------
  |  |  145|    222|#define DWARF_CFA_OPCODE_MASK   0xc0
  ------------------
  |  Branch (132:11): [True: 122, False: 100]
  ------------------
  133|    122|        {
  134|    122|          operand = op & DWARF_CFA_OPERAND_MASK;
  ------------------
  |  |  146|    122|#define DWARF_CFA_OPERAND_MASK  0x3f
  ------------------
  135|    122|          op &= ~DWARF_CFA_OPERAND_MASK;
  ------------------
  |  |  146|    122|#define DWARF_CFA_OPERAND_MASK  0x3f
  ------------------
  136|    122|        }
  137|    222|      switch ((dwarf_cfa_t) op)
  ------------------
  |  Branch (137:15): [True: 222, False: 0]
  ------------------
  138|    222|        {
  139|     48|        case DW_CFA_advance_loc:
  ------------------
  |  Branch (139:9): [True: 48, False: 174]
  ------------------
  140|     48|          *ip += operand * dci->code_align;
  141|     48|          Debug (15, "CFA_advance_loc to 0x%lx\n", (long) *ip);
  142|     48|          break;
  143|       |
  144|      5|        case DW_CFA_advance_loc1:
  ------------------
  |  Branch (144:9): [True: 5, False: 217]
  ------------------
  145|      5|          if ((ret = dwarf_readu8 (as, a, addr, &u8, arg)) < 0)
  ------------------
  |  Branch (145:15): [True: 0, False: 5]
  ------------------
  146|      0|            break;
  147|      5|          *ip += u8 * dci->code_align;
  148|      5|          Debug (15, "CFA_advance_loc1 to 0x%lx\n", (long) *ip);
  149|      5|          break;
  150|       |
  151|      7|        case DW_CFA_advance_loc2:
  ------------------
  |  Branch (151:9): [True: 7, False: 215]
  ------------------
  152|      7|          if ((ret = dwarf_readu16 (as, a, addr, &u16, arg)) < 0)
  ------------------
  |  Branch (152:15): [True: 0, False: 7]
  ------------------
  153|      0|            break;
  154|      7|          *ip += u16 * dci->code_align;
  155|      7|          Debug (15, "CFA_advance_loc2 to 0x%lx\n", (long) *ip);
  156|      7|          break;
  157|       |
  158|      0|        case DW_CFA_advance_loc4:
  ------------------
  |  Branch (158:9): [True: 0, False: 222]
  ------------------
  159|      0|          if ((ret = dwarf_readu32 (as, a, addr, &u32, arg)) < 0)
  ------------------
  |  Branch (159:15): [True: 0, False: 0]
  ------------------
  160|      0|            break;
  161|      0|          *ip += u32 * dci->code_align;
  162|      0|          Debug (15, "CFA_advance_loc4 to 0x%lx\n", (long) *ip);
  163|      0|          break;
  164|       |
  165|      0|        case DW_CFA_MIPS_advance_loc8:
  ------------------
  |  Branch (165:9): [True: 0, False: 222]
  ------------------
  166|       |#ifdef UNW_TARGET_MIPS
  167|       |          {
  168|       |            uint64_t u64 = 0;
  169|       |
  170|       |            if ((ret = dwarf_readu64 (as, a, addr, &u64, arg)) < 0)
  171|       |              break;
  172|       |            *ip += u64 * dci->code_align;
  173|       |            Debug (15, "CFA_MIPS_advance_loc8\n");
  174|       |            break;
  175|       |          }
  176|       |#else
  177|      0|          Debug (1, "DW_CFA_MIPS_advance_loc8 on non-MIPS target\n");
  178|      0|          ret = -UNW_EINVAL;
  179|      0|          break;
  180|      0|#endif
  181|       |
  182|     74|        case DW_CFA_offset:
  ------------------
  |  Branch (182:9): [True: 74, False: 148]
  ------------------
  183|     74|          regnum = operand;
  184|     74|          if (regnum >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|     74|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (184:15): [True: 0, False: 74]
  ------------------
  185|      0|            {
  186|      0|              Debug (1, "Invalid register number %u in DW_cfa_OFFSET\n",
  187|      0|                     (unsigned int) regnum);
  188|      0|              ret = -UNW_EBADREG;
  189|      0|              break;
  190|      0|            }
  191|     74|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (191:15): [True: 0, False: 74]
  ------------------
  192|      0|            break;
  193|     74|          set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  194|     74|          Debug (15, "CFA_offset r%lu at cfa+0x%lx\n",
  195|     74|                 (long) regnum, (long) (val * dci->data_align));
  196|     74|          break;
  197|       |
  198|      0|        case DW_CFA_offset_extended:
  ------------------
  |  Branch (198:9): [True: 0, False: 222]
  ------------------
  199|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (199:15): [True: 0, False: 0]
  ------------------
  200|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (200:18): [True: 0, False: 0]
  ------------------
  201|      0|            break;
  202|      0|          set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  203|      0|          Debug (15, "CFA_offset_extended r%lu at cf+0x%lx\n",
  204|      0|                 (long) regnum, (long) (val * dci->data_align));
  205|      0|          break;
  206|       |
  207|      0|        case DW_CFA_offset_extended_sf:
  ------------------
  |  Branch (207:9): [True: 0, False: 222]
  ------------------
  208|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (208:15): [True: 0, False: 0]
  ------------------
  209|      0|              || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (209:18): [True: 0, False: 0]
  ------------------
  210|      0|            break;
  211|      0|          set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  212|      0|          Debug (15, "CFA_offset_extended_sf r%lu at cf+0x%lx\n",
  213|      0|                 (long) regnum, (long) (val * dci->data_align));
  214|      0|          break;
  215|       |
  216|      0|        case DW_CFA_restore:
  ------------------
  |  Branch (216:9): [True: 0, False: 222]
  ------------------
  217|      0|          regnum = operand;
  218|      0|          if (regnum >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (218:15): [True: 0, False: 0]
  ------------------
  219|      0|            {
  220|      0|              Debug (1, "Invalid register number %u in DW_CFA_restore\n",
  221|      0|                     (unsigned int) regnum);
  222|      0|              ret = -UNW_EINVAL;
  223|      0|              break;
  224|      0|            }
  225|      0|          sr->rs_current.reg.where[regnum] = sr->rs_initial.reg.where[regnum];
  226|      0|          sr->rs_current.reg.val[regnum] = sr->rs_initial.reg.val[regnum];
  227|      0|          Debug (15, "CFA_restore r%lu\n", (long) regnum);
  228|      0|          break;
  229|       |
  230|      0|        case DW_CFA_restore_extended:
  ------------------
  |  Branch (230:9): [True: 0, False: 222]
  ------------------
  231|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (231:15): [True: 0, False: 0]
  ------------------
  232|      0|            break;
  233|      0|          if (regnum >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (233:15): [True: 0, False: 0]
  ------------------
  234|      0|            {
  235|      0|              Debug (1, "Invalid register number %u in "
  236|      0|                     "DW_CFA_restore_extended\n", (unsigned int) regnum);
  237|      0|              ret = -UNW_EINVAL;
  238|      0|              break;
  239|      0|            }
  240|      0|          sr->rs_current.reg.where[regnum] = sr->rs_initial.reg.where[regnum];
  241|      0|          sr->rs_current.reg.val[regnum] = sr->rs_initial.reg.val[regnum];
  242|      0|          Debug (15, "CFA_restore_extended r%lu\n", (long) regnum);
  243|      0|          break;
  244|       |
  245|     37|        case DW_CFA_nop:
  ------------------
  |  Branch (245:9): [True: 37, False: 185]
  ------------------
  246|     37|          break;
  247|       |
  248|      0|        case DW_CFA_set_loc:
  ------------------
  |  Branch (248:9): [True: 0, False: 222]
  ------------------
  249|      0|          if ((ret = dwarf_read_encoded_pointer (as, a, addr, dci->fde_encoding,
  ------------------
  |  |  401|      0|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (249:15): [True: 0, False: 0]
  ------------------
  250|      0|                                                 &c->pi, ip,
  251|      0|                                                 arg)) < 0)
  252|      0|            break;
  253|      0|          Debug (15, "CFA_set_loc to 0x%lx\n", (long) *ip);
  254|      0|          break;
  255|       |
  256|      1|        case DW_CFA_undefined:
  ------------------
  |  Branch (256:9): [True: 1, False: 221]
  ------------------
  257|      1|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (257:15): [True: 0, False: 1]
  ------------------
  258|      0|            break;
  259|      1|          set_reg (sr, regnum, DWARF_WHERE_UNDEF, 0);
  260|      1|          Debug (15, "CFA_undefined r%lu\n", (long) regnum);
  261|      1|          break;
  262|       |
  263|      0|        case DW_CFA_same_value:
  ------------------
  |  Branch (263:9): [True: 0, False: 222]
  ------------------
  264|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (264:15): [True: 0, False: 0]
  ------------------
  265|      0|            break;
  266|      0|          set_reg (sr, regnum, DWARF_WHERE_SAME, 0);
  267|      0|          Debug (15, "CFA_same_value r%lu\n", (long) regnum);
  268|      0|          break;
  269|       |
  270|      0|        case DW_CFA_register:
  ------------------
  |  Branch (270:9): [True: 0, False: 222]
  ------------------
  271|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (271:15): [True: 0, False: 0]
  ------------------
  272|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (272:18): [True: 0, False: 0]
  ------------------
  273|      0|            break;
  274|      0|          set_reg (sr, regnum, DWARF_WHERE_REG, val);
  275|      0|          Debug (15, "CFA_register r%lu to r%lu\n", (long) regnum, (long) val);
  276|      0|          break;
  277|       |
  278|      0|        case DW_CFA_remember_state:
  ------------------
  |  Branch (278:9): [True: 0, False: 222]
  ------------------
  279|      0|	  if (push_rstate_stack(rs_stack) < 0)
  ------------------
  |  Branch (279:8): [True: 0, False: 0]
  ------------------
  280|      0|	    {
  281|      0|              Debug (1, "Out of memory in DW_CFA_remember_state\n");
  282|      0|              ret = -UNW_ENOMEM;
  283|      0|              break;
  284|      0|	    }
  285|      0|          (*rs_stack)->state = sr->rs_current;
  286|      0|          Debug (15, "CFA_remember_state\n");
  287|      0|          break;
  288|       |
  289|      0|        case DW_CFA_restore_state:
  ------------------
  |  Branch (289:9): [True: 0, False: 222]
  ------------------
  290|      0|          if (!*rs_stack)
  ------------------
  |  Branch (290:15): [True: 0, False: 0]
  ------------------
  291|      0|            {
  292|      0|              Debug (1, "register-state stack underflow\n");
  293|      0|              ret = -UNW_EINVAL;
  294|      0|              break;
  295|      0|            }
  296|      0|          sr->rs_current = (*rs_stack)->state;
  297|      0|          pop_rstate_stack(rs_stack);
  298|      0|          Debug (15, "CFA_restore_state\n");
  299|      0|          break;
  300|       |
  301|     17|        case DW_CFA_def_cfa:
  ------------------
  |  Branch (301:9): [True: 17, False: 205]
  ------------------
  302|     17|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (302:15): [True: 0, False: 17]
  ------------------
  303|     17|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (303:18): [True: 0, False: 17]
  ------------------
  304|      0|            break;
  305|     17|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum);
  ------------------
  |  |  248|     17|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|     17|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  306|     17|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val);   /* NOT factored! */
  ------------------
  |  |  249|     17|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|     17|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  307|     17|          Debug (15, "CFA_def_cfa r%lu+0x%lx\n", (long) regnum, (long) val);
  308|     17|          break;
  309|       |
  310|      0|        case DW_CFA_def_cfa_sf:
  ------------------
  |  Branch (310:9): [True: 0, False: 222]
  ------------------
  311|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (311:15): [True: 0, False: 0]
  ------------------
  312|      0|              || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (312:18): [True: 0, False: 0]
  ------------------
  313|      0|            break;
  314|      0|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum);
  ------------------
  |  |  248|      0|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  315|      0|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0,
  ------------------
  |  |  249|      0|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  316|      0|                   val * dci->data_align);              /* factored! */
  317|      0|          Debug (15, "CFA_def_cfa_sf r%lu+0x%lx\n",
  318|      0|                 (long) regnum, (long) (val * dci->data_align));
  319|      0|          break;
  320|       |
  321|     13|        case DW_CFA_def_cfa_register:
  ------------------
  |  Branch (321:9): [True: 13, False: 209]
  ------------------
  322|     13|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (322:15): [True: 0, False: 13]
  ------------------
  323|      0|            break;
  324|     13|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum);
  ------------------
  |  |  248|     13|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|     13|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  325|     13|          Debug (15, "CFA_def_cfa_register r%lu\n", (long) regnum);
  326|     13|          break;
  327|       |
  328|     20|        case DW_CFA_def_cfa_offset:
  ------------------
  |  Branch (328:9): [True: 20, False: 202]
  ------------------
  329|     20|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (329:15): [True: 0, False: 20]
  ------------------
  330|      0|            break;
  331|     20|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val);   /* NOT factored! */
  ------------------
  |  |  249|     20|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|     20|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  332|     20|          Debug (15, "CFA_def_cfa_offset 0x%lx\n", (long) val);
  333|     20|          break;
  334|       |
  335|      0|        case DW_CFA_def_cfa_offset_sf:
  ------------------
  |  Branch (335:9): [True: 0, False: 222]
  ------------------
  336|      0|          if ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (336:15): [True: 0, False: 0]
  ------------------
  337|      0|            break;
  338|      0|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0,
  ------------------
  |  |  249|      0|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  339|      0|                   val * dci->data_align);      /* factored! */
  340|      0|          Debug (15, "CFA_def_cfa_offset_sf 0x%lx\n",
  341|      0|                 (long) (val * dci->data_align));
  342|      0|          break;
  343|       |
  344|      0|        case DW_CFA_def_cfa_expression:
  ------------------
  |  Branch (344:9): [True: 0, False: 222]
  ------------------
  345|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  346|      0|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_EXPR, *addr);
  ------------------
  |  |  248|      0|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  347|       |
  348|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0)
  ------------------
  |  Branch (348:15): [True: 0, False: 0]
  ------------------
  349|      0|            break;
  350|       |
  351|      0|          Debug (15, "CFA_def_cfa_expr @ 0x%lx [%lu bytes]\n",
  352|      0|                 (long) *addr, (long) len);
  353|      0|          *addr += len;
  354|      0|          break;
  355|       |
  356|      0|        case DW_CFA_expression:
  ------------------
  |  Branch (356:9): [True: 0, False: 222]
  ------------------
  357|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (357:15): [True: 0, False: 0]
  ------------------
  358|      0|            break;
  359|       |
  360|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  361|      0|          set_reg (sr, regnum, DWARF_WHERE_EXPR, *addr);
  362|       |
  363|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0)
  ------------------
  |  Branch (363:15): [True: 0, False: 0]
  ------------------
  364|      0|            break;
  365|       |
  366|      0|          Debug (15, "CFA_expression r%lu @ 0x%lx [%lu bytes]\n",
  367|      0|                 (long) regnum, (long) addr, (long) len);
  368|      0|          *addr += len;
  369|      0|          break;
  370|       |
  371|      0|        case DW_CFA_val_expression:
  ------------------
  |  Branch (371:9): [True: 0, False: 222]
  ------------------
  372|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (372:15): [True: 0, False: 0]
  ------------------
  373|      0|            break;
  374|       |
  375|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  376|      0|          set_reg (sr, regnum, DWARF_WHERE_VAL_EXPR, *addr);
  377|       |
  378|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0)
  ------------------
  |  Branch (378:15): [True: 0, False: 0]
  ------------------
  379|      0|            break;
  380|       |
  381|      0|          Debug (15, "CFA_val_expression r%lu @ 0x%lx [%lu bytes]\n",
  382|      0|                 (long) regnum, (long) addr, (long) len);
  383|      0|          *addr += len;
  384|      0|          break;
  385|       |
  386|      0|        case DW_CFA_GNU_args_size:
  ------------------
  |  Branch (386:9): [True: 0, False: 222]
  ------------------
  387|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|            break;
  389|      0|          sr->args_size = val;
  390|      0|          Debug (15, "CFA_GNU_args_size %lu\n", (long) val);
  391|      0|          break;
  392|       |
  393|      0|        case DW_CFA_GNU_negative_offset_extended:
  ------------------
  |  Branch (393:9): [True: 0, False: 222]
  ------------------
  394|       |          /* A comment in GCC says that this is obsoleted by
  395|       |             DW_CFA_offset_extended_sf, but that it's used by older
  396|       |             PowerPC code.  */
  397|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (397:15): [True: 0, False: 0]
  ------------------
  398|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (398:18): [True: 0, False: 0]
  ------------------
  399|      0|            break;
  400|      0|          set_reg (sr, regnum, DWARF_WHERE_CFAREL, ~(val * dci->data_align) + 1);
  401|      0|          Debug (15, "CFA_GNU_negative_offset_extended cfa+0x%lx\n",
  402|      0|                 (long) (~(val * dci->data_align) + 1));
  403|      0|          break;
  404|       |
  405|      0|        case DW_CFA_GNU_window_save:
  ------------------
  |  Branch (405:9): [True: 0, False: 222]
  ------------------
  406|       |#ifdef UNW_TARGET_SPARC
  407|       |          /* This is a special CFA to handle all 16 windowed registers
  408|       |             on SPARC.  */
  409|       |          for (regnum = 16; regnum < 32; ++regnum)
  410|       |            set_reg (sr, regnum, DWARF_WHERE_CFAREL,
  411|       |                     (regnum - 16) * sizeof (unw_word_t));
  412|       |          Debug (15, "CFA_GNU_window_save\n");
  413|       |          break;
  414|       |#elif UNW_TARGET_AARCH64
  415|       |          /* This is a specific opcode on aarch64, DW_CFA_AARCH64_negate_ra_state */
  416|       |          Debug (15, "DW_CFA_AARCH64_negate_ra_state\n");
  417|       |          aarch64_negate_ra_sign_state(sr);
  418|       |          break;
  419|       |#else
  420|       |          /* FALL THROUGH */
  421|      0|#endif
  422|      0|        case DW_CFA_lo_user:
  ------------------
  |  Branch (422:9): [True: 0, False: 222]
  ------------------
  423|      0|        case DW_CFA_hi_user:
  ------------------
  |  Branch (423:9): [True: 0, False: 222]
  ------------------
  424|      0|          Debug (1, "Unexpected CFA opcode 0x%x\n", op);
  425|      0|          ret = -UNW_EINVAL;
  426|      0|          break;
  427|    222|        }
  428|    222|    }
  429|       |
  430|     30|  if (ret > 0)
  ------------------
  |  Branch (430:7): [True: 0, False: 30]
  ------------------
  431|      0|    ret = 0;
  432|     30|  return ret;
  433|     30|}
Lparser.c:read_regnum:
   40|     31|{
   41|     31|  int ret;
   42|       |
   43|     31|  if ((ret = dwarf_read_uleb128 (as, a, addr, valp, arg)) < 0)
  ------------------
  |  Branch (43:7): [True: 0, False: 31]
  ------------------
   44|      0|    return ret;
   45|       |
   46|     31|  if (*valp >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|     31|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (46:7): [True: 0, False: 31]
  ------------------
   47|      0|    {
   48|      0|      Debug (1, "Invalid register number %u\n", (unsigned int) *valp);
   49|      0|      return -UNW_EBADREG;
   50|      0|    }
   51|     31|  return 0;
   52|     31|}
Lparser.c:empty_rstate_stack:
   85|     30|{
   86|     30|  while (*rs_stack)
  ------------------
  |  Branch (86:10): [True: 0, False: 30]
  ------------------
   87|      0|    pop_rstate_stack(rs_stack);
   88|     30|}
Lparser.c:parse_fde:
  551|     15|{
  552|     15|  int ret;
  553|     15|  struct dwarf_cie_info *dci = c->pi.unwind_info;
  554|     15|  unw_word_t addr = dci->fde_instr_start;
  555|     15|  unw_word_t curr_ip = c->pi.start_ip;
  556|     15|  dwarf_stackable_reg_state_t *rs_stack = NULL;
  557|       |  /* Process up to current `ip` for signal frame and `ip - 1` for normal call frame
  558|       |     See `c->use_prev_instr` use in `fetch_proc_info` for details. */
  559|     15|  ret = run_cfi_program (c, sr, &curr_ip, ip - c->use_prev_instr, &addr, dci->fde_instr_end,
  560|     15|			 &rs_stack, dci);
  561|     15|  empty_rstate_stack(&rs_stack);
  562|     15|  if (ret < 0)
  ------------------
  |  Branch (562:7): [True: 0, False: 15]
  ------------------
  563|      0|    return ret;
  564|       |
  565|     15|  return 0;
  566|     15|}
Lparser.c:put_unwind_info:
  503|     15|{
  504|     15|  if (c->pi_is_dynamic)
  ------------------
  |  Branch (504:7): [True: 0, False: 15]
  ------------------
  505|      0|    unwi_put_dynamic_unwind_info (c->as, pi, c->as_arg);
  ------------------
  |  |  270|      0|#define unwi_put_dynamic_unwind_info    UNWI_OBJ(put_dynamic_unwind_info)
  |  |  ------------------
  |  |  |  |  173|      0|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|     15|  else if (pi->unwind_info && pi->format == UNW_INFO_FORMAT_TABLE)
  ------------------
  |  Branch (506:12): [True: 15, False: 0]
  |  Branch (506:31): [True: 15, False: 0]
  ------------------
  507|     15|    {
  508|     15|      mempool_free (&dwarf_cie_info_pool, pi->unwind_info);
  ------------------
  |  |   57|     15|#define mempool_free(p,o)       UNWI_ARCH_OBJ(_mempool_free)(p,o)
  |  |  ------------------
  |  |  |  |  174|     15|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|       |      pi->unwind_info = NULL;
  510|     15|    }
  511|     15|  c->pi_valid = 0;
  512|     15|}

_ULx86_64_dwarf_read_encoded_pointer:
   36|     75|{
   37|     75|  return dwarf_read_encoded_pointer_inlined (as, a, addr, encoding,
   38|     75|                                             pi, valp, arg);
   39|     75|}

_Ux86_64_dwarf_init:
   33|      1|{
   34|      1|  mempool_init (&dwarf_reg_state_pool, sizeof (dwarf_stackable_reg_state_t), 0);
  ------------------
  |  |   55|      1|#define mempool_init(p,s,r)     UNWI_ARCH_OBJ(_mempool_init)(p,s,r)
  |  |  ------------------
  |  |  |  |  174|      1|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   35|      1|  mempool_init (&dwarf_cie_info_pool, sizeof (struct dwarf_cie_info), 0);
  ------------------
  |  |   55|      1|#define mempool_init(p,s,r)     UNWI_ARCH_OBJ(_mempool_init)(p,s,r)
  |  |  ------------------
  |  |  |  |  174|      1|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|      1|  return 0;
   37|      1|}

_Uelf64_get_proc_name_in_image:
  642|  37.2k|{
  643|  37.2k|  Elf_W (Addr) load_offset;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  644|  37.2k|  Elf_W (Addr) min_dist = ~(Elf_W (Addr))0;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  645|  37.2k|  int ret;
  646|       |
  647|  37.2k|  load_offset = elf_w (get_load_offset) (ei, segbase);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  648|  37.2k|  ret = elf_w (lookup_symbol) (as, ip, ei, load_offset, buf, buf_len, &min_dist);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  649|       |
  650|       |  /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in
  651|       |     there as well and replace the previously found if it is closer. */
  652|  37.2k|  struct elf_image mdi;
  653|  37.2k|  if (elf_w (extract_minidebuginfo) (ei, &mdi))
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (653:7): [True: 0, False: 37.2k]
  ------------------
  654|      0|    {
  655|      0|      int ret_mdi = elf_w (lookup_symbol) (as, ip, &mdi, load_offset, buf,
  ------------------
  |  |   42|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  656|      0|                                           buf_len, &min_dist);
  657|       |
  658|       |      /* Closer symbol was found (possibly truncated). */
  659|      0|      if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM)
  ------------------
  |  Branch (659:11): [True: 0, False: 0]
  |  Branch (659:27): [True: 0, False: 0]
  ------------------
  660|      0|        {
  661|      0|          ret = ret_mdi;
  662|      0|        }
  663|       |
  664|      0|      mi_munmap (mdi.image, mdi.size);
  665|      0|    }
  666|       |
  667|  37.2k|  if (min_dist >= ei->size)
  ------------------
  |  Branch (667:7): [True: 0, False: 37.2k]
  ------------------
  668|      0|    return -UNW_ENOINFO;                /* not found */
  669|  37.2k|  if (offp)
  ------------------
  |  Branch (669:7): [True: 37.2k, False: 0]
  ------------------
  670|  37.2k|    *offp = min_dist;
  671|  37.2k|  return ret;
  672|  37.2k|}
_Uelf64_get_proc_name:
  677|  37.2k|{
  678|  37.2k|  unsigned long segbase, mapoff;
  679|  37.2k|  struct elf_image ei;
  680|  37.2k|  int ret;
  681|  37.2k|  char file[PATH_MAX];
  682|       |
  683|  37.2k|  ret = tdep_get_elf_image (as, &ei, pid, ip, &segbase, &mapoff, file, PATH_MAX, arg);
  ------------------
  |  |  237|  37.2k|#define tdep_get_elf_image              UNW_ARCH_OBJ(get_elf_image)
  |  |  ------------------
  |  |  |  |   49|  37.2k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|  37.2k|  if (ret < 0)
  ------------------
  |  Branch (684:7): [True: 0, False: 37.2k]
  ------------------
  685|      0|    return ret;
  686|       |
  687|  37.2k|  ret = elf_w (load_debuginfo) (file, &ei, 1);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  688|  37.2k|  if (ret < 0)
  ------------------
  |  Branch (688:7): [True: 0, False: 37.2k]
  ------------------
  689|      0|    return ret;
  690|       |
  691|  37.2k|  ret = elf_w (get_proc_name_in_image) (as, &ei, segbase, ip, buf, buf_len, offp);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  692|       |
  693|  37.2k|  mi_munmap (ei.image, ei.size);
  694|  37.2k|  ei.image = NULL;
  695|       |
  696|  37.2k|  return ret;
  697|  37.2k|}
_Uelf64_find_section:
  778|  37.2k|{
  779|  37.2k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  780|  37.2k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  781|  37.2k|  char *strtab;
  782|  37.2k|  int i;
  783|       |
  784|  37.2k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (784:7): [True: 0, False: 37.2k]
  ------------------
  785|      0|    return 0;
  786|       |
  787|  37.2k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  788|  37.2k|  if (!shdr)
  ------------------
  |  Branch (788:7): [True: 0, False: 37.2k]
  ------------------
  789|      0|    return 0;
  790|       |
  791|  37.2k|  strtab = elf_w (string_table) (ei, ehdr->e_shstrndx);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  792|  37.2k|  if (!strtab)
  ------------------
  |  Branch (792:7): [True: 0, False: 37.2k]
  ------------------
  793|      0|    return 0;
  794|       |
  795|  2.03M|  for (i = 0; i < ehdr->e_shnum; ++i)
  ------------------
  |  Branch (795:15): [True: 2.00M, False: 32.5k]
  ------------------
  796|  2.00M|    {
  797|  2.00M|      if (strcmp (strtab + shdr->sh_name, secname) == 0)
  ------------------
  |  Branch (797:11): [True: 4.65k, False: 1.99M]
  ------------------
  798|  4.65k|        {
  799|  4.65k|          if (shdr->sh_offset + shdr->sh_size > ei->size)
  ------------------
  |  Branch (799:15): [True: 0, False: 4.65k]
  ------------------
  800|      0|            {
  801|      0|              Debug (1, "section \"%s\" outside image? (0x%lu > 0x%lu)\n",
  802|      0|                     secname,
  803|      0|                     (unsigned long) shdr->sh_offset + shdr->sh_size,
  804|      0|                     (unsigned long) ei->size);
  805|      0|              return 0;
  806|      0|            }
  807|       |
  808|  4.65k|          Debug (16, "found section \"%s\" at 0x%lx\n",
  809|  4.65k|                 secname, (unsigned long) shdr->sh_offset);
  810|  4.65k|          return shdr;
  811|  4.65k|        }
  812|       |
  813|  1.99M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  814|  1.99M|    }
  815|       |
  816|       |  /* section not found */
  817|  32.5k|  return 0;
  818|  37.2k|}
_Uelf64_load_debuginfo:
  917|  55.8k|{
  918|  55.8k|  int ret;
  919|  55.8k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   41|  55.8k|# define Elf_W(x)       Elf64_##x
  ------------------
  920|  55.8k|  Elf_W (Ehdr) *prev_image;
  ------------------
  |  |   41|  55.8k|# define Elf_W(x)       Elf64_##x
  ------------------
  921|  55.8k|  off_t prev_size;
  922|  55.8k|  char path[PATH_MAX];
  923|       |
  924|  55.8k|  if (!ei->image)
  ------------------
  |  Branch (924:7): [True: 18.6k, False: 37.2k]
  ------------------
  925|  18.6k|    {
  926|  18.6k|      ret = elf_map_image(ei, file);
  927|  18.6k|      if (ret)
  ------------------
  |  Branch (927:11): [True: 18.6k, False: 0]
  ------------------
  928|  18.6k|        return ret;
  929|  18.6k|    }
  930|       |
  931|  37.2k|  prev_image = ei->image;
  932|  37.2k|  prev_size = ei->size;
  933|       |
  934|       |  /* Ignore separate debug files which contain a .gnu_debuglink section. */
  935|  37.2k|  if (is_local == -1) {
  ------------------
  |  Branch (935:7): [True: 0, False: 37.2k]
  ------------------
  936|      0|    return 0;
  937|      0|  }
  938|       |
  939|  37.2k|  ret = elf_w (find_build_id_path) (ei, path, sizeof(path));
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  940|  37.2k|  if (ret == 0)
  ------------------
  |  Branch (940:7): [True: 4.65k, False: 32.5k]
  ------------------
  941|  4.65k|    {
  942|  4.65k|      ei->image = NULL;
  943|       |
  944|  4.65k|      ret = elf_w (load_debuginfo) (path, ei, -1);
  ------------------
  |  |   42|  4.65k|# define elf_w(x)       _Uelf64_##x
  ------------------
  945|  4.65k|      if (ret == 0)
  ------------------
  |  Branch (945:11): [True: 0, False: 4.65k]
  ------------------
  946|      0|        {
  947|      0|          mi_munmap (prev_image, prev_size);
  948|      0|          return 0;
  949|      0|        }
  950|       |
  951|  4.65k|      ei->image = prev_image;
  952|  4.65k|      ei->size  = prev_size;
  953|  4.65k|    }
  954|       |
  955|  37.2k|  shdr = elf_w (find_section) (ei, ".gnu_debuglink");
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  956|  37.2k|  if (shdr) {
  ------------------
  |  Branch (956:7): [True: 4.65k, False: 32.5k]
  ------------------
  957|  4.65k|    if (shdr->sh_size >= PATH_MAX ||
  ------------------
  |  Branch (957:9): [True: 0, False: 4.65k]
  ------------------
  958|  4.65k|	(shdr->sh_offset + shdr->sh_size > ei->size))
  ------------------
  |  Branch (958:2): [True: 0, False: 4.65k]
  ------------------
  959|      0|      return 0;
  960|       |
  961|  4.65k|    {
  962|  4.65k|      char linkbuf[shdr->sh_size];
  963|  4.65k|      char *link = ((char *) ei->image) + shdr->sh_offset;
  964|  4.65k|      const char *p;
  965|  4.65k|      static const char *debugdir = "/usr/lib/debug";
  966|  4.65k|      char basedir[strlen(file) + 1];
  967|  4.65k|      char newname[shdr->sh_size + strlen (debugdir) + strlen (file) + 9];
  968|       |
  969|  4.65k|      memcpy(linkbuf, link, shdr->sh_size);
  970|       |
  971|  4.65k|      if (memchr (linkbuf, 0, shdr->sh_size) == NULL)
  ------------------
  |  Branch (971:11): [True: 0, False: 4.65k]
  ------------------
  972|      0|	return 0;
  973|       |
  974|  4.65k|      ei->image = NULL;
  975|       |
  976|  4.65k|      Debug(1, "Found debuglink section, following %s\n", linkbuf);
  977|       |
  978|  4.65k|      p = strrchr (file, '/');
  979|  4.65k|      if (p != NULL)
  ------------------
  |  Branch (979:11): [True: 4.65k, False: 0]
  ------------------
  980|  4.65k|	{
  981|  4.65k|	  memcpy (basedir, file, p - file);
  982|  4.65k|	  basedir[p - file] = '\0';
  983|  4.65k|	}
  984|      0|      else
  985|      0|	basedir[0] = 0;
  986|       |
  987|  4.65k|      strcpy (newname, basedir);
  988|  4.65k|      strcat (newname, "/");
  989|  4.65k|      strcat (newname, linkbuf);
  990|  4.65k|      ret = elf_w (load_debuginfo) (newname, ei, -1);
  ------------------
  |  |   42|  4.65k|# define elf_w(x)       _Uelf64_##x
  ------------------
  991|       |
  992|  4.65k|      if (ret == -1)
  ------------------
  |  Branch (992:11): [True: 4.65k, False: 0]
  ------------------
  993|  4.65k|	{
  994|  4.65k|	  strcpy (newname, basedir);
  995|  4.65k|	  strcat (newname, "/.debug/");
  996|  4.65k|	  strcat (newname, linkbuf);
  997|  4.65k|	  ret = elf_w (load_debuginfo) (newname, ei, -1);
  ------------------
  |  |   42|  4.65k|# define elf_w(x)       _Uelf64_##x
  ------------------
  998|  4.65k|	}
  999|       |
 1000|  4.65k|      if (ret == -1 && is_local == 1)
  ------------------
  |  Branch (1000:11): [True: 4.65k, False: 0]
  |  Branch (1000:24): [True: 4.65k, False: 0]
  ------------------
 1001|  4.65k|	{
 1002|  4.65k|	  strcpy (newname, debugdir);
 1003|  4.65k|	  strcat (newname, basedir);
 1004|  4.65k|	  strcat (newname, "/");
 1005|  4.65k|	  strcat (newname, linkbuf);
 1006|  4.65k|	  ret = elf_w (load_debuginfo) (newname, ei, -1);
  ------------------
  |  |   42|  4.65k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1007|  4.65k|	}
 1008|       |
 1009|  4.65k|      if (ret == -1)
  ------------------
  |  Branch (1009:11): [True: 4.65k, False: 0]
  ------------------
 1010|  4.65k|        {
 1011|       |          /* No debuglink file found even though .gnu_debuglink existed */
 1012|  4.65k|          ei->image = prev_image;
 1013|  4.65k|          ei->size = prev_size;
 1014|       |
 1015|  4.65k|          return 0;
 1016|  4.65k|        }
 1017|      0|      else
 1018|      0|        {
 1019|      0|          mi_munmap (prev_image, prev_size);
 1020|      0|        }
 1021|       |
 1022|      0|      return ret;
 1023|  4.65k|    }
 1024|  4.65k|  }
 1025|       |
 1026|  32.5k|  return 0;
 1027|  37.2k|}
elf64.c:_Uelf64_get_load_offset:
  456|  37.2k|{
  457|  37.2k|  Elf_W (Addr) offset = 0;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  458|  37.2k|  Elf_W (Ehdr) *ehdr;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  459|  37.2k|  Elf_W (Phdr) *phdr;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  460|  37.2k|  int i;
  461|       |  // mapoff is obtained from mmap information, so it is always aligned on a page size.
  462|       |  // PT_LOAD program headers p_offset however is not guaranteed to be aligned on a
  463|       |  // page size, ld.lld generate libraries where this is not the case. So we must
  464|       |  // make sure we compare both values with the same alignment.
  465|  37.2k|  unsigned long pagesize_alignment_mask = ~(unw_page_size - 1UL);
  466|       |
  467|  37.2k|  ehdr = ei->image;
  468|  37.2k|  phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff);
  469|       |
  470|   148k|  for (i = 0; i < ehdr->e_phnum; ++i)
  ------------------
  |  Branch (470:15): [True: 148k, False: 0]
  ------------------
  471|   148k|    if (phdr[i].p_type == PT_LOAD && phdr[i].p_flags & PF_X)
  ------------------
  |  Branch (471:9): [True: 74.4k, False: 74.4k]
  |  Branch (471:38): [True: 37.2k, False: 37.2k]
  ------------------
  472|  37.2k|      {
  473|  37.2k|        offset = segbase - phdr[i].p_vaddr + (phdr[i].p_offset & (~pagesize_alignment_mask));
  474|  37.2k|        break;
  475|  37.2k|      }
  476|       |
  477|  37.2k|  return offset;
  478|  37.2k|}
elf64.c:_Uelf64_lookup_symbol:
  386|  37.2k|{
  387|  37.2k|  struct symbol_lookup_context context =
  388|  37.2k|    {
  389|  37.2k|      .as = as,
  390|  37.2k|      .ip = ip, 
  391|  37.2k|      .ei = ei,
  392|  37.2k|      .load_offset = load_offset,
  393|  37.2k|      .min_dist = min_dist,
  394|  37.2k|    };
  395|  37.2k|  struct symbol_callback_data data =
  396|  37.2k|    {
  397|  37.2k|      .buf = buf, 
  398|  37.2k|      .buf_len = buf_len,
  399|  37.2k|    };
  400|  37.2k|  return elf_w (lookup_symbol_closeness) (as,
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  401|  37.2k|                                          &context,
  402|  37.2k|                                          elf_w (lookup_symbol_callback),
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  403|  37.2k|                                          &data);
  404|  37.2k|}
elf64.c:_Uelf64_lookup_symbol_closeness:
  253|  37.2k|{
  254|  37.2k|  struct elf_image *ei = context->ei;
  255|  37.2k|  Elf_W (Addr) load_offset = context->load_offset;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  256|  37.2k|  size_t syment_size;
  257|  37.2k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  258|  37.2k|  Elf_W (Sym) *sym, *symtab, *symtab_end;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  259|  37.2k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  260|  37.2k|  Elf_W (Addr) val;
  ------------------
  |  |   41|  37.2k|# define Elf_W(x)       Elf64_##x
  ------------------
  261|  37.2k|  int i, ret = -UNW_ENOINFO;
  262|  37.2k|  char *strtab;
  263|       |
  264|  37.2k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (264:7): [True: 0, False: 37.2k]
  ------------------
  265|      0|    return -UNW_ENOINFO;
  266|       |
  267|  37.2k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  268|  37.2k|  if (!shdr)
  ------------------
  |  Branch (268:7): [True: 0, False: 37.2k]
  ------------------
  269|      0|    return -UNW_ENOINFO;
  270|       |
  271|  1.69M|  for (i = 0; i < ehdr->e_shnum && ret == -UNW_ENOINFO; ++i)
  ------------------
  |  Branch (271:15): [True: 1.69M, False: 0]
  |  Branch (271:36): [True: 1.65M, False: 37.2k]
  ------------------
  272|  1.65M|    {
  273|  1.65M|      switch (shdr->sh_type)
  274|  1.65M|        {
  275|  32.5k|        case SHT_SYMTAB:
  ------------------
  |  Branch (275:9): [True: 32.5k, False: 1.62M]
  ------------------
  276|  69.7k|        case SHT_DYNSYM:
  ------------------
  |  Branch (276:9): [True: 37.2k, False: 1.61M]
  ------------------
  277|  69.7k|          symtab = (Elf_W (Sym) *) ((char *) ei->image + shdr->sh_offset);
  278|  69.7k|          symtab_end = (Elf_W (Sym) *) ((char *) symtab + shdr->sh_size);
  279|  69.7k|          syment_size = shdr->sh_entsize;
  280|       |
  281|  69.7k|          strtab = elf_w (string_table) (ei, shdr->sh_link);
  ------------------
  |  |   42|  69.7k|# define elf_w(x)       _Uelf64_##x
  ------------------
  282|  69.7k|          if (!strtab)
  ------------------
  |  Branch (282:15): [True: 0, False: 69.7k]
  ------------------
  283|      0|            break;
  284|       |
  285|  69.7k|          Debug (16, "symtab=0x%lx[%d]\n",
  286|  69.7k|                 (long) shdr->sh_offset, shdr->sh_type);
  287|       |
  288|  69.7k|          for (sym = symtab;
  289|   147M|               sym < symtab_end;
  ------------------
  |  Branch (289:16): [True: 147M, False: 32.5k]
  ------------------
  290|   147M|               sym = (Elf_W (Sym) *) ((char *) sym + syment_size))
  291|   147M|            {
  292|   147M|              if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC
  ------------------
  |  |   40|   147M|# define ELF_W(x)       ELF64_##x
  ------------------
  |  Branch (292:19): [True: 98.7M, False: 48.9M]
  ------------------
  293|  98.7M|                  && sym->st_shndx != SHN_UNDEF)
  ------------------
  |  Branch (293:22): [True: 90.1M, False: 8.60M]
  ------------------
  294|  90.1M|                {
  295|  90.1M|                  val = sym->st_value;
  296|  90.1M|                  if (sym->st_shndx != SHN_ABS)
  ------------------
  |  Branch (296:23): [True: 90.1M, False: 0]
  ------------------
  297|  90.1M|                    val += load_offset;
  298|  90.1M|                  if (tdep_get_func_addr (as, val, &val) < 0)
  ------------------
  |  |  431|  90.1M|# define tdep_get_func_addr(as,addr,v)          (*(v) = addr, 0)
  ------------------
  |  Branch (298:23): [True: 0, False: 90.1M]
  ------------------
  299|      0|                    continue;
  300|  90.1M|                  Debug (16, "0x%016lx info=0x%02x %s\n",
  301|  90.1M|                         (long) val, sym->st_info, strtab + sym->st_name);
  302|       |
  303|  90.1M|                  struct symbol_info syminfo =
  304|  90.1M|                    {
  305|  90.1M|                      .strtab   = strtab,
  306|  90.1M|                      .sym      = sym,
  307|  90.1M|                      .start_ip = val
  308|  90.1M|                    };
  309|  90.1M|                  ret = symtab_lookup (context, &syminfo, data);
  310|       |
  311|       |                  /* Keep going if the IP is not found in this symtab entry. */
  312|  90.1M|                  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (312:23): [True: 90.1M, False: 37.2k]
  ------------------
  313|  90.1M|                    {
  314|  90.1M|                      continue;
  315|  90.1M|                    }
  316|       |
  317|  37.2k|                  break;
  318|  90.1M|                }
  319|   147M|            }
  320|  69.7k|          break;
  321|       |
  322|  1.58M|        default:
  ------------------
  |  Branch (322:9): [True: 1.58M, False: 69.7k]
  ------------------
  323|  1.58M|          break;
  324|  1.65M|        }
  325|  1.65M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  326|  1.65M|    }
  327|       |
  328|       |  /* If it wasn't found in the ELF symtab, check the synamic symtab. */
  329|  37.2k|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (329:7): [True: 0, False: 37.2k]
  ------------------
  330|      0|    ret = elf_w (lookup_symbol_from_dynamic) (as, context, symtab_lookup, data);
  ------------------
  |  |   42|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  331|       |
  332|  37.2k|  return ret;
  333|  37.2k|}
elf64.c:_Uelf64_lookup_symbol_callback:
  349|  90.1M|{
  350|  90.1M|  struct symbol_callback_data *d = data;
  351|  90.1M|  int ret = -UNW_ENOINFO;
  352|       |
  353|  90.1M|  if (context->ip >= syminfo->start_ip &&
  ------------------
  |  Branch (353:7): [True: 32.1M, False: 58.0M]
  ------------------
  354|  32.1M|      context->ip < (syminfo->start_ip + syminfo->sym->st_size))
  ------------------
  |  Branch (354:7): [True: 37.2k, False: 32.1M]
  ------------------
  355|  37.2k|    {
  356|  37.2k|      if ((Elf_W (Addr)) (context->ip - syminfo->start_ip) < *(context->min_dist))
  ------------------
  |  Branch (356:11): [True: 37.2k, False: 0]
  ------------------
  357|  37.2k|        {
  358|  37.2k|          *(context->min_dist) = (Elf_W (Addr)) (context->ip - syminfo->start_ip);
  359|  37.2k|          char const* const sym_name     = syminfo->strtab + syminfo->sym->st_name;
  360|  37.2k|          size_t            sym_name_len = strlen(sym_name);
  361|  37.2k|          Debug (1, "candidate sym: %s@%#010lx\n", sym_name, syminfo->start_ip);
  362|  37.2k|          if (sym_name_len >= d->buf_len)
  ------------------
  |  Branch (362:15): [True: 0, False: 37.2k]
  ------------------
  363|      0|            {
  364|      0|              Debug (1, "symbol length %zu exceeds buffer of length %zu\n",
  365|      0|                     sym_name_len+1, d->buf_len);
  366|      0|              sym_name_len = d->buf_len - 1; /* adjust for null terminator */
  367|      0|              ret = -UNW_ENOMEM; /* indicate truncation of symbol name */
  368|      0|            }
  369|  37.2k|          else
  370|  37.2k|            {
  371|  37.2k|              ret = UNW_ESUCCESS;
  372|  37.2k|            }
  373|  37.2k|          memcpy(d->buf, sym_name, sym_name_len);
  374|  37.2k|          d->buf[sym_name_len] = 0; /* null terminate */
  375|  37.2k|        }
  376|  37.2k|    }
  377|       |
  378|  90.1M|  return ret;
  379|  90.1M|}
elf64.c:_Uelf64_extract_minidebuginfo:
  627|  37.2k|{
  628|  37.2k|  return 0;
  629|  37.2k|}
elf64.c:_Uelf64_section_table:
   85|  74.4k|{
   86|  74.4k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   41|  74.4k|# define Elf_W(x)       Elf64_##x
  ------------------
   87|  74.4k|  Elf_W (Off) soff;
  ------------------
  |  |   41|  74.4k|# define Elf_W(x)       Elf64_##x
  ------------------
   88|       |
   89|  74.4k|  soff = ehdr->e_shoff;
   90|  74.4k|  if (soff + ehdr->e_shnum * ehdr->e_shentsize > ei->size)
  ------------------
  |  Branch (90:7): [True: 0, False: 74.4k]
  ------------------
   91|      0|    {
   92|      0|      Debug (1, "section table outside of image? (%lu > %lu)\n",
   93|      0|             (unsigned long) (soff + ehdr->e_shnum * ehdr->e_shentsize),
   94|      0|             (unsigned long) ei->size);
   95|      0|      return NULL;
   96|      0|    }
   97|       |
   98|  74.4k|  return (Elf_W (Shdr) *) ((char *) ei->image + soff);
   99|  74.4k|}
elf64.c:_Uelf64_string_table:
  103|   106k|{
  104|   106k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   41|   106k|# define Elf_W(x)       Elf64_##x
  ------------------
  105|   106k|  Elf_W (Off) soff, str_soff;
  ------------------
  |  |   41|   106k|# define Elf_W(x)       Elf64_##x
  ------------------
  106|   106k|  Elf_W (Shdr) *str_shdr;
  ------------------
  |  |   41|   106k|# define Elf_W(x)       Elf64_##x
  ------------------
  107|       |
  108|       |  /* this offset is assumed to be OK */
  109|   106k|  soff = ehdr->e_shoff;
  110|       |
  111|   106k|  str_soff = soff + (section * ehdr->e_shentsize);
  112|   106k|  if (str_soff + ehdr->e_shentsize > ei->size)
  ------------------
  |  Branch (112:7): [True: 0, False: 106k]
  ------------------
  113|      0|    {
  114|      0|      Debug (1, "string shdr table outside of image? (%lu > %lu)\n",
  115|      0|             (unsigned long) (str_soff + ehdr->e_shentsize),
  116|      0|             (unsigned long) ei->size);
  117|      0|      return NULL;
  118|      0|    }
  119|   106k|  str_shdr = (Elf_W (Shdr) *) ((char *) ei->image + str_soff);
  120|       |
  121|   106k|  if (str_shdr->sh_offset + str_shdr->sh_size > ei->size)
  ------------------
  |  Branch (121:7): [True: 0, False: 106k]
  ------------------
  122|      0|    {
  123|      0|      Debug (1, "string table outside of image? (%lu > %lu)\n",
  124|      0|             (unsigned long) (str_shdr->sh_offset + str_shdr->sh_size),
  125|      0|             (unsigned long) ei->size);
  126|      0|      return NULL;
  127|      0|    }
  128|       |
  129|   106k|  Debug (16, "strtab=0x%lx\n", (long) str_shdr->sh_offset);
  130|   106k|  return ei->image + str_shdr->sh_offset;
  131|   106k|}
elf64.c:_Uelf64_find_build_id_path:
  836|  37.2k|{
  837|       |/*
  838|       | * build-id is only available on GNU plaforms. So on non-GNU platforms this
  839|       | * function just returns fail (-1).
  840|       | */
  841|  37.2k|#if defined(ELF_NOTE_GNU) && defined(NT_GNU_BUILD_ID)
  842|  37.2k|  const Elf_W (Ehdr) *ehdr = ei->image;
  843|  37.2k|  const Elf_W (Phdr) *phdr;
  844|  37.2k|  unsigned i;
  845|       |
  846|  37.2k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (846:7): [True: 0, False: 37.2k]
  ------------------
  847|      0|    return -1;
  848|       |
  849|  37.2k|  phdr = (Elf_W (Phdr) *) ((uint8_t *) ehdr + ehdr->e_phoff);
  850|       |
  851|   465k|  for (i = 0; i < ehdr->e_phnum; ++i, phdr = (const Elf_W (Phdr) *) (((const uint8_t *) phdr) + ehdr->e_phentsize))
  ------------------
  |  Branch (851:15): [True: 432k, False: 32.5k]
  ------------------
  852|   432k|    {
  853|   432k|      const uint8_t *notes;
  854|   432k|      const uint8_t *notes_end;
  855|       |
  856|       |      /* The build-id is in a note section */
  857|   432k|      if (phdr->p_type != PT_NOTE)
  ------------------
  |  Branch (857:11): [True: 390k, False: 41.8k]
  ------------------
  858|   390k|        continue;
  859|       |
  860|  41.8k|      notes = elf_w (get_program_segment) (ei, phdr, &notes_end);
  ------------------
  |  |   42|  41.8k|# define elf_w(x)       _Uelf64_##x
  ------------------
  861|       |
  862|  79.0k|      while(notes < notes_end)
  ------------------
  |  Branch (862:13): [True: 41.8k, False: 37.2k]
  ------------------
  863|  41.8k|        {
  864|  41.8k|          const char prefix[] = "/usr/lib/debug/.build-id/";
  865|       |
  866|       |          /* See "man 5 elf" for notes about alignment in Nhdr */
  867|  41.8k|          const Elf_W(Nhdr) *nhdr = (const Elf_W(Nhdr) *) notes;
  868|  41.8k|          const Elf_W(Word) namesz = nhdr->n_namesz;
  869|  41.8k|          const Elf_W(Word) descsz = nhdr->n_descsz;
  870|  41.8k|          const Elf_W(Word) nameasz = UNW_ALIGN(namesz, 4); /* Aligned size */
  ------------------
  |  |  439|  41.8k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  871|  41.8k|          const char *name = (const char *) (nhdr + 1);
  872|  41.8k|          const uint8_t *desc = (const uint8_t *) name + nameasz;
  873|  41.8k|          unsigned j;
  874|       |
  875|  41.8k|          notes += sizeof(*nhdr) + nameasz + UNW_ALIGN(descsz, 4);
  ------------------
  |  |  439|  41.8k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  876|       |
  877|  41.8k|          if ((namesz != sizeof(ELF_NOTE_GNU)) ||  /* Spec says must be "GNU" with a NULL */
  ------------------
  |  Branch (877:15): [True: 0, False: 41.8k]
  ------------------
  878|  41.8k|              (nhdr->n_type != NT_GNU_BUILD_ID) || /* Spec says must be NT_GNU_BUILD_ID   */
  ------------------
  |  Branch (878:15): [True: 37.2k, False: 4.65k]
  ------------------
  879|  4.65k|              (strcmp(name, ELF_NOTE_GNU) != 0))   /* Must be "GNU" with NULL termination */
  ------------------
  |  Branch (879:15): [True: 0, False: 4.65k]
  ------------------
  880|  37.2k|            continue;
  881|       |
  882|       |          /* Validate that we have enough space */
  883|  4.65k|          if (path_len < (sizeof(prefix) +     /* Path prefix inc NULL */
  ------------------
  |  Branch (883:15): [True: 0, False: 4.65k]
  ------------------
  884|  4.65k|                          2 +                  /* Subdirectory         */
  885|  4.65k|                          1 +                  /* Directory separator  */
  886|  4.65k|                          (2 * (descsz - 1)) + /* Leaf filename        */
  887|  4.65k|                          6))                  /* .debug extension     */
  888|      0|            return -1;
  889|       |
  890|  4.65k|          memcpy(path, prefix, sizeof(prefix));
  891|       |
  892|  4.65k|          path = elf_w (add_hex_byte) (path + sizeof(prefix) - 1, *desc);
  ------------------
  |  |   42|  4.65k|# define elf_w(x)       _Uelf64_##x
  ------------------
  893|  4.65k|          *path++ = '/';
  894|       |
  895|  93.0k|          for(j = 1, ++desc; j < descsz; ++j, ++desc)
  ------------------
  |  Branch (895:30): [True: 88.3k, False: 4.65k]
  ------------------
  896|  88.3k|            path = elf_w (add_hex_byte) (path, *desc);
  ------------------
  |  |   42|  88.3k|# define elf_w(x)       _Uelf64_##x
  ------------------
  897|       |
  898|  4.65k|          strcat(path, ".debug");
  899|       |
  900|  4.65k|          return 0;
  901|  4.65k|        }
  902|  41.8k|    }
  903|  32.5k|#endif /* defined(ELF_NOTE_GNU) */
  904|       |
  905|  32.5k|  return -1;
  906|  37.2k|}
elf64.c:_Uelf64_add_hex_byte:
  823|  93.0k|{
  824|  93.0k|  const char hex[] = "0123456789abcdef";
  825|       |
  826|  93.0k|  *str++ = hex[byte >> 4];
  827|  93.0k|  *str++ = hex[byte & 0xf];
  828|  93.0k|  *str = 0;
  829|       |
  830|  93.0k|  return str;
  831|  93.0k|}

elf64.c:_Uelf64_get_program_segment:
  116|  41.8k|{
  117|  41.8k|  const uint8_t* result = NULL;
  118|       |
  119|  41.8k|  if (end)
  ------------------
  |  Branch (119:7): [True: 41.8k, False: 0]
  ------------------
  120|  41.8k|    *end = NULL;
  121|       |
  122|  41.8k|  if (!ei || !ei->image || !phdr || phdr->p_filesz == 0 || phdr->p_offset > ei->size)
  ------------------
  |  Branch (122:7): [True: 0, False: 41.8k]
  |  Branch (122:14): [True: 0, False: 41.8k]
  |  Branch (122:28): [True: 0, False: 41.8k]
  |  Branch (122:37): [True: 0, False: 41.8k]
  |  Branch (122:60): [True: 0, False: 41.8k]
  ------------------
  123|      0|    return NULL;
  124|       |
  125|  41.8k|  result = ((const uint8_t*)ei->image) + phdr->p_offset;
  126|  41.8k|  if (end)
  ------------------
  |  Branch (126:7): [True: 41.8k, False: 0]
  ------------------
  127|  41.8k|    *end = result + phdr->p_filesz;
  128|       |
  129|  41.8k|  return result;
  130|  41.8k|}
elf64.c:_Uelf64_valid_object:
   72|   111k|{
   73|   111k|  if (ei->size <= EI_VERSION)
  ------------------
  |  Branch (73:7): [True: 0, False: 111k]
  ------------------
   74|      0|    return 0;
   75|       |
   76|   111k|  return (memcmp (ei->image, ELFMAG, SELFMAG) == 0
  ------------------
  |  Branch (76:11): [True: 111k, False: 0]
  ------------------
   77|   111k|          && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS
  ------------------
  |  |    5|   111k|# define UNW_ELF_CLASS UNW_ELFCLASS64
  |  |  ------------------
  |  |  |  |   82|   223k|# define UNW_ELFCLASS64 ELFCLASS64
  |  |  ------------------
  ------------------
  |  Branch (77:14): [True: 111k, False: 0]
  ------------------
   78|   111k|          && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE
  ------------------
  |  Branch (78:14): [True: 111k, False: 0]
  ------------------
   79|   111k|          && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT);
  ------------------
  |  Branch (79:14): [True: 111k, False: 0]
  ------------------
   80|   111k|}
elf64.c:elf_map_image:
   84|  18.6k|{
   85|  18.6k|  struct stat stat;
   86|  18.6k|  int fd;
   87|       |
   88|  18.6k|  fd = open (path, O_RDONLY);
   89|  18.6k|  if (fd < 0)
  ------------------
  |  Branch (89:7): [True: 18.6k, False: 0]
  ------------------
   90|  18.6k|    return -1;
   91|       |
   92|      0|  if (fstat (fd, &stat) < 0)
  ------------------
  |  Branch (92:7): [True: 0, False: 0]
  ------------------
   93|      0|    {
   94|      0|      close (fd);
   95|      0|      return -1;
   96|      0|    }
   97|       |
   98|      0|  ei->size = stat.st_size;
   99|      0|  ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
  100|      0|  close (fd);
  101|      0|  if (ei->image == MAP_FAILED)
  ------------------
  |  Branch (101:7): [True: 0, False: 0]
  ------------------
  102|      0|    return -1;
  103|       |
  104|      0|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   42|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (104:7): [True: 0, False: 0]
  ------------------
  105|      0|  {
  106|      0|    mi_munmap(ei->image, ei->size);
  107|      0|    ei->image = NULL;
  108|      0|    return -1;
  109|      0|  }
  110|       |
  111|      0|  return 0;
  112|      0|}
os-linux.c:elf_map_image:
   84|  37.2k|{
   85|  37.2k|  struct stat stat;
   86|  37.2k|  int fd;
   87|       |
   88|  37.2k|  fd = open (path, O_RDONLY);
   89|  37.2k|  if (fd < 0)
  ------------------
  |  Branch (89:7): [True: 0, False: 37.2k]
  ------------------
   90|      0|    return -1;
   91|       |
   92|  37.2k|  if (fstat (fd, &stat) < 0)
  ------------------
  |  Branch (92:7): [True: 0, False: 37.2k]
  ------------------
   93|      0|    {
   94|      0|      close (fd);
   95|      0|      return -1;
   96|      0|    }
   97|       |
   98|  37.2k|  ei->size = stat.st_size;
   99|  37.2k|  ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
  100|  37.2k|  close (fd);
  101|  37.2k|  if (ei->image == MAP_FAILED)
  ------------------
  |  Branch (101:7): [True: 0, False: 37.2k]
  ------------------
  102|      0|    return -1;
  103|       |
  104|  37.2k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   42|  37.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (104:7): [True: 0, False: 37.2k]
  ------------------
  105|      0|  {
  106|      0|    mi_munmap(ei->image, ei->size);
  107|      0|    ei->image = NULL;
  108|      0|    return -1;
  109|      0|  }
  110|       |
  111|  37.2k|  return 0;
  112|  37.2k|}
os-linux.c:_Uelf64_valid_object:
   72|  37.2k|{
   73|  37.2k|  if (ei->size <= EI_VERSION)
  ------------------
  |  Branch (73:7): [True: 0, False: 37.2k]
  ------------------
   74|      0|    return 0;
   75|       |
   76|  37.2k|  return (memcmp (ei->image, ELFMAG, SELFMAG) == 0
  ------------------
  |  Branch (76:11): [True: 37.2k, False: 0]
  ------------------
   77|  37.2k|          && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS
  ------------------
  |  |    5|  37.2k|# define UNW_ELF_CLASS UNW_ELFCLASS64
  |  |  ------------------
  |  |  |  |   82|  74.4k|# define UNW_ELFCLASS64 ELFCLASS64
  |  |  ------------------
  ------------------
  |  Branch (77:14): [True: 37.2k, False: 0]
  ------------------
   78|  37.2k|          && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE
  ------------------
  |  Branch (78:14): [True: 37.2k, False: 0]
  ------------------
   79|  37.2k|          && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT);
  ------------------
  |  Branch (79:14): [True: 37.2k, False: 0]
  ------------------
   80|  37.2k|}

_UIx86_64_address_is_valid:
  250|   111k|{
  251|   111k|  if (len == 0)
  ------------------
  |  Branch (251:7): [True: 0, False: 111k]
  ------------------
  252|      0|    return true;
  253|       |
  254|       |  /*
  255|       |   * Find the starting address of the page containing the start of the range.
  256|       |   */
  257|   111k|  unw_word_t start_page_addr = unw_page_start (addr);
  258|       |
  259|       |  /*
  260|       |   * Bounds check on bottom of memory: first page is always deemed inaccessible.
  261|       |   * This is potentially incorrect on an embedded system, especially one running
  262|       |   * on bare metal with no VMM, but the check has always been here and no one
  263|       |   * has complained.
  264|       |   */
  265|   111k|  if (start_page_addr == 0)
  ------------------
  |  Branch (265:7): [True: 0, False: 111k]
  ------------------
  266|      0|    return false;
  267|       |
  268|       |  /*
  269|       |   * Bounds check on top of memory. Unsigned wraparound could be hazardous.
  270|       |   */
  271|   111k|  if (addr > (UNW_WORD_MAX - len - unw_page_size))
  ------------------
  |  |   61|   111k|#define UNW_WORD_MAX UINT64_MAX
  ------------------
  |  Branch (271:7): [True: 0, False: 111k]
  ------------------
  272|      0|    return false;
  273|       |
  274|       |  /*
  275|       |   * Find the starting address of the page containing the end of the range.
  276|       |   */
  277|   111k|  unw_word_t end_page_addr = unw_page_start (addr + (len - 1)) + unw_page_size;
  278|       |
  279|       |  /*
  280|       |   * Step through each page and check if the first address in each is readable.
  281|       |   * The first non-readable page encountered means none of them in the given
  282|       |   * range can be considered readable.
  283|       |   */
  284|   111k|  for (unw_word_t page_addr = start_page_addr;
  285|   223k|       page_addr < end_page_addr;
  ------------------
  |  Branch (285:8): [True: 111k, False: 111k]
  ------------------
  286|   111k|       page_addr += unw_page_size)
  287|   111k|    {
  288|   111k|      if (!_is_cached_valid_mem(page_addr))
  ------------------
  |  Branch (288:11): [True: 2, False: 111k]
  ------------------
  289|      2|        {
  290|       |          /* Check 'addr' in first page to avoid uninitialized memory access. */
  291|      2|          if (!_write_validate ((page_addr == start_page_addr) ? addr : page_addr))
  ------------------
  |  Branch (291:15): [True: 0, False: 2]
  |  Branch (291:33): [True: 2, False: 0]
  ------------------
  292|      0|            {
  293|      0|              Debug(1, "returning false\n");
  294|      0|              return false;
  295|      0|            }
  296|      2|          _cache_valid_mem(page_addr);
  297|      2|        }
  298|   111k|    }
  299|       |
  300|   111k|  return true;
  301|   111k|}
Laddress_validator.c:_is_cached_valid_mem:
  195|   111k|{
  196|   111k|  int i;
  197|   307k|  for (i = 0; i < NLGA; i++)
  ------------------
  |  Branch (197:15): [True: 307k, False: 2]
  ------------------
  198|   307k|    {
  199|   307k|      if (page_addr == atomic_load(&last_good_addr[i]))
  ------------------
  |  Branch (199:11): [True: 111k, False: 195k]
  ------------------
  200|   111k|        return true;
  201|   307k|    }
  202|      2|  return false;
  203|   111k|}
Laddress_validator.c:_write_validate:
  101|      2|{
  102|      2|  int ret = -1;
  103|      2|  ssize_t bytes = 0;
  104|       |
  105|      2|  if (unlikely (_mem_validate_pipe[0] == -1))
  ------------------
  |  |   68|      2|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 1, False: 1]
  |  |  ------------------
  ------------------
  106|      1|    {
  107|      1|      if (_open_pipe () != 0)
  ------------------
  |  Branch (107:11): [True: 0, False: 1]
  ------------------
  108|      0|        {
  109|      0|          return false;
  110|      0|        }
  111|      1|    }
  112|       |
  113|      2|  do
  114|      2|    {
  115|      2|      char buf;
  116|      2|      bytes = read (_mem_validate_pipe[0], &buf, 1);
  117|      2|    }
  118|      2|  while ( errno == EINTR );
  ------------------
  |  Branch (118:11): [True: 0, False: 2]
  ------------------
  119|       |
  120|      2|  if (!(bytes > 0 || errno == EAGAIN || errno == EWOULDBLOCK))
  ------------------
  |  Branch (120:9): [True: 1, False: 1]
  |  Branch (120:22): [True: 1, False: 0]
  |  Branch (120:41): [True: 0, False: 0]
  ------------------
  121|      0|    {
  122|       |      // re-open closed pipe
  123|      0|      if (_open_pipe () != 0)
  ------------------
  |  Branch (123:11): [True: 0, False: 0]
  ------------------
  124|      0|        {
  125|      0|          return false;
  126|      0|        }
  127|      0|    }
  128|       |
  129|      2|  do
  130|      2|    {
  131|      2|#ifdef HAVE_SYS_SYSCALL_H
  132|       |      /* use syscall insteadof write() so that ASAN does not complain */
  133|      2|      ret = syscall (SYS_write, _mem_validate_pipe[1], addr, 1);
  134|       |#else
  135|       |      ret = write (_mem_validate_pipe[1], (void *)addr, 1);
  136|       |#endif
  137|      2|    }
  138|      2|  while ( errno == EINTR );
  ------------------
  |  Branch (138:11): [True: 0, False: 2]
  ------------------
  139|       |
  140|      2|  return ret > 0;
  141|      2|}
Laddress_validator.c:_open_pipe:
   78|      1|{
   79|      1|  if (_mem_validate_pipe[0] != -1)
  ------------------
  |  Branch (79:7): [True: 0, False: 1]
  ------------------
   80|      0|    close (_mem_validate_pipe[0]);
   81|      1|  if (_mem_validate_pipe[1] != -1)
  ------------------
  |  Branch (81:7): [True: 0, False: 1]
  ------------------
   82|      0|    close (_mem_validate_pipe[1]);
   83|       |
   84|      1|  return _do_pipe2 (_mem_validate_pipe);
   85|      1|}
Laddress_validator.c:_do_pipe2:
   45|      1|{
   46|      1|  return pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK);
   47|      1|}
Laddress_validator.c:_cache_valid_mem:
  215|      2|{
  216|      2|  unw_word_t zero = 0;
  217|      2|  int victim = atomic_load(&lga_victim);
  218|      4|  for (int i = 0; i < NLGA; i++)
  ------------------
  |  Branch (218:19): [True: 4, False: 0]
  ------------------
  219|      4|    {
  220|      4|      if (atomic_compare_exchange_strong(&last_good_addr[victim], &zero, page_addr))
  ------------------
  |  Branch (220:11): [True: 2, False: 2]
  ------------------
  221|      2|        {
  222|      2|          return;
  223|      2|        }
  224|      2|      victim = (victim + 1) % NLGA;
  225|      2|    }
  226|       |
  227|       |  /* All slots full. Evict the victim. */
  228|      2|  atomic_store(&last_good_addr[victim], page_addr);
  229|      0|  victim = (victim + 1) % NLGA;
  230|       |  atomic_store(&lga_victim, victim);
  231|      0|}

_ULx86_64_Ifind_dynamic_proc_info:
   90|  37.2k|{
   91|  37.2k|  if (as == unw_local_addr_space)
  ------------------
  |  |  274|  37.2k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  37.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (91:7): [True: 37.2k, False: 0]
  ------------------
   92|  37.2k|    return local_find_proc_info (as, ip, pi, need_unwind_info, arg);
   93|      0|  else
   94|      0|    return remote_find_proc_info (as, ip, pi, need_unwind_info, arg);
   95|  37.2k|}
Lfind_dynamic_proc_info.c:local_find_proc_info:
   42|  37.2k|{
   43|  37.2k|  unw_dyn_info_list_t *list;
   44|  37.2k|  unw_dyn_info_t *di;
   45|       |
   46|       |#ifndef UNW_LOCAL_ONLY
   47|       |# pragma weak _U_dyn_info_list_addr
   48|       |  if (!_U_dyn_info_list_addr)
   49|       |    return -UNW_ENOINFO;
   50|       |#endif
   51|       |
   52|       |  // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
   53|  37.2k|  list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr ();
   54|  37.2k|  for (di = list->first; di; di = di->next)
  ------------------
  |  Branch (54:26): [True: 0, False: 37.2k]
  ------------------
   55|      0|    if (ip >= di->start_ip && ip < di->end_ip)
  ------------------
  |  Branch (55:9): [True: 0, False: 0]
  |  Branch (55:31): [True: 0, False: 0]
  ------------------
   56|      0|      return unwi_extract_dynamic_proc_info (as, ip, pi, di, need_unwind_info,
  ------------------
  |  |  269|      0|#define unwi_extract_dynamic_proc_info  UNWI_OBJ(extract_dynamic_proc_info)
  |  |  ------------------
  |  |  |  |  173|      0|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|      0|                                             arg);
   58|  37.2k|  return -UNW_ENOINFO;
   59|  37.2k|}

_Ux86_64_get_accessors:
   34|  98.4k|{
   35|  98.4k|  if (!atomic_load(&tdep_init_done))
  ------------------
  |  Branch (35:7): [True: 0, False: 98.4k]
  ------------------
   36|      0|    tdep_init ();
  ------------------
  |  |  232|      0|#define tdep_init                       UNW_OBJ(init)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   37|  98.4k|  return &as->acc;
   38|  98.4k|}

_ULx86_64_get_proc_name_by_ip:
   52|  37.2k|{
   53|  37.2k|  unw_accessors_t *a = unw_get_accessors_int (as);
  ------------------
  |  |  278|  37.2k|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|  37.2k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  37.2k|  unw_proc_info_t pi;
   55|  37.2k|  int ret;
   56|       |
   57|  37.2k|  buf[0] = '\0';        /* always return a valid string, even if it's empty */
   58|       |
   59|  37.2k|  ret = unwi_find_dynamic_proc_info (as, ip, &pi, 1, arg);
  ------------------
  |  |  268|  37.2k|#define unwi_find_dynamic_proc_info     UNWI_OBJ(find_dynamic_proc_info)
  |  |  ------------------
  |  |  |  |  173|  37.2k|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  37.2k|  if (ret == 0)
  ------------------
  |  Branch (60:7): [True: 0, False: 37.2k]
  ------------------
   61|      0|    {
   62|      0|      unw_dyn_info_t *di = pi.unwind_info;
   63|       |
   64|      0|      if (offp)
  ------------------
  |  Branch (64:11): [True: 0, False: 0]
  ------------------
   65|      0|        *offp = ip - pi.start_ip;
   66|       |
   67|      0|      switch (di->format)
   68|      0|        {
   69|      0|        case UNW_INFO_FORMAT_DYNAMIC:
  ------------------
  |  Branch (69:9): [True: 0, False: 0]
  ------------------
   70|      0|          ret = intern_string (as, a, di->u.pi.name_ptr, buf, buf_len, arg);
   71|      0|          break;
   72|       |
   73|      0|        case UNW_INFO_FORMAT_TABLE:
  ------------------
  |  Branch (73:9): [True: 0, False: 0]
  ------------------
   74|      0|        case UNW_INFO_FORMAT_REMOTE_TABLE:
  ------------------
  |  Branch (74:9): [True: 0, False: 0]
  ------------------
   75|       |          /* XXX should we create a fake name, e.g.: "tablenameN",
   76|       |             where N is the index of the function in the table??? */
   77|      0|          ret = -UNW_ENOINFO;
   78|      0|          break;
   79|       |
   80|      0|        default:
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|          ret = -UNW_EINVAL;
   82|      0|          break;
   83|      0|        }
   84|      0|      unwi_put_dynamic_unwind_info (as, &pi, arg);
  ------------------
  |  |  270|      0|#define unwi_put_dynamic_unwind_info    UNWI_OBJ(put_dynamic_unwind_info)
  |  |  ------------------
  |  |  |  |  173|      0|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|      0|      return ret;
   86|      0|    }
   87|       |
   88|  37.2k|  if (ret != -UNW_ENOINFO)
  ------------------
  |  Branch (88:7): [True: 0, False: 37.2k]
  ------------------
   89|      0|    return ret;
   90|       |
   91|       |  /* not a dynamic procedure, try to lookup static procedure name: */
   92|       |
   93|  37.2k|  if (a->get_proc_name)
  ------------------
  |  Branch (93:7): [True: 37.2k, False: 0]
  ------------------
   94|  37.2k|    return (*a->get_proc_name) (as, ip, buf, buf_len, offp, arg);
   95|       |
   96|      0|  return -UNW_ENOINFO;
   97|  37.2k|}
_ULx86_64_get_proc_name:
  102|  37.2k|{
  103|  37.2k|  struct cursor *c = (struct cursor *) cursor;
  104|  37.2k|  unw_word_t ip;
  105|  37.2k|  int error;
  106|       |
  107|  37.2k|  ip = tdep_get_ip (c);
  ------------------
  |  |  270|  37.2k|#define tdep_get_ip(c)                  ((c)->dwarf.ip)
  ------------------
  108|  37.2k|#if !defined(__ia64__)
  109|  37.2k|  if (c->dwarf.use_prev_instr)
  ------------------
  |  Branch (109:7): [True: 37.2k, False: 0]
  ------------------
  110|  37.2k|    {
  111|       |#if defined(__arm__)
  112|       |      /* On arm, the least bit denotes thumb/arm mode, clear it. */
  113|       |      ip &= ~(unw_word_t)0x1;
  114|       |#endif
  115|  37.2k|      --ip;
  116|  37.2k|    }
  117|       |
  118|       |
  119|  37.2k|#endif
  120|  37.2k|  error = unw_get_proc_name_by_ip (tdep_get_as (c), ip, buf, buf_len, offp,
  ------------------
  |  |  297|  37.2k|#define unw_get_proc_name_by_ip		UNW_OBJ(get_proc_name_by_ip)
  |  |  ------------------
  |  |  |  |   48|  37.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  37.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  37.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                error = unw_get_proc_name_by_ip (tdep_get_as (c), ip, buf, buf_len, offp,
  ------------------
  |  |  268|  37.2k|#define tdep_get_as(c)                  ((c)->dwarf.as)
  ------------------
  121|  37.2k|                                   tdep_get_as_arg (c));
  ------------------
  |  |  269|  37.2k|#define tdep_get_as_arg(c)              ((c)->dwarf.as_arg)
  ------------------
  122|  37.2k|#if !defined(__ia64__)
  123|  37.2k|  if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
  ------------------
  |  Branch (123:7): [True: 37.2k, False: 0]
  |  Branch (123:34): [True: 37.2k, False: 0]
  |  Branch (123:50): [True: 37.2k, False: 0]
  ------------------
  124|  37.2k|    *offp += 1;
  125|  37.2k|#endif
  126|  37.2k|  return error;
  127|  37.2k|}

_ULx86_64_get_reg:
   30|  73.2k|{
   31|  73.2k|  struct cursor *c = (struct cursor *) cursor;
   32|       |
   33|       |  // We can get the IP value directly without needing a lookup.
   34|  73.2k|  if (regnum == UNW_REG_IP)
  ------------------
  |  Branch (34:7): [True: 392, False: 72.8k]
  ------------------
   35|    392|    {
   36|    392|      *valp = tdep_get_ip (c);
  ------------------
  |  |  270|    392|#define tdep_get_ip(c)                  ((c)->dwarf.ip)
  ------------------
   37|    392|      return 0;
   38|    392|    }
   39|       |
   40|  72.8k|  return tdep_access_reg (c, regnum, valp, 0);
  ------------------
  |  |  239|  72.8k|#define tdep_access_reg                 UNW_OBJ(access_reg)
  |  |  ------------------
  |  |  |  |   48|  72.8k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  72.8k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  72.8k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|  73.2k|}

_U_dyn_info_list_addr:
   32|  37.2k|{
   33|  37.2k|  return (unw_word_t) (uintptr_t) &_U_dyn_info_list;
   34|  37.2k|}

_Ux86_64_flush_cache:
   31|      1|{
   32|      1|#if !UNW_TARGET_IA64
   33|      1|  struct unw_debug_frame_list *w = as->debug_frames;
   34|       |
   35|      1|  while (w)
  ------------------
  |  Branch (35:10): [True: 0, False: 1]
  ------------------
   36|      0|    {
   37|      0|      struct unw_debug_frame_list *n = w->next;
   38|       |
   39|      0|      if (w->index)
  ------------------
  |  Branch (39:11): [True: 0, False: 0]
  ------------------
   40|      0|        mi_munmap (w->index, w->index_size);
   41|       |
   42|      0|      mi_munmap (w->debug_frame, w->debug_frame_size);
   43|      0|      mi_munmap (w, sizeof (*w));
   44|      0|      w = n;
   45|      0|    }
   46|      1|  as->debug_frames = NULL;
   47|      1|#endif
   48|       |
   49|       |  /* clear dyn_info_list_addr cache: */
   50|      1|  as->dyn_info_list_addr = 0;
   51|       |
   52|       |  /* This lets us flush caches lazily.  The implementation currently
   53|       |     ignores the flush range arguments (lo-hi).  This is OK because
   54|       |     unw_flush_cache() is allowed to flush more than the requested
   55|       |     range. */
   56|       |  atomic_fetch_add (&as->cache_generation, 1);
   57|      1|}

_UIx86_64_mi_init:
   69|      1|{
   70|       |#if UNW_DEBUG
   71|       |  const char *str = getenv ("UNW_DEBUG_LEVEL");
   72|       |
   73|       |  if (str)
   74|       |    unwi_debug_level = atoi (str);
   75|       |
   76|       |  if (unwi_debug_level > 0)
   77|       |    {
   78|       |      setbuf (stdout, NULL);
   79|       |      setbuf (stderr, NULL);
   80|       |    }
   81|       |#endif
   82|      1|  unw_init_page_size();
   83|       |  assert(sizeof(struct cursor) <= sizeof(unw_cursor_t));
  ------------------
  |  Branch (83:3): [True: 0, Folded]
  |  Branch (83:3): [True: 1, Folded]
  ------------------
   84|      1|}
init.c:unw_init_page_size:
   45|      1|{
   46|      1|  errno = 0;
   47|      1|  long result = sysconf (_SC_PAGESIZE);
   48|      1|  if (result == -1)
  ------------------
  |  Branch (48:7): [True: 0, False: 1]
  ------------------
   49|      0|    {
   50|      0|      if (errno != 0)
  ------------------
  |  Branch (50:11): [True: 0, False: 0]
  ------------------
   51|      0|        {
   52|      0|          print_error ("Failed to get _SC_PAGESIZE: ");
   53|      0|          print_error (strerror(errno));
   54|      0|          print_error ("\n");
   55|      0|        }
   56|      0|        else
   57|      0|          print_error ("Failed to get _SC_PAGESIZE, errno was not set.\n");
   58|       |
   59|      0|      unw_page_size = 4096;
   60|      0|    }
   61|      1|  else
   62|      1|    {
   63|      1|      unw_page_size = result;
   64|      1|    }
   65|      1|}

_UIx86_64__mempool_init:
  110|      2|{
  111|      2|  memset (pool, 0, sizeof (*pool));
  112|       |
  113|      2|  lock_init (&pool->lock);
  ------------------
  |  |  210|      2|#define lock_init(l)            mutex_init (l)
  |  |  ------------------
  |  |  |  |  167|      2|        (pthread_mutex_init != NULL ? pthread_mutex_init ((l), NULL) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:10): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|       |  /* round object-size up to integer multiple of MAX_ALIGN */
  116|      2|  obj_size = UNW_ALIGN(obj_size, MAX_ALIGN);
  ------------------
  |  |  439|      2|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  117|       |
  118|      2|  if (!reserve)
  ------------------
  |  Branch (118:7): [True: 2, False: 0]
  ------------------
  119|      2|    {
  120|      2|      reserve = unw_page_size / obj_size / 4;
  121|      2|      if (!reserve)
  ------------------
  |  Branch (121:11): [True: 0, False: 2]
  ------------------
  122|      0|        reserve = 16;
  123|      2|    }
  124|       |
  125|      2|  pool->obj_size = obj_size;
  126|      2|  pool->reserve = reserve;
  127|      2|  pool->chunk_size = UNW_ALIGN(2*reserve*obj_size, unw_page_size);
  ------------------
  |  |  439|      2|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  128|       |
  129|      2|  expand (pool);
  130|      2|}
_UIx86_64__mempool_alloc:
  134|     15|{
  135|     15|  intrmask_t saved_mask;
  136|     15|  struct object *obj;
  137|       |
  138|     15|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     15|#define lock_acquire(l,m)                               \
  |  |  212|     15|do {                                                    \
  |  |  213|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     15|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     15|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  139|     15|  {
  140|     15|    if (pool->num_free <= pool->reserve)
  ------------------
  |  Branch (140:9): [True: 0, False: 15]
  ------------------
  141|      0|      expand (pool);
  142|       |
  143|     15|    assert (pool->num_free > 0);
  ------------------
  |  Branch (143:5): [True: 0, False: 15]
  |  Branch (143:5): [True: 15, False: 0]
  ------------------
  144|       |
  145|     15|    --pool->num_free;
  146|     15|    obj = pool->free_list;
  147|     15|    pool->free_list = obj->next;
  148|     15|  }
  149|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     15|#define lock_release(l,m)                       \
  |  |  217|     15|do {                                            \
  |  |  218|     15|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     15|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     15|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  150|     15|  return obj;
  151|     15|}
_UIx86_64__mempool_free:
  155|     15|{
  156|     15|  intrmask_t saved_mask;
  157|       |
  158|     15|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     15|#define lock_acquire(l,m)                               \
  |  |  212|     15|do {                                                    \
  |  |  213|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     15|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     15|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  159|     15|  {
  160|     15|    free_object (pool, object);
  161|     15|  }
  162|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     15|#define lock_release(l,m)                       \
  |  |  217|     15|do {                                            \
  |  |  218|     15|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     15|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     15|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  163|     15|}
mempool.c:expand:
   88|      2|{
   89|      2|  size_t size;
   90|      2|  char *mem;
   91|       |
   92|      2|  size = pool->chunk_size;
   93|      2|  GET_MEMORY (mem, size);
  ------------------
  |  |  260|      2|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      2|do {                                                                        \
  |  |  262|      2|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      2|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      2|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 2]
  |  |  ------------------
  |  |  265|      2|    mem = NULL;                                                             \
  |  |  266|      2|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 2]
  |  |  ------------------
  ------------------
   94|      2|  if (!mem)
  ------------------
  |  Branch (94:7): [True: 0, False: 2]
  ------------------
   95|      0|    {
   96|      0|      size = UNW_ALIGN(pool->obj_size, unw_page_size);
  ------------------
  |  |  439|      0|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
   97|      0|      GET_MEMORY (mem, size);
  ------------------
  |  |  260|      0|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      0|do {                                                                        \
  |  |  262|      0|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      0|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      0|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  265|      0|    mem = NULL;                                                             \
  |  |  266|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
   98|      0|      if (!mem)
  ------------------
  |  Branch (98:11): [True: 0, False: 0]
  ------------------
   99|      0|        {
  100|       |          /* last chance: try to allocate one object from the SOS memory */
  101|      0|          size = pool->obj_size;
  102|      0|          mem = sos_alloc (size);
  ------------------
  |  |   54|      0|#define sos_alloc(s)            UNWI_ARCH_OBJ(_sos_alloc)(s)
  |  |  ------------------
  |  |  |  |  174|      0|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|      0|        }
  104|      0|    }
  105|      2|  add_memory (pool, mem, size, pool->obj_size);
  106|      2|}
mempool.c:add_memory:
   79|      2|{
   80|      2|  char *obj;
   81|       |
   82|     74|  for (obj = mem; obj <= mem + size - obj_size; obj += obj_size)
  ------------------
  |  Branch (82:19): [True: 72, False: 2]
  ------------------
   83|     72|    free_object (pool, obj);
   84|      2|}
mempool.c:free_object:
   69|     87|{
   70|     87|  struct object *obj = object;
   71|       |
   72|     87|  obj->next = pool->free_list;
   73|     87|  pool->free_list = obj;
   74|     87|  ++pool->num_free;
   75|     87|}

_Ux86_64_get_elf_image:
   51|  37.2k|{
   52|  37.2k|  struct map_iterator mi;
   53|  37.2k|  int found = 0, rc = UNW_ESUCCESS;
   54|  37.2k|  unsigned long hi;
   55|  37.2k|  char root[sizeof ("/proc/0123456789/root")], *cp;
   56|  37.2k|  char *full_path;
   57|  37.2k|  struct stat st;
   58|  37.2k|  unw_accessors_t *a;
   59|  37.2k|  unw_word_t magic;
   60|       |
   61|       |
   62|  37.2k|  if (maps_init (&mi, pid) < 0)
  ------------------
  |  Branch (62:7): [True: 0, False: 37.2k]
  ------------------
   63|      0|    return -1;
   64|       |
   65|   130k|  while (maps_next (&mi, segbase, &hi, mapoff, NULL))
  ------------------
  |  Branch (65:10): [True: 130k, False: 0]
  ------------------
   66|   130k|    if (ip >= *segbase && ip < hi)
  ------------------
  |  Branch (66:9): [True: 130k, False: 0]
  |  Branch (66:27): [True: 37.2k, False: 93.0k]
  ------------------
   67|  37.2k|      {
   68|  37.2k|        found = 1;
   69|  37.2k|        break;
   70|  37.2k|      }
   71|       |
   72|  37.2k|  if (!found)
  ------------------
  |  Branch (72:7): [True: 0, False: 37.2k]
  ------------------
   73|      0|    {
   74|      0|      maps_close (&mi);
   75|      0|      return -1;
   76|      0|    }
   77|       |
   78|       |  // get path only, no need to map elf image
   79|  37.2k|  if (!ei && path)
  ------------------
  |  Branch (79:7): [True: 0, False: 37.2k]
  |  Branch (79:14): [True: 0, False: 0]
  ------------------
   80|      0|    {
   81|      0|      strncpy(path, mi.path, pathlen);
   82|      0|      path[pathlen - 1] = '\0';
   83|      0|      if (strlen(mi.path) >= pathlen)
  ------------------
  |  Branch (83:11): [True: 0, False: 0]
  ------------------
   84|      0|        rc = -UNW_ENOMEM;
   85|       |
   86|      0|      maps_close (&mi);
   87|      0|      return rc;
   88|      0|    }
   89|       |
   90|  37.2k|  full_path = mi.path;
   91|       |
   92|       |  /* Get process root */
   93|  37.2k|  memcpy (root, "/proc/", 6);
   94|  37.2k|  cp = unw_ltoa (root + 6, pid);
   95|  37.2k|  assert (cp + 6 < root + sizeof (root));
  ------------------
  |  Branch (95:3): [True: 0, False: 37.2k]
  |  Branch (95:3): [True: 37.2k, False: 0]
  ------------------
   96|  37.2k|  memcpy (cp, "/root", 6);
   97|       |
   98|  37.2k|  size_t _len = strlen (mi.path) + 1;
   99|  37.2k|  if (!stat(root, &st) && S_ISDIR(st.st_mode))
  ------------------
  |  Branch (99:7): [True: 37.2k, False: 0]
  |  Branch (99:27): [True: 37.2k, False: 0]
  ------------------
  100|  37.2k|    _len += strlen (root);
  101|      0|  else
  102|      0|    root[0] = '\0';
  103|       |
  104|  37.2k|  full_path = path;
  105|  37.2k|  if(!path)
  ------------------
  |  Branch (105:6): [True: 0, False: 37.2k]
  ------------------
  106|      0|    full_path = (char*) malloc (_len);
  107|  37.2k|  else if(_len >= pathlen) // passed buffer is too small, fail
  ------------------
  |  Branch (107:11): [True: 0, False: 37.2k]
  ------------------
  108|      0|    {
  109|      0|      maps_close (&mi);
  110|      0|      return -1;
  111|      0|    }
  112|       |
  113|  37.2k|  strcpy (full_path, root);
  114|  37.2k|  strcat (full_path, mi.path);
  115|       |
  116|  37.2k|  if (stat(full_path, &st) || !S_ISREG(st.st_mode))
  ------------------
  |  Branch (116:7): [True: 0, False: 37.2k]
  |  Branch (116:31): [True: 0, False: 37.2k]
  ------------------
  117|      0|    strcpy(full_path, mi.path);
  118|       |
  119|  37.2k|  rc = elf_map_image (ei, full_path);
  120|       |
  121|       |  /*Follwing code is adapted from 
  122|       |    https://sourceware.org/pipermail/frysk-cvs/2008q1/007245.html,
  123|       |    For VDSO there is no file in the file system, so read the ELF , 
  124|       |    and create mmaped file for the content of the VDSO 
  125|       |  */
  126|  37.2k|  if (rc != -1)
  ------------------
  |  Branch (126:7): [True: 37.2k, False: 0]
  ------------------
  127|  37.2k|  {
  128|  37.2k|    maps_close (&mi);
  129|  37.2k|    goto err_exit;
  130|  37.2k|  }
  131|       |
  132|       |  /* If the above failed, try to bring in page-sized segments directly
  133|       |     from process memory.  This enables us to locate VDSO unwind
  134|       |     tables.  */
  135|      0|  ei->size = hi - *segbase;
  136|      0|  if (ei->size > MAX_VDSO_SIZE) 
  ------------------
  |  |   38|      0|# define MAX_VDSO_SIZE ((size_t) 2 * sysconf (_SC_PAGESIZE))
  ------------------
  |  Branch (136:7): [True: 0, False: 0]
  ------------------
  137|      0|  {
  138|      0|    maps_close (&mi);
  139|      0|    goto err_exit;
  140|      0|  }
  141|       |
  142|      0|  a = unw_get_accessors (as);
  ------------------
  |  |  277|      0|#define unw_get_accessors		UNW_ARCH_OBJ(get_accessors)
  |  |  ------------------
  |  |  |  |   49|      0|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|      0|  if (! a->access_mem) 
  ------------------
  |  Branch (143:7): [True: 0, False: 0]
  ------------------
  144|      0|  {
  145|      0|    maps_close (&mi);
  146|      0|    goto err_exit;
  147|      0|  }
  148|       |
  149|       |  /* Try to decide whether it's an ELF image before bringing it all
  150|       |     in.  */
  151|      0|  if (ei->size <= EI_CLASS || ei->size <= sizeof (magic))
  ------------------
  |  Branch (151:7): [True: 0, False: 0]
  |  Branch (151:31): [True: 0, False: 0]
  ------------------
  152|      0|  {
  153|      0|    maps_close (&mi);
  154|      0|    goto err_exit;
  155|      0|  }
  156|       |
  157|      0|  if (sizeof (magic) >= SELFMAG)
  ------------------
  |  Branch (157:7): [True: 0, Folded]
  ------------------
  158|      0|    {
  159|      0|      int ret = (*a->access_mem) (as, *segbase, &magic, 0, arg);
  160|      0|      if (ret < 0)
  ------------------
  |  Branch (160:11): [True: 0, False: 0]
  ------------------
  161|      0|      {
  162|      0|        rc = ret;
  163|      0|        maps_close (&mi);
  164|      0|        goto err_exit;
  165|      0|      }
  166|       |
  167|      0|      if (memcmp (&magic, ELFMAG, SELFMAG) != 0)
  ------------------
  |  Branch (167:11): [True: 0, False: 0]
  ------------------
  168|      0|      {
  169|      0|        maps_close (&mi);
  170|      0|        goto err_exit;
  171|      0|      }
  172|      0|    }
  173|       |
  174|      0|  ei->image = mmap (0, ei->size, PROT_READ | PROT_WRITE,
  175|      0|           MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
  176|      0|  if (ei->image == MAP_FAILED)
  ------------------
  |  Branch (176:7): [True: 0, False: 0]
  ------------------
  177|      0|    {
  178|      0|      maps_close (&mi);
  179|      0|      goto err_exit;
  180|      0|    }
  181|       |
  182|      0|  if (sizeof (magic) >= SELFMAG)
  ------------------
  |  Branch (182:7): [True: 0, Folded]
  ------------------
  183|      0|    {
  184|      0|      *(unw_word_t *)ei->image = magic;
  185|      0|      hi = sizeof (magic);
  186|      0|    }
  187|      0|  else
  188|      0|    hi = 0;
  189|       |
  190|      0|  for (; hi < ei->size; hi += sizeof (unw_word_t))
  ------------------
  |  Branch (190:10): [True: 0, False: 0]
  ------------------
  191|      0|    {
  192|      0|      rc = (*a->access_mem) (as, *segbase + hi, ei->image + hi,
  193|      0|               0, arg);
  194|      0|      if (rc < 0)
  ------------------
  |  Branch (194:11): [True: 0, False: 0]
  ------------------
  195|      0|   {
  196|      0|     munmap (ei->image, ei->size);
  197|      0|     maps_close (&mi);
  198|      0|     goto err_exit;
  199|      0|   }
  200|      0|    }
  201|       |
  202|      0|  if (*segbase == *mapoff
  ------------------
  |  Branch (202:7): [True: 0, False: 0]
  ------------------
  203|      0|      && (*path == 0 || strcmp (path, "[vdso]") == 0))
  ------------------
  |  Branch (203:11): [True: 0, False: 0]
  |  Branch (203:25): [True: 0, False: 0]
  ------------------
  204|      0|    *mapoff = 0;
  205|       |
  206|  37.2k|err_exit:
  207|       |
  208|  37.2k|  if (!path)
  ------------------
  |  Branch (208:7): [True: 0, False: 37.2k]
  ------------------
  209|      0|    free (full_path);
  210|       |
  211|  37.2k|  maps_close (&mi);
  212|  37.2k|  return rc;
  213|      0|}

os-linux.c:maps_init:
   67|  37.2k|{
   68|  37.2k|  char path[sizeof ("/proc/0123456789/maps")], *cp;
   69|       |
   70|  37.2k|  memcpy (path, "/proc/", 6);
   71|  37.2k|  cp = unw_ltoa (path + 6, pid);
   72|  37.2k|  assert (cp + 6 < path + sizeof (path));
  ------------------
  |  Branch (72:3): [True: 0, False: 37.2k]
  |  Branch (72:3): [True: 37.2k, False: 0]
  ------------------
   73|  37.2k|  memcpy (cp, "/maps", 6);
   74|       |
   75|  37.2k|  mi->fd = open (path, O_RDONLY);
   76|  37.2k|  if (mi->fd >= 0)
  ------------------
  |  Branch (76:7): [True: 37.2k, False: 0]
  ------------------
   77|  37.2k|    {
   78|       |      /* Try to allocate a page-sized buffer.  */
   79|  37.2k|      mi->buf_size = getpagesize ();
   80|  37.2k|      GET_MEMORY (cp, mi->buf_size);
  ------------------
  |  |  260|  37.2k|#define GET_MEMORY(mem, size)                                               \
  |  |  261|  37.2k|do {                                                                        \
  |  |  262|  37.2k|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|  37.2k|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|  37.2k|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 37.2k]
  |  |  ------------------
  |  |  265|  37.2k|    mem = NULL;                                                             \
  |  |  266|  37.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 37.2k]
  |  |  ------------------
  ------------------
   81|  37.2k|      if (!cp)
  ------------------
  |  Branch (81:11): [True: 0, False: 37.2k]
  ------------------
   82|      0|        {
   83|      0|          close(mi->fd);
   84|      0|          mi->fd = -1;
   85|      0|          return -1;
   86|      0|        }
   87|  37.2k|      else
   88|  37.2k|        {
   89|  37.2k|          mi->offset = 0;
   90|  37.2k|          mi->buf = mi->buf_end = cp + mi->buf_size;
   91|  37.2k|          return 0;
   92|  37.2k|        }
   93|  37.2k|    }
   94|      0|  return -1;
   95|  37.2k|}
os-linux.c:maps_next:
  205|   130k|{
  206|   130k|  char perm[16], dash = 0, colon = 0, *cp;
  207|   130k|  unsigned long major, minor, inum;
  208|   130k|  ssize_t i, nread;
  209|       |
  210|   130k|  if (mi->fd < 0)
  ------------------
  |  Branch (210:7): [True: 0, False: 130k]
  ------------------
  211|      0|    return 0;
  212|       |
  213|   130k|  while (1)
  ------------------
  |  Branch (213:10): [True: 130k, Folded]
  ------------------
  214|   130k|    {
  215|   130k|      ssize_t bytes_left = mi->buf_end - mi->buf;
  216|   130k|      char *eol = NULL;
  217|       |
  218|  9.41M|      for (i = 0; i < bytes_left; ++i)
  ------------------
  |  Branch (218:19): [True: 9.37M, False: 37.2k]
  ------------------
  219|  9.37M|        {
  220|  9.37M|          if (mi->buf[i] == '\n')
  ------------------
  |  Branch (220:15): [True: 93.0k, False: 9.28M]
  ------------------
  221|  93.0k|            {
  222|  93.0k|              eol = mi->buf + i;
  223|  93.0k|              break;
  224|  93.0k|            }
  225|  9.28M|          else if (mi->buf[i] == '\0')
  ------------------
  |  Branch (225:20): [True: 0, False: 9.28M]
  ------------------
  226|      0|            break;
  227|  9.37M|        }
  228|   130k|      if (!eol)
  ------------------
  |  Branch (228:11): [True: 37.2k, False: 93.0k]
  ------------------
  229|  37.2k|        {
  230|       |          /* copy down the remaining bytes, if any */
  231|  37.2k|          if (bytes_left > 0)
  ------------------
  |  Branch (231:15): [True: 0, False: 37.2k]
  ------------------
  232|      0|            memmove (mi->buf_end - mi->buf_size, mi->buf, bytes_left);
  233|       |
  234|  37.2k|          mi->buf = mi->buf_end - mi->buf_size;
  235|  37.2k|          nread = read (mi->fd, mi->buf + bytes_left,
  236|  37.2k|                        mi->buf_size - bytes_left);
  237|  37.2k|          if (nread <= 0)
  ------------------
  |  Branch (237:15): [True: 0, False: 37.2k]
  ------------------
  238|      0|            return 0;
  239|  37.2k|          else if ((size_t) (nread + bytes_left) < mi->buf_size)
  ------------------
  |  Branch (239:20): [True: 37.2k, False: 0]
  ------------------
  240|  37.2k|            {
  241|       |              /* Move contents to the end of the buffer so we
  242|       |                 maintain the invariant that all bytes between
  243|       |                 mi->buf and mi->buf_end are valid.  */
  244|  37.2k|              memmove (mi->buf_end - nread - bytes_left, mi->buf,
  245|  37.2k|                       nread + bytes_left);
  246|  37.2k|              mi->buf = mi->buf_end - nread - bytes_left;
  247|  37.2k|            }
  248|       |
  249|  37.2k|          eol = mi->buf + bytes_left + nread - 1;
  250|       |
  251|  4.79M|          for (i = bytes_left; i < bytes_left + nread; ++i)
  ------------------
  |  Branch (251:32): [True: 4.79M, False: 0]
  ------------------
  252|  4.79M|            if (mi->buf[i] == '\n')
  ------------------
  |  Branch (252:17): [True: 37.2k, False: 4.76M]
  ------------------
  253|  37.2k|              {
  254|  37.2k|                eol = mi->buf + i;
  255|  37.2k|                break;
  256|  37.2k|              }
  257|  37.2k|        }
  258|   130k|      cp = mi->buf;
  259|   130k|      mi->buf = eol + 1;
  260|   130k|      *eol = '\0';
  261|       |
  262|       |      /* scan: "LOW-HIGH PERM OFFSET MAJOR:MINOR INUM PATH" */
  263|   130k|      cp = scan_hex (cp, low);
  264|   130k|      cp = scan_char (cp, &dash);
  265|   130k|      cp = scan_hex (cp, high);
  266|   130k|      cp = scan_string (cp, perm, sizeof (perm));
  267|   130k|      cp = scan_hex (cp, offset);
  268|   130k|      cp = scan_hex (cp, &major);
  269|   130k|      cp = scan_char (cp, &colon);
  270|   130k|      cp = scan_hex (cp, &minor);
  271|   130k|      cp = scan_dec (cp, &inum);
  272|   130k|      cp = mi->path = skip_whitespace (cp);
  273|   130k|      if (!cp)
  ------------------
  |  Branch (273:11): [True: 0, False: 130k]
  ------------------
  274|      0|        continue;
  275|   130k|      cp = scan_string (cp, NULL, 0);
  276|   130k|      if (dash != '-' || colon != ':')
  ------------------
  |  Branch (276:11): [True: 0, False: 130k]
  |  Branch (276:26): [True: 0, False: 130k]
  ------------------
  277|      0|        continue;       /* skip line with unknown or bad format */
  278|   130k|      if (flags)
  ------------------
  |  Branch (278:11): [True: 0, False: 130k]
  ------------------
  279|      0|        {
  280|      0|          *flags = 0;
  281|      0|          if (perm[0] == 'r')
  ------------------
  |  Branch (281:15): [True: 0, False: 0]
  ------------------
  282|      0|            {
  283|      0|              *flags |= PROT_READ;
  284|      0|            }
  285|      0|          if (perm[1] == 'w')
  ------------------
  |  Branch (285:15): [True: 0, False: 0]
  ------------------
  286|      0|            {
  287|      0|              *flags |= PROT_WRITE;
  288|      0|            }
  289|      0|          if (perm[2] == 'x')
  ------------------
  |  Branch (289:15): [True: 0, False: 0]
  ------------------
  290|      0|            {
  291|      0|              *flags |= PROT_EXEC;
  292|      0|            }
  293|      0|        }
  294|   130k|      return 1;
  295|   130k|    }
  296|      0|  return 0;
  297|   130k|}
os-linux.c:scan_hex:
  110|   651k|{
  111|   651k|  unsigned long num_digits = 0, digit, val = 0;
  112|       |
  113|   651k|  cp = skip_whitespace (cp);
  114|   651k|  if (!cp)
  ------------------
  |  Branch (114:7): [True: 0, False: 651k]
  ------------------
  115|      0|    return NULL;
  116|       |
  117|  5.33M|  while (1)
  ------------------
  |  Branch (117:10): [True: 5.33M, Folded]
  ------------------
  118|  5.33M|    {
  119|  5.33M|      digit = *cp;
  120|  5.33M|      if ((digit - '0') <= 9)
  ------------------
  |  Branch (120:11): [True: 3.40M, False: 1.92M]
  ------------------
  121|  3.40M|        digit -= '0';
  122|  1.92M|      else if ((digit - 'A') < 6)
  ------------------
  |  Branch (122:16): [True: 0, False: 1.92M]
  ------------------
  123|      0|        digit -= 'A' - 10;
  124|  1.92M|      else if ((digit - 'a') < 6)
  ------------------
  |  Branch (124:16): [True: 1.27M, False: 651k]
  ------------------
  125|  1.27M|        digit -= 'a' - 10;
  126|   651k|      else
  127|   651k|        break;
  128|  4.68M|      val = (val << 4) | digit;
  129|  4.68M|      ++num_digits;
  130|  4.68M|      ++cp;
  131|  4.68M|    }
  132|   651k|  if (!num_digits)
  ------------------
  |  Branch (132:7): [True: 0, False: 651k]
  ------------------
  133|      0|    return NULL;
  134|   651k|  *valp = val;
  135|   651k|  return cp;
  136|   651k|}
os-linux.c:scan_char:
  167|   260k|{
  168|   260k|  if (!cp)
  ------------------
  |  Branch (168:7): [True: 0, False: 260k]
  ------------------
  169|      0|    return NULL;
  170|       |
  171|   260k|  *valp = *cp;
  172|       |
  173|       |  /* don't step over NUL terminator */
  174|   260k|  if (*cp)
  ------------------
  |  Branch (174:7): [True: 260k, False: 0]
  ------------------
  175|   260k|    ++cp;
  176|   260k|  return cp;
  177|   260k|}
os-linux.c:scan_string:
  183|   260k|{
  184|   260k|  size_t i = 0;
  185|       |
  186|   260k|  if (!(cp = skip_whitespace (cp)))
  ------------------
  |  Branch (186:7): [True: 0, False: 260k]
  ------------------
  187|      0|    return NULL;
  188|       |
  189|  6.02M|  while (*cp != ' ' && *cp != '\t' && *cp != '\0')
  ------------------
  |  Branch (189:10): [True: 5.89M, False: 130k]
  |  Branch (189:24): [True: 5.89M, False: 0]
  |  Branch (189:39): [True: 5.76M, False: 130k]
  ------------------
  190|  5.76M|    {
  191|  5.76M|      if ((valp != NULL) && (i < buf_size - 1))
  ------------------
  |  Branch (191:11): [True: 520k, False: 5.24M]
  |  Branch (191:29): [True: 520k, False: 0]
  ------------------
  192|   520k|        valp[i++] = *cp;
  193|  5.76M|      ++cp;
  194|  5.76M|    }
  195|   260k|  if (i == 0 || i >= buf_size)
  ------------------
  |  Branch (195:7): [True: 130k, False: 130k]
  |  Branch (195:17): [True: 0, False: 130k]
  ------------------
  196|   130k|    return NULL;
  197|   130k|  valp[i] = '\0';
  198|   130k|  return cp;
  199|   260k|}
os-linux.c:scan_dec:
  140|   130k|{
  141|   130k|  unsigned long num_digits = 0, digit, val = 0;
  142|       |
  143|   130k|  if (!(cp = skip_whitespace (cp)))
  ------------------
  |  Branch (143:7): [True: 0, False: 130k]
  ------------------
  144|      0|    return NULL;
  145|       |
  146|   846k|  while (1)
  ------------------
  |  Branch (146:10): [True: 846k, Folded]
  ------------------
  147|   846k|    {
  148|   846k|      digit = *cp;
  149|   846k|      if ((digit - '0') <= 9)
  ------------------
  |  Branch (149:11): [True: 716k, False: 130k]
  ------------------
  150|   716k|        {
  151|   716k|          digit -= '0';
  152|   716k|          ++cp;
  153|   716k|        }
  154|   130k|      else
  155|   130k|        break;
  156|   716k|      val = (10 * val) + digit;
  157|   716k|      ++num_digits;
  158|   716k|    }
  159|   130k|  if (!num_digits)
  ------------------
  |  Branch (159:7): [True: 0, False: 130k]
  ------------------
  160|      0|    return NULL;
  161|   130k|  *valp = val;
  162|   130k|  return cp;
  163|   130k|}
os-linux.c:skip_whitespace:
   99|  1.17M|{
  100|  1.17M|  if (!cp)
  ------------------
  |  Branch (100:7): [True: 0, False: 1.17M]
  ------------------
  101|      0|    return NULL;
  102|       |
  103|  3.79M|  while (*cp == ' ' || *cp == '\t')
  ------------------
  |  Branch (103:10): [True: 2.62M, False: 1.17M]
  |  Branch (103:24): [True: 0, False: 1.17M]
  ------------------
  104|  2.62M|    ++cp;
  105|  1.17M|  return cp;
  106|  1.17M|}
os-linux.c:maps_close:
  301|  74.4k|{
  302|  74.4k|  if (mi->fd < 0)
  ------------------
  |  Branch (302:7): [True: 37.2k, False: 37.2k]
  ------------------
  303|  37.2k|    return;
  304|  37.2k|  close (mi->fd);
  305|  37.2k|  mi->fd = -1;
  306|  37.2k|  if (mi->buf)
  ------------------
  |  Branch (306:7): [True: 37.2k, False: 0]
  ------------------
  307|  37.2k|    {
  308|  37.2k|      mi_munmap (mi->buf_end - mi->buf_size, mi->buf_size);
  309|       |      mi->buf = mi->buf_end = NULL;
  310|  37.2k|    }
  311|  37.2k|}
os-linux.c:unw_ltoa:
   42|  74.4k|{
   43|  74.4k|  char *cp = buf, tmp;
   44|  74.4k|  ssize_t i, len;
   45|       |
   46|  74.4k|  do
   47|   148k|    {
   48|   148k|      *cp++ = '0' + (val % 10);
   49|   148k|      val /= 10;
   50|   148k|    }
   51|   148k|  while (val);
  ------------------
  |  Branch (51:10): [True: 74.4k, False: 74.4k]
  ------------------
   52|       |
   53|       |  /* reverse the order of the digits: */
   54|  74.4k|  len = cp - buf;
   55|  74.4k|  --cp;
   56|   148k|  for (i = 0; i < len / 2; ++i)
  ------------------
  |  Branch (56:15): [True: 74.4k, False: 74.4k]
  ------------------
   57|  74.4k|    {
   58|  74.4k|      tmp = buf[i];
   59|  74.4k|      buf[i] = cp[-i];
   60|  74.4k|      cp[-i] = tmp;
   61|  74.4k|    }
   62|  74.4k|  return buf + len;
   63|  74.4k|}

_ULx86_64_get_save_loc:
   32|  3.98k|{
   33|  3.98k|  struct cursor *c = (struct cursor *) cursor;
   34|  3.98k|  dwarf_loc_t loc;
   35|       |
   36|  3.98k|  loc = DWARF_NULL_LOC;         /* default to "not saved" */
  ------------------
  |  |  155|  3.98k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  150|  3.98k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   37|       |
   38|  3.98k|  switch (reg)
   39|  3.98k|    {
   40|     64|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|     64|#define RBX     3
  ------------------
  |  Branch (40:5): [True: 64, False: 3.92k]
  ------------------
   41|    328|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|    328|#define RSP     7
  ------------------
  |  Branch (41:5): [True: 328, False: 3.65k]
  ------------------
   42|     24|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|     24|#define RBP     6
  ------------------
  |  Branch (42:5): [True: 24, False: 3.96k]
  ------------------
   43|     24|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|     24|#define R12     12
  ------------------
  |  Branch (43:5): [True: 24, False: 3.96k]
  ------------------
   44|    144|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|    144|#define R13     13
  ------------------
  |  Branch (44:5): [True: 144, False: 3.84k]
  ------------------
   45|      0|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|      0|#define R14     14
  ------------------
  |  Branch (45:5): [True: 0, False: 3.98k]
  ------------------
   46|    288|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|    288|#define R15     15
  ------------------
  |  Branch (46:5): [True: 288, False: 3.69k]
  ------------------
   47|     40|    case UNW_X86_64_RIP: loc = c->dwarf.loc[RIP]; break;
  ------------------
  |  |   59|     40|#define RIP     16
  ------------------
  |  Branch (47:5): [True: 40, False: 3.94k]
  ------------------
   48|       |
   49|  3.07k|    default:
  ------------------
  |  Branch (49:5): [True: 3.07k, False: 912]
  ------------------
   50|  3.07k|      break;
   51|  3.98k|    }
   52|       |
   53|  3.98k|  memset (sloc, 0, sizeof (*sloc));
   54|       |
   55|  3.98k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  156|  3.98k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  3.98k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 3.07k, False: 912]
  |  |  ------------------
  ------------------
   56|  3.07k|    {
   57|  3.07k|      sloc->type = UNW_SLT_NONE;
   58|  3.07k|      return 0;
   59|  3.07k|    }
   60|       |
   61|       |#if !defined(UNW_LOCAL_ONLY)
   62|       |  if (DWARF_IS_REG_LOC (loc))
   63|       |    {
   64|       |      sloc->type = UNW_SLT_REG;
   65|       |      sloc->u.regnum = DWARF_GET_REG_LOC (loc);
   66|       |    }
   67|       |  else
   68|       |#endif
   69|    912|    {
   70|    912|      sloc->type = UNW_SLT_MEMORY;
   71|    912|      sloc->u.addr = DWARF_GET_MEM_LOC (loc);
  ------------------
  |  |  421|    912|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  139|    912|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
   72|    912|    }
   73|    912|  return 0;
   74|  3.98k|}

_ULx86_64_init:
   79|      1|{
   80|      1|  intrmask_t saved_mask;
   81|      1|  intrmask_t full_mask;
   82|      1|  sigfillset (&full_mask);
   83|       |
   84|      1|  SIGPROCMASK (SIG_SETMASK, &full_mask, &saved_mask);
  ------------------
  |  |  195|      1|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 1, False: 0]
  |  |  ------------------
  |  |  196|      1|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
   85|      1|  mutex_lock (&x86_64_lock);
  ------------------
  |  |  169|      1|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  ------------------
  |  |  |  Branch (169:10): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   86|      1|  {
   87|      1|    if (atomic_load(&tdep_init_done))
  ------------------
  |  Branch (87:9): [True: 0, False: 1]
  ------------------
   88|       |      /* another thread else beat us to it... */
   89|      0|      goto out;
   90|       |
   91|      1|    sigfillset (&unwi_full_mask);
  ------------------
  |  |  176|      1|#define unwi_full_mask    UNWI_ARCH_OBJ(full_mask)
  |  |  ------------------
  |  |  |  |  174|      1|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|      1|    mi_init ();
  ------------------
  |  |  365|      1|#define mi_init         UNWI_ARCH_OBJ(mi_init)
  |  |  ------------------
  |  |  |  |  174|      1|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|       |
   94|      1|    dwarf_init ();
  ------------------
  |  |  385|      1|#define dwarf_init                      UNW_ARCH_OBJ (dwarf_init)
  |  |  ------------------
  |  |  |  |   49|      1|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|       |
   96|      1|#ifndef UNW_REMOTE_ONLY
   97|      1|    x86_64_local_addr_space_init ();
  ------------------
  |  |   63|      1|#define x86_64_local_addr_space_init    UNW_OBJ(local_addr_space_init)
  |  |  ------------------
  |  |  |  |   48|      1|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|      1|#endif
   99|      1|    atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */
  100|      1|  }
  101|      1| out:
  102|      1|  mutex_unlock(&x86_64_lock);
  ------------------
  |  |  171|      1|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  ------------------
  |  |  |  Branch (171:10): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  103|       |  SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  ------------------
  |  |  195|      1|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 1, False: 0]
  |  |  ------------------
  |  |  196|      1|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  104|      1|}

_ULx86_64_local_addr_space_init:
  181|      1|{
  182|      1|  memset (&local_addr_space, 0, sizeof (local_addr_space));
  183|      1|#ifndef UNW_REMOTE_ONLY
  184|      1|# if defined(HAVE_DL_ITERATE_PHDR)
  185|      1|  local_addr_space.iterate_phdr_function = dl_iterate_phdr;
  186|      1|# endif
  187|      1|#endif
  188|      1|  local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY;
  ------------------
  |  |   43|      1|#define UNWI_DEFAULT_CACHING_POLICY UNW_CACHE_GLOBAL
  ------------------
  189|      1|  local_addr_space.acc.find_proc_info = dwarf_find_proc_info;
  ------------------
  |  |  387|      1|#define dwarf_find_proc_info            UNW_OBJ (dwarf_find_proc_info)
  |  |  ------------------
  |  |  |  |   48|      1|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|      1|  local_addr_space.acc.put_unwind_info = put_unwind_info;
  191|      1|  local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr;
  192|      1|  local_addr_space.acc.access_mem = access_mem;
  193|      1|  local_addr_space.acc.access_reg = access_reg;
  194|      1|  local_addr_space.acc.access_fpreg = access_fpreg;
  195|      1|  local_addr_space.acc.resume = x86_64_local_resume;
  ------------------
  |  |   62|      1|#define x86_64_local_resume             UNW_OBJ(local_resume)
  |  |  ------------------
  |  |  |  |   48|      1|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|      1|  local_addr_space.acc.get_proc_name = get_static_proc_name;
  197|      1|  local_addr_space.acc.get_elf_filename = get_static_elf_filename;
  198|      1|  unw_flush_cache (&local_addr_space, 0, 0);
  ------------------
  |  |  304|      1|#define unw_flush_cache			UNW_ARCH_OBJ(flush_cache)
  |  |  ------------------
  |  |  |  |   49|      1|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|      1|}
Linit.c:access_mem:
   80|   125k|{
   81|   125k|  if (unlikely (write))
  ------------------
  |  |   68|   125k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 0, False: 125k]
  |  |  ------------------
  ------------------
   82|      0|    {
   83|      0|      Debug (16, "mem[%016lx] <- %lx\n", addr, *val);
   84|      0|      memcpy ((void *) addr, val, sizeof(unw_word_t));
   85|      0|    }
   86|   125k|  else
   87|   125k|    {
   88|       |      /* validate address */
   89|   125k|      if (unlikely (AS_ARG_GET_VALIDATE(arg))
  ------------------
  |  |   68|   250k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 111k, False: 13.6k]
  |  |  ------------------
  ------------------
   90|   111k|          && unlikely (!unw_address_is_valid (addr, sizeof (unw_word_t)))) {
  ------------------
  |  |   68|   111k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
   91|      0|        Debug (16, "mem[%016lx] -> invalid\n", addr);
   92|      0|        return -1;
   93|      0|      }
   94|   125k|      memcpy (val, (void *) addr, sizeof(unw_word_t));
   95|   125k|      Debug (16, "mem[%016lx] -> %lx\n", addr, *val);
   96|   125k|    }
   97|   125k|  return 0;
   98|   125k|}
Linit.c:get_static_proc_name:
  167|  37.2k|{
  168|  37.2k|  return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg);
  169|  37.2k|}

_ULx86_64_init_local:
   60|  6.80k|{
   61|  6.80k|  return unw_init_local_common(cursor, uc, 1);
   62|  6.80k|}
Linit_local.c:unw_init_local_common:
   44|  6.80k|{
   45|  6.80k|  struct cursor *c = (struct cursor *) cursor;
   46|       |
   47|  6.80k|  if (unlikely (!atomic_load(&tdep_init_done)))
  ------------------
  |  |   68|  6.80k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 1, False: 6.80k]
  |  |  ------------------
  ------------------
   48|      1|    tdep_init ();
  ------------------
  |  |  232|      1|#define tdep_init                       UNW_OBJ(init)
  |  |  ------------------
  |  |  |  |   48|      1|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      1|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      1|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|       |
   50|  6.80k|  Debug (1, "(cursor=%p)\n", c);
   51|       |
   52|  6.80k|  c->dwarf.as = unw_local_addr_space;
  ------------------
  |  |  274|  6.80k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  6.80k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  6.80k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  6.80k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|  6.80k|  c->dwarf.as_arg = dwarf_build_as_arg(uc, /*validate*/ 0);
   54|  6.80k|  c->frames = 0;
   55|  6.80k|  return common_init (c, use_prev_instr);
   56|  6.80k|}

_ULx86_64_fetch_frame:
   40|     15|{
   41|     15|  struct cursor *c = (struct cursor *) dw;
   42|     15|  assert(! need_unwind_info || dw->pi_valid);
  ------------------
  |  Branch (42:3): [True: 15, False: 0]
  |  Branch (42:3): [True: 0, False: 0]
  |  Branch (42:3): [True: 0, False: 15]
  |  Branch (42:3): [True: 15, False: 0]
  ------------------
   43|     15|  assert(! need_unwind_info || dw->pi.unwind_info);
  ------------------
  |  Branch (43:3): [True: 15, False: 0]
  |  Branch (43:3): [True: 0, False: 0]
  |  Branch (43:3): [True: 0, False: 15]
  |  Branch (43:3): [True: 15, False: 0]
  ------------------
   44|     15|  if (dw->pi_valid
  ------------------
  |  Branch (44:7): [True: 15, False: 0]
  ------------------
   45|     15|      && dw->pi.unwind_info
  ------------------
  |  Branch (45:10): [True: 15, False: 0]
  ------------------
   46|     15|      && ((struct dwarf_cie_info *) dw->pi.unwind_info)->signal_frame)
  ------------------
  |  Branch (46:10): [True: 0, False: 15]
  ------------------
   47|      0|    c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME;
   48|     15|  else
   49|     15|    c->sigcontext_format = X86_64_SCF_NONE;
   50|       |
   51|     15|  Debug(5, "fetch frame ip=0x%lx cfa=0x%lx format=%d\n",
   52|     15|        dw->ip, dw->cfa, c->sigcontext_format);
   53|     15|}
_ULx86_64_cache_frame:
   57|     15|{
   58|     15|  struct cursor *c = (struct cursor *) dw;
   59|       |
   60|     15|  Debug(5, "cache frame ip=0x%lx cfa=0x%lx format=%d\n",
   61|     15|        dw->ip, dw->cfa, c->sigcontext_format);
   62|     15|  return c->sigcontext_format;
   63|     15|}
_ULx86_64_reuse_frame:
   67|  61.2k|{
   68|  61.2k|  struct cursor *c = (struct cursor *) dw;
   69|  61.2k|  c->sigcontext_format = frame;
   70|  61.2k|  if (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME)
  ------------------
  |  Branch (70:7): [True: 0, False: 61.2k]
  ------------------
   71|      0|  {
   72|      0|    c->frame_info.frame_type = UNW_X86_64_FRAME_SIGRETURN;
   73|       |    /* Offset from cfa to ucontext_t in signal frame.  */
   74|      0|    c->frame_info.cfa_reg_offset = 0;
   75|      0|    c->sigcontext_addr = dw->cfa;
   76|      0|  }
   77|       |
   78|  61.2k|  Debug(5, "reuse frame ip=0x%lx cfa=0x%lx format=%d addr=0x%lx offset=%+d\n",
   79|  61.2k|        dw->ip, dw->cfa, c->sigcontext_format, c->sigcontext_addr,
   80|  61.2k|        (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME
   81|  61.2k|         ? c->frame_info.cfa_reg_offset : 0));
   82|  61.2k|}
_ULx86_64_is_signal_frame:
   86|  1.26k|{
   87|  1.26k|  struct cursor *c = (struct cursor *) cursor;
   88|  1.26k|  return c->sigcontext_format != X86_64_SCF_NONE;
   89|  1.26k|}
_ULx86_64_r_uc_addr:
  110|  6.80k|{
  111|       |  /* NOTE: common_init() in init.h inlines these for fast path access. */
  112|  6.80k|  void *addr;
  113|       |
  114|  6.80k|  switch (reg)
  115|  6.80k|    {
  116|      0|    case UNW_X86_64_R8: addr = &uc->uc_mcontext.gregs[REG_R8]; break;
  ------------------
  |  Branch (116:5): [True: 0, False: 6.80k]
  ------------------
  117|      0|    case UNW_X86_64_R9: addr = &uc->uc_mcontext.gregs[REG_R9]; break;
  ------------------
  |  Branch (117:5): [True: 0, False: 6.80k]
  ------------------
  118|      0|    case UNW_X86_64_R10: addr = &uc->uc_mcontext.gregs[REG_R10]; break;
  ------------------
  |  Branch (118:5): [True: 0, False: 6.80k]
  ------------------
  119|      0|    case UNW_X86_64_R11: addr = &uc->uc_mcontext.gregs[REG_R11]; break;
  ------------------
  |  Branch (119:5): [True: 0, False: 6.80k]
  ------------------
  120|      0|    case UNW_X86_64_R12: addr = &uc->uc_mcontext.gregs[REG_R12]; break;
  ------------------
  |  Branch (120:5): [True: 0, False: 6.80k]
  ------------------
  121|      0|    case UNW_X86_64_R13: addr = &uc->uc_mcontext.gregs[REG_R13]; break;
  ------------------
  |  Branch (121:5): [True: 0, False: 6.80k]
  ------------------
  122|      0|    case UNW_X86_64_R14: addr = &uc->uc_mcontext.gregs[REG_R14]; break;
  ------------------
  |  Branch (122:5): [True: 0, False: 6.80k]
  ------------------
  123|      0|    case UNW_X86_64_R15: addr = &uc->uc_mcontext.gregs[REG_R15]; break;
  ------------------
  |  Branch (123:5): [True: 0, False: 6.80k]
  ------------------
  124|      0|    case UNW_X86_64_RDI: addr = &uc->uc_mcontext.gregs[REG_RDI]; break;
  ------------------
  |  Branch (124:5): [True: 0, False: 6.80k]
  ------------------
  125|      0|    case UNW_X86_64_RSI: addr = &uc->uc_mcontext.gregs[REG_RSI]; break;
  ------------------
  |  Branch (125:5): [True: 0, False: 6.80k]
  ------------------
  126|      0|    case UNW_X86_64_RBP: addr = &uc->uc_mcontext.gregs[REG_RBP]; break;
  ------------------
  |  Branch (126:5): [True: 0, False: 6.80k]
  ------------------
  127|      0|    case UNW_X86_64_RBX: addr = &uc->uc_mcontext.gregs[REG_RBX]; break;
  ------------------
  |  Branch (127:5): [True: 0, False: 6.80k]
  ------------------
  128|      0|    case UNW_X86_64_RDX: addr = &uc->uc_mcontext.gregs[REG_RDX]; break;
  ------------------
  |  Branch (128:5): [True: 0, False: 6.80k]
  ------------------
  129|      0|    case UNW_X86_64_RAX: addr = &uc->uc_mcontext.gregs[REG_RAX]; break;
  ------------------
  |  Branch (129:5): [True: 0, False: 6.80k]
  ------------------
  130|      0|    case UNW_X86_64_RCX: addr = &uc->uc_mcontext.gregs[REG_RCX]; break;
  ------------------
  |  Branch (130:5): [True: 0, False: 6.80k]
  ------------------
  131|  6.80k|    case UNW_X86_64_RSP: addr = &uc->uc_mcontext.gregs[REG_RSP]; break;
  ------------------
  |  Branch (131:5): [True: 6.80k, False: 0]
  ------------------
  132|      0|    case UNW_X86_64_RIP: addr = &uc->uc_mcontext.gregs[REG_RIP]; break;
  ------------------
  |  Branch (132:5): [True: 0, False: 6.80k]
  ------------------
  133|       |
  134|      0|    default:
  ------------------
  |  Branch (134:5): [True: 0, False: 6.80k]
  ------------------
  135|      0|      addr = NULL;
  136|  6.80k|    }
  137|  6.80k|  return addr;
  138|  6.80k|}

_ULx86_64_access_reg:
   67|  72.8k|{
   68|  72.8k|  dwarf_loc_t loc = DWARF_NULL_LOC;
  ------------------
  |  |  155|  72.8k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  150|  72.8k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   69|  72.8k|  unsigned int mask;
   70|  72.8k|  int arg_num;
   71|       |
   72|  72.8k|  switch (reg)
   73|  72.8k|    {
   74|       |
   75|      0|    case UNW_X86_64_RIP:
  ------------------
  |  Branch (75:5): [True: 0, False: 72.8k]
  ------------------
   76|      0|      if (write)
  ------------------
  |  Branch (76:11): [True: 0, False: 0]
  ------------------
   77|      0|        c->dwarf.ip = *valp;            /* also update the RIP cache */
   78|      0|      loc = c->dwarf.loc[RIP];
  ------------------
  |  |   59|      0|#define RIP     16
  ------------------
   79|      0|      break;
   80|       |
   81|    264|    case UNW_X86_64_CFA:
  ------------------
  |  Branch (81:5): [True: 264, False: 72.5k]
  ------------------
   82|    264|      if (write)
  ------------------
  |  Branch (82:11): [True: 0, False: 264]
  ------------------
   83|      0|        return -UNW_EREADONLYREG;
   84|    264|      *valp = c->dwarf.cfa;
   85|    264|      return 0;
   86|       |
   87|    280|    case UNW_X86_64_RAX:
  ------------------
  |  Branch (87:5): [True: 280, False: 72.5k]
  ------------------
   88|  2.72k|    case UNW_X86_64_RDX:
  ------------------
  |  Branch (88:5): [True: 2.44k, False: 70.3k]
  ------------------
   89|  2.72k|      arg_num = reg - UNW_X86_64_RAX;
   90|  2.72k|      mask = (1 << arg_num);
   91|  2.72k|      if (write)
  ------------------
  |  Branch (91:11): [True: 0, False: 2.72k]
  ------------------
   92|      0|        {
   93|      0|          c->dwarf.eh_args[arg_num] = *valp;
   94|      0|          c->dwarf.eh_valid_mask |= mask;
   95|      0|          return 0;
   96|      0|        }
   97|  2.72k|      else if ((c->dwarf.eh_valid_mask & mask) != 0)
  ------------------
  |  Branch (97:16): [True: 0, False: 2.72k]
  ------------------
   98|      0|        {
   99|      0|          *valp = c->dwarf.eh_args[arg_num];
  100|      0|          return 0;
  101|      0|        }
  102|  2.72k|      else
  103|  2.72k|        loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   43|    280|#define RAX     0
  ------------------
                      loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   44|  2.44k|#define RDX     1
  ------------------
  |  Branch (103:28): [True: 280, False: 2.44k]
  ------------------
  104|  2.72k|      break;
  105|       |
  106|  2.72k|    case UNW_X86_64_RCX: loc = c->dwarf.loc[RCX]; break;
  ------------------
  |  |   45|    288|#define RCX     2
  ------------------
  |  Branch (106:5): [True: 288, False: 72.5k]
  ------------------
  107|    384|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|    384|#define RBX     3
  ------------------
  |  Branch (107:5): [True: 384, False: 72.4k]
  ------------------
  108|       |
  109|  13.8k|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|  13.8k|#define RSP     7
  ------------------
  |  Branch (109:5): [True: 13.8k, False: 59.0k]
  ------------------
  110|  48.6k|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|  48.6k|#define RBP     6
  ------------------
  |  Branch (110:5): [True: 48.6k, False: 24.1k]
  ------------------
  111|    696|    case UNW_X86_64_RSI: loc = c->dwarf.loc[RSI]; break;
  ------------------
  |  |   47|    696|#define RSI     4
  ------------------
  |  Branch (111:5): [True: 696, False: 72.1k]
  ------------------
  112|    560|    case UNW_X86_64_RDI: loc = c->dwarf.loc[RDI]; break;
  ------------------
  |  |   48|    560|#define RDI     5
  ------------------
  |  Branch (112:5): [True: 560, False: 72.2k]
  ------------------
  113|    440|    case UNW_X86_64_R8: loc = c->dwarf.loc[R8]; break;
  ------------------
  |  |   51|    440|#define R8      8
  ------------------
  |  Branch (113:5): [True: 440, False: 72.3k]
  ------------------
  114|    424|    case UNW_X86_64_R9: loc = c->dwarf.loc[R9]; break;
  ------------------
  |  |   52|    424|#define R9      9
  ------------------
  |  Branch (114:5): [True: 424, False: 72.4k]
  ------------------
  115|  1.33k|    case UNW_X86_64_R10: loc = c->dwarf.loc[R10]; break;
  ------------------
  |  |   53|  1.33k|#define R10     10
  ------------------
  |  Branch (115:5): [True: 1.33k, False: 71.4k]
  ------------------
  116|    264|    case UNW_X86_64_R11: loc = c->dwarf.loc[R11]; break;
  ------------------
  |  |   54|    264|#define R11     11
  ------------------
  |  Branch (116:5): [True: 264, False: 72.5k]
  ------------------
  117|    240|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|    240|#define R12     12
  ------------------
  |  Branch (117:5): [True: 240, False: 72.5k]
  ------------------
  118|    192|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|    192|#define R13     13
  ------------------
  |  Branch (118:5): [True: 192, False: 72.6k]
  ------------------
  119|    512|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|    512|#define R14     14
  ------------------
  |  Branch (119:5): [True: 512, False: 72.3k]
  ------------------
  120|    416|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|    416|#define R15     15
  ------------------
  |  Branch (120:5): [True: 416, False: 72.4k]
  ------------------
  121|       |
  122|  1.65k|    default:
  ------------------
  |  Branch (122:5): [True: 1.65k, False: 71.1k]
  ------------------
  123|  1.65k|      Debug (1, "bad register number %u\n", reg);
  124|  1.65k|      return -UNW_EBADREG;
  125|  72.8k|    }
  126|       |
  127|  70.9k|  if (write)
  ------------------
  |  Branch (127:7): [True: 0, False: 70.9k]
  ------------------
  128|      0|    return dwarf_put (&c->dwarf, loc, *valp);
  129|  70.9k|  else
  130|  70.9k|    return dwarf_get (&c->dwarf, loc, valp);
  131|  70.9k|}

_ULx86_64_step:
  372|  61.2k|{
  373|  61.2k|  struct cursor *c = (struct cursor *) cursor;
  374|  61.2k|  int val = 0;
  375|  61.2k|#if CONSERVATIVE_CHECKS
  376|  61.2k|  if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|  61.2k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (376:7): [True: 61.2k, False: 0]
  ------------------
  377|  61.2k|    val = dwarf_get_validate(&c->dwarf);
  378|  61.2k|    dwarf_set_validate (&c->dwarf, 1);
  379|  61.2k|  }
  380|  61.2k|#endif
  381|       |
  382|  61.2k|  Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n",
  383|  61.2k|         c, c->dwarf.ip, c->dwarf.cfa);
  384|       |
  385|       |  /* Try DWARF-based unwinding... */
  386|  61.2k|  c->sigcontext_format = X86_64_SCF_NONE;
  387|  61.2k|  int ret = dwarf_step (&c->dwarf);
  ------------------
  |  |  402|  61.2k|#define dwarf_step                      UNW_OBJ (dwarf_step)
  |  |  ------------------
  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|       |
  389|  61.2k|#if CONSERVATIVE_CHECKS
  390|  61.2k|  if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|  61.2k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  61.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  61.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (390:7): [True: 61.2k, False: 0]
  ------------------
  391|  61.2k|    dwarf_set_validate (&c->dwarf, val);
  392|  61.2k|  }
  393|  61.2k|#endif
  394|       |
  395|  61.2k|  if (ret < 0 && ret != -UNW_ENOINFO)
  ------------------
  |  Branch (395:7): [True: 0, False: 61.2k]
  |  Branch (395:18): [True: 0, False: 0]
  ------------------
  396|      0|    {
  397|      0|      Debug (2, "failure in dwarf_step(), returning %d\n", ret);
  398|      0|      return ret;
  399|      0|    }
  400|       |
  401|  61.2k|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (401:7): [True: 0, False: 61.2k]
  ------------------
  402|      0|    {
  403|       |      /*
  404|       |       * DWARF stepping failed. Use fallback strategies.
  405|       |       */
  406|      0|      if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|      0|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (406:11): [True: 0, False: 0]
  ------------------
  407|      0|        val = dwarf_get_validate (&c->dwarf);
  408|      0|        dwarf_set_validate (&c->dwarf, 1);
  409|      0|      }
  410|       |
  411|      0|      unw_word_t prev_ip = c->dwarf.ip;
  412|      0|      unw_word_t prev_cfa = c->dwarf.cfa;
  413|       |
  414|      0|      Debug (2, "dwarf_step() failed, trying fallback heuristics\n");
  415|      0|      ret = _unw_step_fallback (c, cursor);
  416|       |
  417|       |      /*
  418|       |       * Check for infinite call chain loops or no successful stepping.
  419|       |       * If this situation is detected, assume the end of the call chain because
  420|       |       * that's how it works on some OSes.
  421|       |       */
  422|      0|      if (ret >= 0 && c->dwarf.ip == prev_ip && c->dwarf.cfa == prev_cfa)
  ------------------
  |  Branch (422:11): [True: 0, False: 0]
  |  Branch (422:23): [True: 0, False: 0]
  |  Branch (422:49): [True: 0, False: 0]
  ------------------
  423|      0|        {
  424|      0|          Debug (2, "infinite call chain loop detected\n");
  425|      0|          ret = 0;
  426|      0|        }
  427|       |
  428|      0|      if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|      0|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|      0|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|      0|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (428:11): [True: 0, False: 0]
  ------------------
  429|      0|        dwarf_set_validate (&c->dwarf, val);
  430|      0|      }
  431|      0|    }
  432|       |
  433|       |  /*
  434|       |   * If stepping was successful, increment the frame counter.
  435|       |   */
  436|  61.2k|  if (ret >= 0)
  ------------------
  |  Branch (436:7): [True: 61.2k, False: 0]
  ------------------
  437|  61.2k|    {
  438|  61.2k|    	++c->frames;
  439|  61.2k|    }
  440|       |
  441|  61.2k|  Debug (2, "returning %d\n", ret);
  442|  61.2k|  return ret;
  443|  61.2k|}

Linit_local.c:common_init:
   46|  6.80k|{
   47|  6.80k|  int ret;
   48|       |
   49|  6.80k|  c->dwarf.loc[RAX] = REG_INIT_LOC(c, rax, RAX);
  ------------------
  |  |   43|  6.80k|#define RAX     0
  ------------------
                c->dwarf.loc[RAX] = REG_INIT_LOC(c, rax, RAX);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   50|  6.80k|  c->dwarf.loc[RDX] = REG_INIT_LOC(c, rdx, RDX);
  ------------------
  |  |   44|  6.80k|#define RDX     1
  ------------------
                c->dwarf.loc[RDX] = REG_INIT_LOC(c, rdx, RDX);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   51|  6.80k|  c->dwarf.loc[RCX] = REG_INIT_LOC(c, rcx, RCX);
  ------------------
  |  |   45|  6.80k|#define RCX     2
  ------------------
                c->dwarf.loc[RCX] = REG_INIT_LOC(c, rcx, RCX);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   52|  6.80k|  c->dwarf.loc[RBX] = REG_INIT_LOC(c, rbx, RBX);
  ------------------
  |  |   46|  6.80k|#define RBX     3
  ------------------
                c->dwarf.loc[RBX] = REG_INIT_LOC(c, rbx, RBX);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   53|  6.80k|  c->dwarf.loc[RSI] = REG_INIT_LOC(c, rsi, RSI);
  ------------------
  |  |   47|  6.80k|#define RSI     4
  ------------------
                c->dwarf.loc[RSI] = REG_INIT_LOC(c, rsi, RSI);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   54|  6.80k|  c->dwarf.loc[RDI] = REG_INIT_LOC(c, rdi, RDI);
  ------------------
  |  |   48|  6.80k|#define RDI     5
  ------------------
                c->dwarf.loc[RDI] = REG_INIT_LOC(c, rdi, RDI);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   55|  6.80k|  c->dwarf.loc[RBP] = REG_INIT_LOC(c, rbp, RBP);
  ------------------
  |  |   49|  6.80k|#define RBP     6
  ------------------
                c->dwarf.loc[RBP] = REG_INIT_LOC(c, rbp, RBP);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   56|  6.80k|  c->dwarf.loc[RSP] = REG_INIT_LOC(c, rsp, RSP);
  ------------------
  |  |   50|  6.80k|#define RSP     7
  ------------------
                c->dwarf.loc[RSP] = REG_INIT_LOC(c, rsp, RSP);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   57|  6.80k|  c->dwarf.loc[R8]  = REG_INIT_LOC(c, r8,  R8);
  ------------------
  |  |   51|  6.80k|#define R8      8
  ------------------
                c->dwarf.loc[R8]  = REG_INIT_LOC(c, r8,  R8);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   58|  6.80k|  c->dwarf.loc[R9]  = REG_INIT_LOC(c, r9,  R9);
  ------------------
  |  |   52|  6.80k|#define R9      9
  ------------------
                c->dwarf.loc[R9]  = REG_INIT_LOC(c, r9,  R9);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   59|  6.80k|  c->dwarf.loc[R10] = REG_INIT_LOC(c, r10, R10);
  ------------------
  |  |   53|  6.80k|#define R10     10
  ------------------
                c->dwarf.loc[R10] = REG_INIT_LOC(c, r10, R10);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   60|  6.80k|  c->dwarf.loc[R11] = REG_INIT_LOC(c, r11, R11);
  ------------------
  |  |   54|  6.80k|#define R11     11
  ------------------
                c->dwarf.loc[R11] = REG_INIT_LOC(c, r11, R11);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   61|  6.80k|  c->dwarf.loc[R12] = REG_INIT_LOC(c, r12, R12);
  ------------------
  |  |   55|  6.80k|#define R12     12
  ------------------
                c->dwarf.loc[R12] = REG_INIT_LOC(c, r12, R12);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   62|  6.80k|  c->dwarf.loc[R13] = REG_INIT_LOC(c, r13, R13);
  ------------------
  |  |   56|  6.80k|#define R13     13
  ------------------
                c->dwarf.loc[R13] = REG_INIT_LOC(c, r13, R13);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   63|  6.80k|  c->dwarf.loc[R14] = REG_INIT_LOC(c, r14, R14);
  ------------------
  |  |   57|  6.80k|#define R14     14
  ------------------
                c->dwarf.loc[R14] = REG_INIT_LOC(c, r14, R14);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   64|  6.80k|  c->dwarf.loc[R15] = REG_INIT_LOC(c, r15, R15);
  ------------------
  |  |   58|  6.80k|#define R15     15
  ------------------
                c->dwarf.loc[R15] = REG_INIT_LOC(c, r15, R15);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   65|  6.80k|  c->dwarf.loc[RIP] = REG_INIT_LOC(c, rip, RIP);
  ------------------
  |  |   59|  6.80k|#define RIP     16
  ------------------
                c->dwarf.loc[RIP] = REG_INIT_LOC(c, rip, RIP);
  ------------------
  |  |   33|  6.80k|    DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0)
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   66|       |
   67|  6.80k|  ret = dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip);
  ------------------
  |  |   59|  6.80k|#define RIP     16
  ------------------
   68|  6.80k|  if (ret < 0)
  ------------------
  |  Branch (68:7): [True: 0, False: 6.80k]
  ------------------
   69|      0|    return ret;
   70|       |
   71|  6.80k|  ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_X86_64_RSP),
  ------------------
  |  |  157|  6.80k|# define DWARF_REG_LOC(c,r)     (DWARF_LOC((unw_word_t)                      \
  |  |  ------------------
  |  |  |  |  150|  6.80k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  |  |  158|  6.80k|                                 x86_64_r_uc_addr(dwarf_get_uc(c), (r)), 0))
  ------------------
   72|  6.80k|                   &c->dwarf.cfa);
   73|  6.80k|  if (ret < 0)
  ------------------
  |  Branch (73:7): [True: 0, False: 6.80k]
  ------------------
   74|      0|    return ret;
   75|       |
   76|  6.80k|  c->sigcontext_format = X86_64_SCF_NONE;
   77|  6.80k|  c->sigcontext_addr = 0;
   78|       |
   79|  6.80k|  c->dwarf.args_size = 0;
   80|  6.80k|  c->dwarf.stash_frames = 0;
   81|  6.80k|  c->dwarf.use_prev_instr = use_prev_instr;
   82|  6.80k|  c->dwarf.pi_valid = 0;
   83|  6.80k|  c->dwarf.pi_is_dynamic = 0;
   84|  6.80k|  c->dwarf.hint = 0;
   85|  6.80k|  c->dwarf.prev_rs = 0;
   86|  6.80k|  c->dwarf.eh_valid_mask = 0;
   87|       |
   88|  6.80k|  return 0;
   89|  6.80k|}

