get_save_loc:
   34|  1.04k|void get_save_loc(int regnum) {
   35|  1.04k|  unw_cursor_t cursor;
   36|  1.04k|  unw_context_t uc;
   37|  1.04k|  unw_word_t reference_reg;
   38|       |
   39|  1.04k|  unw_getcontext(&uc);
  ------------------
  |  |  131|  1.04k|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|  1.04k|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  1.04k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  1.04k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  1.04k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|  1.04k|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|  1.04k|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|  1.04k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  1.04k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.04k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|  1.04k|  unw_save_loc_t loc;
   42|  10.4k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  10.4k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  10.4k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  10.4k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  10.4k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (42:10): [True: 9.41k, False: 1.04k]
  ------------------
   43|  9.41k|    unw_get_save_loc(&cursor, regnum, &loc);
  ------------------
  |  |  293|  9.41k|#define unw_get_save_loc		UNW_OBJ(get_save_loc)
  |  |  ------------------
  |  |  |  |   48|  9.41k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  9.41k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  9.41k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|  9.41k|  }
   45|  1.04k|}
get_random_reg:
   47|  5.12k|void get_random_reg(int regnum) {
   48|  5.12k|  unw_cursor_t cursor;
   49|  5.12k|  unw_context_t uc;
   50|  5.12k|  unw_word_t reference_reg;
   51|       |
   52|  5.12k|  unw_getcontext(&uc);
  ------------------
  |  |  131|  5.12k|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|  5.12k|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  5.12k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  5.12k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  5.12k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|  5.12k|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|  5.12k|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|  5.12k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  5.12k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  5.12k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  51.2k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  51.2k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  51.2k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  51.2k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  51.2k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (54:10): [True: 46.1k, False: 5.12k]
  ------------------
   55|  46.1k|    unw_get_reg(&cursor, regnum, &reference_reg);
  ------------------
  |  |  289|  46.1k|#define unw_get_reg			UNW_OBJ(get_reg)
  |  |  ------------------
  |  |  |  |   48|  46.1k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  46.1k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  46.1k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|  46.1k|  }
   57|  5.12k|}
check_is_signal:
   59|    531|void check_is_signal() {
   60|    531|  unw_cursor_t cursor;
   61|    531|  unw_context_t uc;
   62|    531|  unw_word_t reference_reg;
   63|       |
   64|    531|  unw_getcontext(&uc);
  ------------------
  |  |  131|    531|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|    531|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    531|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|    531|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|    531|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|    531|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|    531|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|    531|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|    531|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|    531|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|  5.31k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  5.31k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  5.31k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  5.31k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  5.31k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:10): [True: 4.77k, False: 531]
  ------------------
   67|  4.77k|    if (unw_is_signal_frame(&cursor)) {
  ------------------
  |  |  294|  4.77k|#define unw_is_signal_frame		UNW_OBJ(is_signal_frame)
  |  |  ------------------
  |  |  |  |   48|  4.77k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.77k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.77k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 4.77k]
  ------------------
   68|      0|      return;
   69|      0|    }
   70|  4.77k|  }
   71|    531|}
get_proc_name:
   73|  3.45k|void get_proc_name() {
   74|  3.45k|  unw_cursor_t cursor;
   75|  3.45k|  unw_context_t uc;
   76|       |
   77|  3.45k|  unw_getcontext(&uc);
  ------------------
  |  |  131|  3.45k|#define unw_getcontext(uc)		unw_tdep_getcontext(uc)
  |  |  ------------------
  |  |  |  |  138|  3.45k|#define unw_tdep_getcontext             UNW_ARCH_OBJ(getcontext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  3.45k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|  3.45k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|  3.45k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|  3.45k|  unw_init_local(&cursor, &uc);
  ------------------
  |  |  279|  3.45k|#define unw_init_local			UNW_OBJ(init_local)
  |  |  ------------------
  |  |  |  |   48|  3.45k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  3.45k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.45k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|  34.5k|  while (unw_step(&cursor) > 0) {
  ------------------
  |  |  282|  34.5k|#define unw_step			UNW_OBJ(step)
  |  |  ------------------
  |  |  |  |   48|  34.5k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  34.5k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  34.5k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (79:10): [True: 31.0k, False: 3.45k]
  ------------------
   80|  31.0k|    unw_word_t offset;
   81|  31.0k|    char buf[512];
   82|  31.0k|    unw_get_proc_name(&cursor, buf, sizeof(buf), &offset);
  ------------------
  |  |  296|  31.0k|#define unw_get_proc_name		UNW_OBJ(get_proc_name)
  |  |  ------------------
  |  |  |  |   48|  31.0k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  31.0k|  }
   84|  3.45k|}
dispatch:
   86|  11.9k|void dispatch(const uint8_t *data, size_t size) {
   87|  11.9k|  if (size < 8) {
  ------------------
  |  Branch (87:7): [True: 370, False: 11.6k]
  ------------------
   88|    370|    return;
   89|    370|  }
   90|  11.6k|  uint8_t decider = data[0] % 4;
   91|  11.6k|  data += 2;
   92|  11.6k|  size -= 2;
   93|  11.6k|  if (decider == 0) {
  ------------------
  |  Branch (93:7): [True: 3.79k, False: 7.81k]
  ------------------
   94|  3.79k|    recurse1(data, size);
   95|  7.81k|  } else if (decider == 1) {
  ------------------
  |  Branch (95:14): [True: 5.63k, False: 2.18k]
  ------------------
   96|  5.63k|    recurse2(data, size);
   97|  5.63k|  } else if (decider == 2) {
  ------------------
  |  Branch (97:14): [True: 881, False: 1.30k]
  ------------------
   98|    881|    recurse3(data, size);
   99|  1.30k|  } else {
  100|  1.30k|    recurse4(data, size);
  101|  1.30k|  }
  102|  11.6k|}
recurse1:
  104|  3.79k|void recurse1(const uint8_t *data, size_t size) {
  105|  3.79k|  if (data[0] == 0x01) {
  ------------------
  |  Branch (105:7): [True: 3.45k, False: 346]
  ------------------
  106|  3.45k|    get_proc_name();
  107|  3.45k|  }
  108|  3.79k|  data += 2;
  109|  3.79k|  size -= 2;
  110|       |
  111|  3.79k|  dispatch(data, size);
  112|  3.79k|  return;
  113|  3.79k|}
recurse2:
  115|  5.63k|void recurse2(const uint8_t *data, size_t size) {
  116|  5.63k|  if (data[0] == 0x01) {
  ------------------
  |  Branch (116:7): [True: 5.12k, False: 508]
  ------------------
  117|  5.12k|    get_random_reg((int)data[1]);
  118|  5.12k|  }
  119|  5.63k|  data += 2;
  120|  5.63k|  size -= 2;
  121|       |
  122|  5.63k|  dispatch(data, size);
  123|  5.63k|  return;
  124|  5.63k|}
recurse3:
  126|    881|void recurse3(const uint8_t *data, size_t size) {
  127|    881|  if (data[0] == 0x01) {
  ------------------
  |  Branch (127:7): [True: 531, False: 350]
  ------------------
  128|    531|    check_is_signal((int)data[1]);
  129|    531|  }
  130|    881|  data += 2;
  131|    881|  size -= 2;
  132|       |
  133|    881|  dispatch(data, size);
  134|    881|  return;
  135|    881|}
recurse4:
  137|  1.30k|void recurse4(const uint8_t *data, size_t size) {
  138|  1.30k|  if (data[0] == 0x01) {
  ------------------
  |  Branch (138:7): [True: 1.04k, False: 255]
  ------------------
  139|  1.04k|    get_save_loc((int)data[1]);
  140|  1.04k|  }
  141|  1.30k|  data += 2;
  142|  1.30k|  size -= 2;
  143|       |
  144|  1.30k|  dispatch(data, size);
  145|  1.30k|  return;
  146|  1.30k|}
LLVMFuzzerTestOneInput:
  148|    402|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|    402|  if (size < 12 || size > 512) {
  ------------------
  |  Branch (150:7): [True: 6, False: 396]
  |  Branch (150:20): [True: 26, False: 370]
  ------------------
  151|     32|    return 0;
  152|     32|  }
  153|       |
  154|    370|  dispatch(data, size);
  155|    370|  return 0;
  156|    402|}

Lparser.c:dwarf_read_uleb128:
  297|    143|{
  298|    143|  unw_word_t val = 0, shift = 0;
  299|    143|  unsigned char byte;
  300|    143|  int ret;
  301|       |
  302|    143|  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: 0, False: 143]
  ------------------
  311|       |
  312|    143|  *valp = val;
  313|    143|  return 0;
  314|    143|}
Lparser.c:dwarf_readu8:
   92|    376|{
   93|    376|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   94|       |
   95|    376|  *val = mvp->u8;
   96|    376|  *addr += sizeof (mvp->u8);
   97|    376|  return 0;
   98|    376|}
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|     80|{
  351|     80|  unw_word_t val, initial_addr = *addr;
  352|     80|  uint16_t uval16;
  353|     80|  uint32_t uval32;
  354|     80|  uint64_t uval64;
  355|     80|  int16_t sval16 = 0;
  356|     80|  int32_t sval32 = 0;
  357|     80|  int64_t sval64 = 0;
  358|     80|  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|     80|  if (encoding == DW_EH_PE_omit)
  ------------------
  |  |  201|     80|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (362:7): [True: 16, False: 64]
  ------------------
  363|     16|    {
  364|     16|      *valp = 0;
  365|     16|      return 0;
  366|     16|    }
  367|     64|  else if (encoding == DW_EH_PE_aligned)
  ------------------
  |  |  221|     64|#define DW_EH_PE_aligned        0x50    /* aligned pointer */
  ------------------
  |  Branch (367:12): [True: 0, False: 64]
  ------------------
  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|     64|  switch (encoding & DW_EH_PE_FORMAT_MASK)
  ------------------
  |  |  194|     64|#define DW_EH_PE_FORMAT_MASK    0x0f    /* format of the encoded value */
  ------------------
  375|     64|    {
  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: 64]
  ------------------
  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: 64]
  ------------------
  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: 64]
  ------------------
  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|     16|    case DW_EH_PE_udata4:
  ------------------
  |  |  205|     16|#define DW_EH_PE_udata4         0x03    /* unsigned 32-bit value */
  ------------------
  |  Branch (392:5): [True: 16, False: 48]
  ------------------
  393|     16|      if ((ret = dwarf_readu32 (as, a, addr, &uval32, arg)) < 0)
  ------------------
  |  Branch (393:11): [True: 0, False: 16]
  ------------------
  394|      0|        return ret;
  395|     16|      val = uval32;
  396|     16|      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: 64]
  ------------------
  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: 64]
  ------------------
  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: 64]
  ------------------
  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|     48|    case DW_EH_PE_sdata4:
  ------------------
  |  |  209|     48|#define DW_EH_PE_sdata4         0x0b    /* signed 32-bit value */
  ------------------
  |  Branch (415:5): [True: 48, False: 16]
  ------------------
  416|     48|      if ((ret = dwarf_reads32 (as, a, addr, &sval32, arg)) < 0)
  ------------------
  |  Branch (416:11): [True: 0, False: 48]
  ------------------
  417|      0|        return ret;
  418|     48|      val = sval32;
  419|     48|      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: 64]
  ------------------
  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: 64]
  ------------------
  428|      0|      Debug (1, "unexpected encoding format 0x%x\n",
  429|      0|             encoding & DW_EH_PE_FORMAT_MASK);
  430|      0|      return -UNW_EINVAL;
  431|     64|    }
  432|       |
  433|     64|  if (val == 0)
  ------------------
  |  Branch (433:7): [True: 0, False: 64]
  ------------------
  434|      0|    {
  435|       |      /* 0 is a special value and always absolute.  */
  436|      0|      *valp = 0;
  437|      0|      return 0;
  438|      0|    }
  439|       |
  440|     64|  switch (encoding & DW_EH_PE_APPL_MASK)
  ------------------
  |  |  195|     64|#define DW_EH_PE_APPL_MASK      0x70    /* how the value is to be applied */
  ------------------
  441|     64|    {
  442|     32|    case DW_EH_PE_absptr:
  ------------------
  |  |  213|     32|#define DW_EH_PE_absptr         0x00    /* absolute value */
  ------------------
  |  Branch (442:5): [True: 32, False: 32]
  ------------------
  443|     32|      break;
  444|       |
  445|     32|    case DW_EH_PE_pcrel:
  ------------------
  |  |  214|     32|#define DW_EH_PE_pcrel          0x10    /* rel. to addr. of encoded value */
  ------------------
  |  Branch (445:5): [True: 32, False: 32]
  ------------------
  446|     32|      val += initial_addr;
  447|     32|      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: 64]
  ------------------
  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: 64]
  ------------------
  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: 64]
  ------------------
  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: 64]
  ------------------
  464|      0|      Debug (1, "unexpected application type 0x%x\n",
  465|      0|             encoding & DW_EH_PE_APPL_MASK);
  466|      0|      return -UNW_EINVAL;
  467|     64|    }
  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|     64|  if (sizeof (val) > dwarf_addr_size (as))
  ------------------
  |  |   15|     64|# define dwarf_addr_size(as) (sizeof (unw_word_t))
  ------------------
  |  Branch (472:7): [Folded, False: 64]
  ------------------
  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|     64|  if (encoding & DW_EH_PE_indirect)
  ------------------
  |  |  198|     64|#define DW_EH_PE_indirect       0x80
  ------------------
  |  Branch (478:7): [True: 0, False: 64]
  ------------------
  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|     64|  *valp = val;
  487|     64|  return 0;
  488|     64|}
Lpe.c:dwarf_readu32:
  114|     16|{
  115|     16|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
  116|       |
  117|     16|  *val = mvp->u32;
  118|     16|  *addr += sizeof (mvp->u32);
  119|     16|  return 0;
  120|     16|}
Lpe.c:dwarf_reads32:
   70|     48|{
   71|     48|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   72|       |
   73|     48|  *val = mvp->s32;
   74|     48|  *addr += sizeof (mvp->s32);
   75|     48|  return 0;
   76|     48|}
Lfde.c:dwarf_readu32:
  114|     48|{
  115|     48|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
  116|       |
  117|     48|  *val = mvp->u32;
  118|     48|  *addr += sizeof (mvp->u32);
  119|     48|  return 0;
  120|     48|}
Lfde.c:dwarf_reads32:
   70|     16|{
   71|     16|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   72|       |
   73|     16|  *val = mvp->s32;
   74|     16|  *addr += sizeof (mvp->s32);
   75|     16|  return 0;
   76|     16|}
Lfde.c:dwarf_readu8:
   92|    160|{
   93|    160|  dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr;
   94|       |
   95|    160|  *val = mvp->u8;
   96|    160|  *addr += sizeof (mvp->u8);
   97|    160|  return 0;
   98|    160|}
Lfde.c:dwarf_read_sleb128:
  322|     16|{
  323|     16|  unw_word_t val = 0, shift = 0;
  324|     16|  unsigned char byte;
  325|     16|  int ret;
  326|       |
  327|     16|  do
  328|     16|    {
  329|     16|      if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0)
  ------------------
  |  Branch (329:11): [True: 0, False: 16]
  ------------------
  330|      0|        return ret;
  331|       |
  332|     16|      val |= ((unw_word_t) byte & 0x7f) << shift;
  333|     16|      shift += 7;
  334|     16|    }
  335|     16|  while (byte & 0x80);
  ------------------
  |  Branch (335:10): [True: 0, False: 16]
  ------------------
  336|       |
  337|     16|  if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0)
  ------------------
  |  Branch (337:7): [True: 16, False: 0]
  |  Branch (337:42): [True: 16, False: 0]
  ------------------
  338|       |    /* sign-extend negative value */
  339|     16|    val |= ((unw_word_t) -1) << shift;
  340|       |
  341|     16|  *valp = val;
  342|     16|  return 0;
  343|     16|}
Lfde.c:dwarf_read_uleb128:
  297|     48|{
  298|     48|  unw_word_t val = 0, shift = 0;
  299|     48|  unsigned char byte;
  300|     48|  int ret;
  301|       |
  302|     48|  do
  303|     48|    {
  304|     48|      if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0)
  ------------------
  |  Branch (304:11): [True: 0, False: 48]
  ------------------
  305|      0|        return ret;
  306|       |
  307|     48|      val |= ((unw_word_t) byte & 0x7f) << shift;
  308|     48|      shift += 7;
  309|     48|    }
  310|     48|  while (byte & 0x80);
  ------------------
  |  Branch (310:10): [True: 0, False: 48]
  ------------------
  311|       |
  312|     48|  *valp = val;
  313|     48|  return 0;
  314|     48|}

elf64.c:mi_munmap:
  249|  31.0k|{
  250|  31.0k|#ifdef SYS_munmap
  251|  31.0k|  return syscall (SYS_munmap, addr, len);
  252|       |#else
  253|       |  return munmap (addr, len);
  254|       |#endif
  255|  31.0k|}
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|  62.1k|{
  228|  62.1k|#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|  62.1k|  long int ret = syscall (SYS_mmap, addr, len, prot, flags, fd, offset);
  234|  62.1k|# endif
  235|       |  // @todo this is very likely Linux specific
  236|  62.1k|  if ((unsigned long int)ret > -4096UL)
  ------------------
  |  Branch (236:7): [True: 0, False: 62.1k]
  ------------------
  237|      0|    return MAP_FAILED;
  238|  62.1k|  else
  239|  62.1k|    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|  62.1k|}
os-linux.c:mi_munmap:
  249|  31.0k|{
  250|  31.0k|#ifdef SYS_munmap
  251|  31.0k|  return syscall (SYS_munmap, addr, len);
  252|       |#else
  253|       |  return munmap (addr, len);
  254|       |#endif
  255|  31.0k|}
Laddress_validator.c:unw_page_start:
  369|   384k|{
  370|   384k|  return addr & ~(unw_page_size - 1);
  371|   384k|}

Linit_local.c:dwarf_build_as_arg:
  133|  10.1k|dwarf_build_as_arg(const ucontext_t *uc, const int validate) {
  134|  10.1k|  uintptr_t packed_args = (uintptr_t) uc;
  135|  10.1k|  assert((packed_args & AS_ARG_VALIDATE_MASK) == 0);
  ------------------
  |  Branch (135:3): [True: 0, False: 10.1k]
  |  Branch (135:3): [True: 10.1k, False: 0]
  ------------------
  136|  10.1k|  packed_args |= (AS_ARG_VALIDATE_MASK & validate);
  ------------------
  |  |  102|  10.1k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  137|  10.1k|  return (void *) packed_args;
  138|  10.1k|}
Linit_local.c:dwarf_get_uc:
  111|   182k|{
  112|   182k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (112:3): [True: 0, False: 182k]
  |  Branch (112:3): [True: 182k, False: 0]
  ------------------
  113|   182k|  return AS_ARG_GET_UC_PTR(cursor->as_arg);
  ------------------
  |  |  105|   182k|  ((ucontext_t *) ((uintptr_t) arg & AS_ARG_UCONTEXT_MASK))
  |  |  ------------------
  |  |  |  |  101|   182k|#define AS_ARG_UCONTEXT_MASK ~0x1UL
  |  |  ------------------
  ------------------
  114|   182k|}
Linit_local.c:dwarf_get:
  200|  20.3k|{
  201|  20.3k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  157|  20.3k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|  20.3k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (157:33): [True: 0, False: 20.3k]
  |  |  ------------------
  ------------------
  202|      0|    return -UNW_EBADREG;
  203|       |
  204|  20.3k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  146|  20.3k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  143|  20.3k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (146:33): [True: 0, False: 20.3k]
  |  |  ------------------
  ------------------
  205|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  430|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  206|      0|                                     0, c->as_arg);
  207|  20.3k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  148|  20.3k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  141|  20.3k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (148:33): [True: 20.3k, False: 0]
  |  |  ------------------
  ------------------
  208|  20.3k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  429|  20.3k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  140|  20.3k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  209|  20.3k|                                     0, c->as_arg);
  210|  20.3k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (210:3): [True: 0, False: 0]
  |  Branch (210:3): [True: 0, False: 0]
  ------------------
  211|      0|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  212|      0|  return 0;
  213|      0|}
Los-linux.c:dwarf_get_validate:
  118|  4.77k|{
  119|  4.77k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (119:3): [True: 0, False: 4.77k]
  |  Branch (119:3): [True: 4.77k, False: 0]
  ------------------
  120|  4.77k|  return AS_ARG_GET_VALIDATE(cursor->as_arg);
  ------------------
  |  |  107|  4.77k|  ((int) ((uintptr_t) arg & AS_ARG_VALIDATE_MASK))
  |  |  ------------------
  |  |  |  |  102|  4.77k|#define AS_ARG_VALIDATE_MASK 0x1UL
  |  |  ------------------
  ------------------
  121|  4.77k|}
Los-linux.c:dwarf_set_validate:
  125|  9.55k|{
  126|  9.55k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (126:3): [True: 0, False: 9.55k]
  |  Branch (126:3): [True: 9.55k, False: 0]
  ------------------
  127|  9.55k|  uintptr_t *packed_args = (uintptr_t *) &cursor->as_arg;
  128|  9.55k|  *packed_args = (*packed_args & ~AS_ARG_VALIDATE_MASK)
  ------------------
  |  |  102|  9.55k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  129|  9.55k|                 | (AS_ARG_VALIDATE_MASK & validate);
  ------------------
  |  |  102|  9.55k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  130|  9.55k|}
Lregs.c:dwarf_get:
  200|   139k|{
  201|   139k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  157|   139k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|   139k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (157:33): [True: 0, False: 139k]
  |  |  ------------------
  ------------------
  202|      0|    return -UNW_EBADREG;
  203|       |
  204|   139k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  146|   139k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  143|   139k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (146:33): [True: 0, False: 139k]
  |  |  ------------------
  ------------------
  205|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  430|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  206|      0|                                     0, c->as_arg);
  207|   139k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  148|   139k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  141|   139k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (148:33): [True: 129k, False: 10.3k]
  |  |  ------------------
  ------------------
  208|   129k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  429|   129k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  140|   129k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  209|   129k|                                     0, c->as_arg);
  210|   139k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (210:3): [True: 0, False: 10.3k]
  |  Branch (210:3): [True: 10.3k, False: 0]
  ------------------
  211|  10.3k|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  140|  10.3k|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  212|  10.3k|  return 0;
  213|  10.3k|}
Lstep.c:dwarf_get_validate:
  118|   101k|{
  119|   101k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (119:3): [True: 0, False: 101k]
  |  Branch (119:3): [True: 101k, False: 0]
  ------------------
  120|   101k|  return AS_ARG_GET_VALIDATE(cursor->as_arg);
  ------------------
  |  |  107|   101k|  ((int) ((uintptr_t) arg & AS_ARG_VALIDATE_MASK))
  |  |  ------------------
  |  |  |  |  102|   101k|#define AS_ARG_VALIDATE_MASK 0x1UL
  |  |  ------------------
  ------------------
  121|   101k|}
Lstep.c:dwarf_set_validate:
  125|   203k|{
  126|   203k|  assert(cursor->as == unw_local_addr_space);
  ------------------
  |  Branch (126:3): [True: 0, False: 203k]
  |  Branch (126:3): [True: 203k, False: 0]
  ------------------
  127|   203k|  uintptr_t *packed_args = (uintptr_t *) &cursor->as_arg;
  128|   203k|  *packed_args = (*packed_args & ~AS_ARG_VALIDATE_MASK)
  ------------------
  |  |  102|   203k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  129|   203k|                 | (AS_ARG_VALIDATE_MASK & validate);
  ------------------
  |  |  102|   203k|#define AS_ARG_VALIDATE_MASK 0x1UL
  ------------------
  130|   203k|}
Lparser.c:dwarf_get:
  200|  91.3k|{
  201|  91.3k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  157|  91.3k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|  91.3k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (157:33): [True: 0, False: 91.3k]
  |  |  ------------------
  ------------------
  202|      0|    return -UNW_EBADREG;
  203|       |
  204|  91.3k|  if (DWARF_IS_REG_LOC (loc))
  ------------------
  |  |  146|  91.3k|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  143|  91.3k|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (146:33): [True: 0, False: 91.3k]
  |  |  ------------------
  ------------------
  205|      0|    return (*c->as->acc.access_reg) (c->as, DWARF_GET_REG_LOC (loc), val,
  ------------------
  |  |  430|      0|#define DWARF_GET_REG_LOC(l)    ((unw_regnum_t) DWARF_GET_LOC(l))
  |  |  ------------------
  |  |  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  206|      0|                                     0, c->as_arg);
  207|  91.3k|  if (DWARF_IS_MEM_LOC (loc))
  ------------------
  |  |  148|  91.3k|# define DWARF_IS_MEM_LOC(l)    ((l).type == DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  141|  91.3k|# define DWARF_LOC_TYPE_MEM     (0 << 0)
  |  |  ------------------
  |  |  |  Branch (148:33): [True: 91.3k, False: 0]
  |  |  ------------------
  ------------------
  208|  91.3k|    return (*c->as->acc.access_mem) (c->as, DWARF_GET_MEM_LOC (loc), val,
  ------------------
  |  |  429|  91.3k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  140|  91.3k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  209|  91.3k|                                     0, c->as_arg);
  210|  91.3k|  assert(DWARF_IS_VAL_LOC (loc));
  ------------------
  |  Branch (210:3): [True: 0, False: 0]
  |  Branch (210:3): [True: 0, False: 0]
  ------------------
  211|      0|  *val = DWARF_GET_LOC (loc);
  ------------------
  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  212|      0|  return 0;
  213|      0|}

_ULx86_64_dwarf_extract_proc_info_from_fde:
  237|     16|{
  238|     16|  unw_word_t fde_end_addr, cie_addr, cie_offset_addr, aug_end_addr = 0;
  239|     16|  unw_word_t start_ip, ip_range, aug_size, addr = *addrp;
  240|     16|  int ret;
  241|     16|  uint8_t ip_range_encoding;
  242|     16|  struct dwarf_cie_info dci;
  243|     16|  uint64_t u64val;
  244|     16|  uint32_t u32val;
  245|       |
  246|     16|  Debug (12, "FDE @ 0x%lx\n", (long) addr);
  247|       |
  248|     16|  memset (&dci, 0, sizeof (dci));
  249|       |
  250|     16|  if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0)
  ------------------
  |  Branch (250:7): [True: 0, False: 16]
  ------------------
  251|      0|    return ret;
  252|       |
  253|     16|  if (u32val != 0xffffffff)
  ------------------
  |  Branch (253:7): [True: 16, False: 0]
  ------------------
  254|     16|    {
  255|     16|      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|     16|      if (u32val == 0)
  ------------------
  |  Branch (259:11): [True: 0, False: 16]
  ------------------
  260|      0|        return -UNW_ENOINFO;
  261|       |
  262|       |      /* the FDE is in the 32-bit DWARF format */
  263|       |
  264|     16|      *addrp = fde_end_addr = addr + u32val;
  265|     16|      cie_offset_addr = addr;
  266|       |
  267|     16|      if ((ret = dwarf_reads32 (as, a, &addr, &cie_offset, arg)) < 0)
  ------------------
  |  Branch (267:11): [True: 0, False: 16]
  ------------------
  268|      0|        return ret;
  269|       |
  270|     16|      if (is_cie_id (cie_offset, is_debug_frame))
  ------------------
  |  Branch (270:11): [True: 0, False: 16]
  ------------------
  271|       |        /* ignore CIEs (happens during linear searches) */
  272|      0|        return 0;
  273|       |
  274|     16|      if (is_debug_frame)
  ------------------
  |  Branch (274:11): [True: 0, False: 16]
  ------------------
  275|      0|        cie_addr = base + cie_offset;
  276|     16|      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|     16|        cie_addr = cie_offset_addr - cie_offset;
  282|     16|    }
  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|     16|  Debug (15, "looking for CIE at address %lx\n", (long) cie_addr);
  313|       |
  314|     16|  if ((ret = parse_cie (as, a, cie_addr, pi, &dci, is_debug_frame, arg)) < 0)
  ------------------
  |  Branch (314:7): [True: 0, False: 16]
  ------------------
  315|      0|    return ret;
  316|       |
  317|       |  /* IP-range has same encoding as FDE pointers, except that it's
  318|       |     always an absolute value: */
  319|     16|  ip_range_encoding = dci.fde_encoding & DW_EH_PE_FORMAT_MASK;
  ------------------
  |  |  194|     16|#define DW_EH_PE_FORMAT_MASK    0x0f    /* format of the encoded value */
  ------------------
  320|       |
  321|     16|  if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.fde_encoding,
  ------------------
  |  |  402|     16|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (321:7): [True: 0, False: 16]
  ------------------
  322|     16|                                         pi, &start_ip, arg)) < 0
  323|     16|      || (ret = dwarf_read_encoded_pointer (as, a, &addr, ip_range_encoding,
  ------------------
  |  |  402|     16|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (323:10): [True: 0, False: 16]
  ------------------
  324|     16|                                            pi, &ip_range, arg)) < 0)
  325|      0|    return ret;
  326|     16|  pi->start_ip = start_ip;
  327|     16|  pi->end_ip = start_ip + ip_range;
  328|     16|  pi->handler = dci.handler;
  329|       |
  330|     16|  if (dci.sized_augmentation)
  ------------------
  |  Branch (330:7): [True: 16, False: 0]
  ------------------
  331|     16|    {
  332|     16|      if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0)
  ------------------
  |  Branch (332:11): [True: 0, False: 16]
  ------------------
  333|      0|        return ret;
  334|     16|      aug_end_addr = addr + aug_size;
  335|     16|    }
  336|       |
  337|     16|  if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.lsda_encoding,
  ------------------
  |  |  402|     16|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (337:7): [True: 0, False: 16]
  ------------------
  338|     16|                                         pi, &pi->lsda, arg)) < 0)
  339|      0|    return ret;
  340|       |
  341|     16|  Debug (15, "FDE covers IP 0x%lx-0x%lx, LSDA=0x%lx\n",
  342|     16|         (long) pi->start_ip, (long) pi->end_ip, (long) pi->lsda);
  343|       |
  344|     16|  if (need_unwind_info)
  ------------------
  |  Branch (344:7): [True: 16, False: 0]
  ------------------
  345|     16|    {
  346|     16|      pi->format = UNW_INFO_FORMAT_TABLE;
  347|     16|      pi->unwind_info_size = sizeof (dci);
  348|     16|      pi->unwind_info = mempool_alloc (&dwarf_cie_info_pool);
  ------------------
  |  |   56|     16|#define mempool_alloc(p)        UNWI_ARCH_OBJ(_mempool_alloc)(p)
  |  |  ------------------
  |  |  |  |  174|     16|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|     16|      if (!pi->unwind_info)
  ------------------
  |  Branch (349:11): [True: 0, False: 16]
  ------------------
  350|      0|        return -UNW_ENOMEM;
  351|       |
  352|     16|      if (dci.have_abi_marker)
  ------------------
  |  Branch (352:11): [True: 0, False: 16]
  ------------------
  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|     16|      if (dci.sized_augmentation)
  ------------------
  |  Branch (361:11): [True: 16, False: 0]
  ------------------
  362|     16|        dci.fde_instr_start = aug_end_addr;
  363|      0|      else
  364|      0|        dci.fde_instr_start = addr;
  365|     16|      dci.fde_instr_end = fde_end_addr;
  366|       |
  367|     16|      memcpy (pi->unwind_info, &dci, sizeof (dci));
  368|     16|    }
  369|     16|  return 0;
  370|     16|}
Lfde.c:is_cie_id:
   30|     16|{
   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|     16|  if (is_debug_frame)
  ------------------
  |  Branch (34:7): [True: 0, False: 16]
  ------------------
   35|      0|      return val == (unw_word_t)(-1);
   36|     16|  else
   37|     16|    return (val == 0);
   38|     16|}
Lfde.c:parse_cie:
   49|     16|{
   50|     16|  uint8_t version, ch, augstr[5], fde_encoding, handler_encoding;
   51|     16|  uint8_t address_size, segment_size;
   52|     16|  unw_word_t len, cie_end_addr, aug_size;
   53|     16|  uint32_t u32val;
   54|     16|  uint64_t u64val;
   55|     16|  size_t i;
   56|     16|  int ret;
   57|     16|# define STR2(x)        #x
   58|     16|# 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|     16|  switch (dwarf_addr_size (as))
  ------------------
  |  |   15|     16|# define dwarf_addr_size(as) (sizeof (unw_word_t))
  ------------------
   66|     16|    {
   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: 16]
  ------------------
   68|     16|    case 8:     fde_encoding = DW_EH_PE_udata8; break;
  ------------------
  |  |  206|     16|#define DW_EH_PE_udata8         0x04    /* unsigned 64-bit value */
  ------------------
  |  Branch (68:5): [True: 16, 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: 16]
  ------------------
   70|     16|    }
   71|       |
   72|     16|  dci->lsda_encoding = DW_EH_PE_omit;
  ------------------
  |  |  201|     16|#define DW_EH_PE_omit           0xff
  ------------------
   73|     16|  dci->handler = 0;
   74|       |
   75|     16|  if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0)
  ------------------
  |  Branch (75:7): [True: 0, False: 16]
  ------------------
   76|      0|    return ret;
   77|       |
   78|     16|  if (u32val != 0xffffffff)
  ------------------
  |  Branch (78:7): [True: 16, False: 0]
  ------------------
   79|     16|    {
   80|       |      /* the CIE is in the 32-bit DWARF format */
   81|     16|      uint32_t cie_id;
   82|       |      /* DWARF says CIE id should be 0xffffffff, but in .eh_frame, it's 0 */
   83|     16|      const uint32_t expected_id = (is_debug_frame) ? 0xffffffff : 0;
  ------------------
  |  Branch (83:36): [True: 0, False: 16]
  ------------------
   84|       |
   85|     16|      len = u32val;
   86|     16|      cie_end_addr = addr + len;
   87|     16|      if ((ret = dwarf_readu32 (as, a, &addr, &cie_id, arg)) < 0)
  ------------------
  |  Branch (87:11): [True: 0, False: 16]
  ------------------
   88|      0|        return ret;
   89|     16|      if (cie_id != expected_id)
  ------------------
  |  Branch (89:11): [True: 0, False: 16]
  ------------------
   90|      0|        {
   91|      0|          Debug (1, "Unexpected CIE id %x\n", cie_id);
   92|      0|          return -UNW_EINVAL;
   93|      0|        }
   94|     16|    }
   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|     16|  dci->cie_instr_end = cie_end_addr;
  116|       |
  117|     16|  if ((ret = dwarf_readu8 (as, a, &addr, &version, arg)) < 0)
  ------------------
  |  Branch (117:7): [True: 0, False: 16]
  ------------------
  118|      0|    return ret;
  119|       |
  120|       |  /* GCC emits version 1??? */
  121|     16|  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: 16]
  |  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|     16|  memset (augstr, 0, sizeof (augstr));
  130|     16|  for (i = 0;;)
  131|     48|    {
  132|     48|      if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0)
  ------------------
  |  Branch (132:11): [True: 0, False: 48]
  ------------------
  133|      0|        return ret;
  134|       |
  135|     48|      if (!ch)
  ------------------
  |  Branch (135:11): [True: 16, False: 32]
  ------------------
  136|     16|        break;  /* end of augmentation string */
  137|       |
  138|     32|      if (i < sizeof (augstr) - 1)
  ------------------
  |  Branch (138:11): [True: 32, False: 0]
  ------------------
  139|     32|        augstr[i++] = ch;
  140|     32|    }
  141|       |
  142|     16|  if (version > 3)
  ------------------
  |  Branch (142:7): [True: 0, False: 16]
  ------------------
  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|     16|  if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->code_align, arg)) < 0
  ------------------
  |  Branch (151:7): [True: 0, False: 16]
  ------------------
  152|     16|      || (ret = dwarf_read_sleb128 (as, a, &addr, &dci->data_align, arg)) < 0)
  ------------------
  |  Branch (152:10): [True: 0, False: 16]
  ------------------
  153|      0|    return ret;
  154|       |
  155|       |  /* Read the return-address column either as a u8 or as a uleb128.  */
  156|     16|  if (version == 1)
  ------------------
  |  Branch (156:7): [True: 16, False: 0]
  ------------------
  157|     16|    {
  158|     16|      if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0)
  ------------------
  |  Branch (158:11): [True: 0, False: 16]
  ------------------
  159|      0|        return ret;
  160|     16|      dci->ret_addr_column = ch;
  161|     16|    }
  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|     16|  i = 0;
  167|     16|  if (augstr[0] == 'z')
  ------------------
  |  Branch (167:7): [True: 16, False: 0]
  ------------------
  168|     16|    {
  169|     16|      dci->sized_augmentation = 1;
  170|     16|      if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0)
  ------------------
  |  Branch (170:11): [True: 0, False: 16]
  ------------------
  171|      0|        return ret;
  172|     16|      i++;
  173|     16|    }
  174|       |
  175|     32|  for (; i < sizeof (augstr) && augstr[i]; ++i)
  ------------------
  |  Branch (175:10): [True: 32, False: 0]
  |  Branch (175:33): [True: 16, False: 16]
  ------------------
  176|     16|    switch (augstr[i])
  177|     16|      {
  178|      0|      case 'L':
  ------------------
  |  Branch (178:7): [True: 0, False: 16]
  ------------------
  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|     16|      case 'R':
  ------------------
  |  Branch (185:7): [True: 16, False: 0]
  ------------------
  186|       |        /* read the FDE pointer-encoding format.  */
  187|     16|        if ((ret = dwarf_readu8 (as, a, &addr, &fde_encoding, arg)) < 0)
  ------------------
  |  Branch (187:13): [True: 0, False: 16]
  ------------------
  188|      0|          return ret;
  189|     16|        break;
  190|       |
  191|     16|      case 'P':
  ------------------
  |  Branch (191:7): [True: 0, False: 16]
  ------------------
  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,
  ------------------
  |  |  402|      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: 16]
  ------------------
  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: 16]
  ------------------
  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|     16|      }
  218|     16| done:
  219|     16|  dci->fde_encoding = fde_encoding;
  220|     16|  dci->cie_instr_start = addr;
  221|     16|  Debug (15, "CIE parsed OK, augmentation = \"%s\", handler=0x%lx\n",
  222|     16|         augstr, (long) dci->handler);
  223|     16|  return 0;
  224|     16|}

_ULx86_64_dwarf_callback:
  637|     16|{
  638|     16|  struct dwarf_callback_data *cb_data = ptr;
  639|     16|  unw_dyn_info_t *di = &cb_data->di;
  640|     16|  const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text;
  641|     16|  unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip;
  642|     16|  Elf_W(Addr) load_base, max_load_addr = 0;
  ------------------
  |  |   44|     16|# define Elf_W(x)       Elf64_##x
  ------------------
  643|     16|  int ret, need_unwind_info = cb_data->need_unwind_info;
  644|     16|  unw_proc_info_t *pi = cb_data->pi;
  645|     16|  struct dwarf_eh_frame_hdr *hdr = NULL;
  646|     16|  unw_accessors_t *a;
  647|     16|  long n;
  648|     16|  int found = 0;
  649|     16|  Elf_W (Addr) eh_frame = 0;
  ------------------
  |  |   44|     16|# define Elf_W(x)       Elf64_##x
  ------------------
  650|       |#ifdef CONFIG_DEBUG_FRAME
  651|       |  unw_word_t start, end;
  652|       |#endif /* CONFIG_DEBUG_FRAME*/
  653|       |
  654|     16|  ip = cb_data->ip;
  655|       |
  656|       |  /* Make sure struct dl_phdr_info is at least as big as we need.  */
  657|     16|  if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
  ------------------
  |  Branch (657:7): [True: 0, False: 16]
  ------------------
  658|     16|             + sizeof (info->dlpi_phnum))
  659|      0|    return -1;
  660|       |
  661|     16|  Debug (15, "checking %s, base=0x%lx)\n",
  662|     16|         info->dlpi_name, (long) info->dlpi_addr);
  663|       |
  664|     16|  phdr = info->dlpi_phdr;
  665|     16|  load_base = info->dlpi_addr;
  666|     16|  p_text = NULL;
  667|     16|  p_eh_hdr = NULL;
  668|     16|  p_dynamic = NULL;
  669|       |
  670|       |  /* See if PC falls into one of the loaded segments.  Find the
  671|       |     eh-header segment at the same time.  */
  672|    240|  for (n = info->dlpi_phnum; --n >= 0; phdr++)
  ------------------
  |  Branch (672:30): [True: 224, False: 16]
  ------------------
  673|    224|    {
  674|    224|      if (phdr->p_type == PT_LOAD)
  ------------------
  |  Branch (674:11): [True: 64, False: 160]
  ------------------
  675|     64|        {
  676|     64|          Elf_W(Addr) vaddr = phdr->p_vaddr + load_base;
  ------------------
  |  |   44|     64|# define Elf_W(x)       Elf64_##x
  ------------------
  677|       |
  678|     64|          if (ip >= vaddr && ip < vaddr + phdr->p_memsz)
  ------------------
  |  Branch (678:15): [True: 32, False: 32]
  |  Branch (678:30): [True: 16, False: 16]
  ------------------
  679|     16|            p_text = phdr;
  680|       |
  681|     64|          if (vaddr + phdr->p_filesz > max_load_addr)
  ------------------
  |  Branch (681:15): [True: 64, False: 0]
  ------------------
  682|     64|            max_load_addr = vaddr + phdr->p_filesz;
  683|     64|        }
  684|    160|      else if (phdr->p_type == PT_GNU_EH_FRAME)
  ------------------
  |  Branch (684:16): [True: 16, False: 144]
  ------------------
  685|     16|        p_eh_hdr = phdr;
  686|       |#if defined __sun
  687|       |      else if (phdr->p_type == PT_SUNW_UNWIND)
  688|       |        p_eh_hdr = phdr;
  689|       |#endif
  690|    144|      else if (phdr->p_type == PT_DYNAMIC)
  ------------------
  |  Branch (690:16): [True: 16, False: 128]
  ------------------
  691|     16|        p_dynamic = phdr;
  692|    224|    }
  693|       |
  694|     16|  if (!p_text)
  ------------------
  |  Branch (694:7): [True: 0, False: 16]
  ------------------
  695|      0|    return 0;
  696|       |
  697|     16|  if (p_eh_hdr)
  ------------------
  |  Branch (697:7): [True: 16, False: 0]
  ------------------
  698|     16|    {
  699|     16|      hdr = (struct dwarf_eh_frame_hdr *) (p_eh_hdr->p_vaddr + load_base);
  700|     16|    }
  701|      0|  else
  702|      0|    {
  703|      0|      Debug (1, "no .eh_frame_hdr section found\n");
  704|      0|      eh_frame = dwarf_find_eh_frame_section (info);
  705|      0|      if (eh_frame)
  ------------------
  |  Branch (705:11): [True: 0, False: 0]
  ------------------
  706|      0|        Debug (1, "using the .eh_frame section of %s directly\n",
  707|      0|               info->dlpi_name);
  708|      0|    }
  709|       |
  710|     16|  if (hdr || eh_frame)
  ------------------
  |  Branch (710:7): [True: 16, False: 0]
  |  Branch (710:14): [True: 0, False: 0]
  ------------------
  711|     16|    {
  712|     16|      if (p_dynamic)
  ------------------
  |  Branch (712:11): [True: 16, False: 0]
  ------------------
  713|     16|        {
  714|       |          /* For dynamically linked executables and shared libraries,
  715|       |             DT_PLTGOT is the value that data-relative addresses are
  716|       |             relative to for that object.  We call this the "gp".  */
  717|     16|          Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(p_dynamic->p_vaddr + load_base);
  ------------------
  |  |   44|     16|# define Elf_W(x)       Elf64_##x
  ------------------
  718|    308|          for (; dyn->d_tag != DT_NULL; ++dyn)
  ------------------
  |  Branch (718:18): [True: 308, False: 0]
  ------------------
  719|    308|            if (dyn->d_tag == DT_PLTGOT)
  ------------------
  |  Branch (719:17): [True: 16, False: 292]
  ------------------
  720|     16|              {
  721|       |                /* Assume that _DYNAMIC is writable and GLIBC has
  722|       |                   relocated it (true for x86 at least).  */
  723|     16|                di->gp = dyn->d_un.d_ptr;
  724|     16|                break;
  725|     16|              }
  726|     16|        }
  727|      0|      else
  728|       |        /* Otherwise this is a static executable with no _DYNAMIC.  Assume
  729|       |           that data-relative addresses are relative to 0, i.e.,
  730|       |           absolute.  */
  731|      0|        di->gp = 0;
  732|     16|      pi->gp = di->gp;
  733|       |
  734|     16|      if (hdr == NULL)
  ------------------
  |  Branch (734:11): [True: 0, False: 16]
  ------------------
  735|      0|        {
  736|       |          /* There is no .eh_frame_hdr section, hence no binary search
  737|       |             table: search the .eh_frame section linearly.  */
  738|      0|          eh_frame_start = eh_frame;
  739|      0|          eh_frame_end = max_load_addr; /* XXX can we do better? */
  740|      0|          fde_count = ~0UL;
  741|       |
  742|      0|          Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n",
  743|      0|                 eh_frame_start, eh_frame_end);
  744|       |
  745|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|      0|                                 eh_frame_start, eh_frame_end, fde_count,
  747|      0|                                 pi, need_unwind_info, NULL);
  748|      0|          if (found != 1)
  ------------------
  |  Branch (748:15): [True: 0, False: 0]
  ------------------
  749|      0|            found = 0;
  750|      0|          else
  751|      0|            cb_data->single_fde = 1;
  752|       |
  753|      0|          goto out;
  754|      0|        }
  755|       |
  756|     16|      if (hdr->version != DW_EH_VERSION)
  ------------------
  |  |  108|     16|#define DW_EH_VERSION           1       /* The version we're implementing */
  ------------------
  |  Branch (756:11): [True: 0, False: 16]
  ------------------
  757|      0|        {
  758|      0|          Debug (1, "table `%s' has unexpected version %d\n",
  759|      0|                 info->dlpi_name, hdr->version);
  760|      0|          return 0;
  761|      0|        }
  762|       |
  763|     16|      a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  278|     16|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     16|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  274|     16|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  764|     16|      addr = (unw_word_t) (uintptr_t) (&hdr->eh_frame);
  765|       |
  766|     16|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  402|     16|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     16|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (766:11): [True: 0, False: 16]
  ------------------
  767|     16|                                             &addr, hdr->eh_frame_ptr_enc, pi,
  768|     16|                                             &eh_frame_start, NULL)) < 0)
  769|      0|        return ret;
  770|       |
  771|     16|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  402|     16|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     16|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (771:11): [True: 0, False: 16]
  ------------------
  772|     16|                                             &addr, hdr->fde_count_enc, pi,
  773|     16|                                             &fde_count, NULL)) < 0)
  774|      0|        return ret;
  775|       |
  776|     16|      if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  216|     16|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                    if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  209|     16|#define DW_EH_PE_sdata4         0x0b    /* signed 32-bit value */
  ------------------
  |  Branch (776:11): [True: 0, False: 16]
  ------------------
  777|      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 (777:14): [True: 0, False: 0]
  ------------------
  778|      0|        {
  779|       |          /* If there is no search table or it has an unsupported
  780|       |             encoding, fall back on linear search.  */
  781|      0|          if (hdr->table_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (781:15): [True: 0, False: 0]
  ------------------
  782|      0|            {
  783|      0|              Debug (4, "table `%s' lacks search table; doing linear search\n",
  784|      0|                     info->dlpi_name);
  785|      0|            }
  786|      0|          else
  787|      0|            {
  788|      0|              Debug (4, "table `%s' has encoding 0x%x; doing linear search\n",
  789|      0|                     info->dlpi_name, hdr->table_enc);
  790|      0|            }
  791|       |
  792|      0|          eh_frame_end = max_load_addr; /* XXX can we do better? */
  793|       |
  794|      0|          if (hdr->fde_count_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (794:15): [True: 0, False: 0]
  ------------------
  795|      0|            fde_count = ~0UL;
  796|      0|          if (hdr->eh_frame_ptr_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (796:15): [True: 0, False: 0]
  ------------------
  797|      0|            abort ();
  798|       |
  799|      0|          Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n",
  800|      0|                 eh_frame_start, eh_frame_end);
  801|       |
  802|       |          /* XXX we know how to build a local binary search table for
  803|       |             .debug_frame, so we could do that here too.  */
  804|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|      0|                                 eh_frame_start, eh_frame_end, fde_count,
  806|      0|                                 pi, need_unwind_info, NULL);
  807|      0|          if (found != 1)
  ------------------
  |  Branch (807:15): [True: 0, False: 0]
  ------------------
  808|      0|            found = 0;
  809|      0|	  else
  810|      0|	    cb_data->single_fde = 1;
  811|      0|        }
  812|     16|      else
  813|     16|        {
  814|     16|          int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  216|     16|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                        int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  210|     16|#define DW_EH_PE_sdata8         0x0c    /* signed 64-bit value */
  ------------------
  815|     16|          size_t entry_size = is_sdata8 ? sizeof (struct table_entry64)
  ------------------
  |  Branch (815:31): [True: 0, False: 16]
  ------------------
  816|     16|                                        : sizeof (struct table_entry);
  817|     16|          di->format = is_sdata8 ? UNW_INFO_FORMAT_REMOTE_TABLE_64
  ------------------
  |  Branch (817:24): [True: 0, False: 16]
  ------------------
  818|     16|                                 : UNW_INFO_FORMAT_REMOTE_TABLE;
  819|     16|          di->start_ip = p_text->p_vaddr + load_base;
  820|     16|          di->end_ip = p_text->p_vaddr + load_base + p_text->p_memsz;
  821|     16|          di->u.rti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name;
  822|     16|          di->u.rti.table_data = addr;
  823|     16|          assert (entry_size % sizeof (unw_word_t) == 0);
  ------------------
  |  Branch (823:11): [True: 0, False: 16]
  |  Branch (823:11): [True: 16, False: 0]
  ------------------
  824|     16|          di->u.rti.table_len = (fde_count * entry_size
  825|     16|                                 / sizeof (unw_word_t));
  826|       |          /* For the binary-search table in the eh_frame_hdr, data-relative
  827|       |             means relative to the start of that section... */
  828|     16|          di->u.rti.segbase = (unw_word_t) (uintptr_t) hdr;
  829|       |
  830|     16|          found = 1;
  831|     16|          Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, "
  832|     16|                 "table_data=0x%lx\n", (char *) (uintptr_t) di->u.rti.name_ptr,
  833|     16|                 (long) di->u.rti.segbase, (long) di->u.rti.table_len,
  834|     16|                 (long) di->gp, (long) di->u.rti.table_data);
  835|     16|        }
  836|     16|    }
  837|       |
  838|     16|out:
  839|       |#ifdef CONFIG_DEBUG_FRAME
  840|       |  /* Find the start/end of the described region by parsing the phdr_info
  841|       |     structure.  */
  842|       |  start = (unw_word_t) -1;
  843|       |  end = 0;
  844|       |
  845|       |  for (n = 0; n < info->dlpi_phnum; n++)
  846|       |    {
  847|       |      if (info->dlpi_phdr[n].p_type == PT_LOAD)
  848|       |        {
  849|       |          unw_word_t seg_start = info->dlpi_addr + info->dlpi_phdr[n].p_vaddr;
  850|       |          unw_word_t seg_end = seg_start + info->dlpi_phdr[n].p_memsz;
  851|       |
  852|       |          if (seg_start < start)
  853|       |            start = seg_start;
  854|       |
  855|       |          if (seg_end > end)
  856|       |            end = seg_end;
  857|       |        }
  858|       |    }
  859|       |
  860|       |  found = dwarf_find_debug_frame (found, &cb_data->di_debug, ip,
  861|       |                                  info->dlpi_addr, info->dlpi_name, start,
  862|       |                                  end);
  863|       |#endif  /* CONFIG_DEBUG_FRAME */
  864|       |
  865|     16|  return found;
  866|     16|}
_ULx86_64_dwarf_find_proc_info:
  871|     16|{
  872|     16|  struct dwarf_callback_data cb_data;
  873|     16|  int ret;
  874|       |
  875|     16|  Debug (14, "looking for IP=0x%lx\n", (long) ip);
  876|       |
  877|     16|  memset (&cb_data, 0, sizeof (cb_data));
  878|     16|  cb_data.ip = ip;
  879|     16|  cb_data.pi = pi;
  880|     16|  cb_data.need_unwind_info = need_unwind_info;
  881|     16|  cb_data.di.format = -1;
  882|     16|  cb_data.di_debug.format = -1;
  883|       |
  884|     16|  ret = unwi_iterate_phdr_for_ip (as, ip, dwarf_callback, &cb_data);
  ------------------
  |  |  302|     16|#define unwi_iterate_phdr_for_ip        UNWI_OBJ(iterate_phdr_for_ip)
  |  |  ------------------
  |  |  |  |  173|     16|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                ret = unwi_iterate_phdr_for_ip (as, ip, dwarf_callback, &cb_data);
  ------------------
  |  |  387|     16|#define dwarf_callback                  UNW_OBJ (dwarf_callback)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  885|       |
  886|     16|  if (ret > 0)
  ------------------
  |  Branch (886:7): [True: 16, False: 0]
  ------------------
  887|     16|    {
  888|     16|      if (cb_data.single_fde)
  ------------------
  |  Branch (888:11): [True: 0, False: 16]
  ------------------
  889|       |	/* already got the result in *pi */
  890|      0|	return 0;
  891|       |
  892|       |      /* search the table: */
  893|     16|      if (cb_data.di.format != -1)
  ------------------
  |  Branch (893:11): [True: 16, False: 0]
  ------------------
  894|     16|        {
  895|     16|	ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di,
  ------------------
  |  |   59|     16|#define dwarf_search_unwind_table_int dwarf_search_unwind_table
  |  |  ------------------
  |  |  |  |  390|     16|#define dwarf_search_unwind_table       UNW_OBJ (dwarf_search_unwind_table)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  896|     16|					     pi, need_unwind_info, arg);
  897|     16|        }
  898|      0|      else
  899|      0|	ret = -UNW_ENOINFO;
  900|       |
  901|     16|      if (ret == -UNW_ENOINFO && cb_data.di_debug.format != -1)
  ------------------
  |  Branch (901:11): [True: 0, False: 16]
  |  Branch (901:34): [True: 0, False: 0]
  ------------------
  902|      0|	ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di_debug, pi,
  ------------------
  |  |   59|      0|#define dwarf_search_unwind_table_int dwarf_search_unwind_table
  |  |  ------------------
  |  |  |  |  390|      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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  903|      0|					     need_unwind_info, arg);
  904|     16|    }
  905|      0|  else
  906|      0|    ret = -UNW_ENOINFO;
  907|       |
  908|     16|  return ret;
  909|     16|}
_ULx86_64_dwarf_search_unwind_table:
  987|     16|{
  988|     16|  unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr;
  989|     16|  unw_word_t found_start_ip_offset UNUSED = 0;
  990|     16|  unw_word_t found_fde_offset = 0;
  991|     16|  int found_entry = 0;
  992|     16|  unw_accessors_t *a;
  993|     16|  int ret;
  994|     16|  unw_word_t debug_frame_base = 0;
  995|     16|  size_t table_len = 0;
  996|     16|  const void *table_data = NULL;
  997|     16|  int is_table64 = (di->format == UNW_INFO_FORMAT_REMOTE_TABLE_64);
  998|       |
  999|       |#ifdef UNW_REMOTE_ONLY
 1000|       |  assert (is_remote_table(di->format));
 1001|       |#else
 1002|     16|  assert (is_remote_table(di->format)
  ------------------
  |  Branch (1002:3): [True: 16, False: 0]
  |  Branch (1002:3): [True: 0, False: 0]
  |  Branch (1002:3): [True: 16, False: 0]
  |  Branch (1002:3): [True: 0, False: 0]
  ------------------
 1003|     16|          || di->format == UNW_INFO_FORMAT_TABLE);
 1004|     16|#endif
 1005|     16|  assert (ip >= di->start_ip && ip < di->end_ip);
  ------------------
  |  Branch (1005:3): [True: 0, False: 16]
  |  Branch (1005:3): [True: 0, False: 0]
  |  Branch (1005:3): [True: 16, False: 0]
  |  Branch (1005:3): [True: 16, False: 0]
  ------------------
 1006|       |
 1007|     16|  if (is_remote_table(di->format))
  ------------------
  |  Branch (1007:7): [True: 16, False: 0]
  ------------------
 1008|     16|    {
 1009|     16|      table_data = (const void *) (uintptr_t) di->u.rti.table_data;
 1010|     16|      table_len = di->u.rti.table_len * sizeof (unw_word_t);
 1011|     16|      debug_frame_base = 0;
 1012|     16|    }
 1013|      0|  else
 1014|      0|    {
 1015|      0|      assert(di->format == UNW_INFO_FORMAT_TABLE);
  ------------------
  |  Branch (1015:7): [True: 0, False: 0]
  |  Branch (1015:7): [True: 0, False: 0]
  ------------------
 1016|      0|#ifndef UNW_REMOTE_ONLY
 1017|      0|      struct unw_debug_frame_list *fdesc = (void *) di->u.ti.table_data;
 1018|       |
 1019|       |      /* UNW_INFO_FORMAT_TABLE (i.e. .debug_frame) is read from local address
 1020|       |         space.  Both the index and the unwind tables live in local memory, but
 1021|       |         the address space to check for properties like the address size and
 1022|       |         endianness is the target one.  */
 1023|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|      0|      table_data = fdesc->index;
 1025|      0|      table_len = fdesc->index_size;
 1026|      0|      debug_frame_base = (uintptr_t) fdesc->debug_frame;
 1027|      0|#endif
 1028|      0|    }
 1029|       |
 1030|     16|  a = unw_get_accessors_int (as);
  ------------------
  |  |  278|     16|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     16|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1031|       |
 1032|     16|  segbase = di->u.rti.segbase;
 1033|     16|  if (di->format == UNW_INFO_FORMAT_IP_OFFSET) {
  ------------------
  |  Branch (1033:7): [True: 0, False: 16]
  ------------------
 1034|      0|    ip_base = di->start_ip;
 1035|     16|  } else {
 1036|     16|    ip_base = segbase;
 1037|     16|  }
 1038|       |
 1039|     16|#ifndef UNW_REMOTE_ONLY
 1040|     16|  if (as == unw_local_addr_space)
  ------------------
  |  |  274|     16|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1040:7): [True: 16, False: 0]
  ------------------
 1041|     16|    {
 1042|     16|      if (is_table64)
  ------------------
  |  Branch (1042:11): [True: 0, False: 16]
  ------------------
 1043|      0|        {
 1044|      0|          const struct table_entry64 *table64 = (const struct table_entry64 *) table_data;
 1045|      0|          const struct table_entry64 *e64;
 1046|      0|          e64 = lookup64 (table64, table_len, ip - ip_base);
 1047|      0|          if (e64)
  ------------------
  |  Branch (1047:15): [True: 0, False: 0]
  ------------------
 1048|      0|            {
 1049|      0|              found_entry = 1;
 1050|      0|              found_start_ip_offset = (unw_word_t) e64->start_ip_offset;
 1051|      0|              found_fde_offset = (unw_word_t) e64->fde_offset;
 1052|      0|              if (&e64[1] < &table64[table_len / sizeof (struct table_entry64)])
  ------------------
  |  Branch (1052:19): [True: 0, False: 0]
  ------------------
 1053|      0|                last_ip = (unw_word_t) e64[1].start_ip_offset + ip_base;
 1054|      0|              else
 1055|      0|                last_ip = di->end_ip;
 1056|      0|            }
 1057|      0|        }
 1058|     16|      else
 1059|     16|        {
 1060|     16|          const struct table_entry *table = (const struct table_entry *) table_data;
 1061|     16|          const struct table_entry *e;
 1062|     16|          e = lookup (table, table_len, ip - ip_base);
 1063|     16|          if (e)
  ------------------
  |  Branch (1063:15): [True: 16, False: 0]
  ------------------
 1064|     16|            {
 1065|     16|              found_entry = 1;
 1066|     16|              found_start_ip_offset = (unw_word_t) e->start_ip_offset;
 1067|     16|              found_fde_offset = (unw_word_t) e->fde_offset;
 1068|     16|              if (&e[1] < &table[table_len / sizeof (struct table_entry)])
  ------------------
  |  Branch (1068:19): [True: 16, False: 0]
  ------------------
 1069|     16|                last_ip = e[1].start_ip_offset + ip_base;
 1070|      0|              else
 1071|      0|                last_ip = di->end_ip;
 1072|     16|            }
 1073|     16|        }
 1074|     16|    }
 1075|      0|  else
 1076|      0|#endif
 1077|      0|    {
 1078|       |#ifndef UNW_LOCAL_ONLY
 1079|       |      int64_t found_start = 0, found_fde = 0;
 1080|       |      /* Cast through unw_sword_t to preserve the sign of the offset on
 1081|       |       * 32-bit targets: ip - ip_base is computed in unsigned unw_word_t
 1082|       |       * arithmetic and would wrap for ip < ip_base (which happens when
 1083|       |       * the IP is below segbase).  The explicit signed-narrowing cast
 1084|       |       * sign-extends the 32-bit result to int64_t correctly.  On 64-bit
 1085|       |       * targets unw_sword_t is int64_t so the cast is a no-op.  */
 1086|       |      int64_t rel_ip = (int64_t)(unw_sword_t)(ip - ip_base);
 1087|       |      int64_t last_ip_offset64 = (int64_t)(unw_sword_t)(di->end_ip - ip_base);
 1088|       |      segbase = di->u.rti.segbase;
 1089|       |      if ((ret = remote_lookup (as, (uintptr_t) table_data, table_len,
 1090|       |                                rel_ip, &found_start, &found_fde,
 1091|       |                                &last_ip_offset64, is_table64, arg)) < 0)
 1092|       |        return ret;
 1093|       |      if (ret)
 1094|       |        {
 1095|       |          found_entry = 1;
 1096|       |          found_start_ip_offset = (unw_word_t) found_start;
 1097|       |          found_fde_offset = (unw_word_t) found_fde;
 1098|       |          last_ip = (unw_word_t) last_ip_offset64 + ip_base;
 1099|       |        }
 1100|       |#endif
 1101|      0|    }
 1102|     16|  if (!found_entry)
  ------------------
  |  Branch (1102:7): [True: 0, False: 16]
  ------------------
 1103|      0|    {
 1104|      0|      Debug (1, "IP %lx inside range %lx-%lx, but no explicit unwind info found\n",
 1105|      0|             (long) ip, (long) di->start_ip, (long) di->end_ip);
 1106|       |      /* IP is inside this table's range, but there is no explicit
 1107|       |         unwind info.  */
 1108|      0|      return -UNW_ENOINFO;
 1109|      0|    }
 1110|     16|  Debug (15, "ip=0x%lx, start_ip=0x%lx\n",
 1111|     16|         (long) ip, (long) found_start_ip_offset);
 1112|     16|  if (debug_frame_base)
  ------------------
  |  Branch (1112:7): [True: 0, False: 16]
  ------------------
 1113|      0|    fde_addr = found_fde_offset + debug_frame_base;
 1114|     16|  else
 1115|     16|    fde_addr = found_fde_offset + segbase;
 1116|     16|  Debug (1, "fde_offset = %lx, segbase = %lx, debug_frame_base = %lx, "
 1117|     16|            "fde_addr = %lx\n", (long) found_fde_offset, (long) segbase,
 1118|     16|            (long) debug_frame_base, (long) fde_addr);
 1119|     16|  if ((ret = dwarf_extract_proc_info_from_fde (as, a, &fde_addr, pi,
  ------------------
  |  |  397|     16|                UNW_OBJ (dwarf_extract_proc_info_from_fde)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1119:7): [True: 0, False: 16]
  ------------------
 1120|     16|                                               debug_frame_base ?
  ------------------
  |  Branch (1120:48): [True: 0, False: 16]
  ------------------
 1121|     16|                                               debug_frame_base : segbase,
 1122|     16|                                               need_unwind_info,
 1123|     16|                                               debug_frame_base != 0, arg)) < 0)
 1124|      0|    return ret;
 1125|       |
 1126|       |  /* .debug_frame uses an absolute encoding that does not know about any
 1127|       |     shared library relocation.  */
 1128|     16|  if (di->format == UNW_INFO_FORMAT_TABLE)
  ------------------
  |  Branch (1128:7): [True: 0, False: 16]
  ------------------
 1129|      0|    {
 1130|      0|      pi->start_ip += segbase;
 1131|      0|      pi->end_ip += segbase;
 1132|      0|      pi->flags = UNW_PI_FLAG_DEBUG_FRAME;
  ------------------
  |  |  146|      0|#define UNW_PI_FLAG_DEBUG_FRAME	32
  ------------------
 1133|      0|    }
 1134|       |
 1135|       |#if defined(NEED_LAST_IP)
 1136|       |  pi->last_ip = last_ip;
 1137|       |#else
 1138|     16|  (void)last_ip;
 1139|     16|#endif
 1140|     16|  if (ip < pi->start_ip || ip >= pi->end_ip)
  ------------------
  |  Branch (1140:7): [True: 0, False: 16]
  |  Branch (1140:28): [True: 0, False: 16]
  ------------------
 1141|      0|    return -UNW_ENOINFO;
 1142|       |
 1143|     16|  return 0;
 1144|     16|}
Lfind_proc_info-lsb.c:is_remote_table:
  977|     32|{
  978|     32|  return (format == UNW_INFO_FORMAT_REMOTE_TABLE ||
  ------------------
  |  Branch (978:11): [True: 32, False: 0]
  ------------------
  979|      0|          format == UNW_INFO_FORMAT_REMOTE_TABLE_64 ||
  ------------------
  |  Branch (979:11): [True: 0, False: 0]
  ------------------
  980|      0|          format == UNW_INFO_FORMAT_IP_OFFSET);
  ------------------
  |  Branch (980:11): [True: 0, False: 0]
  ------------------
  981|     32|}

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

_ULx86_64_dwarf_flush_rs_cache:
  604|      1|{
  605|      1|  int i;
  606|       |
  607|      1|  if (cache->log_size == DWARF_DEFAULT_LOG_UNW_CACHE_SIZE
  ------------------
  |  |  337|      2|#define DWARF_DEFAULT_LOG_UNW_CACHE_SIZE        7
  ------------------
  |  Branch (607:7): [True: 0, False: 1]
  ------------------
  608|      1|      || !cache->hash) {
  ------------------
  |  Branch (608:10): [True: 1, False: 0]
  ------------------
  609|      1|    cache->hash = cache->default_hash;
  610|      1|    cache->buckets = cache->default_buckets;
  611|      1|    cache->links = cache->default_links;
  612|      1|    cache->log_size = DWARF_DEFAULT_LOG_UNW_CACHE_SIZE;
  ------------------
  |  |  337|      1|#define DWARF_DEFAULT_LOG_UNW_CACHE_SIZE        7
  ------------------
  613|      1|  } else {
  614|      0|    if (cache->hash && cache->hash != cache->default_hash)
  ------------------
  |  Branch (614:9): [True: 0, False: 0]
  |  Branch (614:24): [True: 0, False: 0]
  ------------------
  615|      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))
  ------------------
  616|      0|                              * sizeof (cache->hash[0]));
  617|      0|    if (cache->buckets && cache->buckets != cache->default_buckets)
  ------------------
  |  Branch (617:9): [True: 0, False: 0]
  |  Branch (617:27): [True: 0, False: 0]
  ------------------
  618|      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)
  ------------------
  619|      0|                              * sizeof (cache->buckets[0]));
  620|      0|    if (cache->links && cache->links != cache->default_links)
  ------------------
  |  Branch (620:9): [True: 0, False: 0]
  |  Branch (620:25): [True: 0, False: 0]
  ------------------
  621|      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)
  ------------------
  622|      0|                              * sizeof (cache->links[0]));
  623|      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]
  |  |  ------------------
  ------------------
  624|      0|                             * sizeof (cache->hash[0]));
  625|      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]
  |  |  ------------------
  ------------------
  626|      0|                                * sizeof (cache->buckets[0]));
  627|      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]
  |  |  ------------------
  ------------------
  628|      0|                                * sizeof (cache->links[0]));
  629|      0|    if (!cache->hash || !cache->buckets || !cache->links)
  ------------------
  |  Branch (629:9): [True: 0, False: 0]
  |  Branch (629:25): [True: 0, False: 0]
  |  Branch (629:44): [True: 0, False: 0]
  ------------------
  630|      0|      {
  631|      0|        Debug (1, "Unable to allocate cache memory");
  632|      0|        return -UNW_ENOMEM;
  633|      0|      }
  634|      0|    cache->prev_log_size = cache->log_size;
  635|      0|  }
  636|       |
  637|      1|  cache->rr_head = 0;
  638|       |
  639|    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 (639:15): [True: 128, False: 1]
  ------------------
  640|    128|    {
  641|    128|      cache->links[i].coll_chain = -1;
  642|    128|      cache->links[i].ip = 0;
  643|    128|      cache->links[i].valid = 0;
  644|    128|    }
  645|    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 (645:15): [True: 256, False: 1]
  ------------------
  646|    256|    cache->hash[i] = -1;
  647|       |
  648|      1|  return 0;
  649|      1|}
_ULx86_64_dwarf_step:
 1111|   101k|{
 1112|   101k|  int ret;
 1113|   101k|  dwarf_state_record_t sr;
 1114|   101k|  if ((ret = find_reg_state (c, &sr)) < 0)
  ------------------
  |  Branch (1114:7): [True: 0, False: 101k]
  ------------------
 1115|      0|    return ret;
 1116|   101k|  return apply_reg_state (c, &sr.rs_current);
 1117|   101k|}
Lparser.c:find_reg_state:
 1014|   101k|{
 1015|   101k|  dwarf_reg_state_t *rs = NULL;
 1016|   101k|  struct dwarf_rs_cache *cache;
 1017|   101k|  int ret = 0;
 1018|   101k|  intrmask_t saved_mask;
 1019|       |
 1020|   101k|  if ((cache = get_rs_cache(c->as, &saved_mask)) &&
  ------------------
  |  Branch (1020:7): [True: 101k, False: 0]
  ------------------
 1021|   101k|      (rs = rs_lookup(cache, c)))
  ------------------
  |  Branch (1021:7): [True: 101k, False: 16]
  ------------------
 1022|   101k|    {
 1023|       |      /* update hint; no locking needed: single-word writes are atomic */
 1024|   101k|      unsigned short index = (unsigned short) (rs - cache->buckets);
 1025|   101k|      c->use_prev_instr = cache->links[index].use_prev_instr;
 1026|   101k|      memcpy (&sr->rs_current, rs, sizeof (*rs));
 1027|   101k|    }
 1028|     16|  else
 1029|     16|    {
 1030|       |      /* Release the cache lock before looking up the saved locations.
 1031|       |       * If we do not release the lock we risk deadlock if the lookup
 1032|       |       * causes libunwind to be reentered.  */
 1033|     16|      if (cache)
  ------------------
  |  Branch (1033:11): [True: 16, False: 0]
  ------------------
 1034|     16|	{
 1035|     16|	  put_rs_cache (c->as, cache, &saved_mask);
 1036|     16|	  cache = NULL;
 1037|     16|	}
 1038|       |
 1039|     16|      assert (!cache);
  ------------------
  |  Branch (1039:7): [True: 0, False: 16]
  |  Branch (1039:7): [True: 16, False: 0]
  ------------------
 1040|       |
 1041|     16|      ret = fetch_proc_info (c, c->ip);
 1042|     16|      int next_use_prev_instr = c->use_prev_instr;
 1043|     16|      if (ret >= 0)
  ------------------
  |  Branch (1043:11): [True: 16, False: 0]
  ------------------
 1044|     16|	{
 1045|       |	  /* Update use_prev_instr for the next frame. */
 1046|     16|	  assert(c->pi.unwind_info);
  ------------------
  |  Branch (1046:4): [True: 0, False: 16]
  |  Branch (1046:4): [True: 16, False: 0]
  ------------------
 1047|       |#ifdef UNW_TARGET_SPARC
 1048|       |	  /* On SPARC, O7 = address of CALL instruction itself (not call+N),
 1049|       |	     and DWARF CFI annotations start at the CALL instruction.
 1050|       |	     No backward adjustment of ip is ever needed.  */
 1051|       |	  next_use_prev_instr = 0;
 1052|       |#else
 1053|     16|	  struct dwarf_cie_info *dci = c->pi.unwind_info;
 1054|     16|	  next_use_prev_instr = ! dci->signal_frame;
 1055|     16|#endif
 1056|     16|	  ret = create_state_record_for (c, sr, c->ip);
 1057|     16|	}
 1058|     16|      put_unwind_info (c, &c->pi);
 1059|     16|      c->use_prev_instr = next_use_prev_instr;
 1060|       |
 1061|       |      /* Reacquire the cache lock.  We repeat the lookup in case the
 1062|       |       * cache was updated by another thread while we did not hold the
 1063|       |       * lock.  */
 1064|     16|      if (ret >= 0)
  ------------------
  |  Branch (1064:11): [True: 16, False: 0]
  ------------------
 1065|     16|	cache = get_rs_cache (c->as, &saved_mask);
 1066|       |
 1067|     16|      if (cache)
  ------------------
  |  Branch (1067:11): [True: 16, False: 0]
  ------------------
 1068|     16|	{
 1069|     16|	  rs = rs_lookup (cache, c);
 1070|     16|	  if (rs)
  ------------------
  |  Branch (1070:8): [True: 0, False: 16]
  ------------------
 1071|      0|	    {
 1072|      0|	      memcpy (&sr->rs_current, rs, sizeof(*rs));
 1073|      0|	    }
 1074|     16|	  else
 1075|     16|	    {
 1076|     16|	      rs = rs_new (cache, c);
 1077|     16|	      cache->links[rs - cache->buckets].hint = 0;
 1078|     16|	      memcpy (rs, &sr->rs_current, sizeof(*rs));
 1079|     16|	    }
 1080|     16|	}
 1081|      0|      else if (ret >= 0)
  ------------------
  |  Branch (1081:16): [True: 0, False: 0]
  ------------------
 1082|       |	/* Without a cache there is no entry to reuse below, but the
 1083|       |	   architecture still needs to set up its signal frame state. */
 1084|      0|	tdep_reuse_frame (c, tdep_cache_frame (c) ? 1 : 0);
  ------------------
  |  |  245|      0|# define tdep_reuse_frame               UNW_OBJ(reuse_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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	tdep_reuse_frame (c, tdep_cache_frame (c) ? 1 : 0);
  ------------------
  |  |  244|      0|# define tdep_cache_frame               UNW_OBJ(cache_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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1084:23): [True: 0, False: 0]
  ------------------
 1085|     16|    }
 1086|       |
 1087|   101k|  unsigned short index = -1;
 1088|   101k|  if (cache)
  ------------------
  |  Branch (1088:7): [True: 101k, False: 0]
  ------------------
 1089|   101k|    {
 1090|   101k|      if (rs)
  ------------------
  |  Branch (1090:11): [True: 101k, False: 0]
  ------------------
 1091|   101k|	{
 1092|   101k|	  index = (unsigned short) (rs - cache->buckets);
 1093|   101k|	  c->hint = cache->links[index].hint;
 1094|   101k|	  cache->links[c->prev_rs].hint = index + 1;
 1095|   101k|	  c->prev_rs = index;
 1096|   101k|	}
 1097|   101k|      if (ret >= 0)
  ------------------
  |  Branch (1097:11): [True: 101k, False: 0]
  ------------------
 1098|   101k|	{
 1099|   101k|	  assert (rs);
  ------------------
  |  Branch (1099:4): [True: 0, False: 101k]
  |  Branch (1099:4): [True: 101k, False: 0]
  ------------------
 1100|   101k|	  tdep_reuse_frame (c, cache->links[index].signal_frame);
  ------------------
  |  |  245|   101k|# define tdep_reuse_frame               UNW_OBJ(reuse_frame)
  |  |  ------------------
  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1101|   101k|	}
 1102|   101k|      put_rs_cache (c->as, cache, &saved_mask);
 1103|   101k|    }
 1104|   101k|  return ret;
 1105|   101k|}
Lparser.c:get_rs_cache:
  653|   101k|{
  654|   101k|  struct dwarf_rs_cache *cache = &as->global_cache;
  655|   101k|  unw_caching_policy_t caching = as->caching_policy;
  656|       |
  657|   101k|  if (caching == UNW_CACHE_NONE)
  ------------------
  |  Branch (657:7): [True: 0, False: 101k]
  ------------------
  658|      0|    return NULL;
  659|       |
  660|       |#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD
  661|       |  if (likely (caching == UNW_CACHE_PER_THREAD))
  662|       |    {
  663|       |      static thread_local struct dwarf_rs_cache tls_cache __attribute__((tls_model("initial-exec")));
  664|       |      Debug (16, "using TLS cache\n");
  665|       |      cache = &tls_cache;
  666|       |    }
  667|       |  else
  668|       |#else
  669|   101k|  if (likely (caching == UNW_CACHE_GLOBAL))
  ------------------
  |  |   67|   101k|#  define likely(x)     __builtin_expect ((x), 1)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 101k, False: 0]
  |  |  ------------------
  ------------------
  670|   101k|#endif
  671|   101k|    {
  672|   101k|      Debug (16, "acquiring lock\n");
  673|   101k|      lock_acquire (&cache->lock, *saved_maskp);
  ------------------
  |  |  211|   101k|#define lock_acquire(l,m)                               \
  |  |  212|   101k|do {                                                    \
  |  |  213|   101k|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|   101k|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 101k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|   101k|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|   101k|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|   101k|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 101k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|   101k|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  674|   101k|    }
  675|       |
  676|   101k|  if ((atomic_load (&as->cache_generation) != atomic_load (&cache->generation))
  ------------------
  |  Branch (676:7): [True: 1, False: 101k]
  ------------------
  677|   101k|       || !cache->hash)
  ------------------
  |  Branch (677:11): [True: 0, False: 101k]
  ------------------
  678|      1|    {
  679|       |      /* cache_size is only set in the global_cache, copy it over before flushing */
  680|      1|      cache->log_size = as->global_cache.log_size;
  681|      1|      if (dwarf_flush_rs_cache (cache) < 0)
  ------------------
  |  |  404|      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 (681:11): [True: 0, False: 1]
  ------------------
  682|      0|        return NULL;
  683|      1|      atomic_store (&cache->generation, atomic_load (&as->cache_generation));
  684|      1|    }
  685|       |
  686|   101k|  return cache;
  687|   101k|}
Lparser.c:rs_lookup:
  717|   101k|{
  718|   101k|  unsigned short index;
  719|   101k|  unw_word_t ip = c->ip;
  720|       |
  721|   101k|  if (c->hint > 0)
  ------------------
  |  Branch (721:7): [True: 91.3k, False: 10.1k]
  ------------------
  722|  91.3k|    {
  723|  91.3k|      index = c->hint - 1;
  724|  91.3k|      if (cache_match (cache, index, ip))
  ------------------
  |  Branch (724:11): [True: 91.2k, False: 153]
  ------------------
  725|  91.2k|	return &cache->buckets[index];
  726|  91.3k|    }
  727|       |
  728|  10.3k|  for (index = cache->hash[hash (ip, cache->log_size)];
  729|  10.3k|       index < DWARF_UNW_CACHE_SIZE(cache->log_size);
  ------------------
  |  |   34|  10.3k|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  |  Branch (729:8): [True: 10.3k, False: 32]
  ------------------
  730|  10.3k|       index = cache->links[index].coll_chain)
  731|  10.3k|    {
  732|  10.3k|      if (cache_match (cache, index, ip))
  ------------------
  |  Branch (732:11): [True: 10.3k, False: 0]
  ------------------
  733|  10.3k|	return &cache->buckets[index];
  734|  10.3k|    }
  735|     32|  return NULL;
  736|  10.3k|}
Lparser.c:cache_match:
  711|   101k|{
  712|   101k|  return (cache->links[index].valid && (ip == cache->links[index].ip));
  ------------------
  |  Branch (712:11): [True: 101k, False: 0]
  |  Branch (712:40): [True: 101k, False: 153]
  ------------------
  713|   101k|}
Lparser.c:hash:
  702|  10.3k|{
  703|       |  /* based on (sqrt(5)/2-1)*2^64 */
  704|  10.3k|# define magic  ((unw_word_t) 0x9e3779b97f4a7c16ULL)
  705|       |
  706|  10.3k|  return (unw_hash_index_t) (ip * magic >> ((sizeof(unw_word_t) * 8) - (log_size + 1)));
  ------------------
  |  |  704|  10.3k|# define magic  ((unw_word_t) 0x9e3779b97f4a7c16ULL)
  ------------------
  707|  10.3k|}
Lparser.c:put_rs_cache:
  692|   101k|{
  693|   101k|  assert (as->caching_policy != UNW_CACHE_NONE);
  ------------------
  |  Branch (693:3): [True: 0, False: 101k]
  |  Branch (693:3): [True: 101k, False: 0]
  ------------------
  694|       |
  695|   101k|  Debug (16, "unmasking signals/interrupts and releasing lock\n");
  696|   101k|  if (likely (as->caching_policy == UNW_CACHE_GLOBAL))
  ------------------
  |  |   67|   101k|#  define likely(x)     __builtin_expect ((x), 1)
  |  |  ------------------
  |  |  |  Branch (67:25): [True: 101k, False: 0]
  |  |  ------------------
  ------------------
  697|       |    lock_release (&cache->lock, *saved_maskp);
  ------------------
  |  |  216|   101k|#define lock_release(l,m)                       \
  |  |  217|   101k|do {                                            \
  |  |  218|   101k|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|   101k|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 101k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|   101k|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|   101k|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 101k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|   101k|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|   101k|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  698|   101k|}
Lparser.c:rs_new:
  740|     16|{
  741|     16|  unw_hash_index_t index;
  742|     16|  unsigned short head;
  743|       |
  744|     16|  head = cache->rr_head;
  745|     16|  cache->rr_head = (head + 1) & (DWARF_UNW_CACHE_SIZE(cache->log_size) - 1);
  ------------------
  |  |   34|     16|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  746|       |
  747|       |  /* remove the old rs from the hash table (if it's there): */
  748|     16|  if (cache->links[head].ip)
  ------------------
  |  Branch (748:7): [True: 0, False: 16]
  ------------------
  749|      0|    {
  750|      0|      unsigned short *pindex;
  751|      0|      for (pindex = &cache->hash[hash (cache->links[head].ip, cache->log_size)];
  752|      0|	   *pindex < DWARF_UNW_CACHE_SIZE(cache->log_size);
  ------------------
  |  |   34|      0|#define DWARF_UNW_CACHE_SIZE(log_size)   (1 << log_size)
  ------------------
  |  Branch (752:5): [True: 0, False: 0]
  ------------------
  753|      0|	   pindex = &cache->links[*pindex].coll_chain)
  754|      0|	{
  755|      0|	  if (*pindex == head)
  ------------------
  |  Branch (755:8): [True: 0, False: 0]
  ------------------
  756|      0|	    {
  757|      0|	      *pindex = cache->links[*pindex].coll_chain;
  758|      0|	      break;
  759|      0|	    }
  760|      0|	}
  761|      0|    }
  762|       |
  763|       |  /* enter new rs in the hash table */
  764|     16|  index = hash (c->ip, cache->log_size);
  765|     16|  cache->links[head].coll_chain = cache->hash[index];
  766|     16|  cache->hash[index] = head;
  767|       |
  768|     16|  cache->links[head].ip = c->ip;
  769|     16|  cache->links[head].valid = 1;
  770|     16|  cache->links[head].signal_frame = tdep_cache_frame(c) ? 1 : 0;
  ------------------
  |  |  244|     16|# define tdep_cache_frame               UNW_OBJ(cache_frame)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (770:37): [True: 0, False: 16]
  ------------------
  771|     16|  cache->links[head].use_prev_instr = c->use_prev_instr;
  772|     16|  return cache->buckets + head;
  773|     16|}
Lparser.c:apply_reg_state:
  855|   101k|{
  856|   101k|  unw_regnum_t regnum;
  857|   101k|  unw_word_t addr, cfa, ip;
  858|   101k|  unw_word_t prev_ip, prev_cfa;
  859|   101k|  unw_addr_space_t as;
  860|   101k|  dwarf_loc_t cfa_loc;
  861|   101k|  unw_accessors_t *a;
  862|   101k|  int i, ret;
  863|   101k|  void *arg;
  864|       |
  865|       |  /* In the case that we have incorrect CFI, the return address column may be
  866|       |   * outside the valid range of data and will read invalid data.  Protect
  867|       |   * against the errant read and indicate that we have a bad frame.  */
  868|   101k|  if (rs->ret_addr_column >= DWARF_NUM_PRESERVED_REGS) {
  ------------------
  |  |   38|   101k|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (868:7): [True: 0, False: 101k]
  ------------------
  869|      0|    Dprintf ("%s: return address entry %zu is outside of range of CIE",
  870|      0|             __FUNCTION__, rs->ret_addr_column);
  871|      0|    return -UNW_EBADFRAME;
  872|      0|  }
  873|       |
  874|   101k|  prev_ip = c->ip;
  875|   101k|  prev_cfa = c->cfa;
  876|       |
  877|   101k|  as = c->as;
  878|   101k|  arg = c->as_arg;
  879|   101k|  a = unw_get_accessors_int (as);
  ------------------
  |  |  278|   101k|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|   101k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  880|       |
  881|       |  /* Evaluate the CFA first, because it may be referred to by other
  882|       |     expressions.  */
  883|       |
  884|   101k|  if (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG)
  ------------------
  |  |  248|   101k|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|   101k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  |  Branch (884:7): [True: 101k, False: 0]
  ------------------
  885|   101k|    {
  886|       |      /* CFA is equal to [reg] + offset: */
  887|       |
  888|       |      /* As a special-case, if the stack-pointer is the CFA and the
  889|       |         stack-pointer wasn't saved, popping the CFA implicitly pops
  890|       |         the stack-pointer as well.  */
  891|   101k|      if ((rs->reg.val[DWARF_CFA_REG_COLUMN] == TDEP_DWARF_SP)
  ------------------
  |  |  248|   101k|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|   101k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
                    if ((rs->reg.val[DWARF_CFA_REG_COLUMN] == TDEP_DWARF_SP)
  ------------------
  |  |  435|   101k|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
  |  Branch (891:11): [True: 10.1k, False: 91.3k]
  ------------------
  892|  10.1k|          && (TDEP_DWARF_SP < ARRAY_SIZE(rs->reg.val))
  ------------------
  |  |  435|  10.1k|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
                        && (TDEP_DWARF_SP < ARRAY_SIZE(rs->reg.val))
  ------------------
  |  |   98|  10.1k|#define ARRAY_SIZE(a)   (sizeof (a) / sizeof ((a)[0]))
  ------------------
  |  Branch (892:14): [True: 0, Folded]
  ------------------
  893|  10.1k|          && (DWARF_IS_NULL_LOC(c->loc[TDEP_DWARF_SP])))
  ------------------
  |  |  157|  10.1k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|  10.1k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
  |  Branch (893:14): [True: 0, False: 10.1k]
  ------------------
  894|      0|          cfa = c->cfa;
  895|   101k|      else
  896|   101k|        {
  897|   101k|          regnum = dwarf_to_unw_regnum ((unw_regnum_t) rs->reg.val[DWARF_CFA_REG_COLUMN]);
  ------------------
  |  |   23|   101k|  (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
  |  |  ------------------
  |  |  |  |   41|   101k|#define DWARF_REGNUM_MAP_LENGTH         DWARF_NUM_PRESERVED_REGS
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   101k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
  |  |  ------------------
  |  |  |  |   19|   101k|# define dwarf_to_unw_regnum_map                UNW_OBJ (dwarf_to_unw_regnum_map)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (23:4): [True: 101k, False: 0]
  |  |  ------------------
  ------------------
  898|   101k|          if ((ret = unw_get_reg (dwarf_to_cursor(c), regnum, &cfa)) < 0)
  ------------------
  |  |  289|   101k|#define unw_get_reg			UNW_OBJ(get_reg)
  |  |  ------------------
  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                        if ((ret = unw_get_reg (dwarf_to_cursor(c), regnum, &cfa)) < 0)
  ------------------
  |  |   48|   101k|#define dwarf_to_cursor(c)      ((unw_cursor_t *) (c))
  ------------------
  |  Branch (898:15): [True: 0, False: 101k]
  ------------------
  899|      0|            return ret;
  900|   101k|        }
  901|   101k|      cfa += rs->reg.val[DWARF_CFA_OFF_COLUMN];
  ------------------
  |  |  249|   101k|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|   101k|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  902|   101k|    }
  903|      0|  else
  904|      0|    {
  905|       |      /* CFA is equal to EXPR: */
  906|       |
  907|      0|      assert (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_EXPR);
  ------------------
  |  Branch (907:7): [True: 0, False: 0]
  |  Branch (907:7): [True: 0, False: 0]
  ------------------
  908|       |
  909|      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
  |  |  ------------------
  ------------------
  910|       |      /* The dwarf standard doesn't specify an initial value to be pushed on */
  911|       |      /* the stack before DW_CFA_def_cfa_expression evaluation. We push on a */
  912|       |      /* dummy value (0) to keep the eval_location_expr function consistent. */
  913|      0|      if ((ret = eval_location_expr (c, 0, as, a, addr, &cfa_loc, arg)) < 0)
  ------------------
  |  Branch (913:11): [True: 0, False: 0]
  ------------------
  914|      0|        return ret;
  915|       |      /* the returned location better be a memory location... */
  916|      0|      if (DWARF_IS_REG_LOC (cfa_loc))
  ------------------
  |  |  146|      0|# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
  |  |  ------------------
  |  |  |  |  143|      0|# define DWARF_LOC_TYPE_REG     (1 << 1)
  |  |  ------------------
  |  |  |  Branch (146:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  917|      0|        return -UNW_EBADFRAME;
  918|      0|      cfa = DWARF_GET_LOC (cfa_loc);
  ------------------
  |  |  140|      0|#define DWARF_GET_LOC(l)        ((l).val)
  ------------------
  919|      0|    }
  920|       |
  921|   101k|  dwarf_loc_t new_loc[DWARF_NUM_PRESERVED_REGS];
  922|   101k|  memcpy(new_loc, c->loc, sizeof(new_loc));
  923|       |
  924|  1.82M|  for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
  ------------------
  |  |   38|  1.82M|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (924:15): [True: 1.72M, False: 101k]
  ------------------
  925|  1.72M|    {
  926|  1.72M|      switch ((dwarf_where_t) rs->reg.where[i])
  ------------------
  |  Branch (926:15): [True: 1.72M, False: 0]
  ------------------
  927|  1.72M|        {
  928|  10.1k|        case DWARF_WHERE_UNDEF:
  ------------------
  |  Branch (928:9): [True: 10.1k, False: 1.71M]
  ------------------
  929|  10.1k|          new_loc[i] = DWARF_NULL_LOC;
  ------------------
  |  |  156|  10.1k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  151|  10.1k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  930|  10.1k|          break;
  931|       |
  932|  1.14M|        case DWARF_WHERE_SAME:
  ------------------
  |  Branch (932:9): [True: 1.14M, False: 578k]
  ------------------
  933|  1.14M|          break;
  934|       |
  935|   101k|        case DWARF_WHERE_CFA:
  ------------------
  |  Branch (935:9): [True: 101k, False: 1.62M]
  ------------------
  936|   101k|          new_loc[i] = DWARF_VAL_LOC (c, cfa);
  ------------------
  |  |  152|   101k|# define DWARF_VAL_LOC(c,v)     DWARF_LOC ((v), DWARF_LOC_TYPE_VAL)
  |  |  ------------------
  |  |  |  |  151|   101k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  937|   101k|          break;
  938|       |
  939|   466k|        case DWARF_WHERE_CFAREL:
  ------------------
  |  Branch (939:9): [True: 466k, False: 1.25M]
  ------------------
  940|   466k|          new_loc[i] = DWARF_MEM_LOC (c, cfa + rs->reg.val[i]);
  ------------------
  |  |  153|   466k|# define DWARF_MEM_LOC(c,m)     DWARF_LOC ((m), DWARF_LOC_TYPE_MEM)
  |  |  ------------------
  |  |  |  |  151|   466k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  941|   466k|          break;
  942|       |
  943|      0|        case DWARF_WHERE_REG:
  ------------------
  |  Branch (943:9): [True: 0, False: 1.72M]
  ------------------
  944|       |#ifdef __s390x__
  945|       |          /* GPRs can be saved in FPRs on s390x */
  946|       |          if (unw_is_fpreg (dwarf_to_unw_regnum (rs->reg.val[i])))
  947|       |            {
  948|       |              new_loc[i] = DWARF_FPREG_LOC (c, dwarf_to_unw_regnum (rs->reg.val[i]));
  949|       |              break;
  950|       |            }
  951|       |#endif
  952|      0|          new_loc[i] = new_loc[rs->reg.val[i]];
  953|      0|          break;
  954|       |
  955|      0|        case DWARF_WHERE_EXPR:
  ------------------
  |  Branch (955:9): [True: 0, False: 1.72M]
  ------------------
  956|      0|          addr = rs->reg.val[i];
  957|       |          /* The dwarf standard requires the current CFA to be pushed on the */
  958|       |          /* stack before DW_CFA_expression evaluation. */
  959|      0|          if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0)
  ------------------
  |  Branch (959:15): [True: 0, False: 0]
  ------------------
  960|      0|            return ret;
  961|      0|          break;
  962|       |
  963|      0|        case DWARF_WHERE_VAL_EXPR:
  ------------------
  |  Branch (963:9): [True: 0, False: 1.72M]
  ------------------
  964|      0|          addr = rs->reg.val[i];
  965|       |          /* The dwarf standard requires the current CFA to be pushed on the */
  966|       |          /* stack before DW_CFA_val_expression evaluation. */
  967|      0|          if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0)
  ------------------
  |  Branch (967:15): [True: 0, False: 0]
  ------------------
  968|      0|            return ret;
  969|      0|          new_loc[i] = DWARF_VAL_LOC (c, DWARF_GET_LOC (new_loc[i]));
  ------------------
  |  |  152|      0|# define DWARF_VAL_LOC(c,v)     DWARF_LOC ((v), DWARF_LOC_TYPE_VAL)
  |  |  ------------------
  |  |  |  |  151|      0|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
  970|      0|          break;
  971|  1.72M|        }
  972|  1.72M|    }
  973|       |
  974|   101k|  memcpy(c->loc, new_loc, sizeof(new_loc));
  975|       |
  976|   101k|  c->cfa = cfa;
  977|       |  /* DWARF spec says undefined return address location means end of stack. */
  978|   101k|  if (DWARF_IS_NULL_LOC (c->loc[rs->ret_addr_column]))
  ------------------
  |  |  157|   101k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|   101k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (157:33): [True: 10.1k, False: 91.3k]
  |  |  ------------------
  ------------------
  979|  10.1k|    {
  980|  10.1k|      c->ip = 0;
  981|  10.1k|    }
  982|  91.3k|  else
  983|  91.3k|  {
  984|  91.3k|    ret = dwarf_get (c, c->loc[rs->ret_addr_column], &ip);
  985|  91.3k|    if (ret < 0)
  ------------------
  |  Branch (985:9): [True: 0, False: 91.3k]
  ------------------
  986|      0|      return ret;
  987|       |#ifdef UNW_TARGET_AARCH64
  988|       |    if (aarch64_get_ra_sign_state(rs))
  989|       |      {
  990|       |        ip = tdep_strip_ptrauth_insn_mask ((unw_cursor_t*)c, ip);
  991|       |      }
  992|       |#endif
  993|  91.3k|    c->ip = ip;
  994|  91.3k|  }
  995|   101k|  ret = (c->ip != 0) ? 1 : 0;
  ------------------
  |  Branch (995:9): [True: 91.3k, False: 10.1k]
  ------------------
  996|       |
  997|       |  /* XXX: check for ip to be code_aligned */
  998|   101k|  if (c->ip == prev_ip && c->cfa == prev_cfa)
  ------------------
  |  Branch (998:7): [True: 0, False: 101k]
  |  Branch (998:27): [True: 0, False: 0]
  ------------------
  999|      0|    {
 1000|      0|      Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n",
 1001|      0|               __FUNCTION__, (long) c->ip);
 1002|      0|      return -UNW_EBADFRAME;
 1003|      0|    }
 1004|       |
 1005|   101k|  if (c->stash_frames)
  ------------------
  |  Branch (1005:7): [True: 0, False: 101k]
  ------------------
 1006|      0|    tdep_stash_frame (c, rs);
  ------------------
  |  |  251|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1007|       |
 1008|   101k|  return ret;
 1009|   101k|}
Lparser.c:fetch_proc_info:
  467|     16|{
  468|     16|  int ret, dynamic = 1;
  469|       |
  470|       |  /* The 'ip' can point either to the previous or next instruction
  471|       |     depending on what type of frame we have: normal call or a place
  472|       |     to resume execution (e.g. after signal frame).
  473|       |
  474|       |     For a normal call frame we need to back up so we point within the
  475|       |     call itself; this is important because a) the call might be the
  476|       |     very last instruction of the function and the edge of the FDE,
  477|       |     and b) so that run_cfi_program() runs locations up to the call
  478|       |     but not more.
  479|       |
  480|       |     For signal frame, we need to do the exact opposite and look
  481|       |     up using the current 'ip' value.  That is where execution will
  482|       |     continue, and it's important we get this right, as 'ip' could be
  483|       |     right at the function entry and hence FDE edge, or at instruction
  484|       |     that manipulates CFA (push/pop). */
  485|       |
  486|     16|  if (c->use_prev_instr)
  ------------------
  |  Branch (486:7): [True: 16, False: 0]
  ------------------
  487|     16|    {
  488|       |#if defined(__arm__)
  489|       |      /* On arm, the least bit denotes thumb/arm mode, clear it. */
  490|       |      ip &= ~(unw_word_t)0x1;
  491|       |#endif
  492|     16|      --ip;
  493|     16|    }
  494|       |
  495|     16|  memset (&c->pi, 0, sizeof (c->pi));
  496|       |
  497|       |  /* check dynamic info first --- it overrides everything else */
  498|     16|  ret = unwi_find_dynamic_proc_info (c->as, ip, &c->pi, 1,
  ------------------
  |  |  268|     16|#define unwi_find_dynamic_proc_info     UNWI_OBJ(find_dynamic_proc_info)
  |  |  ------------------
  |  |  |  |  173|     16|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|     16|                                     c->as_arg);
  500|     16|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (500:7): [True: 16, False: 0]
  ------------------
  501|     16|    {
  502|     16|      dynamic = 0;
  503|     16|      if ((ret = tdep_find_proc_info (c, ip, 1)) < 0)
  ------------------
  |  |  257|     16|        dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n),      \
  |  |  ------------------
  |  |  |  |  388|     16|#define dwarf_find_proc_info            UNW_OBJ (dwarf_find_proc_info)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  258|     16|                                       (c)->as_arg)
  ------------------
  |  Branch (503:11): [True: 0, False: 16]
  ------------------
  504|      0|        return ret;
  505|     16|    }
  506|       |
  507|     16|  if (c->pi.format != UNW_INFO_FORMAT_DYNAMIC
  ------------------
  |  Branch (507:7): [True: 16, False: 0]
  ------------------
  508|     16|      && c->pi.format != UNW_INFO_FORMAT_TABLE
  ------------------
  |  Branch (508:10): [True: 0, False: 16]
  ------------------
  509|      0|      && c->pi.format != UNW_INFO_FORMAT_REMOTE_TABLE
  ------------------
  |  Branch (509:10): [True: 0, False: 0]
  ------------------
  510|       |#ifdef UNW_TARGET_ARM
  511|       |      && c->pi.format != UNW_INFO_FORMAT_ARM_EXIDX
  512|       |#endif
  513|     16|      )
  514|      0|    return -UNW_ENOINFO;
  515|       |
  516|     16|  c->pi_valid = 1;
  517|     16|  c->pi_is_dynamic = dynamic;
  518|       |
  519|       |  /* Let system/machine-dependent code determine frame-specific attributes. */
  520|     16|  if (ret >= 0)
  ------------------
  |  Branch (520:7): [True: 16, False: 0]
  ------------------
  521|     16|    tdep_fetch_frame (c, ip, 1);
  ------------------
  |  |  243|     16|# define tdep_fetch_frame               UNW_OBJ(fetch_frame)
  |  |  ------------------
  |  |  |  |   48|     16|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|       |
  523|     16|  return ret;
  524|     16|}
Lparser.c:create_state_record_for:
  778|     16|{
  779|     16|  int ret;
  780|     16|  switch (c->pi.format)
  781|     16|    {
  782|     16|    case UNW_INFO_FORMAT_TABLE:
  ------------------
  |  Branch (782:5): [True: 16, False: 0]
  ------------------
  783|     16|    case UNW_INFO_FORMAT_REMOTE_TABLE:
  ------------------
  |  Branch (783:5): [True: 0, False: 16]
  ------------------
  784|     16|      if ((ret = setup_fde(c, sr)) < 0)
  ------------------
  |  Branch (784:11): [True: 0, False: 16]
  ------------------
  785|      0|	return ret;
  786|     16|      ret = parse_fde (c, ip, sr);
  787|     16|      break;
  788|       |
  789|      0|    case UNW_INFO_FORMAT_DYNAMIC:
  ------------------
  |  Branch (789:5): [True: 0, False: 16]
  ------------------
  790|      0|      ret = parse_dynamic (c, ip, sr);
  791|      0|      break;
  792|       |
  793|       |#ifdef UNW_TARGET_ARM
  794|       |    case UNW_INFO_FORMAT_ARM_EXIDX:
  795|       |      /* ARM exidx proc info is stepped by arm_exidx_step(), not the DWARF
  796|       |         path; signal dwarf_step() to skip so the cursor is not advanced
  797|       |         with an uninitialized state record. */
  798|       |      ret = -UNW_ENOINFO;
  799|       |      break;
  800|       |#endif
  801|       |
  802|      0|    default:
  ------------------
  |  Branch (802:5): [True: 0, False: 16]
  ------------------
  803|      0|      Debug (1, "Unexpected unwind-info format %d\n", c->pi.format);
  804|      0|      ret = -UNW_EINVAL;
  805|     16|    }
  806|     16|  return ret;
  807|     16|}
Lparser.c:setup_fde:
  550|     16|{
  551|     16|  int i, ret;
  552|       |
  553|     16|  assert (c->pi_valid);
  ------------------
  |  Branch (553:3): [True: 0, False: 16]
  |  Branch (553:3): [True: 16, False: 0]
  ------------------
  554|       |
  555|     16|  memset (sr, 0, sizeof (*sr));
  556|    320|  for (i = 0; i < DWARF_NUM_PRESERVED_REGS + 2; ++i)
  ------------------
  |  |   38|    320|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (556:15): [True: 304, False: 16]
  ------------------
  557|    304|    set_reg (sr, i, DWARF_WHERE_SAME, 0);
  558|       |
  559|     16|#if !(defined(UNW_TARGET_MIPS) && _MIPS_SIM == _ABI64) \
  560|     16|    && !defined(UNW_TARGET_S390X)
  561|       |  /* SP defaults to CFA. s390x excluded: CFA = R15+160, so this default gives
  562|       |     caller's R15 = CFA instead of R15, breaking frameless functions like kill
  563|       |     that never emit DW_CFA_offset for R15. */
  564|     16|  set_reg (sr, TDEP_DWARF_SP, DWARF_WHERE_CFA, 0);
  ------------------
  |  |  435|     16|#define TDEP_DWARF_SP UNW_TDEP_SP
  ------------------
  565|     16|#endif
  566|       |
  567|     16|  struct dwarf_cie_info *dci = c->pi.unwind_info;
  568|     16|  sr->rs_current.ret_addr_column  = dci->ret_addr_column;
  569|     16|  unw_word_t addr = dci->cie_instr_start;
  570|     16|  unw_word_t curr_ip = 0;
  571|     16|  dwarf_stackable_reg_state_t *rs_stack = NULL;
  572|     16|  ret = run_cfi_program (c, sr, &curr_ip, ~(unw_word_t) 0, &addr,
  573|     16|			 dci->cie_instr_end,
  574|     16|			 &rs_stack, dci);
  575|     16|  empty_rstate_stack(&rs_stack);
  576|     16|  if (ret < 0)
  ------------------
  |  Branch (576:7): [True: 0, False: 16]
  ------------------
  577|      0|    return ret;
  578|       |
  579|     16|  memcpy (&sr->rs_initial, &sr->rs_current, sizeof (sr->rs_initial));
  580|     16|  return 0;
  581|     16|}
Lparser.c:set_reg:
   70|    463|{
   71|    463|  sr->rs_current.reg.where[regnum] = where;
   72|    463|  sr->rs_current.reg.val[regnum] = val;
   73|    463|}
Lparser.c:run_cfi_program:
  147|     32|{
  148|     32|  unw_addr_space_t as;
  149|     32|  void *arg;
  150|       |
  151|     32|  if (c->pi.flags & UNW_PI_FLAG_DEBUG_FRAME)
  ------------------
  |  |  146|     32|#define UNW_PI_FLAG_DEBUG_FRAME	32
  ------------------
  |  Branch (151:7): [True: 0, False: 32]
  ------------------
  152|      0|    {
  153|       |      /* .debug_frame CFI is stored in local address space.  */
  154|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|      0|      arg = NULL;
  156|      0|    }
  157|     32|  else
  158|     32|    {
  159|     32|      as = c->as;
  160|     32|      arg = c->as_arg;
  161|     32|    }
  162|     32|  unw_accessors_t *a = unw_get_accessors_int (as);
  ------------------
  |  |  278|     32|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     32|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     32|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     32|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|     32|  int ret = 0;
  164|       |
  165|    260|  while (*ip <= end_ip && *addr < end_addr && ret >= 0)
  ------------------
  |  Branch (165:10): [True: 248, False: 12]
  |  Branch (165:27): [True: 228, False: 20]
  |  Branch (165:47): [True: 228, False: 0]
  ------------------
  166|    228|    {
  167|    228|      unw_word_t operand = 0, regnum, val, len;
  168|    228|      uint8_t u8, op;
  169|    228|      uint16_t u16;
  170|    228|      uint32_t u32;
  171|       |
  172|    228|      if ((ret = dwarf_readu8 (as, a, addr, &op, arg)) < 0)
  ------------------
  |  Branch (172:11): [True: 0, False: 228]
  ------------------
  173|      0|        break;
  174|       |
  175|    228|      if (op & DWARF_CFA_OPCODE_MASK)
  ------------------
  |  |  145|    228|#define DWARF_CFA_OPCODE_MASK   0xc0
  ------------------
  |  Branch (175:11): [True: 124, False: 104]
  ------------------
  176|    124|        {
  177|    124|          operand = op & DWARF_CFA_OPERAND_MASK;
  ------------------
  |  |  146|    124|#define DWARF_CFA_OPERAND_MASK  0x3f
  ------------------
  178|    124|          op &= ~DWARF_CFA_OPERAND_MASK;
  ------------------
  |  |  146|    124|#define DWARF_CFA_OPERAND_MASK  0x3f
  ------------------
  179|    124|        }
  180|    228|      switch ((dwarf_cfa_t) op)
  ------------------
  |  Branch (180:15): [True: 228, False: 0]
  ------------------
  181|    228|        {
  182|     48|        case DW_CFA_advance_loc:
  ------------------
  |  Branch (182:9): [True: 48, False: 180]
  ------------------
  183|     48|          *ip += operand * dci->code_align;
  184|     48|          Debug (15, "CFA_advance_loc to 0x%lx\n", (long) *ip);
  185|     48|          break;
  186|       |
  187|      5|        case DW_CFA_advance_loc1:
  ------------------
  |  Branch (187:9): [True: 5, False: 223]
  ------------------
  188|      5|          if ((ret = dwarf_readu8 (as, a, addr, &u8, arg)) < 0)
  ------------------
  |  Branch (188:15): [True: 0, False: 5]
  ------------------
  189|      0|            break;
  190|      5|          *ip += u8 * dci->code_align;
  191|      5|          Debug (15, "CFA_advance_loc1 to 0x%lx\n", (long) *ip);
  192|      5|          break;
  193|       |
  194|      7|        case DW_CFA_advance_loc2:
  ------------------
  |  Branch (194:9): [True: 7, False: 221]
  ------------------
  195|      7|          if ((ret = dwarf_readu16 (as, a, addr, &u16, arg)) < 0)
  ------------------
  |  Branch (195:15): [True: 0, False: 7]
  ------------------
  196|      0|            break;
  197|      7|          *ip += u16 * dci->code_align;
  198|      7|          Debug (15, "CFA_advance_loc2 to 0x%lx\n", (long) *ip);
  199|      7|          break;
  200|       |
  201|      0|        case DW_CFA_advance_loc4:
  ------------------
  |  Branch (201:9): [True: 0, False: 228]
  ------------------
  202|      0|          if ((ret = dwarf_readu32 (as, a, addr, &u32, arg)) < 0)
  ------------------
  |  Branch (202:15): [True: 0, False: 0]
  ------------------
  203|      0|            break;
  204|      0|          *ip += u32 * dci->code_align;
  205|      0|          Debug (15, "CFA_advance_loc4 to 0x%lx\n", (long) *ip);
  206|      0|          break;
  207|       |
  208|      0|        case DW_CFA_MIPS_advance_loc8:
  ------------------
  |  Branch (208:9): [True: 0, False: 228]
  ------------------
  209|       |#ifdef UNW_TARGET_MIPS
  210|       |          {
  211|       |            uint64_t u64 = 0;
  212|       |
  213|       |            if ((ret = dwarf_readu64 (as, a, addr, &u64, arg)) < 0)
  214|       |              break;
  215|       |            *ip += u64 * dci->code_align;
  216|       |            Debug (15, "CFA_MIPS_advance_loc8\n");
  217|       |            break;
  218|       |          }
  219|       |#else
  220|      0|          Debug (1, "DW_CFA_MIPS_advance_loc8 on non-MIPS target\n");
  221|      0|          ret = -UNW_EINVAL;
  222|      0|          break;
  223|      0|#endif
  224|       |
  225|     76|        case DW_CFA_offset:
  ------------------
  |  Branch (225:9): [True: 76, False: 152]
  ------------------
  226|     76|          regnum = operand;
  227|     76|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (227:15): [True: 0, False: 76]
  ------------------
  228|      0|            break;
  229|     76|          set_savedreg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  230|     76|          Debug (15, "CFA_offset r%lu at cfa+0x%lx\n",
  231|     76|                 (long) regnum, (long) (val * dci->data_align));
  232|     76|          break;
  233|       |
  234|      0|        case DW_CFA_offset_extended:
  ------------------
  |  Branch (234:9): [True: 0, False: 228]
  ------------------
  235|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (235:15): [True: 0, False: 0]
  ------------------
  236|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (236:18): [True: 0, False: 0]
  ------------------
  237|      0|            break;
  238|      0|          set_savedreg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  239|      0|          Debug (15, "CFA_offset_extended r%lu at cf+0x%lx\n",
  240|      0|                 (long) regnum, (long) (val * dci->data_align));
  241|      0|          break;
  242|       |
  243|      0|        case DW_CFA_offset_extended_sf:
  ------------------
  |  Branch (243:9): [True: 0, False: 228]
  ------------------
  244|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (244:15): [True: 0, False: 0]
  ------------------
  245|      0|              || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (245:18): [True: 0, False: 0]
  ------------------
  246|      0|            break;
  247|      0|          set_savedreg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align);
  248|      0|          Debug (15, "CFA_offset_extended_sf r%lu at cf+0x%lx\n",
  249|      0|                 (long) regnum, (long) (val * dci->data_align));
  250|      0|          break;
  251|       |
  252|      0|        case DW_CFA_restore:
  ------------------
  |  Branch (252:9): [True: 0, False: 228]
  ------------------
  253|      0|          regnum = operand;
  254|      0|          restore_savedreg (sr, regnum);
  255|      0|          Debug (15, "CFA_restore r%lu\n", (long) regnum);
  256|      0|          break;
  257|       |
  258|      0|        case DW_CFA_restore_extended:
  ------------------
  |  Branch (258:9): [True: 0, False: 228]
  ------------------
  259|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (259:15): [True: 0, False: 0]
  ------------------
  260|      0|            break;
  261|      0|          restore_savedreg (sr, regnum);
  262|      0|          Debug (15, "CFA_restore_extended r%lu\n", (long) regnum);
  263|      0|          break;
  264|       |
  265|     43|        case DW_CFA_nop:
  ------------------
  |  Branch (265:9): [True: 43, False: 185]
  ------------------
  266|     43|          break;
  267|       |
  268|      0|        case DW_CFA_set_loc:
  ------------------
  |  Branch (268:9): [True: 0, False: 228]
  ------------------
  269|      0|          if ((ret = dwarf_read_encoded_pointer (as, a, addr, dci->fde_encoding,
  ------------------
  |  |  402|      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 (269:15): [True: 0, False: 0]
  ------------------
  270|      0|                                                 &c->pi, ip,
  271|      0|                                                 arg)) < 0)
  272|      0|            break;
  273|      0|          Debug (15, "CFA_set_loc to 0x%lx\n", (long) *ip);
  274|      0|          break;
  275|       |
  276|      1|        case DW_CFA_undefined:
  ------------------
  |  Branch (276:9): [True: 1, False: 227]
  ------------------
  277|      1|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (277:15): [True: 0, False: 1]
  ------------------
  278|      0|            break;
  279|      1|          set_savedreg (sr, regnum, DWARF_WHERE_UNDEF, 0);
  280|      1|          Debug (15, "CFA_undefined r%lu\n", (long) regnum);
  281|      1|          break;
  282|       |
  283|      0|        case DW_CFA_same_value:
  ------------------
  |  Branch (283:9): [True: 0, False: 228]
  ------------------
  284|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (284:15): [True: 0, False: 0]
  ------------------
  285|      0|            break;
  286|      0|          set_savedreg (sr, regnum, DWARF_WHERE_SAME, 0);
  287|      0|          Debug (15, "CFA_same_value r%lu\n", (long) regnum);
  288|      0|          break;
  289|       |
  290|      0|        case DW_CFA_register:
  ------------------
  |  Branch (290:9): [True: 0, False: 228]
  ------------------
  291|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (291:15): [True: 0, False: 0]
  ------------------
  292|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (292:18): [True: 0, False: 0]
  ------------------
  293|      0|            break;
  294|      0|          if (val >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|      0|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (294:15): [True: 0, False: 0]
  ------------------
  295|      0|            {
  296|       |              /* The value was saved in a register we have no slot for, so it
  297|       |                 cannot be recovered.  apply_reg_state() uses VAL to index the
  298|       |                 register locations, so it must not be recorded as-is.  */
  299|      0|              set_savedreg (sr, regnum, DWARF_WHERE_UNDEF, 0);
  300|      0|              Debug (15, "CFA_register r%lu to unrepresentable r%lu\n",
  301|      0|                     (long) regnum, (long) val);
  302|      0|              break;
  303|      0|            }
  304|      0|          set_savedreg (sr, regnum, DWARF_WHERE_REG, val);
  305|      0|          Debug (15, "CFA_register r%lu to r%lu\n", (long) regnum, (long) val);
  306|      0|          break;
  307|       |
  308|      0|        case DW_CFA_remember_state:
  ------------------
  |  Branch (308:9): [True: 0, False: 228]
  ------------------
  309|      0|	  if (push_rstate_stack(rs_stack) < 0)
  ------------------
  |  Branch (309:8): [True: 0, False: 0]
  ------------------
  310|      0|	    {
  311|      0|              Debug (1, "Out of memory in DW_CFA_remember_state\n");
  312|      0|              ret = -UNW_ENOMEM;
  313|      0|              break;
  314|      0|	    }
  315|      0|          (*rs_stack)->state = sr->rs_current;
  316|      0|          Debug (15, "CFA_remember_state\n");
  317|      0|          break;
  318|       |
  319|      0|        case DW_CFA_restore_state:
  ------------------
  |  Branch (319:9): [True: 0, False: 228]
  ------------------
  320|      0|          if (!*rs_stack)
  ------------------
  |  Branch (320:15): [True: 0, False: 0]
  ------------------
  321|      0|            {
  322|      0|              Debug (1, "register-state stack underflow\n");
  323|      0|              ret = -UNW_EINVAL;
  324|      0|              break;
  325|      0|            }
  326|      0|          sr->rs_current = (*rs_stack)->state;
  327|      0|          pop_rstate_stack(rs_stack);
  328|      0|          Debug (15, "CFA_restore_state\n");
  329|      0|          break;
  330|       |
  331|     18|        case DW_CFA_def_cfa:
  ------------------
  |  Branch (331:9): [True: 18, False: 210]
  ------------------
  332|     18|          if (((ret = read_cfa_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (332:15): [True: 0, False: 18]
  ------------------
  333|     18|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (333:18): [True: 0, False: 18]
  ------------------
  334|      0|            break;
  335|     18|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum);
  ------------------
  |  |  248|     18|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|     18|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  336|     18|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val);   /* NOT factored! */
  ------------------
  |  |  249|     18|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|     18|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  337|     18|          Debug (15, "CFA_def_cfa r%lu+0x%lx\n", (long) regnum, (long) val);
  338|     18|          break;
  339|       |
  340|      0|        case DW_CFA_def_cfa_sf:
  ------------------
  |  Branch (340:9): [True: 0, False: 228]
  ------------------
  341|      0|          if (((ret = read_cfa_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (341:15): [True: 0, False: 0]
  ------------------
  342|      0|              || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (342:18): [True: 0, False: 0]
  ------------------
  343|      0|            break;
  344|      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
  |  |  ------------------
  ------------------
  345|      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
  |  |  ------------------
  ------------------
  346|      0|                   val * dci->data_align);              /* factored! */
  347|      0|          Debug (15, "CFA_def_cfa_sf r%lu+0x%lx\n",
  348|      0|                 (long) regnum, (long) (val * dci->data_align));
  349|      0|          break;
  350|       |
  351|     15|        case DW_CFA_def_cfa_register:
  ------------------
  |  Branch (351:9): [True: 15, False: 213]
  ------------------
  352|     15|          if ((ret = read_cfa_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (352:15): [True: 0, False: 15]
  ------------------
  353|      0|            break;
  354|     15|          set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum);
  ------------------
  |  |  248|     15|#define DWARF_CFA_REG_COLUMN    DWARF_NUM_PRESERVED_REGS
  |  |  ------------------
  |  |  |  |   38|     15|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  355|     15|          Debug (15, "CFA_def_cfa_register r%lu\n", (long) regnum);
  356|     15|          break;
  357|       |
  358|     15|        case DW_CFA_def_cfa_offset:
  ------------------
  |  Branch (358:9): [True: 15, False: 213]
  ------------------
  359|     15|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (359:15): [True: 0, False: 15]
  ------------------
  360|      0|            break;
  361|     15|          set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val);   /* NOT factored! */
  ------------------
  |  |  249|     15|#define DWARF_CFA_OFF_COLUMN    (DWARF_NUM_PRESERVED_REGS + 1)
  |  |  ------------------
  |  |  |  |   38|     15|#define DWARF_NUM_PRESERVED_REGS        17
  |  |  ------------------
  ------------------
  362|     15|          Debug (15, "CFA_def_cfa_offset 0x%lx\n", (long) val);
  363|     15|          break;
  364|       |
  365|      0|        case DW_CFA_def_cfa_offset_sf:
  ------------------
  |  Branch (365:9): [True: 0, False: 228]
  ------------------
  366|      0|          if ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (366:15): [True: 0, False: 0]
  ------------------
  367|      0|            break;
  368|      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
  |  |  ------------------
  ------------------
  369|      0|                   val * dci->data_align);      /* factored! */
  370|      0|          Debug (15, "CFA_def_cfa_offset_sf 0x%lx\n",
  371|      0|                 (long) (val * dci->data_align));
  372|      0|          break;
  373|       |
  374|      0|        case DW_CFA_def_cfa_expression:
  ------------------
  |  Branch (374:9): [True: 0, False: 228]
  ------------------
  375|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  376|      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
  |  |  ------------------
  ------------------
  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_def_cfa_expr @ 0x%lx [%lu bytes]\n",
  382|      0|                 (long) *addr, (long) len);
  383|      0|          *addr += len;
  384|      0|          break;
  385|       |
  386|      0|        case DW_CFA_expression:
  ------------------
  |  Branch (386:9): [True: 0, False: 228]
  ------------------
  387|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|            break;
  389|       |
  390|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  391|      0|          set_savedreg (sr, regnum, DWARF_WHERE_EXPR, *addr);
  392|       |
  393|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0)
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            break;
  395|       |
  396|      0|          Debug (15, "CFA_expression r%lu @ 0x%lx [%lu bytes]\n",
  397|      0|                 (long) regnum, (long) addr, (long) len);
  398|      0|          *addr += len;
  399|      0|          break;
  400|       |
  401|      0|        case DW_CFA_val_expression:
  ------------------
  |  Branch (401:9): [True: 0, False: 228]
  ------------------
  402|      0|          if ((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (402:15): [True: 0, False: 0]
  ------------------
  403|      0|            break;
  404|       |
  405|       |          /* Save the address of the DW_FORM_block for later evaluation. */
  406|      0|          set_savedreg (sr, regnum, DWARF_WHERE_VAL_EXPR, *addr);
  407|       |
  408|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0)
  ------------------
  |  Branch (408:15): [True: 0, False: 0]
  ------------------
  409|      0|            break;
  410|       |
  411|      0|          Debug (15, "CFA_val_expression r%lu @ 0x%lx [%lu bytes]\n",
  412|      0|                 (long) regnum, (long) addr, (long) len);
  413|      0|          *addr += len;
  414|      0|          break;
  415|       |
  416|      0|        case DW_CFA_GNU_args_size:
  ------------------
  |  Branch (416:9): [True: 0, False: 228]
  ------------------
  417|      0|          if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)
  ------------------
  |  Branch (417:15): [True: 0, False: 0]
  ------------------
  418|      0|            break;
  419|      0|          sr->args_size = val;
  420|      0|          Debug (15, "CFA_GNU_args_size %lu\n", (long) val);
  421|      0|          break;
  422|       |
  423|      0|        case DW_CFA_GNU_negative_offset_extended:
  ------------------
  |  Branch (423:9): [True: 0, False: 228]
  ------------------
  424|       |          /* A comment in GCC says that this is obsoleted by
  425|       |             DW_CFA_offset_extended_sf, but that it's used by older
  426|       |             PowerPC code.  */
  427|      0|          if (((ret = read_regnum (as, a, addr, &regnum, arg)) < 0)
  ------------------
  |  Branch (427:15): [True: 0, False: 0]
  ------------------
  428|      0|              || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0))
  ------------------
  |  Branch (428:18): [True: 0, False: 0]
  ------------------
  429|      0|            break;
  430|      0|          set_savedreg (sr, regnum, DWARF_WHERE_CFAREL, ~(val * dci->data_align) + 1);
  431|      0|          Debug (15, "CFA_GNU_negative_offset_extended cfa+0x%lx\n",
  432|      0|                 (long) (~(val * dci->data_align) + 1));
  433|      0|          break;
  434|       |
  435|      0|        case DW_CFA_GNU_window_save:
  ------------------
  |  Branch (435:9): [True: 0, False: 228]
  ------------------
  436|       |#ifdef UNW_TARGET_SPARC
  437|       |          /* This is a special CFA to handle all 16 windowed registers
  438|       |             on SPARC.  */
  439|       |          for (regnum = 16; regnum < 32; ++regnum)
  440|       |            set_savedreg (sr, regnum, DWARF_WHERE_CFAREL,
  441|       |                     (regnum - 16) * sizeof (unw_word_t));
  442|       |          Debug (15, "CFA_GNU_window_save\n");
  443|       |          break;
  444|       |#elif UNW_TARGET_AARCH64
  445|       |          /* This is a specific opcode on aarch64, DW_CFA_AARCH64_negate_ra_state */
  446|       |          Debug (15, "DW_CFA_AARCH64_negate_ra_state\n");
  447|       |          aarch64_negate_ra_sign_state(sr);
  448|       |          break;
  449|       |#else
  450|       |          /* FALL THROUGH */
  451|      0|#endif
  452|      0|        case DW_CFA_lo_user:
  ------------------
  |  Branch (452:9): [True: 0, False: 228]
  ------------------
  453|      0|        case DW_CFA_hi_user:
  ------------------
  |  Branch (453:9): [True: 0, False: 228]
  ------------------
  454|      0|          Debug (1, "Unexpected CFA opcode 0x%x\n", op);
  455|      0|          ret = -UNW_EINVAL;
  456|      0|          break;
  457|    228|        }
  458|    228|    }
  459|       |
  460|     32|  if (ret > 0)
  ------------------
  |  Branch (460:7): [True: 0, False: 32]
  ------------------
  461|      0|    ret = 0;
  462|     32|  return ret;
  463|     32|}
Lparser.c:set_savedreg:
   80|     77|{
   81|     77|  if (regnum >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|     77|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (81:7): [True: 0, False: 77]
  ------------------
   82|      0|    {
   83|      0|      Debug (15, "ignoring rule for unrepresentable register r%lu\n",
   84|      0|             (long) regnum);
   85|      0|      return;
   86|      0|    }
   87|     77|  set_reg (sr, regnum, where, val);
   88|     77|}
Lparser.c:read_regnum:
   63|      1|{
   64|      1|  return dwarf_read_uleb128 (as, a, addr, valp, arg);
   65|      1|}
Lparser.c:read_cfa_regnum:
   42|     33|{
   43|     33|  int ret;
   44|       |
   45|     33|  if ((ret = dwarf_read_uleb128 (as, a, addr, valp, arg)) < 0)
  ------------------
  |  Branch (45:7): [True: 0, False: 33]
  ------------------
   46|      0|    return ret;
   47|       |
   48|     33|  if (*valp >= DWARF_NUM_PRESERVED_REGS)
  ------------------
  |  |   38|     33|#define DWARF_NUM_PRESERVED_REGS        17
  ------------------
  |  Branch (48:7): [True: 0, False: 33]
  ------------------
   49|      0|    {
   50|      0|      Debug (1, "Invalid CFA register number %u\n", (unsigned int) *valp);
   51|      0|      return -UNW_EBADREG;
   52|      0|    }
   53|     33|  return 0;
   54|     33|}
Lparser.c:empty_rstate_stack:
  128|     32|{
  129|     32|  while (*rs_stack)
  ------------------
  |  Branch (129:10): [True: 0, False: 32]
  ------------------
  130|      0|    pop_rstate_stack(rs_stack);
  131|     32|}
Lparser.c:parse_fde:
  585|     16|{
  586|     16|  int ret;
  587|     16|  struct dwarf_cie_info *dci = c->pi.unwind_info;
  588|     16|  unw_word_t addr = dci->fde_instr_start;
  589|     16|  unw_word_t curr_ip = c->pi.start_ip;
  590|     16|  dwarf_stackable_reg_state_t *rs_stack = NULL;
  591|       |  /* Process up to current `ip` for signal frame and `ip - 1` for normal call frame
  592|       |     See `c->use_prev_instr` use in `fetch_proc_info` for details. */
  593|     16|  ret = run_cfi_program (c, sr, &curr_ip, ip - c->use_prev_instr, &addr, dci->fde_instr_end,
  594|     16|			 &rs_stack, dci);
  595|     16|  empty_rstate_stack(&rs_stack);
  596|     16|  if (ret < 0)
  ------------------
  |  Branch (596:7): [True: 0, False: 16]
  ------------------
  597|      0|    return ret;
  598|       |
  599|     16|  return 0;
  600|     16|}
Lparser.c:put_unwind_info:
  537|     16|{
  538|     16|  if (c->pi_is_dynamic)
  ------------------
  |  Branch (538:7): [True: 0, False: 16]
  ------------------
  539|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|     16|  else if (pi->unwind_info && pi->format == UNW_INFO_FORMAT_TABLE)
  ------------------
  |  Branch (540:12): [True: 16, False: 0]
  |  Branch (540:31): [True: 16, False: 0]
  ------------------
  541|     16|    {
  542|     16|      mempool_free (&dwarf_cie_info_pool, pi->unwind_info);
  ------------------
  |  |   57|     16|#define mempool_free(p,o)       UNWI_ARCH_OBJ(_mempool_free)(p,o)
  |  |  ------------------
  |  |  |  |  174|     16|#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     16|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     16|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  543|       |      pi->unwind_info = NULL;
  544|     16|    }
  545|     16|  c->pi_valid = 0;
  546|     16|}

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

_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:
  657|  31.0k|{
  658|  31.0k|  Elf_W (Addr) load_offset;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  659|  31.0k|  Elf_W (Addr) min_dist = ~(Elf_W (Addr))0;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  660|  31.0k|  int ret;
  661|       |
  662|  31.0k|  load_offset = elf_w (get_load_offset) (ei, segbase);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  663|  31.0k|  ret = elf_w (lookup_symbol) (as, ip, ei, load_offset, buf, buf_len, &min_dist, arg);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  664|       |
  665|       |  /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in
  666|       |     there as well and replace the previously found if it is closer. */
  667|  31.0k|  struct elf_image mdi;
  668|  31.0k|  if (elf_w (extract_minidebuginfo) (ei, &mdi))
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (668:7): [True: 0, False: 31.0k]
  ------------------
  669|      0|    {
  670|      0|      int ret_mdi = elf_w (lookup_symbol) (as, ip, &mdi, load_offset, buf,
  ------------------
  |  |   45|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  671|      0|                                           buf_len, &min_dist, arg);
  672|       |
  673|       |      /* Closer symbol was found (possibly truncated). */
  674|      0|      if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM)
  ------------------
  |  Branch (674:11): [True: 0, False: 0]
  |  Branch (674:27): [True: 0, False: 0]
  ------------------
  675|      0|        {
  676|      0|          ret = ret_mdi;
  677|      0|        }
  678|       |
  679|      0|      mi_munmap (mdi.image, mdi.size);
  680|      0|    }
  681|       |
  682|  31.0k|  if (min_dist >= ei->size)
  ------------------
  |  Branch (682:7): [True: 3.45k, False: 27.6k]
  ------------------
  683|  3.45k|    return -UNW_ENOINFO;                /* not found */
  684|  27.6k|  if (offp)
  ------------------
  |  Branch (684:7): [True: 27.6k, False: 0]
  ------------------
  685|  27.6k|    *offp = min_dist;
  686|  27.6k|  return ret;
  687|  31.0k|}
_Uelf64_get_proc_name:
  692|  31.0k|{
  693|  31.0k|  unsigned long segbase, mapoff;
  694|  31.0k|  struct elf_image ei;
  695|  31.0k|  int ret;
  696|  31.0k|  char file[PATH_MAX];
  697|       |
  698|  31.0k|  ret = tdep_get_elf_image (as, &ei, pid, ip, &segbase, &mapoff, file, PATH_MAX, arg);
  ------------------
  |  |  238|  31.0k|#define tdep_get_elf_image              UNW_ARCH_OBJ(get_elf_image)
  |  |  ------------------
  |  |  |  |   49|  31.0k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  699|  31.0k|  if (ret < 0)
  ------------------
  |  Branch (699:7): [True: 0, False: 31.0k]
  ------------------
  700|      0|    return ret;
  701|       |
  702|  31.0k|  ret = elf_w (load_debuginfo) (file, &ei, 1);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  703|  31.0k|  if (ret < 0)
  ------------------
  |  Branch (703:7): [True: 0, False: 31.0k]
  ------------------
  704|      0|    return ret;
  705|       |
  706|  31.0k|  ret = elf_w (get_proc_name_in_image) (as, &ei, segbase, ip, buf, buf_len, offp, arg);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  707|       |
  708|  31.0k|  mi_munmap (ei.image, ei.size);
  709|  31.0k|  ei.image = NULL;
  710|       |
  711|  31.0k|  return ret;
  712|  31.0k|}
_Uelf64_find_section:
  793|  31.0k|{
  794|  31.0k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  795|  31.0k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  796|  31.0k|  char *strtab;
  797|  31.0k|  int i;
  798|       |
  799|  31.0k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (799:7): [True: 0, False: 31.0k]
  ------------------
  800|      0|    return 0;
  801|       |
  802|  31.0k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  803|  31.0k|  if (!shdr)
  ------------------
  |  Branch (803:7): [True: 0, False: 31.0k]
  ------------------
  804|      0|    return 0;
  805|       |
  806|  31.0k|  strtab = elf_w (string_table) (ei, ehdr->e_shstrndx);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  807|  31.0k|  if (!strtab)
  ------------------
  |  Branch (807:7): [True: 0, False: 31.0k]
  ------------------
  808|      0|    return 0;
  809|       |
  810|  1.73M|  for (i = 0; i < ehdr->e_shnum; ++i)
  ------------------
  |  Branch (810:15): [True: 1.71M, False: 24.1k]
  ------------------
  811|  1.71M|    {
  812|  1.71M|      if (strcmp (strtab + shdr->sh_name, secname) == 0)
  ------------------
  |  Branch (812:11): [True: 6.90k, False: 1.70M]
  ------------------
  813|  6.90k|        {
  814|  6.90k|          if (shdr->sh_offset > ei->size
  ------------------
  |  Branch (814:15): [True: 0, False: 6.90k]
  ------------------
  815|  6.90k|              || shdr->sh_size > ei->size - shdr->sh_offset)
  ------------------
  |  Branch (815:18): [True: 0, False: 6.90k]
  ------------------
  816|      0|            {
  817|      0|              Debug (1, "section \"%s\" outside image? (0x%lx + 0x%lx > 0x%lx)\n",
  818|      0|                     secname,
  819|      0|                     (unsigned long) shdr->sh_offset,
  820|      0|                     (unsigned long) shdr->sh_size,
  821|      0|                     (unsigned long) ei->size);
  822|      0|              return 0;
  823|      0|            }
  824|       |
  825|  6.90k|          Debug (16, "found section \"%s\" at 0x%lx\n",
  826|  6.90k|                 secname, (unsigned long) shdr->sh_offset);
  827|  6.90k|          return shdr;
  828|  6.90k|        }
  829|       |
  830|  1.70M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  831|  1.70M|    }
  832|       |
  833|       |  /* section not found */
  834|  24.1k|  return 0;
  835|  31.0k|}
_Uelf64_load_debuginfo:
 1005|  58.6k|{
 1006|  58.6k|  int ret;
 1007|  58.6k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  58.6k|# define Elf_W(x)       Elf64_##x
  ------------------
 1008|  58.6k|  Elf_W (Ehdr) *prev_image;
  ------------------
  |  |   44|  58.6k|# define Elf_W(x)       Elf64_##x
  ------------------
 1009|  58.6k|  off_t prev_size;
 1010|  58.6k|  char path[PATH_MAX];
 1011|       |
 1012|  58.6k|  if (!ei->image)
  ------------------
  |  Branch (1012:7): [True: 27.6k, False: 31.0k]
  ------------------
 1013|  27.6k|    {
 1014|  27.6k|      ret = elf_map_image(ei, file);
 1015|  27.6k|      if (ret)
  ------------------
  |  Branch (1015:11): [True: 27.6k, False: 0]
  ------------------
 1016|  27.6k|        return ret;
 1017|  27.6k|    }
 1018|       |
 1019|  31.0k|  prev_image = ei->image;
 1020|  31.0k|  prev_size = ei->size;
 1021|       |
 1022|       |  /* Ignore separate debug files which contain a .gnu_debuglink section. */
 1023|  31.0k|  if (is_local == -1) {
  ------------------
  |  Branch (1023:7): [True: 0, False: 31.0k]
  ------------------
 1024|      0|    return 0;
 1025|      0|  }
 1026|       |
 1027|  31.0k|  ret = elf_w (find_build_id_path) (ei, path, sizeof(path));
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1028|  31.0k|  if (ret == 0)
  ------------------
  |  Branch (1028:7): [True: 6.90k, False: 24.1k]
  ------------------
 1029|  6.90k|    {
 1030|  6.90k|      ei->image = NULL;
 1031|       |
 1032|  6.90k|      ret = elf_w (load_debuginfo) (path, ei, -1);
  ------------------
  |  |   45|  6.90k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1033|  6.90k|      if (ret == 0)
  ------------------
  |  Branch (1033:11): [True: 0, False: 6.90k]
  ------------------
 1034|      0|        {
 1035|      0|          mi_munmap (prev_image, prev_size);
 1036|      0|          return 0;
 1037|      0|        }
 1038|       |
 1039|  6.90k|      ei->image = prev_image;
 1040|  6.90k|      ei->size  = prev_size;
 1041|  6.90k|    }
 1042|       |
 1043|  31.0k|  shdr = elf_w (find_section) (ei, ".gnu_debuglink");
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1044|  31.0k|  if (shdr) {
  ------------------
  |  Branch (1044:7): [True: 6.90k, False: 24.1k]
  ------------------
 1045|  6.90k|    if (shdr->sh_size >= PATH_MAX ||
  ------------------
  |  Branch (1045:9): [True: 0, False: 6.90k]
  ------------------
 1046|  6.90k|	shdr->sh_offset > ei->size ||
  ------------------
  |  Branch (1046:2): [True: 0, False: 6.90k]
  ------------------
 1047|  6.90k|	shdr->sh_size > ei->size - shdr->sh_offset)
  ------------------
  |  Branch (1047:2): [True: 0, False: 6.90k]
  ------------------
 1048|      0|      return 0;
 1049|       |
 1050|  6.90k|    {
 1051|  6.90k|      char linkbuf[shdr->sh_size];
 1052|  6.90k|      char *link = ((char *) ei->image) + shdr->sh_offset;
 1053|  6.90k|      const char *p;
 1054|  6.90k|      static const char *debugdir = "/usr/lib/debug";
 1055|  6.90k|      char basedir[strlen(file) + 1];
 1056|  6.90k|      char newname[shdr->sh_size + strlen (debugdir) + strlen (file) + 9];
 1057|  6.90k|      size_t crc_offset;
 1058|  6.90k|      uint32_t crc;
 1059|       |
 1060|  6.90k|      memcpy(linkbuf, link, shdr->sh_size);
 1061|       |
 1062|  6.90k|      if (memchr (linkbuf, 0, shdr->sh_size) == NULL)
  ------------------
  |  Branch (1062:11): [True: 0, False: 6.90k]
  ------------------
 1063|      0|	return 0;
 1064|       |
 1065|       |      /* The section holds the NUL-terminated file name, padded to a
 1066|       |	 four-byte boundary, followed by the CRC-32 of the debug file.  */
 1067|  6.90k|      crc_offset = UNW_ALIGN (strlen (linkbuf) + 1, 4);
  ------------------
  |  |  447|  6.90k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
 1068|  6.90k|      if (crc_offset + sizeof (crc) > shdr->sh_size)
  ------------------
  |  Branch (1068:11): [True: 0, False: 6.90k]
  ------------------
 1069|      0|	{
 1070|      0|	  Debug (1, "Malformed .gnu_debuglink section in %s\n", file);
 1071|      0|	  return 0;
 1072|      0|	}
 1073|  6.90k|      memcpy (&crc, linkbuf + crc_offset, sizeof (crc));
 1074|       |
 1075|  6.90k|      ei->image = NULL;
 1076|       |
 1077|  6.90k|      Debug(1, "Found debuglink section, following %s\n", linkbuf);
 1078|       |
 1079|  6.90k|      p = strrchr (file, '/');
 1080|  6.90k|      if (p != NULL)
  ------------------
  |  Branch (1080:11): [True: 6.90k, False: 0]
  ------------------
 1081|  6.90k|	{
 1082|  6.90k|	  memcpy (basedir, file, p - file);
 1083|  6.90k|	  basedir[p - file] = '\0';
 1084|  6.90k|	}
 1085|      0|      else
 1086|      0|	basedir[0] = 0;
 1087|       |
 1088|  6.90k|      strcpy (newname, basedir);
 1089|  6.90k|      strcat (newname, "/");
 1090|  6.90k|      strcat (newname, linkbuf);
 1091|  6.90k|      ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  6.90k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1092|       |
 1093|  6.90k|      if (ret == -1)
  ------------------
  |  Branch (1093:11): [True: 6.90k, False: 0]
  ------------------
 1094|  6.90k|	{
 1095|  6.90k|	  strcpy (newname, basedir);
 1096|  6.90k|	  strcat (newname, "/.debug/");
 1097|  6.90k|	  strcat (newname, linkbuf);
 1098|  6.90k|	  ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  6.90k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1099|  6.90k|	}
 1100|       |
 1101|  6.90k|      if (ret == -1 && is_local == 1)
  ------------------
  |  Branch (1101:11): [True: 6.90k, False: 0]
  |  Branch (1101:24): [True: 6.90k, False: 0]
  ------------------
 1102|  6.90k|	{
 1103|  6.90k|	  strcpy (newname, debugdir);
 1104|  6.90k|	  strcat (newname, basedir);
 1105|  6.90k|	  strcat (newname, "/");
 1106|  6.90k|	  strcat (newname, linkbuf);
 1107|  6.90k|	  ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  6.90k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1108|  6.90k|	}
 1109|       |
 1110|  6.90k|      if (ret == -1)
  ------------------
  |  Branch (1110:11): [True: 6.90k, False: 0]
  ------------------
 1111|  6.90k|        {
 1112|       |          /* No debuglink file found even though .gnu_debuglink existed */
 1113|  6.90k|          ei->image = prev_image;
 1114|  6.90k|          ei->size = prev_size;
 1115|       |
 1116|  6.90k|          return 0;
 1117|  6.90k|        }
 1118|      0|      else
 1119|      0|        {
 1120|      0|          mi_munmap (prev_image, prev_size);
 1121|      0|        }
 1122|       |
 1123|      0|      return ret;
 1124|  6.90k|    }
 1125|  6.90k|  }
 1126|       |
 1127|  24.1k|  return 0;
 1128|  31.0k|}
elf64.c:_Uelf64_get_load_offset:
  471|  31.0k|{
  472|  31.0k|  Elf_W (Addr) offset = 0;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  473|  31.0k|  Elf_W (Ehdr) *ehdr;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  474|  31.0k|  Elf_W (Phdr) *phdr;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  475|  31.0k|  int i;
  476|       |  // mapoff is obtained from mmap information, so it is always aligned on a page size.
  477|       |  // PT_LOAD program headers p_offset however is not guaranteed to be aligned on a
  478|       |  // page size, ld.lld generate libraries where this is not the case. So we must
  479|       |  // make sure we compare both values with the same alignment.
  480|  31.0k|  unsigned long pagesize_alignment_mask = ~(unw_page_size - 1UL);
  481|       |
  482|  31.0k|  ehdr = ei->image;
  483|  31.0k|  phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff);
  484|       |
  485|   124k|  for (i = 0; i < ehdr->e_phnum; ++i)
  ------------------
  |  Branch (485:15): [True: 124k, False: 0]
  ------------------
  486|   124k|    if (phdr[i].p_type == PT_LOAD && phdr[i].p_flags & PF_X)
  ------------------
  |  Branch (486:9): [True: 62.1k, False: 62.1k]
  |  Branch (486:38): [True: 31.0k, False: 31.0k]
  ------------------
  487|  31.0k|      {
  488|  31.0k|        offset = segbase - phdr[i].p_vaddr + (phdr[i].p_offset & (~pagesize_alignment_mask));
  489|  31.0k|        break;
  490|  31.0k|      }
  491|       |
  492|  31.0k|  return offset;
  493|  31.0k|}
elf64.c:_Uelf64_lookup_symbol:
  398|  31.0k|{
  399|  31.0k|  struct symbol_lookup_context context =
  400|  31.0k|    {
  401|  31.0k|      .as = as,
  402|  31.0k|      .ip = ip,
  403|  31.0k|      .ei = ei,
  404|  31.0k|      .load_offset = load_offset,
  405|  31.0k|      .min_dist = min_dist,
  406|  31.0k|      .arg = arg,
  407|  31.0k|    };
  408|  31.0k|  struct symbol_callback_data data =
  409|  31.0k|    {
  410|  31.0k|      .buf = buf, 
  411|  31.0k|      .buf_len = buf_len,
  412|  31.0k|    };
  413|  31.0k|  return elf_w (lookup_symbol_closeness) (as,
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  414|  31.0k|                                          &context,
  415|  31.0k|                                          elf_w (lookup_symbol_callback),
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  416|  31.0k|                                          &data);
  417|  31.0k|}
elf64.c:_Uelf64_lookup_symbol_closeness:
  256|  31.0k|{
  257|  31.0k|  struct elf_image *ei = context->ei;
  258|  31.0k|  Elf_W (Addr) load_offset = context->load_offset;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  259|  31.0k|  size_t syment_size;
  260|  31.0k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  261|  31.0k|  Elf_W (Sym) *sym, *symtab, *symtab_end;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  262|  31.0k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  263|  31.0k|  Elf_W (Addr) val;
  ------------------
  |  |   44|  31.0k|# define Elf_W(x)       Elf64_##x
  ------------------
  264|  31.0k|  int i, ret = -UNW_ENOINFO;
  265|  31.0k|  char *strtab;
  266|       |
  267|  31.0k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (267:7): [True: 0, False: 31.0k]
  ------------------
  268|      0|    return -UNW_ENOINFO;
  269|       |
  270|  31.0k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  271|  31.0k|  if (!shdr)
  ------------------
  |  Branch (271:7): [True: 0, False: 31.0k]
  ------------------
  272|      0|    return -UNW_ENOINFO;
  273|       |
  274|  1.50M|  for (i = 0; i < ehdr->e_shnum && ret == -UNW_ENOINFO; ++i)
  ------------------
  |  Branch (274:15): [True: 1.50M, False: 3.45k]
  |  Branch (274:36): [True: 1.47M, False: 27.6k]
  ------------------
  275|  1.47M|    {
  276|  1.47M|      switch (shdr->sh_type)
  277|  1.47M|        {
  278|  24.1k|        case SHT_SYMTAB:
  ------------------
  |  Branch (278:9): [True: 24.1k, False: 1.45M]
  ------------------
  279|  55.2k|        case SHT_DYNSYM:
  ------------------
  |  Branch (279:9): [True: 31.0k, False: 1.44M]
  ------------------
  280|       |          /* The section header comes from the file; keep the symbol table
  281|       |             inside the image and make sure the walk below advances. */
  282|  55.2k|          if (shdr->sh_offset > ei->size
  ------------------
  |  Branch (282:15): [True: 0, False: 55.2k]
  ------------------
  283|  55.2k|              || shdr->sh_size > ei->size - shdr->sh_offset
  ------------------
  |  Branch (283:18): [True: 0, False: 55.2k]
  ------------------
  284|  55.2k|              || shdr->sh_entsize < sizeof (Elf_W (Sym)))
  ------------------
  |  Branch (284:18): [True: 0, False: 55.2k]
  ------------------
  285|      0|            break;
  286|       |
  287|  55.2k|          symtab = (Elf_W (Sym) *) ((char *) ei->image + shdr->sh_offset);
  288|  55.2k|          symtab_end = (Elf_W (Sym) *) ((char *) symtab + shdr->sh_size);
  289|  55.2k|          syment_size = shdr->sh_entsize;
  290|       |
  291|  55.2k|          strtab = elf_w (string_table) (ei, shdr->sh_link);
  ------------------
  |  |   45|  55.2k|# define elf_w(x)       _Uelf64_##x
  ------------------
  292|  55.2k|          if (!strtab)
  ------------------
  |  Branch (292:15): [True: 0, False: 55.2k]
  ------------------
  293|      0|            break;
  294|       |
  295|  55.2k|          Debug (16, "symtab=0x%lx[%d]\n",
  296|  55.2k|                 (long) shdr->sh_offset, shdr->sh_type);
  297|       |
  298|  55.2k|          for (sym = symtab;
  299|   118M|               sym < symtab_end
  ------------------
  |  Branch (299:16): [True: 118M, False: 27.6k]
  ------------------
  300|   118M|               && (size_t) ((char *) symtab_end - (char *) sym) >= sizeof (*sym);
  ------------------
  |  Branch (300:19): [True: 118M, False: 0]
  ------------------
  301|   118M|               sym = (Elf_W (Sym) *) ((char *) sym + syment_size))
  302|   118M|            {
  303|   118M|              if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC
  ------------------
  |  |   43|   118M|# define ELF_W(x)       ELF64_##x
  ------------------
  |  Branch (303:19): [True: 81.9M, False: 36.3M]
  ------------------
  304|  81.9M|                  && sym->st_shndx != SHN_UNDEF)
  ------------------
  |  Branch (304:22): [True: 75.4M, False: 6.55M]
  ------------------
  305|  75.4M|                {
  306|  75.4M|                  val = sym->st_value;
  307|  75.4M|                  if (sym->st_shndx != SHN_ABS)
  ------------------
  |  Branch (307:23): [True: 75.4M, False: 0]
  ------------------
  308|  75.4M|                    val += load_offset;
  309|  75.4M|                  if (tdep_get_func_addr (as, val, &val, context->arg) < 0)
  ------------------
  |  |  439|  75.4M|# define tdep_get_func_addr(as,addr,v,arg)       (*(v) = addr, 0)
  ------------------
  |  Branch (309:23): [True: 0, False: 75.4M]
  ------------------
  310|      0|                    continue;
  311|  75.4M|                  Debug (16, "0x%016lx info=0x%02x %s\n",
  312|  75.4M|                         (long) val, sym->st_info, strtab + sym->st_name);
  313|       |
  314|  75.4M|                  struct symbol_info syminfo =
  315|  75.4M|                    {
  316|  75.4M|                      .strtab   = strtab,
  317|  75.4M|                      .sym      = sym,
  318|  75.4M|                      .start_ip = val
  319|  75.4M|                    };
  320|  75.4M|                  ret = symtab_lookup (context, &syminfo, data);
  321|       |
  322|       |                  /* Keep going if the IP is not found in this symtab entry. */
  323|  75.4M|                  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (323:23): [True: 75.3M, False: 27.6k]
  ------------------
  324|  75.3M|                    {
  325|  75.3M|                      continue;
  326|  75.3M|                    }
  327|       |
  328|  27.6k|                  break;
  329|  75.4M|                }
  330|   118M|            }
  331|  55.2k|          break;
  332|       |
  333|  1.42M|        default:
  ------------------
  |  Branch (333:9): [True: 1.42M, False: 55.2k]
  ------------------
  334|  1.42M|          break;
  335|  1.47M|        }
  336|  1.47M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  337|  1.47M|    }
  338|       |
  339|       |  /* If it wasn't found in the ELF symtab, check the synamic symtab. */
  340|  31.0k|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (340:7): [True: 3.45k, False: 27.6k]
  ------------------
  341|  3.45k|    ret = elf_w (lookup_symbol_from_dynamic) (as, context, symtab_lookup, data);
  ------------------
  |  |   45|  3.45k|# define elf_w(x)       _Uelf64_##x
  ------------------
  342|       |
  343|  31.0k|  return ret;
  344|  31.0k|}
elf64.c:_Uelf64_lookup_symbol_from_dynamic:
  156|  3.45k|{
  157|  3.45k|  struct elf_image *ei = context->ei;
  158|  3.45k|  Elf_W (Addr) load_offset = context->load_offset;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  159|  3.45k|  Elf_W (Addr) file_offset = 0;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  160|  3.45k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  161|  3.45k|  Elf_W (Sym) *sym = NULL, *symtab = NULL;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  162|  3.45k|  Elf_W (Phdr) *phdr;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  163|  3.45k|  Elf_W (Word) sym_num = 0;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  164|  3.45k|  Elf_W (Word) *hash = NULL;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  165|  3.45k|  uint32_t *gnu_hash = NULL;
  166|  3.45k|  Elf_W (Addr) val;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  167|  3.45k|  const char *strtab = NULL;
  168|  3.45k|  int ret = -UNW_ENOINFO;
  169|  3.45k|  size_t i;
  170|  3.45k|  Elf_W(Dyn) *dyn = NULL;
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  171|       |
  172|  3.45k|  phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff);
  173|  24.1k|  for (i = 0; i < ehdr->e_phnum; ++i)
  ------------------
  |  Branch (173:15): [True: 24.1k, False: 0]
  ------------------
  174|  24.1k|    if (phdr[i].p_type == PT_PHDR)
  ------------------
  |  Branch (174:9): [True: 3.45k, False: 20.7k]
  ------------------
  175|  3.45k|      {
  176|  3.45k|        file_offset = phdr[i].p_vaddr - phdr[i].p_offset;
  177|  3.45k|      }
  178|  20.7k|    else if (phdr[i].p_type == PT_DYNAMIC)
  ------------------
  |  Branch (178:14): [True: 3.45k, False: 17.2k]
  ------------------
  179|  3.45k|      {
  180|  3.45k|        dyn = (Elf_W (Dyn) *) elf_w (get_program_segment) (ei, &phdr[i], NULL);
  ------------------
  |  |   45|  3.45k|# define elf_w(x)       _Uelf64_##x
  ------------------
  181|  3.45k|        break;
  182|  3.45k|      }
  183|       |
  184|  3.45k|  if (!dyn)
  ------------------
  |  Branch (184:7): [True: 0, False: 3.45k]
  ------------------
  185|      0|    return -UNW_ENOINFO;
  186|       |
  187|   107k|  for (; dyn->d_tag != DT_NULL; ++dyn)
  ------------------
  |  Branch (187:10): [True: 103k, False: 3.45k]
  ------------------
  188|   103k|    {
  189|   103k|      switch (dyn->d_tag)
  190|   103k|        {
  191|  3.45k|        case DT_SYMTAB:
  ------------------
  |  Branch (191:9): [True: 3.45k, False: 100k]
  ------------------
  192|  3.45k|          symtab = (Elf_W (Sym) *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset);
  193|  3.45k|          break;
  194|  3.45k|        case DT_STRTAB:
  ------------------
  |  Branch (194:9): [True: 3.45k, False: 100k]
  ------------------
  195|  3.45k|          strtab = (const char *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset);
  196|  3.45k|          break;
  197|  3.45k|        case DT_HASH:
  ------------------
  |  Branch (197:9): [True: 3.45k, False: 100k]
  ------------------
  198|  3.45k|          hash = (Elf_W (Word) *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset);
  199|  3.45k|          break;
  200|  3.45k|        case DT_GNU_HASH:
  ------------------
  |  Branch (200:9): [True: 3.45k, False: 100k]
  ------------------
  201|  3.45k|          {
  202|  3.45k|            Elf_W (Off) gh_file_offset = dynamic_va_to_file_offset (dyn->d_un.d_ptr, phdr, ehdr->e_phnum);
  ------------------
  |  |   44|  3.45k|# define Elf_W(x)       Elf64_##x
  ------------------
  203|  3.45k|            gnu_hash = (uint32_t *) ((char *) ei->image + gh_file_offset);
  204|  3.45k|            break;
  205|      0|          }
  206|  89.7k|        default:
  ------------------
  |  Branch (206:9): [True: 89.7k, False: 13.8k]
  ------------------
  207|  89.7k|          break;
  208|   103k|        }
  209|   103k|    }
  210|       |
  211|  3.45k|  if (!symtab || !strtab || (!hash && !gnu_hash))
  ------------------
  |  Branch (211:7): [True: 0, False: 3.45k]
  |  Branch (211:18): [True: 0, False: 3.45k]
  |  Branch (211:30): [True: 0, False: 3.45k]
  |  Branch (211:39): [True: 0, False: 0]
  ------------------
  212|      0|      return -UNW_ENOINFO;
  213|       |
  214|  3.45k|  if (elf_w (dynamic_symtab_count) (hash, gnu_hash, &sym_num) < 0)
  ------------------
  |  |   45|  3.45k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (214:7): [True: 0, False: 3.45k]
  ------------------
  215|      0|    return -UNW_ENOINFO;
  216|       |
  217|  10.8M|  for (i = 0; i < sym_num; ++i)
  ------------------
  |  Branch (217:15): [True: 10.8M, False: 3.45k]
  ------------------
  218|  10.8M|    {
  219|  10.8M|      sym = &symtab[i];
  220|  10.8M|      if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC && sym->st_shndx != SHN_UNDEF)
  ------------------
  |  |   43|  10.8M|# define ELF_W(x)       ELF64_##x
  ------------------
  |  Branch (220:11): [True: 9.94M, False: 945k]
  |  Branch (220:57): [True: 9.90M, False: 48.3k]
  ------------------
  221|  9.90M|        {
  222|  9.90M|          val = sym->st_value;
  223|  9.90M|          if (sym->st_shndx != SHN_ABS)
  ------------------
  |  Branch (223:15): [True: 9.90M, False: 0]
  ------------------
  224|  9.90M|            val += load_offset;
  225|  9.90M|          if (tdep_get_func_addr (as, val, &val, context->arg) < 0)
  ------------------
  |  |  439|  9.90M|# define tdep_get_func_addr(as,addr,v,arg)       (*(v) = addr, 0)
  ------------------
  |  Branch (225:15): [True: 0, False: 9.90M]
  ------------------
  226|      0|            continue;
  227|  9.90M|          Debug (16, "0x%016lx info=0x%02x %s\n",
  228|  9.90M|                 (long) val, sym->st_info, strtab + sym->st_name);
  229|       |
  230|  9.90M|          struct symbol_info syminfo =
  231|  9.90M|            {
  232|  9.90M|              .strtab = strtab,
  233|  9.90M|              .sym = sym,
  234|  9.90M|              .start_ip = val
  235|  9.90M|            };
  236|  9.90M|          ret = symtab_lookup (context, &syminfo, data);
  237|       |
  238|       |          /* Keep going if the IP is not found in this symtab entry. */
  239|  9.90M|          if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (239:15): [True: 9.90M, False: 0]
  ------------------
  240|  9.90M|            {
  241|  9.90M|              continue;
  242|  9.90M|            }
  243|       |
  244|      0|          break;
  245|  9.90M|        }
  246|  10.8M|    }
  247|       |
  248|  3.45k|  return ret;
  249|  3.45k|}
elf64.c:dynamic_va_to_file_offset:
  138|  3.45k|{
  139|  10.3k|  for (size_t i = 0; i < phnum; ++i)
  ------------------
  |  Branch (139:22): [True: 10.3k, False: 0]
  ------------------
  140|  10.3k|    {
  141|  10.3k|      if (phdr[i].p_type != PT_LOAD)
  ------------------
  |  Branch (141:11): [True: 6.90k, False: 3.45k]
  ------------------
  142|  6.90k|        continue;
  143|       |
  144|  3.45k|      if (va >= phdr[i].p_vaddr && (va + sizeof(Elf_W (Addr))) < phdr[i].p_vaddr + phdr[i].p_filesz)
  ------------------
  |  Branch (144:11): [True: 3.45k, False: 0]
  |  Branch (144:36): [True: 3.45k, False: 0]
  ------------------
  145|  3.45k|        return phdr[i].p_offset + (va - phdr[i].p_vaddr);
  146|  3.45k|    }
  147|      0|  return 0;
  148|  3.45k|}
elf64.c:_Uelf64_lookup_symbol_callback:
  360|  85.3M|{
  361|  85.3M|  struct symbol_callback_data *d = data;
  362|  85.3M|  int ret = -UNW_ENOINFO;
  363|       |
  364|  85.3M|  if (context->ip >= syminfo->start_ip &&
  ------------------
  |  Branch (364:7): [True: 23.9M, False: 61.4M]
  ------------------
  365|  23.9M|      context->ip < (syminfo->start_ip + syminfo->sym->st_size))
  ------------------
  |  Branch (365:7): [True: 27.6k, False: 23.8M]
  ------------------
  366|  27.6k|    {
  367|  27.6k|      if ((Elf_W (Addr)) (context->ip - syminfo->start_ip) < *(context->min_dist))
  ------------------
  |  Branch (367:11): [True: 27.6k, False: 0]
  ------------------
  368|  27.6k|        {
  369|  27.6k|          *(context->min_dist) = (Elf_W (Addr)) (context->ip - syminfo->start_ip);
  370|  27.6k|          char const* const sym_name     = syminfo->strtab + syminfo->sym->st_name;
  371|  27.6k|          size_t            sym_name_len = strlen(sym_name);
  372|  27.6k|          Debug (1, "candidate sym: %s@%#010lx\n", sym_name, syminfo->start_ip);
  373|  27.6k|          if (sym_name_len >= d->buf_len)
  ------------------
  |  Branch (373:15): [True: 0, False: 27.6k]
  ------------------
  374|      0|            {
  375|      0|              Debug (1, "symbol length %zu exceeds buffer of length %zu\n",
  376|      0|                     sym_name_len+1, d->buf_len);
  377|      0|              sym_name_len = d->buf_len - 1; /* adjust for null terminator */
  378|      0|              ret = -UNW_ENOMEM; /* indicate truncation of symbol name */
  379|      0|            }
  380|  27.6k|          else
  381|  27.6k|            {
  382|  27.6k|              ret = UNW_ESUCCESS;
  383|  27.6k|            }
  384|  27.6k|          memcpy(d->buf, sym_name, sym_name_len);
  385|  27.6k|          d->buf[sym_name_len] = 0; /* null terminate */
  386|  27.6k|        }
  387|  27.6k|    }
  388|       |
  389|  85.3M|  return ret;
  390|  85.3M|}
elf64.c:_Uelf64_extract_minidebuginfo:
  642|  31.0k|{
  643|  31.0k|  return 0;
  644|  31.0k|}
elf64.c:_Uelf64_section_table:
   86|   148k|{
   87|   148k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|   148k|# define Elf_W(x)       Elf64_##x
  ------------------
   88|   148k|  Elf_W (Off) soff;
  ------------------
  |  |   44|   148k|# define Elf_W(x)       Elf64_##x
  ------------------
   89|   148k|  size_t table_size;
   90|       |
   91|   148k|  soff = ehdr->e_shoff;
   92|   148k|  table_size = (size_t) ehdr->e_shnum * ehdr->e_shentsize;
   93|   148k|  if (soff > ei->size || table_size > ei->size - (size_t) soff)
  ------------------
  |  Branch (93:7): [True: 0, False: 148k]
  |  Branch (93:26): [True: 0, False: 148k]
  ------------------
   94|      0|    {
   95|      0|      Debug (1, "section table outside of image? (%lu + %zu > %zu)\n",
   96|      0|             (unsigned long) soff, table_size, ei->size);
   97|      0|      return NULL;
   98|      0|    }
   99|       |
  100|   148k|  return (Elf_W (Shdr) *) ((char *) ei->image + soff);
  101|   148k|}
elf64.c:_Uelf64_string_table:
  105|  86.3k|{
  106|  86.3k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  86.3k|# define Elf_W(x)       Elf64_##x
  ------------------
  107|  86.3k|  Elf_W (Shdr) *shdr = elf_w (section_table) (ei);
  ------------------
  |  |   44|  86.3k|# define Elf_W(x)       Elf64_##x
  ------------------
                Elf_W (Shdr) *shdr = elf_w (section_table) (ei);
  ------------------
  |  |   45|  86.3k|# define elf_w(x)       _Uelf64_##x
  ------------------
  108|  86.3k|  Elf_W (Shdr) *str_shdr;
  ------------------
  |  |   44|  86.3k|# define Elf_W(x)       Elf64_##x
  ------------------
  109|       |
  110|  86.3k|  if (!shdr)
  ------------------
  |  Branch (110:7): [True: 0, False: 86.3k]
  ------------------
  111|      0|    return NULL;
  112|       |
  113|  86.3k|  if (section >= ehdr->e_shnum)
  ------------------
  |  Branch (113:7): [True: 0, False: 86.3k]
  ------------------
  114|      0|    {
  115|      0|      Debug (1, "string table index outside of section table? (%lu >= %lu)\n",
  116|      0|             (unsigned long) section, (unsigned long) ehdr->e_shnum);
  117|      0|      return NULL;
  118|      0|    }
  119|  86.3k|  str_shdr = (Elf_W (Shdr) *) ((char *) shdr
  120|  86.3k|                               + (size_t) section * ehdr->e_shentsize);
  121|       |
  122|  86.3k|  if (str_shdr->sh_offset > ei->size
  ------------------
  |  Branch (122:7): [True: 0, False: 86.3k]
  ------------------
  123|  86.3k|      || str_shdr->sh_size > ei->size - str_shdr->sh_offset)
  ------------------
  |  Branch (123:10): [True: 0, False: 86.3k]
  ------------------
  124|      0|    {
  125|      0|      Debug (1, "string table outside of image? (%lu + %lu > %lu)\n",
  126|      0|             (unsigned long) str_shdr->sh_offset,
  127|      0|             (unsigned long) str_shdr->sh_size,
  128|      0|             (unsigned long) ei->size);
  129|      0|      return NULL;
  130|      0|    }
  131|       |
  132|  86.3k|  Debug (16, "strtab=0x%lx\n", (long) str_shdr->sh_offset);
  133|  86.3k|  return ei->image + str_shdr->sh_offset;
  134|  86.3k|}
elf64.c:_Uelf64_find_build_id_path:
  853|  31.0k|{
  854|       |/*
  855|       | * build-id is only available on GNU plaforms. So on non-GNU platforms this
  856|       | * function just returns fail (-1).
  857|       | */
  858|  31.0k|#if defined(ELF_NOTE_GNU) && defined(NT_GNU_BUILD_ID)
  859|  31.0k|  const Elf_W (Ehdr) *ehdr = ei->image;
  860|  31.0k|  const Elf_W (Phdr) *phdr;
  861|  31.0k|  unsigned i;
  862|       |
  863|  31.0k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (863:7): [True: 0, False: 31.0k]
  ------------------
  864|      0|    return -1;
  865|       |
  866|  31.0k|  phdr = (Elf_W (Phdr) *) ((uint8_t *) ehdr + ehdr->e_phoff);
  867|       |
  868|   424k|  for (i = 0; i < ehdr->e_phnum; ++i, phdr = (const Elf_W (Phdr) *) (((const uint8_t *) phdr) + ehdr->e_phentsize))
  ------------------
  |  Branch (868:15): [True: 400k, False: 24.1k]
  ------------------
  869|   400k|    {
  870|   400k|      const uint8_t *notes;
  871|   400k|      const uint8_t *notes_end;
  872|       |
  873|       |      /* The build-id is in a note section */
  874|   400k|      if (phdr->p_type != PT_NOTE)
  ------------------
  |  Branch (874:11): [True: 338k, False: 62.1k]
  ------------------
  875|   338k|        continue;
  876|       |
  877|  62.1k|      notes = elf_w (get_program_segment) (ei, phdr, &notes_end);
  ------------------
  |  |   45|  62.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  878|       |
  879|   117k|      while((size_t) (notes_end - notes) >= sizeof(Elf_W(Nhdr)))
  ------------------
  |  Branch (879:13): [True: 62.1k, False: 55.2k]
  ------------------
  880|  62.1k|        {
  881|  62.1k|          const char prefix[] = "/usr/lib/debug/.build-id/";
  882|       |
  883|       |          /* See "man 5 elf" for notes about alignment in Nhdr */
  884|  62.1k|          const Elf_W(Nhdr) *nhdr = (const Elf_W(Nhdr) *) notes;
  885|  62.1k|          const Elf_W(Word) namesz = nhdr->n_namesz;
  886|  62.1k|          const Elf_W(Word) descsz = nhdr->n_descsz;
  887|  62.1k|          const size_t nameasz = UNW_ALIGN(namesz, 4); /* Aligned size */
  ------------------
  |  |  447|  62.1k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  888|  62.1k|          const size_t descasz = UNW_ALIGN(descsz, 4);
  ------------------
  |  |  447|  62.1k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  889|  62.1k|          const size_t avail = (size_t) (notes_end - notes) - sizeof(*nhdr);
  890|  62.1k|          const char *name = (const char *) (nhdr + 1);
  891|  62.1k|          const uint8_t *desc = (const uint8_t *) name + nameasz;
  892|  62.1k|          unsigned j;
  893|       |
  894|       |          /* The note sizes come from the file: keep name and desc inside the
  895|       |             segment, as _UCD_elf_visit_notes() does for core file notes. */
  896|  62.1k|          if (nameasz > avail || descasz > avail - nameasz)
  ------------------
  |  Branch (896:15): [True: 0, False: 62.1k]
  |  Branch (896:34): [True: 0, False: 62.1k]
  ------------------
  897|      0|            break;
  898|       |
  899|  62.1k|          notes += sizeof(*nhdr) + nameasz + descasz;
  900|       |
  901|  62.1k|          if ((namesz != sizeof(ELF_NOTE_GNU)) ||  /* Spec says must be "GNU" with a NULL */
  ------------------
  |  Branch (901:15): [True: 0, False: 62.1k]
  ------------------
  902|  62.1k|              (nhdr->n_type != NT_GNU_BUILD_ID) || /* Spec says must be NT_GNU_BUILD_ID   */
  ------------------
  |  Branch (902:15): [True: 55.2k, False: 6.90k]
  ------------------
  903|  6.90k|              (descsz == 0) ||                     /* Need at least one byte of build-id  */
  ------------------
  |  Branch (903:15): [True: 0, False: 6.90k]
  ------------------
  904|  6.90k|              (strcmp(name, ELF_NOTE_GNU) != 0))   /* Must be "GNU" with NULL termination */
  ------------------
  |  Branch (904:15): [True: 0, False: 6.90k]
  ------------------
  905|  55.2k|            continue;
  906|       |
  907|       |          /* Validate that we have enough space */
  908|  6.90k|          if (path_len < (sizeof(prefix) +     /* Path prefix inc NULL */
  ------------------
  |  Branch (908:15): [True: 0, False: 6.90k]
  ------------------
  909|  6.90k|                          2 +                  /* Subdirectory         */
  910|  6.90k|                          1 +                  /* Directory separator  */
  911|  6.90k|                          (2 * (descsz - 1)) + /* Leaf filename        */
  912|  6.90k|                          6))                  /* .debug extension     */
  913|      0|            return -1;
  914|       |
  915|  6.90k|          memcpy(path, prefix, sizeof(prefix));
  916|       |
  917|  6.90k|          path = elf_w (add_hex_byte) (path + sizeof(prefix) - 1, *desc);
  ------------------
  |  |   45|  6.90k|# define elf_w(x)       _Uelf64_##x
  ------------------
  918|  6.90k|          *path++ = '/';
  919|       |
  920|   138k|          for(j = 1, ++desc; j < descsz; ++j, ++desc)
  ------------------
  |  Branch (920:30): [True: 131k, False: 6.90k]
  ------------------
  921|   131k|            path = elf_w (add_hex_byte) (path, *desc);
  ------------------
  |  |   45|   131k|# define elf_w(x)       _Uelf64_##x
  ------------------
  922|       |
  923|  6.90k|          strcat(path, ".debug");
  924|       |
  925|  6.90k|          return 0;
  926|  6.90k|        }
  927|  62.1k|    }
  928|  24.1k|#endif /* defined(ELF_NOTE_GNU) */
  929|       |
  930|  24.1k|  return -1;
  931|  31.0k|}
elf64.c:_Uelf64_add_hex_byte:
  840|   138k|{
  841|   138k|  const char hex[] = "0123456789abcdef";
  842|       |
  843|   138k|  *str++ = hex[byte >> 4];
  844|   138k|  *str++ = hex[byte & 0xf];
  845|   138k|  *str = 0;
  846|       |
  847|   138k|  return str;
  848|   138k|}
elf64.c:_Uelf64_load_debuglink_file:
  974|  20.7k|{
  975|  20.7k|  uint32_t file_crc;
  976|       |
  977|  20.7k|  if (elf_w (load_debuginfo) (file, ei, -1) != 0)
  ------------------
  |  |   45|  20.7k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (977:7): [True: 20.7k, False: 0]
  ------------------
  978|  20.7k|    {
  979|  20.7k|      ei->image = NULL;
  980|  20.7k|      return -1;
  981|  20.7k|    }
  982|       |
  983|      0|  file_crc = debuglink_crc32 (ei->image, ei->size);
  984|      0|  if (file_crc != crc)
  ------------------
  |  Branch (984:7): [True: 0, False: 0]
  ------------------
  985|      0|    {
  986|      0|      Debug (1, "CRC mismatch for debug file %s (%08x, expected %08x)\n",
  987|      0|             file, file_crc, crc);
  988|      0|      mi_munmap (ei->image, ei->size);
  989|      0|      ei->image = NULL;
  990|      0|      return -1;
  991|      0|    }
  992|       |
  993|      0|  return 0;
  994|      0|}

elf64.c:_Uelf64_get_program_segment:
  121|  65.5k|{
  122|  65.5k|  const uint8_t* result = NULL;
  123|       |
  124|  65.5k|  if (end)
  ------------------
  |  Branch (124:7): [True: 62.1k, False: 3.45k]
  ------------------
  125|  62.1k|    *end = NULL;
  126|       |
  127|  65.5k|  if (!ei || !ei->image || !phdr || phdr->p_filesz == 0 || phdr->p_offset > ei->size
  ------------------
  |  Branch (127:7): [True: 0, False: 65.5k]
  |  Branch (127:14): [True: 0, False: 65.5k]
  |  Branch (127:28): [True: 0, False: 65.5k]
  |  Branch (127:37): [True: 0, False: 65.5k]
  |  Branch (127:60): [True: 0, False: 65.5k]
  ------------------
  128|  65.5k|      || phdr->p_filesz > ei->size - phdr->p_offset)
  ------------------
  |  Branch (128:10): [True: 0, False: 65.5k]
  ------------------
  129|      0|    return NULL;
  130|       |
  131|  65.5k|  result = ((const uint8_t*)ei->image) + phdr->p_offset;
  132|  65.5k|  if (end)
  ------------------
  |  Branch (132:7): [True: 62.1k, False: 3.45k]
  ------------------
  133|  62.1k|    *end = result + phdr->p_filesz;
  134|       |
  135|  65.5k|  return result;
  136|  65.5k|}
elf64.c:_Uelf64_valid_object:
   77|  93.2k|{
   78|  93.2k|  if (ei->size <= EI_VERSION)
  ------------------
  |  Branch (78:7): [True: 0, False: 93.2k]
  ------------------
   79|      0|    return 0;
   80|       |
   81|  93.2k|  return (memcmp (ei->image, ELFMAG, SELFMAG) == 0
  ------------------
  |  Branch (81:11): [True: 93.2k, False: 0]
  ------------------
   82|  93.2k|          && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS
  ------------------
  |  |    5|  93.2k|# define UNW_ELF_CLASS UNW_ELFCLASS64
  |  |  ------------------
  |  |  |  |   82|   186k|# define UNW_ELFCLASS64 ELFCLASS64
  |  |  ------------------
  ------------------
  |  Branch (82:14): [True: 93.2k, False: 0]
  ------------------
   83|  93.2k|          && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE
  ------------------
  |  Branch (83:14): [True: 93.2k, False: 0]
  ------------------
   84|  93.2k|          && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT);
  ------------------
  |  Branch (84:14): [True: 93.2k, False: 0]
  ------------------
   85|  93.2k|}
elf64.c:elf_map_image:
   89|  27.6k|{
   90|  27.6k|  struct stat stat;
   91|  27.6k|  int fd;
   92|       |
   93|  27.6k|  fd = open (path, O_RDONLY);
   94|  27.6k|  if (fd < 0)
  ------------------
  |  Branch (94:7): [True: 27.6k, False: 0]
  ------------------
   95|  27.6k|    return -1;
   96|       |
   97|      0|  if (fstat (fd, &stat) < 0)
  ------------------
  |  Branch (97:7): [True: 0, False: 0]
  ------------------
   98|      0|    {
   99|      0|      close (fd);
  100|      0|      return -1;
  101|      0|    }
  102|       |
  103|      0|  ei->size = stat.st_size;
  104|      0|  ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
  105|      0|  close (fd);
  106|      0|  if (ei->image == MAP_FAILED)
  ------------------
  |  Branch (106:7): [True: 0, False: 0]
  ------------------
  107|      0|    return -1;
  108|       |
  109|      0|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (109:7): [True: 0, False: 0]
  ------------------
  110|      0|  {
  111|      0|    mi_munmap(ei->image, ei->size);
  112|      0|    ei->image = NULL;
  113|      0|    return -1;
  114|      0|  }
  115|       |
  116|      0|  return 0;
  117|      0|}
os-linux.c:elf_map_image:
   89|  31.0k|{
   90|  31.0k|  struct stat stat;
   91|  31.0k|  int fd;
   92|       |
   93|  31.0k|  fd = open (path, O_RDONLY);
   94|  31.0k|  if (fd < 0)
  ------------------
  |  Branch (94:7): [True: 0, False: 31.0k]
  ------------------
   95|      0|    return -1;
   96|       |
   97|  31.0k|  if (fstat (fd, &stat) < 0)
  ------------------
  |  Branch (97:7): [True: 0, False: 31.0k]
  ------------------
   98|      0|    {
   99|      0|      close (fd);
  100|      0|      return -1;
  101|      0|    }
  102|       |
  103|  31.0k|  ei->size = stat.st_size;
  104|  31.0k|  ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
  105|  31.0k|  close (fd);
  106|  31.0k|  if (ei->image == MAP_FAILED)
  ------------------
  |  Branch (106:7): [True: 0, False: 31.0k]
  ------------------
  107|      0|    return -1;
  108|       |
  109|  31.0k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  31.0k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (109:7): [True: 0, False: 31.0k]
  ------------------
  110|      0|  {
  111|      0|    mi_munmap(ei->image, ei->size);
  112|      0|    ei->image = NULL;
  113|      0|    return -1;
  114|      0|  }
  115|       |
  116|  31.0k|  return 0;
  117|  31.0k|}
os-linux.c:_Uelf64_valid_object:
   77|  31.0k|{
   78|  31.0k|  if (ei->size <= EI_VERSION)
  ------------------
  |  Branch (78:7): [True: 0, False: 31.0k]
  ------------------
   79|      0|    return 0;
   80|       |
   81|  31.0k|  return (memcmp (ei->image, ELFMAG, SELFMAG) == 0
  ------------------
  |  Branch (81:11): [True: 31.0k, False: 0]
  ------------------
   82|  31.0k|          && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS
  ------------------
  |  |    5|  31.0k|# define UNW_ELF_CLASS UNW_ELFCLASS64
  |  |  ------------------
  |  |  |  |   82|  62.1k|# define UNW_ELFCLASS64 ELFCLASS64
  |  |  ------------------
  ------------------
  |  Branch (82:14): [True: 31.0k, False: 0]
  ------------------
   83|  31.0k|          && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE
  ------------------
  |  Branch (83:14): [True: 31.0k, False: 0]
  ------------------
   84|  31.0k|          && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT);
  ------------------
  |  Branch (84:14): [True: 31.0k, False: 0]
  ------------------
   85|  31.0k|}

elf64.c:_Uelf64_dynamic_symtab_count:
   33|  3.45k|{
   34|       |
   35|  3.45k|  if (!sym_num || (!hash && !gnu_hash))
  ------------------
  |  Branch (35:7): [True: 0, False: 3.45k]
  |  Branch (35:20): [True: 0, False: 3.45k]
  |  Branch (35:29): [True: 0, False: 0]
  ------------------
   36|      0|    return -UNW_ENOINFO;
   37|       |
   38|       |  /* Prefer the SYSV hash table when present since, unlike the GNU
   39|       |     hash, it directly encodes the symbol count. */
   40|  3.45k|  if (hash)
  ------------------
  |  Branch (40:7): [True: 3.45k, False: 0]
  ------------------
   41|  3.45k|    {
   42|  3.45k|      *sym_num = hash[1];
   43|  3.45k|    }
   44|      0|  else
   45|      0|    {
   46|      0|      uint32_t nbuckets   = gnu_hash[0];
   47|      0|      uint32_t symoffset  = gnu_hash[1];
   48|      0|      uint32_t bloom_size = gnu_hash[2];
   49|      0|      Elf_W (Addr) *bloom = (Elf_W (Addr) *) &gnu_hash[4];
  ------------------
  |  |   44|      0|# define Elf_W(x)       Elf64_##x
  ------------------
   50|      0|      uint32_t *buckets   = (uint32_t *) (bloom + bloom_size);
   51|      0|      uint32_t i;
   52|      0|      Elf_W (Word) count;
  ------------------
  |  |   44|      0|# define Elf_W(x)       Elf64_##x
  ------------------
   53|       |
   54|      0|      for (i = 0, count = 0; i < nbuckets; ++i)
  ------------------
  |  Branch (54:30): [True: 0, False: 0]
  ------------------
   55|      0|	if (buckets[i] != 0)
  ------------------
  |  Branch (55:6): [True: 0, False: 0]
  ------------------
   56|      0|	  {
   57|      0|	    if (buckets[i] < count)
  ------------------
  |  Branch (57:10): [True: 0, False: 0]
  ------------------
   58|      0|	      return -UNW_ENOINFO;
   59|      0|	    count = buckets[i];
   60|      0|	  }
   61|       |
   62|      0|      if (count)
  ------------------
  |  Branch (62:11): [True: 0, False: 0]
  ------------------
   63|      0|	{
   64|      0|	  uint32_t *hashval;
   65|       |
   66|      0|	  if (count < symoffset)
  ------------------
  |  Branch (66:8): [True: 0, False: 0]
  ------------------
   67|      0|	    return -UNW_ENOINFO;
   68|       |
   69|      0|	  hashval = buckets + nbuckets + (count - symoffset);
   70|      0|	  do
   71|      0|	    ++count;
   72|      0|	  while (!(*hashval++ & 1));
  ------------------
  |  Branch (72:11): [True: 0, False: 0]
  ------------------
   73|      0|	}
   74|       |
   75|      0|      *sym_num = count;
   76|      0|    }
   77|       |
   78|  3.45k|  return 0;
   79|  3.45k|}

_UIx86_64_address_is_valid:
  250|   192k|{
  251|   192k|  if (len == 0)
  ------------------
  |  Branch (251:7): [True: 0, False: 192k]
  ------------------
  252|      0|    return true;
  253|       |
  254|       |  /*
  255|       |   * Find the starting address of the page containing the start of the range.
  256|       |   */
  257|   192k|  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|   192k|  if (start_page_addr == 0)
  ------------------
  |  Branch (265:7): [True: 0, False: 192k]
  ------------------
  266|      0|    return false;
  267|       |
  268|       |  /*
  269|       |   * Bounds check on top of memory. Unsigned wraparound could be hazardous.
  270|       |   */
  271|   192k|  if (addr > (UNW_WORD_MAX - len - unw_page_size))
  ------------------
  |  |   61|   192k|#define UNW_WORD_MAX UINT64_MAX
  ------------------
  |  Branch (271:7): [True: 0, False: 192k]
  ------------------
  272|      0|    return false;
  273|       |
  274|       |  /*
  275|       |   * Find the starting address of the page containing the end of the range.
  276|       |   */
  277|   192k|  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|   192k|  for (unw_word_t page_addr = start_page_addr;
  285|   384k|       page_addr < end_page_addr;
  ------------------
  |  Branch (285:8): [True: 192k, False: 192k]
  ------------------
  286|   192k|       page_addr += unw_page_size)
  287|   192k|    {
  288|   192k|      if (!_is_cached_valid_mem(page_addr))
  ------------------
  |  Branch (288:11): [True: 4.85k, False: 187k]
  ------------------
  289|  4.85k|        {
  290|       |          /* Check 'addr' in first page to avoid uninitialized memory access. */
  291|  4.85k|          if (!_write_validate ((page_addr == start_page_addr) ? addr : page_addr))
  ------------------
  |  Branch (291:15): [True: 0, False: 4.85k]
  |  Branch (291:33): [True: 4.85k, False: 0]
  ------------------
  292|      0|            {
  293|      0|              Debug(1, "returning false\n");
  294|      0|              return false;
  295|      0|            }
  296|  4.85k|          _cache_valid_mem(page_addr);
  297|  4.85k|        }
  298|   192k|    }
  299|       |
  300|   192k|  return true;
  301|   192k|}
Laddress_validator.c:_is_cached_valid_mem:
  195|   192k|{
  196|   192k|  int i;
  197|   458k|  for (i = 0; i < NLGA; i++)
  ------------------
  |  Branch (197:15): [True: 453k, False: 4.85k]
  ------------------
  198|   453k|    {
  199|   453k|      if (page_addr == atomic_load(&last_good_addr[i]))
  ------------------
  |  Branch (199:11): [True: 187k, False: 265k]
  ------------------
  200|   187k|        return true;
  201|   453k|    }
  202|  4.85k|  return false;
  203|   192k|}
Laddress_validator.c:_write_validate:
  101|  4.85k|{
  102|  4.85k|  int ret = -1;
  103|  4.85k|  ssize_t bytes = 0;
  104|       |
  105|  4.85k|  if (unlikely (_mem_validate_pipe[0] == -1))
  ------------------
  |  |   68|  4.85k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 1, False: 4.85k]
  |  |  ------------------
  ------------------
  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|  4.85k|  do
  114|  4.85k|    {
  115|  4.85k|      char buf;
  116|  4.85k|      bytes = read (_mem_validate_pipe[0], &buf, 1);
  117|  4.85k|    }
  118|  4.85k|  while ( errno == EINTR );
  ------------------
  |  Branch (118:11): [True: 0, False: 4.85k]
  ------------------
  119|       |
  120|  4.85k|  if (!(bytes > 0 || errno == EAGAIN || errno == EWOULDBLOCK))
  ------------------
  |  Branch (120:9): [True: 4.85k, 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|  4.85k|  do
  130|  4.85k|    {
  131|  4.85k|#ifdef HAVE_SYS_SYSCALL_H
  132|       |      /* use syscall insteadof write() so that ASAN does not complain */
  133|  4.85k|      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|  4.85k|    }
  138|  4.85k|  while ( errno == EINTR );
  ------------------
  |  Branch (138:11): [True: 0, False: 4.85k]
  ------------------
  139|       |
  140|  4.85k|  return ret > 0;
  141|  4.85k|}
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|  4.85k|{
  216|  4.85k|  unw_word_t zero = 0;
  217|  4.85k|  int victim = atomic_load(&lga_victim);
  218|  24.2k|  for (int i = 0; i < NLGA; i++)
  ------------------
  |  Branch (218:19): [True: 19.4k, False: 4.85k]
  ------------------
  219|  19.4k|    {
  220|  19.4k|      if (atomic_compare_exchange_strong(&last_good_addr[victim], &zero, page_addr))
  ------------------
  |  Branch (220:11): [True: 4, False: 19.4k]
  ------------------
  221|      4|        {
  222|      4|          return;
  223|      4|        }
  224|  19.4k|      victim = (victim + 1) % NLGA;
  225|  19.4k|    }
  226|       |
  227|       |  /* All slots full. Evict the victim. */
  228|  4.85k|  atomic_store(&last_good_addr[victim], page_addr);
  229|  4.85k|  victim = (victim + 1) % NLGA;
  230|       |  atomic_store(&lga_victim, victim);
  231|  4.85k|}

_ULx86_64_Ifind_dynamic_proc_info:
   90|  31.0k|{
   91|  31.0k|  if (as == unw_local_addr_space)
  ------------------
  |  |  274|  31.0k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  31.0k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (91:7): [True: 31.0k, False: 0]
  ------------------
   92|  31.0k|    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|  31.0k|}
Lfind_dynamic_proc_info.c:local_find_proc_info:
   42|  31.0k|{
   43|  31.0k|  unw_dyn_info_list_t *list;
   44|  31.0k|  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|  31.0k|  list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr ();
   54|  31.0k|  for (di = list->first; di; di = di->next)
  ------------------
  |  Branch (54:26): [True: 0, False: 31.0k]
  ------------------
   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|  31.0k|  return -UNW_ENOINFO;
   59|  31.0k|}

_Ux86_64_get_accessors:
   34|   137k|{
   35|   137k|  if (!atomic_load(&tdep_init_done))
  ------------------
  |  Branch (35:7): [True: 0, False: 137k]
  ------------------
   36|      0|    tdep_init ();
  ------------------
  |  |  233|      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|   137k|  return &as->acc;
   38|   137k|}

_ULx86_64_get_proc_name_by_ip:
   52|  31.0k|{
   53|  31.0k|  unw_accessors_t *a = unw_get_accessors_int (as);
  ------------------
  |  |  278|  31.0k|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|  31.0k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  31.0k|  unw_proc_info_t pi;
   55|  31.0k|  int ret;
   56|       |
   57|  31.0k|  buf[0] = '\0';        /* always return a valid string, even if it's empty */
   58|       |
   59|  31.0k|  ret = unwi_find_dynamic_proc_info (as, ip, &pi, 1, arg);
  ------------------
  |  |  268|  31.0k|#define unwi_find_dynamic_proc_info     UNWI_OBJ(find_dynamic_proc_info)
  |  |  ------------------
  |  |  |  |  173|  31.0k|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|  31.0k|  if (ret == 0)
  ------------------
  |  Branch (60:7): [True: 0, False: 31.0k]
  ------------------
   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|  31.0k|  if (ret != -UNW_ENOINFO)
  ------------------
  |  Branch (88:7): [True: 0, False: 31.0k]
  ------------------
   89|      0|    return ret;
   90|       |
   91|       |  /* not a dynamic procedure, try to lookup static procedure name: */
   92|       |
   93|  31.0k|  if (a->get_proc_name)
  ------------------
  |  Branch (93:7): [True: 31.0k, False: 0]
  ------------------
   94|  31.0k|    return (*a->get_proc_name) (as, ip, buf, buf_len, offp, arg);
   95|       |
   96|      0|  return -UNW_ENOINFO;
   97|  31.0k|}
_ULx86_64_get_proc_name:
  102|  31.0k|{
  103|  31.0k|  struct cursor *c = (struct cursor *) cursor;
  104|  31.0k|  unw_word_t ip;
  105|  31.0k|  int error;
  106|       |
  107|  31.0k|  ip = tdep_get_ip (c);
  ------------------
  |  |  271|  31.0k|#define tdep_get_ip(c)                  ((c)->dwarf.ip)
  ------------------
  108|  31.0k|#if !defined(__ia64__)
  109|  31.0k|  if (c->dwarf.use_prev_instr)
  ------------------
  |  Branch (109:7): [True: 31.0k, False: 0]
  ------------------
  110|  31.0k|    {
  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|  31.0k|      --ip;
  116|  31.0k|    }
  117|       |
  118|       |
  119|  31.0k|#endif
  120|  31.0k|  error = unw_get_proc_name_by_ip (tdep_get_as (c), ip, buf, buf_len, offp,
  ------------------
  |  |  297|  31.0k|#define unw_get_proc_name_by_ip		UNW_OBJ(get_proc_name_by_ip)
  |  |  ------------------
  |  |  |  |   48|  31.0k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  31.0k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  31.0k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                error = unw_get_proc_name_by_ip (tdep_get_as (c), ip, buf, buf_len, offp,
  ------------------
  |  |  269|  31.0k|#define tdep_get_as(c)                  ((c)->dwarf.as)
  ------------------
  121|  31.0k|                                   tdep_get_as_arg (c));
  ------------------
  |  |  270|  31.0k|#define tdep_get_as_arg(c)              ((c)->dwarf.as_arg)
  ------------------
  122|  31.0k|#if !defined(__ia64__)
  123|  31.0k|  if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
  ------------------
  |  Branch (123:7): [True: 31.0k, False: 0]
  |  Branch (123:34): [True: 31.0k, False: 0]
  |  Branch (123:50): [True: 27.6k, False: 3.45k]
  ------------------
  124|  27.6k|    *offp += 1;
  125|  31.0k|#endif
  126|  31.0k|  return error;
  127|  31.0k|}

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

_ULx86_64_Iiterate_phdr_for_ip:
  111|     16|{
  112|     16|  intrmask_t saved_mask;
  113|     16|  int ret;
  114|       |
  115|     16|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
  ------------------
  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  ------------------
  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  116|     16|#if defined(HAVE__DL_FIND_OBJECT) && defined(HAVE_DL_ITERATE_PHDR)
  117|     16|  if (as->iterate_phdr_function == dl_iterate_phdr)
  ------------------
  |  Branch (117:7): [True: 16, False: 0]
  ------------------
  118|     16|    {
  119|     16|      struct dl_phdr_info info;
  120|       |
  121|     16|      ret = find_object_phdr_info (ip, &info);
  122|     16|      if (ret >= 0)
  ------------------
  |  Branch (122:11): [True: 16, False: 0]
  ------------------
  123|     16|        {
  124|     16|          if (ret > 0)
  ------------------
  |  Branch (124:15): [True: 16, False: 0]
  ------------------
  125|     16|            ret = callback (&info, sizeof (info), data);
  126|     16|          SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  ------------------
  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  ------------------
  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  127|     16|          return ret;
  128|     16|        }
  129|      0|      Debug (3, "cannot locate program headers for IP=0x%lx, "
  130|      0|             "falling back to dl_iterate_phdr\n", (long) ip);
  131|      0|    }
  132|      0|#endif
  133|      0|  ret = as->iterate_phdr_function (callback, data);
  134|       |  SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  ------------------
  |  |  195|      0|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  196|      0|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  135|      0|  return ret;
  136|     16|}
Literate_phdr_for_ip.c:find_object_phdr_info:
   46|     16|{
   47|     16|  struct dl_find_object dlfo, main_dlfo;
   48|     16|  const ElfW(Ehdr) *ehdr;
   49|     16|  const ElfW(Phdr) *phdr;
   50|     16|  uintptr_t bias, start, size;
   51|     16|  size_t phnum, n;
   52|       |
   53|     16|  if (_dl_find_object ((void *) (uintptr_t) ip, &dlfo) != 0)
  ------------------
  |  Branch (53:7): [True: 0, False: 16]
  ------------------
   54|      0|    return 0;
   55|       |
   56|     16|  bias = dlfo.dlfo_link_map->l_addr;
   57|       |
   58|     16|  if (_dl_find_object ((void *) getauxval (AT_ENTRY), &main_dlfo) == 0
  ------------------
  |  Branch (58:7): [True: 16, False: 0]
  ------------------
   59|     16|      && main_dlfo.dlfo_link_map == dlfo.dlfo_link_map
  ------------------
  |  Branch (59:10): [True: 14, False: 2]
  ------------------
   60|     14|      && getauxval (AT_PHENT) == sizeof (ElfW(Phdr)))
  ------------------
  |  Branch (60:10): [True: 14, False: 0]
  ------------------
   61|     14|    {
   62|     14|      phdr = (const ElfW(Phdr) *) getauxval (AT_PHDR);
   63|     14|      phnum = getauxval (AT_PHNUM);
   64|     14|      goto found;
   65|     14|    }
   66|       |
   67|      2|  start = (uintptr_t) dlfo.dlfo_map_start;
   68|      2|  size = (uintptr_t) dlfo.dlfo_map_end - start;
   69|      2|  ehdr = (const ElfW(Ehdr) *) start;
   70|       |
   71|      2|  if (size < sizeof (*ehdr)
  ------------------
  |  Branch (71:7): [True: 0, False: 2]
  ------------------
   72|      2|      || memcmp (ehdr->e_ident, ELFMAG, SELFMAG) != 0
  ------------------
  |  Branch (72:10): [True: 0, False: 2]
  ------------------
   73|      2|      || ehdr->e_phentsize != sizeof (ElfW(Phdr))
  ------------------
  |  Branch (73:10): [True: 0, False: 2]
  ------------------
   74|      2|      || ehdr->e_phoff > size
  ------------------
  |  Branch (74:10): [True: 0, False: 2]
  ------------------
   75|      2|      || ehdr->e_phnum > (size - ehdr->e_phoff) / sizeof (ElfW(Phdr)))
  ------------------
  |  Branch (75:10): [True: 0, False: 2]
  ------------------
   76|      0|    return -1;
   77|       |
   78|      2|  phdr = (const ElfW(Phdr) *) (start + ehdr->e_phoff);
   79|      2|  phnum = ehdr->e_phnum;
   80|       |
   81|     30|  for (n = 0; n < phnum; n++)
  ------------------
  |  Branch (81:15): [True: 28, False: 2]
  ------------------
   82|     28|    if (phdr[n].p_type == PT_PHDR && bias + phdr[n].p_vaddr != (uintptr_t) phdr)
  ------------------
  |  Branch (82:9): [True: 2, False: 26]
  |  Branch (82:38): [True: 0, False: 2]
  ------------------
   83|      0|      return -1;
   84|       |
   85|       |  /* The segment mapping file offset 0 holds the ELF header. */
   86|      6|  for (n = 0; n < phnum; n++)
  ------------------
  |  Branch (86:15): [True: 6, False: 0]
  ------------------
   87|      6|    if (phdr[n].p_type == PT_LOAD && phdr[n].p_offset == 0)
  ------------------
  |  Branch (87:9): [True: 2, False: 4]
  |  Branch (87:38): [True: 2, False: 0]
  ------------------
   88|      2|      break;
   89|      2|  if (n == phnum || bias + phdr[n].p_vaddr != start)
  ------------------
  |  Branch (89:7): [True: 0, False: 2]
  |  Branch (89:21): [True: 0, False: 2]
  ------------------
   90|      0|    return -1;
   91|       |
   92|     16|found:
   93|     16|  memset (info, 0, sizeof (*info));
   94|     16|  info->dlpi_addr = bias;
   95|     16|  info->dlpi_name = dlfo.dlfo_link_map->l_name;
   96|     16|  info->dlpi_phdr = phdr;
   97|     16|  info->dlpi_phnum = phnum;
   98|     16|  return 1;
   99|      2|}

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

_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);
  ------------------
  |  |  447|      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);
  ------------------
  |  |  447|      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|     16|{
  135|     16|  intrmask_t saved_mask;
  136|     16|  struct object *obj;
  137|       |
  138|     16|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     16|#define lock_acquire(l,m)                               \
  |  |  212|     16|do {                                                    \
  |  |  213|     16|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     16|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     16|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     16|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 16]
  |  |  ------------------
  ------------------
  139|     16|  {
  140|     16|    if (pool->num_free <= pool->reserve)
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      expand (pool);
  142|       |
  143|     16|    assert (pool->num_free > 0);
  ------------------
  |  Branch (143:5): [True: 0, False: 16]
  |  Branch (143:5): [True: 16, False: 0]
  ------------------
  144|       |
  145|     16|    --pool->num_free;
  146|     16|    obj = pool->free_list;
  147|     16|    pool->free_list = obj->next;
  148|     16|  }
  149|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     16|#define lock_release(l,m)                       \
  |  |  217|     16|do {                                            \
  |  |  218|     16|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     16|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     16|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     16|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 16]
  |  |  ------------------
  ------------------
  150|     16|  return obj;
  151|     16|}
_UIx86_64__mempool_free:
  155|     16|{
  156|     16|  intrmask_t saved_mask;
  157|       |
  158|     16|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     16|#define lock_acquire(l,m)                               \
  |  |  212|     16|do {                                                    \
  |  |  213|     16|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     16|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     16|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     16|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 16]
  |  |  ------------------
  ------------------
  159|     16|  {
  160|     16|    free_object (pool, object);
  161|     16|  }
  162|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     16|#define lock_release(l,m)                       \
  |  |  217|     16|do {                                            \
  |  |  218|     16|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     16|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     16|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     16|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     16|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     16|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 16]
  |  |  ------------------
  ------------------
  163|     16|}
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);
  ------------------
  |  |  447|      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|     88|{
   70|     88|  struct object *obj = object;
   71|       |
   72|     88|  obj->next = pool->free_list;
   73|     88|  pool->free_list = obj;
   74|     88|  ++pool->num_free;
   75|     88|}

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

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

_ULx86_64_get_save_loc:
   32|  9.41k|{
   33|  9.41k|  struct cursor *c = (struct cursor *) cursor;
   34|  9.41k|  dwarf_loc_t loc;
   35|       |
   36|  9.41k|  loc = DWARF_NULL_LOC;         /* default to "not saved" */
  ------------------
  |  |  156|  9.41k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  151|  9.41k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   37|       |
   38|  9.41k|  switch (reg)
   39|  9.41k|    {
   40|    270|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|    270|#define RBX     3
  ------------------
  |  Branch (40:5): [True: 270, False: 9.14k]
  ------------------
   41|    216|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|    216|#define RSP     7
  ------------------
  |  Branch (41:5): [True: 216, False: 9.19k]
  ------------------
   42|     63|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|     63|#define RBP     6
  ------------------
  |  Branch (42:5): [True: 63, False: 9.35k]
  ------------------
   43|    216|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|    216|#define R12     12
  ------------------
  |  Branch (43:5): [True: 216, False: 9.19k]
  ------------------
   44|  1.04k|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|  1.04k|#define R13     13
  ------------------
  |  Branch (44:5): [True: 1.04k, False: 8.37k]
  ------------------
   45|     63|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|     63|#define R14     14
  ------------------
  |  Branch (45:5): [True: 63, False: 9.35k]
  ------------------
   46|    711|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|    711|#define R15     15
  ------------------
  |  Branch (46:5): [True: 711, False: 8.70k]
  ------------------
   47|     90|    case UNW_X86_64_RIP: loc = c->dwarf.loc[RIP]; break;
  ------------------
  |  |   59|     90|#define RIP     16
  ------------------
  |  Branch (47:5): [True: 90, False: 9.32k]
  ------------------
   48|       |
   49|  6.74k|    default:
  ------------------
  |  Branch (49:5): [True: 6.74k, False: 2.67k]
  ------------------
   50|  6.74k|      break;
   51|  9.41k|    }
   52|       |
   53|  9.41k|  memset (sloc, 0, sizeof (*sloc));
   54|       |
   55|  9.41k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  157|  9.41k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  140|  9.41k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (157:33): [True: 6.74k, False: 2.67k]
  |  |  ------------------
  ------------------
   56|  6.74k|    {
   57|  6.74k|      sloc->type = UNW_SLT_NONE;
   58|  6.74k|      return 0;
   59|  6.74k|    }
   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|  2.67k|    {
   70|  2.67k|      sloc->type = UNW_SLT_MEMORY;
   71|  2.67k|      sloc->u.addr = DWARF_GET_MEM_LOC (loc);
  ------------------
  |  |  429|  2.67k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  140|  2.67k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
   72|  2.67k|    }
   73|  2.67k|  return 0;
   74|  9.41k|}

_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 ();
  ------------------
  |  |  373|      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 ();
  ------------------
  |  |  386|      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;
  ------------------
  |  |  388|      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|   250k|{
   81|   250k|  if (unlikely (write))
  ------------------
  |  |   68|   250k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 0, False: 250k]
  |  |  ------------------
  ------------------
   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|   250k|  else
   87|   250k|    {
   88|       |      /* validate address */
   89|   250k|      if (unlikely (AS_ARG_GET_VALIDATE(arg))
  ------------------
  |  |   68|   501k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 192k, False: 58.2k]
  |  |  ------------------
  ------------------
   90|   192k|          && unlikely (!unw_address_is_valid (addr, sizeof (unw_word_t)))) {
  ------------------
  |  |   68|   192k|#  define unlikely(x)   __builtin_expect ((x), 0)
  |  |  ------------------
  |  |  |  Branch (68:25): [True: 0, False: 192k]
  |  |  ------------------
  ------------------
   91|      0|        Debug (16, "mem[%016lx] -> invalid\n", addr);
   92|      0|        return -1;
   93|      0|      }
   94|   250k|      memcpy (val, (void *) addr, sizeof(unw_word_t));
   95|   250k|      Debug (16, "mem[%016lx] -> %lx\n", addr, *val);
   96|   250k|    }
   97|   250k|  return 0;
   98|   250k|}
Linit.c:get_static_proc_name:
  167|  31.0k|{
  168|  31.0k|  return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg);
  169|  31.0k|}

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

_ULx86_64_fetch_frame:
   40|     16|{
   41|     16|  struct cursor *c = (struct cursor *) dw;
   42|     16|  assert(! need_unwind_info || dw->pi_valid);
  ------------------
  |  Branch (42:3): [True: 16, False: 0]
  |  Branch (42:3): [True: 0, False: 0]
  |  Branch (42:3): [True: 0, False: 16]
  |  Branch (42:3): [True: 16, False: 0]
  ------------------
   43|     16|  assert(! need_unwind_info || dw->pi.unwind_info);
  ------------------
  |  Branch (43:3): [True: 16, False: 0]
  |  Branch (43:3): [True: 0, False: 0]
  |  Branch (43:3): [True: 0, False: 16]
  |  Branch (43:3): [True: 16, False: 0]
  ------------------
   44|     16|  if (dw->pi_valid
  ------------------
  |  Branch (44:7): [True: 16, False: 0]
  ------------------
   45|     16|      && dw->pi.unwind_info
  ------------------
  |  Branch (45:10): [True: 16, False: 0]
  ------------------
   46|     16|      && ((struct dwarf_cie_info *) dw->pi.unwind_info)->signal_frame)
  ------------------
  |  Branch (46:10): [True: 0, False: 16]
  ------------------
   47|      0|    c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME;
   48|     16|  else
   49|     16|    c->sigcontext_format = X86_64_SCF_NONE;
   50|       |
   51|     16|  Debug(5, "fetch frame ip=0x%lx cfa=0x%lx format=%d\n",
   52|     16|        dw->ip, dw->cfa, c->sigcontext_format);
   53|     16|}
_ULx86_64_cache_frame:
   57|     16|{
   58|     16|  struct cursor *c = (struct cursor *) dw;
   59|       |
   60|     16|  Debug(5, "cache frame ip=0x%lx cfa=0x%lx format=%d\n",
   61|     16|        dw->ip, dw->cfa, c->sigcontext_format);
   62|     16|  return c->sigcontext_format;
   63|     16|}
_ULx86_64_reuse_frame:
   67|   101k|{
   68|   101k|  struct cursor *c = (struct cursor *) dw;
   69|   101k|  c->sigcontext_format = frame;
   70|   101k|  if (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME)
  ------------------
  |  Branch (70:7): [True: 0, False: 101k]
  ------------------
   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|   101k|  Debug(5, "reuse frame ip=0x%lx cfa=0x%lx format=%d addr=0x%lx offset=%+d\n",
   79|   101k|        dw->ip, dw->cfa, c->sigcontext_format, c->sigcontext_addr,
   80|   101k|        (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME
   81|   101k|         ? c->frame_info.cfa_reg_offset : 0));
   82|   101k|}
_ULx86_64_is_signal_frame:
  123|  4.77k|{
  124|  4.77k|  struct cursor *c = (struct cursor *) cursor;
  125|       |
  126|  4.77k|  return c->sigcontext_format != X86_64_SCF_NONE
  ------------------
  |  Branch (126:10): [True: 0, False: 4.77k]
  ------------------
  127|  4.77k|         || is_rt_sigreturn_trampoline (c);
  ------------------
  |  Branch (127:13): [True: 0, False: 4.77k]
  ------------------
  128|  4.77k|}
_ULx86_64_r_uc_addr:
  194|  10.1k|{
  195|       |  /* NOTE: common_init() in init.h inlines these for fast path access. */
  196|  10.1k|  void *addr;
  197|       |
  198|  10.1k|  switch (reg)
  199|  10.1k|    {
  200|      0|    case UNW_X86_64_R8: addr = &uc->uc_mcontext.gregs[REG_R8]; break;
  ------------------
  |  Branch (200:5): [True: 0, False: 10.1k]
  ------------------
  201|      0|    case UNW_X86_64_R9: addr = &uc->uc_mcontext.gregs[REG_R9]; break;
  ------------------
  |  Branch (201:5): [True: 0, False: 10.1k]
  ------------------
  202|      0|    case UNW_X86_64_R10: addr = &uc->uc_mcontext.gregs[REG_R10]; break;
  ------------------
  |  Branch (202:5): [True: 0, False: 10.1k]
  ------------------
  203|      0|    case UNW_X86_64_R11: addr = &uc->uc_mcontext.gregs[REG_R11]; break;
  ------------------
  |  Branch (203:5): [True: 0, False: 10.1k]
  ------------------
  204|      0|    case UNW_X86_64_R12: addr = &uc->uc_mcontext.gregs[REG_R12]; break;
  ------------------
  |  Branch (204:5): [True: 0, False: 10.1k]
  ------------------
  205|      0|    case UNW_X86_64_R13: addr = &uc->uc_mcontext.gregs[REG_R13]; break;
  ------------------
  |  Branch (205:5): [True: 0, False: 10.1k]
  ------------------
  206|      0|    case UNW_X86_64_R14: addr = &uc->uc_mcontext.gregs[REG_R14]; break;
  ------------------
  |  Branch (206:5): [True: 0, False: 10.1k]
  ------------------
  207|      0|    case UNW_X86_64_R15: addr = &uc->uc_mcontext.gregs[REG_R15]; break;
  ------------------
  |  Branch (207:5): [True: 0, False: 10.1k]
  ------------------
  208|      0|    case UNW_X86_64_RDI: addr = &uc->uc_mcontext.gregs[REG_RDI]; break;
  ------------------
  |  Branch (208:5): [True: 0, False: 10.1k]
  ------------------
  209|      0|    case UNW_X86_64_RSI: addr = &uc->uc_mcontext.gregs[REG_RSI]; break;
  ------------------
  |  Branch (209:5): [True: 0, False: 10.1k]
  ------------------
  210|      0|    case UNW_X86_64_RBP: addr = &uc->uc_mcontext.gregs[REG_RBP]; break;
  ------------------
  |  Branch (210:5): [True: 0, False: 10.1k]
  ------------------
  211|      0|    case UNW_X86_64_RBX: addr = &uc->uc_mcontext.gregs[REG_RBX]; break;
  ------------------
  |  Branch (211:5): [True: 0, False: 10.1k]
  ------------------
  212|      0|    case UNW_X86_64_RDX: addr = &uc->uc_mcontext.gregs[REG_RDX]; break;
  ------------------
  |  Branch (212:5): [True: 0, False: 10.1k]
  ------------------
  213|      0|    case UNW_X86_64_RAX: addr = &uc->uc_mcontext.gregs[REG_RAX]; break;
  ------------------
  |  Branch (213:5): [True: 0, False: 10.1k]
  ------------------
  214|      0|    case UNW_X86_64_RCX: addr = &uc->uc_mcontext.gregs[REG_RCX]; break;
  ------------------
  |  Branch (214:5): [True: 0, False: 10.1k]
  ------------------
  215|  10.1k|    case UNW_X86_64_RSP: addr = &uc->uc_mcontext.gregs[REG_RSP]; break;
  ------------------
  |  Branch (215:5): [True: 10.1k, False: 0]
  ------------------
  216|      0|    case UNW_X86_64_RIP: addr = &uc->uc_mcontext.gregs[REG_RIP]; break;
  ------------------
  |  Branch (216:5): [True: 0, False: 10.1k]
  ------------------
  217|       |
  218|      0|    default:
  ------------------
  |  Branch (218:5): [True: 0, False: 10.1k]
  ------------------
  219|      0|      addr = NULL;
  220|  10.1k|    }
  221|  10.1k|  return addr;
  222|  10.1k|}
Los-linux.c:is_rt_sigreturn_trampoline:
   98|  4.77k|{
   99|  4.77k|  unw_accessors_t *a = unw_get_accessors_int (c->dwarf.as);
  ------------------
  |  |  278|  4.77k|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|  4.77k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.77k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.77k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|  4.77k|  unw_word_t w0, w1;
  101|  4.77k|  int validate = 0, ret;
  102|       |
  103|  4.77k|  if (c->dwarf.as == unw_local_addr_space)
  ------------------
  |  |  274|  4.77k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  4.77k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.77k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.77k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (103:7): [True: 4.77k, False: 0]
  ------------------
  104|  4.77k|    {
  105|  4.77k|      validate = dwarf_get_validate (&c->dwarf);
  106|  4.77k|      dwarf_set_validate (&c->dwarf, 1);
  107|  4.77k|    }
  108|       |
  109|  4.77k|  ret = (*a->access_mem) (c->dwarf.as, c->dwarf.ip, &w0, 0,
  ------------------
  |  Branch (109:9): [True: 4.77k, False: 0]
  ------------------
  110|  4.77k|                          c->dwarf.as_arg) >= 0
  111|  4.77k|        && (*a->access_mem) (c->dwarf.as, c->dwarf.ip + 8, &w1, 0,
  ------------------
  |  Branch (111:12): [True: 4.77k, False: 0]
  ------------------
  112|  4.77k|                             c->dwarf.as_arg) >= 0
  113|  4.77k|        && w0 == 0x0f0000000fc0c748 && (w1 & 0xff) == 0x05;
  ------------------
  |  Branch (113:12): [True: 0, False: 4.77k]
  |  Branch (113:40): [True: 0, False: 0]
  ------------------
  114|       |
  115|  4.77k|  if (c->dwarf.as == unw_local_addr_space)
  ------------------
  |  |  274|  4.77k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|  4.77k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  4.77k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.77k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (115:7): [True: 4.77k, False: 0]
  ------------------
  116|  4.77k|    dwarf_set_validate (&c->dwarf, validate);
  117|       |
  118|  4.77k|  return ret;
  119|  4.77k|}

_ULx86_64_access_reg:
   67|   145k|{
   68|   145k|  dwarf_loc_t loc = DWARF_NULL_LOC;
  ------------------
  |  |  156|   145k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  151|   145k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   69|   145k|  unsigned int mask;
   70|   145k|  int arg_num;
   71|       |
   72|   145k|  switch (reg)
   73|   145k|    {
   74|       |
   75|      0|    case UNW_X86_64_RIP:
  ------------------
  |  Branch (75:5): [True: 0, False: 145k]
  ------------------
   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|  2.01k|    case UNW_X86_64_CFA:
  ------------------
  |  Branch (81:5): [True: 2.01k, False: 143k]
  ------------------
   82|  2.01k|      if (write)
  ------------------
  |  Branch (82:11): [True: 0, False: 2.01k]
  ------------------
   83|      0|        return -UNW_EREADONLYREG;
   84|  2.01k|      *valp = c->dwarf.cfa;
   85|  2.01k|      return 0;
   86|       |
   87|  2.44k|    case UNW_X86_64_RAX:
  ------------------
  |  Branch (87:5): [True: 2.44k, False: 142k]
  ------------------
   88|  5.27k|    case UNW_X86_64_RDX:
  ------------------
  |  Branch (88:5): [True: 2.82k, False: 142k]
  ------------------
   89|  5.27k|      arg_num = reg - UNW_X86_64_RAX;
   90|  5.27k|      mask = (1 << arg_num);
   91|  5.27k|      if (write)
  ------------------
  |  Branch (91:11): [True: 0, False: 5.27k]
  ------------------
   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|  5.27k|      else if ((c->dwarf.eh_valid_mask & mask) != 0)
  ------------------
  |  Branch (97:16): [True: 0, False: 5.27k]
  ------------------
   98|      0|        {
   99|      0|          *valp = c->dwarf.eh_args[arg_num];
  100|      0|          return 0;
  101|      0|        }
  102|  5.27k|      else
  103|  5.27k|        loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   43|  2.44k|#define RAX     0
  ------------------
                      loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   44|  2.82k|#define RDX     1
  ------------------
  |  Branch (103:28): [True: 2.44k, False: 2.82k]
  ------------------
  104|  5.27k|      break;
  105|       |
  106|  5.27k|    case UNW_X86_64_RCX: loc = c->dwarf.loc[RCX]; break;
  ------------------
  |  |   45|  2.52k|#define RCX     2
  ------------------
  |  Branch (106:5): [True: 2.52k, False: 142k]
  ------------------
  107|  2.21k|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|  2.21k|#define RBX     3
  ------------------
  |  Branch (107:5): [True: 2.21k, False: 143k]
  ------------------
  108|       |
  109|  10.3k|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|  10.3k|#define RSP     7
  ------------------
  |  Branch (109:5): [True: 10.3k, False: 134k]
  ------------------
  110|  93.1k|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|  93.1k|#define RBP     6
  ------------------
  |  Branch (110:5): [True: 93.1k, False: 52.1k]
  ------------------
  111|  2.81k|    case UNW_X86_64_RSI: loc = c->dwarf.loc[RSI]; break;
  ------------------
  |  |   47|  2.81k|#define RSI     4
  ------------------
  |  Branch (111:5): [True: 2.81k, False: 142k]
  ------------------
  112|  2.23k|    case UNW_X86_64_RDI: loc = c->dwarf.loc[RDI]; break;
  ------------------
  |  |   48|  2.23k|#define RDI     5
  ------------------
  |  Branch (112:5): [True: 2.23k, False: 143k]
  ------------------
  113|  2.43k|    case UNW_X86_64_R8: loc = c->dwarf.loc[R8]; break;
  ------------------
  |  |   51|  2.43k|#define R8      8
  ------------------
  |  Branch (113:5): [True: 2.43k, False: 142k]
  ------------------
  114|  2.63k|    case UNW_X86_64_R9: loc = c->dwarf.loc[R9]; break;
  ------------------
  |  |   52|  2.63k|#define R9      9
  ------------------
  |  Branch (114:5): [True: 2.63k, False: 142k]
  ------------------
  115|  3.33k|    case UNW_X86_64_R10: loc = c->dwarf.loc[R10]; break;
  ------------------
  |  |   53|  3.33k|#define R10     10
  ------------------
  |  Branch (115:5): [True: 3.33k, False: 141k]
  ------------------
  116|  2.44k|    case UNW_X86_64_R11: loc = c->dwarf.loc[R11]; break;
  ------------------
  |  |   54|  2.44k|#define R11     11
  ------------------
  |  Branch (116:5): [True: 2.44k, False: 142k]
  ------------------
  117|  2.63k|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|  2.63k|#define R12     12
  ------------------
  |  Branch (117:5): [True: 2.63k, False: 142k]
  ------------------
  118|  3.43k|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|  3.43k|#define R13     13
  ------------------
  |  Branch (118:5): [True: 3.43k, False: 141k]
  ------------------
  119|  2.15k|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|  2.15k|#define R14     14
  ------------------
  |  Branch (119:5): [True: 2.15k, False: 143k]
  ------------------
  120|  2.02k|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|  2.02k|#define R15     15
  ------------------
  |  Branch (120:5): [True: 2.02k, False: 143k]
  ------------------
  121|       |
  122|  3.64k|    default:
  ------------------
  |  Branch (122:5): [True: 3.64k, False: 141k]
  ------------------
  123|  3.64k|      Debug (1, "bad register number %u\n", reg);
  124|  3.64k|      return -UNW_EBADREG;
  125|   145k|    }
  126|       |
  127|   139k|  if (write)
  ------------------
  |  Branch (127:7): [True: 0, False: 139k]
  ------------------
  128|      0|    return dwarf_put (&c->dwarf, loc, *valp);
  129|   139k|  else
  130|   139k|    return dwarf_get (&c->dwarf, loc, valp);
  131|   139k|}

_ULx86_64_step:
  742|   101k|{
  743|   101k|  struct cursor *c = (struct cursor *) cursor;
  744|   101k|  int val = 0;
  745|   101k|#if CONSERVATIVE_CHECKS
  746|   101k|  if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|   101k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (746:7): [True: 101k, False: 0]
  ------------------
  747|   101k|    val = dwarf_get_validate(&c->dwarf);
  748|   101k|    dwarf_set_validate (&c->dwarf, 1);
  749|   101k|  }
  750|   101k|#endif
  751|       |
  752|   101k|  Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n",
  753|   101k|         c, c->dwarf.ip, c->dwarf.cfa);
  754|       |
  755|       |  /* Try DWARF-based unwinding... */
  756|   101k|  c->sigcontext_format = X86_64_SCF_NONE;
  757|   101k|  int ret = dwarf_step (&c->dwarf);
  ------------------
  |  |  403|   101k|#define dwarf_step                      UNW_OBJ (dwarf_step)
  |  |  ------------------
  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  758|       |
  759|   101k|#if CONSERVATIVE_CHECKS
  760|   101k|  if (c->dwarf.as == unw_local_addr_space) {
  ------------------
  |  |  274|   101k|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|   101k|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|   101k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   101k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (760:7): [True: 101k, False: 0]
  ------------------
  761|   101k|    dwarf_set_validate (&c->dwarf, val);
  762|   101k|  }
  763|   101k|#endif
  764|       |
  765|   101k|  if (ret < 0 && ret != -UNW_ENOINFO)
  ------------------
  |  Branch (765:7): [True: 0, False: 101k]
  |  Branch (765:18): [True: 0, False: 0]
  ------------------
  766|      0|    {
  767|      0|      Debug (2, "failure in dwarf_step(), returning %d\n", ret);
  768|      0|      return ret;
  769|      0|    }
  770|       |
  771|   101k|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (771:7): [True: 0, False: 101k]
  ------------------
  772|      0|    {
  773|       |      /*
  774|       |       * DWARF stepping failed. Use fallback strategies.
  775|       |       */
  776|      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 (776:11): [True: 0, False: 0]
  ------------------
  777|      0|        val = dwarf_get_validate (&c->dwarf);
  778|      0|        dwarf_set_validate (&c->dwarf, 1);
  779|      0|      }
  780|       |
  781|      0|      unw_word_t prev_ip = c->dwarf.ip;
  782|      0|      unw_word_t prev_cfa = c->dwarf.cfa;
  783|       |
  784|      0|      Debug (2, "dwarf_step() failed, trying fallback heuristics\n");
  785|      0|      ret = _unw_step_fallback (c, cursor);
  786|       |
  787|       |      /*
  788|       |       * Check for infinite call chain loops or no successful stepping.
  789|       |       * If this situation is detected, assume the end of the call chain because
  790|       |       * that's how it works on some OSes.
  791|       |       */
  792|      0|      if (ret >= 0 && c->dwarf.ip == prev_ip && c->dwarf.cfa == prev_cfa)
  ------------------
  |  Branch (792:11): [True: 0, False: 0]
  |  Branch (792:23): [True: 0, False: 0]
  |  Branch (792:49): [True: 0, False: 0]
  ------------------
  793|      0|        {
  794|      0|          Debug (2, "infinite call chain loop detected\n");
  795|      0|          ret = 0;
  796|      0|        }
  797|       |
  798|      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 (798:11): [True: 0, False: 0]
  ------------------
  799|      0|        dwarf_set_validate (&c->dwarf, val);
  800|      0|      }
  801|      0|    }
  802|       |
  803|       |  /*
  804|       |   * If stepping was successful, increment the frame counter.
  805|       |   */
  806|   101k|  if (ret >= 0)
  ------------------
  |  Branch (806:7): [True: 101k, False: 0]
  ------------------
  807|   101k|    {
  808|   101k|    	++c->frames;
  809|   101k|    }
  810|       |
  811|   101k|  Debug (2, "returning %d\n", ret);
  812|   101k|  return ret;
  813|   101k|}

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

