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

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

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

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

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

_ULx86_64_dwarf_callback:
  589|     23|{
  590|     23|  struct dwarf_callback_data *cb_data = ptr;
  591|     23|  unw_dyn_info_t *di = &cb_data->di;
  592|     23|  const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text;
  593|     23|  unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip;
  594|     23|  Elf_W(Addr) load_base, max_load_addr = 0;
  ------------------
  |  |   44|     23|# define Elf_W(x)       Elf64_##x
  ------------------
  595|     23|  int ret, need_unwind_info = cb_data->need_unwind_info;
  596|     23|  unw_proc_info_t *pi = cb_data->pi;
  597|     23|  struct dwarf_eh_frame_hdr *hdr = NULL;
  598|     23|  unw_accessors_t *a;
  599|     23|  long n;
  600|     23|  int found = 0;
  601|     23|  Elf_W (Addr) eh_frame = 0;
  ------------------
  |  |   44|     23|# define Elf_W(x)       Elf64_##x
  ------------------
  602|       |#ifdef CONFIG_DEBUG_FRAME
  603|       |  unw_word_t start, end;
  604|       |#endif /* CONFIG_DEBUG_FRAME*/
  605|       |
  606|     23|  ip = cb_data->ip;
  607|       |
  608|       |  /* Make sure struct dl_phdr_info is at least as big as we need.  */
  609|     23|  if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
  ------------------
  |  Branch (609:7): [True: 0, False: 23]
  ------------------
  610|     23|             + sizeof (info->dlpi_phnum))
  611|      0|    return -1;
  612|       |
  613|     23|  Debug (15, "checking %s, base=0x%lx)\n",
  614|     23|         info->dlpi_name, (long) info->dlpi_addr);
  615|       |
  616|     23|  phdr = info->dlpi_phdr;
  617|     23|  load_base = info->dlpi_addr;
  618|     23|  p_text = NULL;
  619|     23|  p_eh_hdr = NULL;
  620|     23|  p_dynamic = NULL;
  621|       |
  622|       |  /* See if PC falls into one of the loaded segments.  Find the
  623|       |     eh-header segment at the same time.  */
  624|    289|  for (n = info->dlpi_phnum; --n >= 0; phdr++)
  ------------------
  |  Branch (624:30): [True: 266, False: 23]
  ------------------
  625|    266|    {
  626|    266|      if (phdr->p_type == PT_LOAD)
  ------------------
  |  Branch (626:11): [True: 89, False: 177]
  ------------------
  627|     89|        {
  628|     89|          Elf_W(Addr) vaddr = phdr->p_vaddr + load_base;
  ------------------
  |  |   44|     89|# define Elf_W(x)       Elf64_##x
  ------------------
  629|       |
  630|     89|          if (ip >= vaddr && ip < vaddr + phdr->p_memsz)
  ------------------
  |  Branch (630:15): [True: 34, False: 55]
  |  Branch (630:30): [True: 15, False: 19]
  ------------------
  631|     15|            p_text = phdr;
  632|       |
  633|     89|          if (vaddr + phdr->p_filesz > max_load_addr)
  ------------------
  |  Branch (633:15): [True: 89, False: 0]
  ------------------
  634|     89|            max_load_addr = vaddr + phdr->p_filesz;
  635|     89|        }
  636|    177|      else if (phdr->p_type == PT_GNU_EH_FRAME)
  ------------------
  |  Branch (636:16): [True: 23, False: 154]
  ------------------
  637|     23|        p_eh_hdr = phdr;
  638|       |#if defined __sun
  639|       |      else if (phdr->p_type == PT_SUNW_UNWIND)
  640|       |        p_eh_hdr = phdr;
  641|       |#endif
  642|    154|      else if (phdr->p_type == PT_DYNAMIC)
  ------------------
  |  Branch (642:16): [True: 23, False: 131]
  ------------------
  643|     23|        p_dynamic = phdr;
  644|    266|    }
  645|       |
  646|     23|  if (!p_text)
  ------------------
  |  Branch (646:7): [True: 8, False: 15]
  ------------------
  647|      8|    return 0;
  648|       |
  649|     15|  if (p_eh_hdr)
  ------------------
  |  Branch (649:7): [True: 15, False: 0]
  ------------------
  650|     15|    {
  651|     15|      hdr = (struct dwarf_eh_frame_hdr *) (p_eh_hdr->p_vaddr + load_base);
  652|     15|    }
  653|      0|  else
  654|      0|    {
  655|      0|      Debug (1, "no .eh_frame_hdr section found\n");
  656|      0|      eh_frame = dwarf_find_eh_frame_section (info);
  657|      0|      if (eh_frame)
  ------------------
  |  Branch (657:11): [True: 0, False: 0]
  ------------------
  658|      0|        Debug (1, "using the .eh_frame section of %s directly\n",
  659|      0|               info->dlpi_name);
  660|      0|    }
  661|       |
  662|     15|  if (hdr || eh_frame)
  ------------------
  |  Branch (662:7): [True: 15, False: 0]
  |  Branch (662:14): [True: 0, False: 0]
  ------------------
  663|     15|    {
  664|     15|      if (p_dynamic)
  ------------------
  |  Branch (664:11): [True: 15, False: 0]
  ------------------
  665|     15|        {
  666|       |          /* For dynamically linked executables and shared libraries,
  667|       |             DT_PLTGOT is the value that data-relative addresses are
  668|       |             relative to for that object.  We call this the "gp".  */
  669|     15|          Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(p_dynamic->p_vaddr + load_base);
  ------------------
  |  |   44|     15|# define Elf_W(x)       Elf64_##x
  ------------------
  670|    334|          for (; dyn->d_tag != DT_NULL; ++dyn)
  ------------------
  |  Branch (670:18): [True: 334, False: 0]
  ------------------
  671|    334|            if (dyn->d_tag == DT_PLTGOT)
  ------------------
  |  Branch (671:17): [True: 15, False: 319]
  ------------------
  672|     15|              {
  673|       |                /* Assume that _DYNAMIC is writable and GLIBC has
  674|       |                   relocated it (true for x86 at least).  */
  675|     15|                di->gp = dyn->d_un.d_ptr;
  676|     15|                break;
  677|     15|              }
  678|     15|        }
  679|      0|      else
  680|       |        /* Otherwise this is a static executable with no _DYNAMIC.  Assume
  681|       |           that data-relative addresses are relative to 0, i.e.,
  682|       |           absolute.  */
  683|      0|        di->gp = 0;
  684|     15|      pi->gp = di->gp;
  685|       |
  686|     15|      if (hdr == NULL)
  ------------------
  |  Branch (686:11): [True: 0, False: 15]
  ------------------
  687|      0|        {
  688|       |          /* There is no .eh_frame_hdr section, hence no binary search
  689|       |             table: search the .eh_frame section linearly.  */
  690|      0|          eh_frame_start = eh_frame;
  691|      0|          eh_frame_end = max_load_addr; /* XXX can we do better? */
  692|      0|          fde_count = ~0UL;
  693|       |
  694|      0|          Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n",
  695|      0|                 eh_frame_start, eh_frame_end);
  696|       |
  697|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|      0|                                 eh_frame_start, eh_frame_end, fde_count,
  699|      0|                                 pi, need_unwind_info, NULL);
  700|      0|          if (found != 1)
  ------------------
  |  Branch (700:15): [True: 0, False: 0]
  ------------------
  701|      0|            found = 0;
  702|      0|          else
  703|      0|            cb_data->single_fde = 1;
  704|       |
  705|      0|          goto out;
  706|      0|        }
  707|       |
  708|     15|      if (hdr->version != DW_EH_VERSION)
  ------------------
  |  |  108|     15|#define DW_EH_VERSION           1       /* The version we're implementing */
  ------------------
  |  Branch (708:11): [True: 0, False: 15]
  ------------------
  709|      0|        {
  710|      0|          Debug (1, "table `%s' has unexpected version %d\n",
  711|      0|                 info->dlpi_name, hdr->version);
  712|      0|          return 0;
  713|      0|        }
  714|       |
  715|     15|      a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  278|     15|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     15|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    a = unw_get_accessors_int (unw_local_addr_space);
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  716|     15|      addr = (unw_word_t) (uintptr_t) (&hdr->eh_frame);
  717|       |
  718|     15|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  402|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (718:11): [True: 0, False: 15]
  ------------------
  719|     15|                                             &addr, hdr->eh_frame_ptr_enc, pi,
  720|     15|                                             &eh_frame_start, NULL)) < 0)
  721|      0|        return ret;
  722|       |
  723|     15|      if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  402|     15|#define dwarf_read_encoded_pointer      UNW_OBJ (dwarf_read_encoded_pointer)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a,
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (723:11): [True: 0, False: 15]
  ------------------
  724|     15|                                             &addr, hdr->fde_count_enc, pi,
  725|     15|                                             &fde_count, NULL)) < 0)
  726|      0|        return ret;
  727|       |
  728|     15|      if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  216|     15|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                    if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)
  ------------------
  |  |  209|     15|#define DW_EH_PE_sdata4         0x0b    /* signed 32-bit value */
  ------------------
  |  Branch (728:11): [True: 0, False: 15]
  ------------------
  729|      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 (729:14): [True: 0, False: 0]
  ------------------
  730|      0|        {
  731|       |          /* If there is no search table or it has an unsupported
  732|       |             encoding, fall back on linear search.  */
  733|      0|          if (hdr->table_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (733:15): [True: 0, False: 0]
  ------------------
  734|      0|            {
  735|      0|              Debug (4, "table `%s' lacks search table; doing linear search\n",
  736|      0|                     info->dlpi_name);
  737|      0|            }
  738|      0|          else
  739|      0|            {
  740|      0|              Debug (4, "table `%s' has encoding 0x%x; doing linear search\n",
  741|      0|                     info->dlpi_name, hdr->table_enc);
  742|      0|            }
  743|       |
  744|      0|          eh_frame_end = max_load_addr; /* XXX can we do better? */
  745|       |
  746|      0|          if (hdr->fde_count_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (746:15): [True: 0, False: 0]
  ------------------
  747|      0|            fde_count = ~0UL;
  748|      0|          if (hdr->eh_frame_ptr_enc == DW_EH_PE_omit)
  ------------------
  |  |  201|      0|#define DW_EH_PE_omit           0xff
  ------------------
  |  Branch (748:15): [True: 0, False: 0]
  ------------------
  749|      0|            abort ();
  750|       |
  751|      0|          Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n",
  752|      0|                 eh_frame_start, eh_frame_end);
  753|       |
  754|       |          /* XXX we know how to build a local binary search table for
  755|       |             .debug_frame, so we could do that here too.  */
  756|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|      0|                                 eh_frame_start, eh_frame_end, fde_count,
  758|      0|                                 pi, need_unwind_info, NULL);
  759|      0|          if (found != 1)
  ------------------
  |  Branch (759:15): [True: 0, False: 0]
  ------------------
  760|      0|            found = 0;
  761|      0|	  else
  762|      0|	    cb_data->single_fde = 1;
  763|      0|        }
  764|     15|      else
  765|     15|        {
  766|     15|          int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  216|     15|#define DW_EH_PE_datarel        0x30    /* data-relative */
  ------------------
                        int is_sdata8 = (hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata8));
  ------------------
  |  |  210|     15|#define DW_EH_PE_sdata8         0x0c    /* signed 64-bit value */
  ------------------
  767|     15|          size_t entry_size = is_sdata8 ? sizeof (struct table_entry64)
  ------------------
  |  Branch (767:31): [True: 0, False: 15]
  ------------------
  768|     15|                                        : sizeof (struct table_entry);
  769|     15|          di->format = is_sdata8 ? UNW_INFO_FORMAT_REMOTE_TABLE_64
  ------------------
  |  Branch (769:24): [True: 0, False: 15]
  ------------------
  770|     15|                                 : UNW_INFO_FORMAT_REMOTE_TABLE;
  771|     15|          di->start_ip = p_text->p_vaddr + load_base;
  772|     15|          di->end_ip = p_text->p_vaddr + load_base + p_text->p_memsz;
  773|     15|          di->u.rti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name;
  774|     15|          di->u.rti.table_data = addr;
  775|     15|          assert (entry_size % sizeof (unw_word_t) == 0);
  ------------------
  |  Branch (775:11): [True: 0, False: 15]
  |  Branch (775:11): [True: 15, False: 0]
  ------------------
  776|     15|          di->u.rti.table_len = (fde_count * entry_size
  777|     15|                                 / sizeof (unw_word_t));
  778|       |          /* For the binary-search table in the eh_frame_hdr, data-relative
  779|       |             means relative to the start of that section... */
  780|     15|          di->u.rti.segbase = (unw_word_t) (uintptr_t) hdr;
  781|       |
  782|     15|          found = 1;
  783|     15|          Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, "
  784|     15|                 "table_data=0x%lx\n", (char *) (uintptr_t) di->u.rti.name_ptr,
  785|     15|                 (long) di->u.rti.segbase, (long) di->u.rti.table_len,
  786|     15|                 (long) di->gp, (long) di->u.rti.table_data);
  787|     15|        }
  788|     15|    }
  789|       |
  790|     15|out:
  791|       |#ifdef CONFIG_DEBUG_FRAME
  792|       |  /* Find the start/end of the described region by parsing the phdr_info
  793|       |     structure.  */
  794|       |  start = (unw_word_t) -1;
  795|       |  end = 0;
  796|       |
  797|       |  for (n = 0; n < info->dlpi_phnum; n++)
  798|       |    {
  799|       |      if (info->dlpi_phdr[n].p_type == PT_LOAD)
  800|       |        {
  801|       |          unw_word_t seg_start = info->dlpi_addr + info->dlpi_phdr[n].p_vaddr;
  802|       |          unw_word_t seg_end = seg_start + info->dlpi_phdr[n].p_memsz;
  803|       |
  804|       |          if (seg_start < start)
  805|       |            start = seg_start;
  806|       |
  807|       |          if (seg_end > end)
  808|       |            end = seg_end;
  809|       |        }
  810|       |    }
  811|       |
  812|       |  found = dwarf_find_debug_frame (found, &cb_data->di_debug, ip,
  813|       |                                  info->dlpi_addr, info->dlpi_name, start,
  814|       |                                  end);
  815|       |#endif  /* CONFIG_DEBUG_FRAME */
  816|       |
  817|     15|  return found;
  818|     15|}
_ULx86_64_dwarf_find_proc_info:
  823|     15|{
  824|     15|  struct dwarf_callback_data cb_data;
  825|     15|  int ret;
  826|       |
  827|     15|  Debug (14, "looking for IP=0x%lx\n", (long) ip);
  828|       |
  829|     15|  memset (&cb_data, 0, sizeof (cb_data));
  830|     15|  cb_data.ip = ip;
  831|     15|  cb_data.pi = pi;
  832|     15|  cb_data.need_unwind_info = need_unwind_info;
  833|     15|  cb_data.di.format = -1;
  834|     15|  cb_data.di_debug.format = -1;
  835|       |
  836|     15|  ret = unwi_iterate_phdr_for_ip (as, ip, dwarf_callback, &cb_data);
  ------------------
  |  |  302|     15|#define unwi_iterate_phdr_for_ip        UNWI_OBJ(iterate_phdr_for_ip)
  |  |  ------------------
  |  |  |  |  173|     15|#define UNWI_OBJ(fn)      UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn))
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                ret = unwi_iterate_phdr_for_ip (as, ip, dwarf_callback, &cb_data);
  ------------------
  |  |  387|     15|#define dwarf_callback                  UNW_OBJ (dwarf_callback)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  837|       |
  838|     15|  if (ret > 0)
  ------------------
  |  Branch (838:7): [True: 15, False: 0]
  ------------------
  839|     15|    {
  840|     15|      if (cb_data.single_fde)
  ------------------
  |  Branch (840:11): [True: 0, False: 15]
  ------------------
  841|       |	/* already got the result in *pi */
  842|      0|	return 0;
  843|       |
  844|       |      /* search the table: */
  845|     15|      if (cb_data.di.format != -1)
  ------------------
  |  Branch (845:11): [True: 15, False: 0]
  ------------------
  846|     15|        {
  847|     15|	ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di,
  ------------------
  |  |   59|     15|#define dwarf_search_unwind_table_int dwarf_search_unwind_table
  |  |  ------------------
  |  |  |  |  390|     15|#define dwarf_search_unwind_table       UNW_OBJ (dwarf_search_unwind_table)
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|     15|					     pi, need_unwind_info, arg);
  849|     15|        }
  850|      0|      else
  851|      0|	ret = -UNW_ENOINFO;
  852|       |
  853|     15|      if (ret == -UNW_ENOINFO && cb_data.di_debug.format != -1)
  ------------------
  |  Branch (853:11): [True: 0, False: 15]
  |  Branch (853:34): [True: 0, False: 0]
  ------------------
  854|      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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  855|      0|					     need_unwind_info, arg);
  856|     15|    }
  857|      0|  else
  858|      0|    ret = -UNW_ENOINFO;
  859|       |
  860|     15|  return ret;
  861|     15|}
_ULx86_64_dwarf_search_unwind_table:
  937|     15|{
  938|     15|  unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr;
  939|     15|  unw_word_t found_start_ip_offset = 0, found_fde_offset = 0;
  940|     15|  int found_entry = 0;
  941|     15|  unw_accessors_t *a;
  942|     15|  int ret;
  943|     15|  unw_word_t debug_frame_base = 0;
  944|     15|  size_t table_len = 0;
  945|     15|  const void *table_data = NULL;
  946|     15|  int is_table64 = (di->format == UNW_INFO_FORMAT_REMOTE_TABLE_64);
  947|       |
  948|       |#ifdef UNW_REMOTE_ONLY
  949|       |  assert (is_remote_table(di->format));
  950|       |#else
  951|     15|  assert (is_remote_table(di->format)
  ------------------
  |  Branch (951:3): [True: 15, False: 0]
  |  Branch (951:3): [True: 0, False: 0]
  |  Branch (951:3): [True: 15, False: 0]
  |  Branch (951:3): [True: 0, False: 0]
  ------------------
  952|     15|          || di->format == UNW_INFO_FORMAT_TABLE);
  953|     15|#endif
  954|     15|  assert (ip >= di->start_ip && ip < di->end_ip);
  ------------------
  |  Branch (954:3): [True: 0, False: 15]
  |  Branch (954:3): [True: 0, False: 0]
  |  Branch (954:3): [True: 15, False: 0]
  |  Branch (954:3): [True: 15, False: 0]
  ------------------
  955|       |
  956|     15|  if (is_remote_table(di->format))
  ------------------
  |  Branch (956:7): [True: 15, False: 0]
  ------------------
  957|     15|    {
  958|     15|      table_data = (const void *) (uintptr_t) di->u.rti.table_data;
  959|     15|      table_len = di->u.rti.table_len * sizeof (unw_word_t);
  960|     15|      debug_frame_base = 0;
  961|     15|    }
  962|      0|  else
  963|      0|    {
  964|      0|      assert(di->format == UNW_INFO_FORMAT_TABLE);
  ------------------
  |  Branch (964:7): [True: 0, False: 0]
  |  Branch (964:7): [True: 0, False: 0]
  ------------------
  965|      0|#ifndef UNW_REMOTE_ONLY
  966|      0|      struct unw_debug_frame_list *fdesc = (void *) di->u.ti.table_data;
  967|       |
  968|       |      /* UNW_INFO_FORMAT_TABLE (i.e. .debug_frame) is read from local address
  969|       |         space.  Both the index and the unwind tables live in local memory, but
  970|       |         the address space to check for properties like the address size and
  971|       |         endianness is the target one.  */
  972|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|      0|      table_data = fdesc->index;
  974|      0|      table_len = fdesc->index_size;
  975|      0|      debug_frame_base = (uintptr_t) fdesc->debug_frame;
  976|      0|#endif
  977|      0|    }
  978|       |
  979|     15|  a = unw_get_accessors_int (as);
  ------------------
  |  |  278|     15|#define unw_get_accessors_int		UNW_ARCH_OBJ(get_accessors_int)
  |  |  ------------------
  |  |  |  |   49|     15|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|       |
  981|     15|  segbase = di->u.rti.segbase;
  982|     15|  if (di->format == UNW_INFO_FORMAT_IP_OFFSET) {
  ------------------
  |  Branch (982:7): [True: 0, False: 15]
  ------------------
  983|      0|    ip_base = di->start_ip;
  984|     15|  } else {
  985|     15|    ip_base = segbase;
  986|     15|  }
  987|       |
  988|     15|#ifndef UNW_REMOTE_ONLY
  989|     15|  if (as == unw_local_addr_space)
  ------------------
  |  |  274|     15|#define unw_local_addr_space		UNW_OBJ(local_addr_space)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (989:7): [True: 15, False: 0]
  ------------------
  990|     15|    {
  991|     15|      if (is_table64)
  ------------------
  |  Branch (991:11): [True: 0, False: 15]
  ------------------
  992|      0|        {
  993|      0|          const struct table_entry64 *table64 = (const struct table_entry64 *) table_data;
  994|      0|          const struct table_entry64 *e64;
  995|      0|          e64 = lookup64 (table64, table_len, ip - ip_base);
  996|      0|          if (e64)
  ------------------
  |  Branch (996:15): [True: 0, False: 0]
  ------------------
  997|      0|            {
  998|      0|              found_entry = 1;
  999|      0|              found_start_ip_offset = (unw_word_t) e64->start_ip_offset;
 1000|      0|              found_fde_offset = (unw_word_t) e64->fde_offset;
 1001|      0|              if (&e64[1] < &table64[table_len / sizeof (struct table_entry64)])
  ------------------
  |  Branch (1001:19): [True: 0, False: 0]
  ------------------
 1002|      0|                last_ip = (unw_word_t) e64[1].start_ip_offset + ip_base;
 1003|      0|              else
 1004|      0|                last_ip = di->end_ip;
 1005|      0|            }
 1006|      0|        }
 1007|     15|      else
 1008|     15|        {
 1009|     15|          const struct table_entry *table = (const struct table_entry *) table_data;
 1010|     15|          const struct table_entry *e;
 1011|     15|          e = lookup (table, table_len, ip - ip_base);
 1012|     15|          if (e)
  ------------------
  |  Branch (1012:15): [True: 15, False: 0]
  ------------------
 1013|     15|            {
 1014|     15|              found_entry = 1;
 1015|     15|              found_start_ip_offset = (unw_word_t) e->start_ip_offset;
 1016|     15|              found_fde_offset = (unw_word_t) e->fde_offset;
 1017|     15|              if (&e[1] < &table[table_len / sizeof (struct table_entry)])
  ------------------
  |  Branch (1017:19): [True: 15, False: 0]
  ------------------
 1018|     15|                last_ip = e[1].start_ip_offset + ip_base;
 1019|      0|              else
 1020|      0|                last_ip = di->end_ip;
 1021|     15|            }
 1022|     15|        }
 1023|     15|    }
 1024|      0|  else
 1025|      0|#endif
 1026|      0|    {
 1027|       |#ifndef UNW_LOCAL_ONLY
 1028|       |      int64_t found_start = 0, found_fde = 0;
 1029|       |      /* Cast through unw_sword_t to preserve the sign of the offset on
 1030|       |       * 32-bit targets: ip - ip_base is computed in unsigned unw_word_t
 1031|       |       * arithmetic and would wrap for ip < ip_base (which happens when
 1032|       |       * the IP is below segbase).  The explicit signed-narrowing cast
 1033|       |       * sign-extends the 32-bit result to int64_t correctly.  On 64-bit
 1034|       |       * targets unw_sword_t is int64_t so the cast is a no-op.  */
 1035|       |      int64_t rel_ip = (int64_t)(unw_sword_t)(ip - ip_base);
 1036|       |      int64_t last_ip_offset64 = (int64_t)(unw_sword_t)(di->end_ip - ip_base);
 1037|       |      segbase = di->u.rti.segbase;
 1038|       |      if ((ret = remote_lookup (as, (uintptr_t) table_data, table_len,
 1039|       |                                rel_ip, &found_start, &found_fde,
 1040|       |                                &last_ip_offset64, is_table64, arg)) < 0)
 1041|       |        return ret;
 1042|       |      if (ret)
 1043|       |        {
 1044|       |          found_entry = 1;
 1045|       |          found_start_ip_offset = (unw_word_t) found_start;
 1046|       |          found_fde_offset = (unw_word_t) found_fde;
 1047|       |          last_ip = (unw_word_t) last_ip_offset64 + ip_base;
 1048|       |        }
 1049|       |#endif
 1050|      0|    }
 1051|     15|  if (!found_entry)
  ------------------
  |  Branch (1051:7): [True: 0, False: 15]
  ------------------
 1052|      0|    {
 1053|      0|      Debug (1, "IP %lx inside range %lx-%lx, but no explicit unwind info found\n",
 1054|      0|             (long) ip, (long) di->start_ip, (long) di->end_ip);
 1055|       |      /* IP is inside this table's range, but there is no explicit
 1056|       |         unwind info.  */
 1057|      0|      return -UNW_ENOINFO;
 1058|      0|    }
 1059|     15|  Debug (15, "ip=0x%lx, start_ip=0x%lx\n",
 1060|     15|         (long) ip, (long) found_start_ip_offset);
 1061|     15|  if (debug_frame_base)
  ------------------
  |  Branch (1061:7): [True: 0, False: 15]
  ------------------
 1062|      0|    fde_addr = found_fde_offset + debug_frame_base;
 1063|     15|  else
 1064|     15|    fde_addr = found_fde_offset + segbase;
 1065|     15|  Debug (1, "fde_offset = %lx, segbase = %lx, debug_frame_base = %lx, "
 1066|     15|            "fde_addr = %lx\n", (long) found_fde_offset, (long) segbase,
 1067|     15|            (long) debug_frame_base, (long) fde_addr);
 1068|     15|  if ((ret = dwarf_extract_proc_info_from_fde (as, a, &fde_addr, pi,
  ------------------
  |  |  397|     15|                UNW_OBJ (dwarf_extract_proc_info_from_fde)
  |  |  ------------------
  |  |  |  |   48|     15|#define UNW_OBJ(fn)	UNW_PASTE(UNW_PREFIX, fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|     15|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|     15|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1068:7): [True: 0, False: 15]
  ------------------
 1069|     15|                                               debug_frame_base ?
  ------------------
  |  Branch (1069:48): [True: 0, False: 15]
  ------------------
 1070|     15|                                               debug_frame_base : segbase,
 1071|     15|                                               need_unwind_info,
 1072|     15|                                               debug_frame_base != 0, arg)) < 0)
 1073|      0|    return ret;
 1074|       |
 1075|       |  /* .debug_frame uses an absolute encoding that does not know about any
 1076|       |     shared library relocation.  */
 1077|     15|  if (di->format == UNW_INFO_FORMAT_TABLE)
  ------------------
  |  Branch (1077:7): [True: 0, False: 15]
  ------------------
 1078|      0|    {
 1079|      0|      pi->start_ip += segbase;
 1080|      0|      pi->end_ip += segbase;
 1081|      0|      pi->flags = UNW_PI_FLAG_DEBUG_FRAME;
  ------------------
  |  |  146|      0|#define UNW_PI_FLAG_DEBUG_FRAME	32
  ------------------
 1082|      0|    }
 1083|       |
 1084|       |#if defined(NEED_LAST_IP)
 1085|       |  pi->last_ip = last_ip;
 1086|       |#else
 1087|     15|  (void)last_ip;
 1088|     15|#endif
 1089|     15|  if (ip < pi->start_ip || ip >= pi->end_ip)
  ------------------
  |  Branch (1089:7): [True: 0, False: 15]
  |  Branch (1089:28): [True: 0, False: 15]
  ------------------
 1090|      0|    return -UNW_ENOINFO;
 1091|       |
 1092|     15|  return 0;
 1093|     15|}
Lfind_proc_info-lsb.c:is_remote_table:
  927|     30|{
  928|     30|  return (format == UNW_INFO_FORMAT_REMOTE_TABLE ||
  ------------------
  |  Branch (928:11): [True: 30, False: 0]
  ------------------
  929|      0|          format == UNW_INFO_FORMAT_REMOTE_TABLE_64 ||
  ------------------
  |  Branch (929:11): [True: 0, False: 0]
  ------------------
  930|      0|          format == UNW_INFO_FORMAT_IP_OFFSET);
  ------------------
  |  Branch (930:11): [True: 0, False: 0]
  ------------------
  931|     30|}

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

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

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

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

_Uelf64_get_proc_name_in_image:
  648|  36.1k|{
  649|  36.1k|  Elf_W (Addr) load_offset;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  650|  36.1k|  Elf_W (Addr) min_dist = ~(Elf_W (Addr))0;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  651|  36.1k|  int ret;
  652|       |
  653|  36.1k|  load_offset = elf_w (get_load_offset) (ei, segbase);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  654|  36.1k|  ret = elf_w (lookup_symbol) (as, ip, ei, load_offset, buf, buf_len, &min_dist, arg);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  655|       |
  656|       |  /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in
  657|       |     there as well and replace the previously found if it is closer. */
  658|  36.1k|  struct elf_image mdi;
  659|  36.1k|  if (elf_w (extract_minidebuginfo) (ei, &mdi))
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (659:7): [True: 0, False: 36.1k]
  ------------------
  660|      0|    {
  661|      0|      int ret_mdi = elf_w (lookup_symbol) (as, ip, &mdi, load_offset, buf,
  ------------------
  |  |   45|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  662|      0|                                           buf_len, &min_dist, arg);
  663|       |
  664|       |      /* Closer symbol was found (possibly truncated). */
  665|      0|      if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM)
  ------------------
  |  Branch (665:11): [True: 0, False: 0]
  |  Branch (665:27): [True: 0, False: 0]
  ------------------
  666|      0|        {
  667|      0|          ret = ret_mdi;
  668|      0|        }
  669|       |
  670|      0|      mi_munmap (mdi.image, mdi.size);
  671|      0|    }
  672|       |
  673|  36.1k|  if (min_dist >= ei->size)
  ------------------
  |  Branch (673:7): [True: 0, False: 36.1k]
  ------------------
  674|      0|    return -UNW_ENOINFO;                /* not found */
  675|  36.1k|  if (offp)
  ------------------
  |  Branch (675:7): [True: 36.1k, False: 0]
  ------------------
  676|  36.1k|    *offp = min_dist;
  677|  36.1k|  return ret;
  678|  36.1k|}
_Uelf64_get_proc_name:
  683|  36.1k|{
  684|  36.1k|  unsigned long segbase, mapoff;
  685|  36.1k|  struct elf_image ei;
  686|  36.1k|  int ret;
  687|  36.1k|  char file[PATH_MAX];
  688|       |
  689|  36.1k|  ret = tdep_get_elf_image (as, &ei, pid, ip, &segbase, &mapoff, file, PATH_MAX, arg);
  ------------------
  |  |  237|  36.1k|#define tdep_get_elf_image              UNW_ARCH_OBJ(get_elf_image)
  |  |  ------------------
  |  |  |  |   49|  36.1k|#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn)
  |  |  |  |  ------------------
  |  |  |  |  |  |   47|  36.1k|#define UNW_PASTE(x,y)	UNW_PASTE2(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  36.1k|#define UNW_PASTE2(x,y)	x##y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|  36.1k|  if (ret < 0)
  ------------------
  |  Branch (690:7): [True: 0, False: 36.1k]
  ------------------
  691|      0|    return ret;
  692|       |
  693|  36.1k|  ret = elf_w (load_debuginfo) (file, &ei, 1);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  694|  36.1k|  if (ret < 0)
  ------------------
  |  Branch (694:7): [True: 0, False: 36.1k]
  ------------------
  695|      0|    return ret;
  696|       |
  697|  36.1k|  ret = elf_w (get_proc_name_in_image) (as, &ei, segbase, ip, buf, buf_len, offp, arg);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  698|       |
  699|  36.1k|  mi_munmap (ei.image, ei.size);
  700|  36.1k|  ei.image = NULL;
  701|       |
  702|  36.1k|  return ret;
  703|  36.1k|}
_Uelf64_find_section:
  784|  36.1k|{
  785|  36.1k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  786|  36.1k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  787|  36.1k|  char *strtab;
  788|  36.1k|  int i;
  789|       |
  790|  36.1k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (790:7): [True: 0, False: 36.1k]
  ------------------
  791|      0|    return 0;
  792|       |
  793|  36.1k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  794|  36.1k|  if (!shdr)
  ------------------
  |  Branch (794:7): [True: 0, False: 36.1k]
  ------------------
  795|      0|    return 0;
  796|       |
  797|  36.1k|  strtab = elf_w (string_table) (ei, ehdr->e_shstrndx);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  798|  36.1k|  if (!strtab)
  ------------------
  |  Branch (798:7): [True: 0, False: 36.1k]
  ------------------
  799|      0|    return 0;
  800|       |
  801|  1.97M|  for (i = 0; i < ehdr->e_shnum; ++i)
  ------------------
  |  Branch (801:15): [True: 1.94M, False: 31.5k]
  ------------------
  802|  1.94M|    {
  803|  1.94M|      if (strcmp (strtab + shdr->sh_name, secname) == 0)
  ------------------
  |  Branch (803:11): [True: 4.51k, False: 1.94M]
  ------------------
  804|  4.51k|        {
  805|  4.51k|          if (shdr->sh_offset + shdr->sh_size > ei->size)
  ------------------
  |  Branch (805:15): [True: 0, False: 4.51k]
  ------------------
  806|      0|            {
  807|      0|              Debug (1, "section \"%s\" outside image? (0x%lu > 0x%lu)\n",
  808|      0|                     secname,
  809|      0|                     (unsigned long) shdr->sh_offset + shdr->sh_size,
  810|      0|                     (unsigned long) ei->size);
  811|      0|              return 0;
  812|      0|            }
  813|       |
  814|  4.51k|          Debug (16, "found section \"%s\" at 0x%lx\n",
  815|  4.51k|                 secname, (unsigned long) shdr->sh_offset);
  816|  4.51k|          return shdr;
  817|  4.51k|        }
  818|       |
  819|  1.94M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  820|  1.94M|    }
  821|       |
  822|       |  /* section not found */
  823|  31.5k|  return 0;
  824|  36.1k|}
_Uelf64_load_debuginfo:
  986|  54.1k|{
  987|  54.1k|  int ret;
  988|  54.1k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  54.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  989|  54.1k|  Elf_W (Ehdr) *prev_image;
  ------------------
  |  |   44|  54.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  990|  54.1k|  off_t prev_size;
  991|  54.1k|  char path[PATH_MAX];
  992|       |
  993|  54.1k|  if (!ei->image)
  ------------------
  |  Branch (993:7): [True: 18.0k, False: 36.1k]
  ------------------
  994|  18.0k|    {
  995|  18.0k|      ret = elf_map_image(ei, file);
  996|  18.0k|      if (ret)
  ------------------
  |  Branch (996:11): [True: 18.0k, False: 0]
  ------------------
  997|  18.0k|        return ret;
  998|  18.0k|    }
  999|       |
 1000|  36.1k|  prev_image = ei->image;
 1001|  36.1k|  prev_size = ei->size;
 1002|       |
 1003|       |  /* Ignore separate debug files which contain a .gnu_debuglink section. */
 1004|  36.1k|  if (is_local == -1) {
  ------------------
  |  Branch (1004:7): [True: 0, False: 36.1k]
  ------------------
 1005|      0|    return 0;
 1006|      0|  }
 1007|       |
 1008|  36.1k|  ret = elf_w (find_build_id_path) (ei, path, sizeof(path));
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1009|  36.1k|  if (ret == 0)
  ------------------
  |  Branch (1009:7): [True: 4.51k, False: 31.5k]
  ------------------
 1010|  4.51k|    {
 1011|  4.51k|      ei->image = NULL;
 1012|       |
 1013|  4.51k|      ret = elf_w (load_debuginfo) (path, ei, -1);
  ------------------
  |  |   45|  4.51k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1014|  4.51k|      if (ret == 0)
  ------------------
  |  Branch (1014:11): [True: 0, False: 4.51k]
  ------------------
 1015|      0|        {
 1016|      0|          mi_munmap (prev_image, prev_size);
 1017|      0|          return 0;
 1018|      0|        }
 1019|       |
 1020|  4.51k|      ei->image = prev_image;
 1021|  4.51k|      ei->size  = prev_size;
 1022|  4.51k|    }
 1023|       |
 1024|  36.1k|  shdr = elf_w (find_section) (ei, ".gnu_debuglink");
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1025|  36.1k|  if (shdr) {
  ------------------
  |  Branch (1025:7): [True: 4.51k, False: 31.5k]
  ------------------
 1026|  4.51k|    if (shdr->sh_size >= PATH_MAX ||
  ------------------
  |  Branch (1026:9): [True: 0, False: 4.51k]
  ------------------
 1027|  4.51k|	(shdr->sh_offset + shdr->sh_size > ei->size))
  ------------------
  |  Branch (1027:2): [True: 0, False: 4.51k]
  ------------------
 1028|      0|      return 0;
 1029|       |
 1030|  4.51k|    {
 1031|  4.51k|      char linkbuf[shdr->sh_size];
 1032|  4.51k|      char *link = ((char *) ei->image) + shdr->sh_offset;
 1033|  4.51k|      const char *p;
 1034|  4.51k|      static const char *debugdir = "/usr/lib/debug";
 1035|  4.51k|      char basedir[strlen(file) + 1];
 1036|  4.51k|      char newname[shdr->sh_size + strlen (debugdir) + strlen (file) + 9];
 1037|  4.51k|      size_t crc_offset;
 1038|  4.51k|      uint32_t crc;
 1039|       |
 1040|  4.51k|      memcpy(linkbuf, link, shdr->sh_size);
 1041|       |
 1042|  4.51k|      if (memchr (linkbuf, 0, shdr->sh_size) == NULL)
  ------------------
  |  Branch (1042:11): [True: 0, False: 4.51k]
  ------------------
 1043|      0|	return 0;
 1044|       |
 1045|       |      /* The section holds the NUL-terminated file name, padded to a
 1046|       |	 four-byte boundary, followed by the CRC-32 of the debug file.  */
 1047|  4.51k|      crc_offset = UNW_ALIGN (strlen (linkbuf) + 1, 4);
  ------------------
  |  |  447|  4.51k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
 1048|  4.51k|      if (crc_offset + sizeof (crc) > shdr->sh_size)
  ------------------
  |  Branch (1048:11): [True: 0, False: 4.51k]
  ------------------
 1049|      0|	{
 1050|      0|	  Debug (1, "Malformed .gnu_debuglink section in %s\n", file);
 1051|      0|	  return 0;
 1052|      0|	}
 1053|  4.51k|      memcpy (&crc, linkbuf + crc_offset, sizeof (crc));
 1054|       |
 1055|  4.51k|      ei->image = NULL;
 1056|       |
 1057|  4.51k|      Debug(1, "Found debuglink section, following %s\n", linkbuf);
 1058|       |
 1059|  4.51k|      p = strrchr (file, '/');
 1060|  4.51k|      if (p != NULL)
  ------------------
  |  Branch (1060:11): [True: 4.51k, False: 0]
  ------------------
 1061|  4.51k|	{
 1062|  4.51k|	  memcpy (basedir, file, p - file);
 1063|  4.51k|	  basedir[p - file] = '\0';
 1064|  4.51k|	}
 1065|      0|      else
 1066|      0|	basedir[0] = 0;
 1067|       |
 1068|  4.51k|      strcpy (newname, basedir);
 1069|  4.51k|      strcat (newname, "/");
 1070|  4.51k|      strcat (newname, linkbuf);
 1071|  4.51k|      ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  4.51k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1072|       |
 1073|  4.51k|      if (ret == -1)
  ------------------
  |  Branch (1073:11): [True: 4.51k, False: 0]
  ------------------
 1074|  4.51k|	{
 1075|  4.51k|	  strcpy (newname, basedir);
 1076|  4.51k|	  strcat (newname, "/.debug/");
 1077|  4.51k|	  strcat (newname, linkbuf);
 1078|  4.51k|	  ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  4.51k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1079|  4.51k|	}
 1080|       |
 1081|  4.51k|      if (ret == -1 && is_local == 1)
  ------------------
  |  Branch (1081:11): [True: 4.51k, False: 0]
  |  Branch (1081:24): [True: 4.51k, False: 0]
  ------------------
 1082|  4.51k|	{
 1083|  4.51k|	  strcpy (newname, debugdir);
 1084|  4.51k|	  strcat (newname, basedir);
 1085|  4.51k|	  strcat (newname, "/");
 1086|  4.51k|	  strcat (newname, linkbuf);
 1087|  4.51k|	  ret = elf_w (load_debuglink_file) (newname, ei, crc);
  ------------------
  |  |   45|  4.51k|# define elf_w(x)       _Uelf64_##x
  ------------------
 1088|  4.51k|	}
 1089|       |
 1090|  4.51k|      if (ret == -1)
  ------------------
  |  Branch (1090:11): [True: 4.51k, False: 0]
  ------------------
 1091|  4.51k|        {
 1092|       |          /* No debuglink file found even though .gnu_debuglink existed */
 1093|  4.51k|          ei->image = prev_image;
 1094|  4.51k|          ei->size = prev_size;
 1095|       |
 1096|  4.51k|          return 0;
 1097|  4.51k|        }
 1098|      0|      else
 1099|      0|        {
 1100|      0|          mi_munmap (prev_image, prev_size);
 1101|      0|        }
 1102|       |
 1103|      0|      return ret;
 1104|  4.51k|    }
 1105|  4.51k|  }
 1106|       |
 1107|  31.5k|  return 0;
 1108|  36.1k|}
elf64.c:_Uelf64_get_load_offset:
  462|  36.1k|{
  463|  36.1k|  Elf_W (Addr) offset = 0;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  464|  36.1k|  Elf_W (Ehdr) *ehdr;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  465|  36.1k|  Elf_W (Phdr) *phdr;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  466|  36.1k|  int i;
  467|       |  // mapoff is obtained from mmap information, so it is always aligned on a page size.
  468|       |  // PT_LOAD program headers p_offset however is not guaranteed to be aligned on a
  469|       |  // page size, ld.lld generate libraries where this is not the case. So we must
  470|       |  // make sure we compare both values with the same alignment.
  471|  36.1k|  unsigned long pagesize_alignment_mask = ~(unw_page_size - 1UL);
  472|       |
  473|  36.1k|  ehdr = ei->image;
  474|  36.1k|  phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff);
  475|       |
  476|   144k|  for (i = 0; i < ehdr->e_phnum; ++i)
  ------------------
  |  Branch (476:15): [True: 144k, False: 0]
  ------------------
  477|   144k|    if (phdr[i].p_type == PT_LOAD && phdr[i].p_flags & PF_X)
  ------------------
  |  Branch (477:9): [True: 72.2k, False: 72.2k]
  |  Branch (477:38): [True: 36.1k, False: 36.1k]
  ------------------
  478|  36.1k|      {
  479|  36.1k|        offset = segbase - phdr[i].p_vaddr + (phdr[i].p_offset & (~pagesize_alignment_mask));
  480|  36.1k|        break;
  481|  36.1k|      }
  482|       |
  483|  36.1k|  return offset;
  484|  36.1k|}
elf64.c:_Uelf64_lookup_symbol:
  389|  36.1k|{
  390|  36.1k|  struct symbol_lookup_context context =
  391|  36.1k|    {
  392|  36.1k|      .as = as,
  393|  36.1k|      .ip = ip,
  394|  36.1k|      .ei = ei,
  395|  36.1k|      .load_offset = load_offset,
  396|  36.1k|      .min_dist = min_dist,
  397|  36.1k|      .arg = arg,
  398|  36.1k|    };
  399|  36.1k|  struct symbol_callback_data data =
  400|  36.1k|    {
  401|  36.1k|      .buf = buf, 
  402|  36.1k|      .buf_len = buf_len,
  403|  36.1k|    };
  404|  36.1k|  return elf_w (lookup_symbol_closeness) (as,
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  405|  36.1k|                                          &context,
  406|  36.1k|                                          elf_w (lookup_symbol_callback),
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  407|  36.1k|                                          &data);
  408|  36.1k|}
elf64.c:_Uelf64_lookup_symbol_closeness:
  255|  36.1k|{
  256|  36.1k|  struct elf_image *ei = context->ei;
  257|  36.1k|  Elf_W (Addr) load_offset = context->load_offset;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  258|  36.1k|  size_t syment_size;
  259|  36.1k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  260|  36.1k|  Elf_W (Sym) *sym, *symtab, *symtab_end;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  261|  36.1k|  Elf_W (Shdr) *shdr;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  262|  36.1k|  Elf_W (Addr) val;
  ------------------
  |  |   44|  36.1k|# define Elf_W(x)       Elf64_##x
  ------------------
  263|  36.1k|  int i, ret = -UNW_ENOINFO;
  264|  36.1k|  char *strtab;
  265|       |
  266|  36.1k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (266:7): [True: 0, False: 36.1k]
  ------------------
  267|      0|    return -UNW_ENOINFO;
  268|       |
  269|  36.1k|  shdr = elf_w (section_table) (ei);
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  270|  36.1k|  if (!shdr)
  ------------------
  |  Branch (270:7): [True: 0, False: 36.1k]
  ------------------
  271|      0|    return -UNW_ENOINFO;
  272|       |
  273|  1.64M|  for (i = 0; i < ehdr->e_shnum && ret == -UNW_ENOINFO; ++i)
  ------------------
  |  Branch (273:15): [True: 1.64M, False: 0]
  |  Branch (273:36): [True: 1.60M, False: 36.1k]
  ------------------
  274|  1.60M|    {
  275|  1.60M|      switch (shdr->sh_type)
  276|  1.60M|        {
  277|  31.5k|        case SHT_SYMTAB:
  ------------------
  |  Branch (277:9): [True: 31.5k, False: 1.57M]
  ------------------
  278|  67.6k|        case SHT_DYNSYM:
  ------------------
  |  Branch (278:9): [True: 36.1k, False: 1.57M]
  ------------------
  279|  67.6k|          symtab = (Elf_W (Sym) *) ((char *) ei->image + shdr->sh_offset);
  280|  67.6k|          symtab_end = (Elf_W (Sym) *) ((char *) symtab + shdr->sh_size);
  281|  67.6k|          syment_size = shdr->sh_entsize;
  282|       |
  283|  67.6k|          strtab = elf_w (string_table) (ei, shdr->sh_link);
  ------------------
  |  |   45|  67.6k|# define elf_w(x)       _Uelf64_##x
  ------------------
  284|  67.6k|          if (!strtab)
  ------------------
  |  Branch (284:15): [True: 0, False: 67.6k]
  ------------------
  285|      0|            break;
  286|       |
  287|  67.6k|          Debug (16, "symtab=0x%lx[%d]\n",
  288|  67.6k|                 (long) shdr->sh_offset, shdr->sh_type);
  289|       |
  290|  67.6k|          for (sym = symtab;
  291|   143M|               sym < symtab_end;
  ------------------
  |  Branch (291:16): [True: 143M, False: 31.5k]
  ------------------
  292|   143M|               sym = (Elf_W (Sym) *) ((char *) sym + syment_size))
  293|   143M|            {
  294|   143M|              if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC
  ------------------
  |  |   43|   143M|# define ELF_W(x)       ELF64_##x
  ------------------
  |  Branch (294:19): [True: 95.9M, False: 47.7M]
  ------------------
  295|  95.9M|                  && sym->st_shndx != SHN_UNDEF)
  ------------------
  |  Branch (295:22): [True: 87.6M, False: 8.35M]
  ------------------
  296|  87.6M|                {
  297|  87.6M|                  val = sym->st_value;
  298|  87.6M|                  if (sym->st_shndx != SHN_ABS)
  ------------------
  |  Branch (298:23): [True: 87.6M, False: 0]
  ------------------
  299|  87.6M|                    val += load_offset;
  300|  87.6M|                  if (tdep_get_func_addr (as, val, &val, context->arg) < 0)
  ------------------
  |  |  439|  87.6M|# define tdep_get_func_addr(as,addr,v,arg)       (*(v) = addr, 0)
  ------------------
  |  Branch (300:23): [True: 0, False: 87.6M]
  ------------------
  301|      0|                    continue;
  302|  87.6M|                  Debug (16, "0x%016lx info=0x%02x %s\n",
  303|  87.6M|                         (long) val, sym->st_info, strtab + sym->st_name);
  304|       |
  305|  87.6M|                  struct symbol_info syminfo =
  306|  87.6M|                    {
  307|  87.6M|                      .strtab   = strtab,
  308|  87.6M|                      .sym      = sym,
  309|  87.6M|                      .start_ip = val
  310|  87.6M|                    };
  311|  87.6M|                  ret = symtab_lookup (context, &syminfo, data);
  312|       |
  313|       |                  /* Keep going if the IP is not found in this symtab entry. */
  314|  87.6M|                  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (314:23): [True: 87.5M, False: 36.1k]
  ------------------
  315|  87.5M|                    {
  316|  87.5M|                      continue;
  317|  87.5M|                    }
  318|       |
  319|  36.1k|                  break;
  320|  87.6M|                }
  321|   143M|            }
  322|  67.6k|          break;
  323|       |
  324|  1.53M|        default:
  ------------------
  |  Branch (324:9): [True: 1.53M, False: 67.6k]
  ------------------
  325|  1.53M|          break;
  326|  1.60M|        }
  327|  1.60M|      shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize);
  328|  1.60M|    }
  329|       |
  330|       |  /* If it wasn't found in the ELF symtab, check the synamic symtab. */
  331|  36.1k|  if (ret == -UNW_ENOINFO)
  ------------------
  |  Branch (331:7): [True: 0, False: 36.1k]
  ------------------
  332|      0|    ret = elf_w (lookup_symbol_from_dynamic) (as, context, symtab_lookup, data);
  ------------------
  |  |   45|      0|# define elf_w(x)       _Uelf64_##x
  ------------------
  333|       |
  334|  36.1k|  return ret;
  335|  36.1k|}
elf64.c:_Uelf64_lookup_symbol_callback:
  351|  87.6M|{
  352|  87.6M|  struct symbol_callback_data *d = data;
  353|  87.6M|  int ret = -UNW_ENOINFO;
  354|       |
  355|  87.6M|  if (context->ip >= syminfo->start_ip &&
  ------------------
  |  Branch (355:7): [True: 31.2M, False: 56.4M]
  ------------------
  356|  31.2M|      context->ip < (syminfo->start_ip + syminfo->sym->st_size))
  ------------------
  |  Branch (356:7): [True: 36.1k, False: 31.1M]
  ------------------
  357|  36.1k|    {
  358|  36.1k|      if ((Elf_W (Addr)) (context->ip - syminfo->start_ip) < *(context->min_dist))
  ------------------
  |  Branch (358:11): [True: 36.1k, False: 0]
  ------------------
  359|  36.1k|        {
  360|  36.1k|          *(context->min_dist) = (Elf_W (Addr)) (context->ip - syminfo->start_ip);
  361|  36.1k|          char const* const sym_name     = syminfo->strtab + syminfo->sym->st_name;
  362|  36.1k|          size_t            sym_name_len = strlen(sym_name);
  363|  36.1k|          Debug (1, "candidate sym: %s@%#010lx\n", sym_name, syminfo->start_ip);
  364|  36.1k|          if (sym_name_len >= d->buf_len)
  ------------------
  |  Branch (364:15): [True: 0, False: 36.1k]
  ------------------
  365|      0|            {
  366|      0|              Debug (1, "symbol length %zu exceeds buffer of length %zu\n",
  367|      0|                     sym_name_len+1, d->buf_len);
  368|      0|              sym_name_len = d->buf_len - 1; /* adjust for null terminator */
  369|      0|              ret = -UNW_ENOMEM; /* indicate truncation of symbol name */
  370|      0|            }
  371|  36.1k|          else
  372|  36.1k|            {
  373|  36.1k|              ret = UNW_ESUCCESS;
  374|  36.1k|            }
  375|  36.1k|          memcpy(d->buf, sym_name, sym_name_len);
  376|  36.1k|          d->buf[sym_name_len] = 0; /* null terminate */
  377|  36.1k|        }
  378|  36.1k|    }
  379|       |
  380|  87.6M|  return ret;
  381|  87.6M|}
elf64.c:_Uelf64_extract_minidebuginfo:
  633|  36.1k|{
  634|  36.1k|  return 0;
  635|  36.1k|}
elf64.c:_Uelf64_section_table:
   86|  72.2k|{
   87|  72.2k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|  72.2k|# define Elf_W(x)       Elf64_##x
  ------------------
   88|  72.2k|  Elf_W (Off) soff;
  ------------------
  |  |   44|  72.2k|# define Elf_W(x)       Elf64_##x
  ------------------
   89|  72.2k|  size_t table_size;
   90|       |
   91|  72.2k|  soff = ehdr->e_shoff;
   92|  72.2k|  table_size = (size_t) ehdr->e_shnum * ehdr->e_shentsize;
   93|  72.2k|  if (soff > ei->size || table_size > ei->size - (size_t) soff)
  ------------------
  |  Branch (93:7): [True: 0, False: 72.2k]
  |  Branch (93:26): [True: 0, False: 72.2k]
  ------------------
   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|  72.2k|  return (Elf_W (Shdr) *) ((char *) ei->image + soff);
  101|  72.2k|}
elf64.c:_Uelf64_string_table:
  105|   103k|{
  106|   103k|  Elf_W (Ehdr) *ehdr = ei->image;
  ------------------
  |  |   44|   103k|# define Elf_W(x)       Elf64_##x
  ------------------
  107|   103k|  Elf_W (Off) soff, str_soff;
  ------------------
  |  |   44|   103k|# define Elf_W(x)       Elf64_##x
  ------------------
  108|   103k|  Elf_W (Shdr) *str_shdr;
  ------------------
  |  |   44|   103k|# define Elf_W(x)       Elf64_##x
  ------------------
  109|       |
  110|       |  /* this offset is assumed to be OK */
  111|   103k|  soff = ehdr->e_shoff;
  112|       |
  113|   103k|  str_soff = soff + (section * ehdr->e_shentsize);
  114|   103k|  if (str_soff + ehdr->e_shentsize > ei->size)
  ------------------
  |  Branch (114:7): [True: 0, False: 103k]
  ------------------
  115|      0|    {
  116|      0|      Debug (1, "string shdr table outside of image? (%lu > %lu)\n",
  117|      0|             (unsigned long) (str_soff + ehdr->e_shentsize),
  118|      0|             (unsigned long) ei->size);
  119|      0|      return NULL;
  120|      0|    }
  121|   103k|  str_shdr = (Elf_W (Shdr) *) ((char *) ei->image + str_soff);
  122|       |
  123|   103k|  if (str_shdr->sh_offset + str_shdr->sh_size > ei->size)
  ------------------
  |  Branch (123:7): [True: 0, False: 103k]
  ------------------
  124|      0|    {
  125|      0|      Debug (1, "string table outside of image? (%lu > %lu)\n",
  126|      0|             (unsigned long) (str_shdr->sh_offset + str_shdr->sh_size),
  127|      0|             (unsigned long) ei->size);
  128|      0|      return NULL;
  129|      0|    }
  130|       |
  131|   103k|  Debug (16, "strtab=0x%lx\n", (long) str_shdr->sh_offset);
  132|   103k|  return ei->image + str_shdr->sh_offset;
  133|   103k|}
elf64.c:_Uelf64_find_build_id_path:
  842|  36.1k|{
  843|       |/*
  844|       | * build-id is only available on GNU plaforms. So on non-GNU platforms this
  845|       | * function just returns fail (-1).
  846|       | */
  847|  36.1k|#if defined(ELF_NOTE_GNU) && defined(NT_GNU_BUILD_ID)
  848|  36.1k|  const Elf_W (Ehdr) *ehdr = ei->image;
  849|  36.1k|  const Elf_W (Phdr) *phdr;
  850|  36.1k|  unsigned i;
  851|       |
  852|  36.1k|  if (!elf_w (valid_object) (ei))
  ------------------
  |  |   45|  36.1k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (852:7): [True: 0, False: 36.1k]
  ------------------
  853|      0|    return -1;
  854|       |
  855|  36.1k|  phdr = (Elf_W (Phdr) *) ((uint8_t *) ehdr + ehdr->e_phoff);
  856|       |
  857|   451k|  for (i = 0; i < ehdr->e_phnum; ++i, phdr = (const Elf_W (Phdr) *) (((const uint8_t *) phdr) + ehdr->e_phentsize))
  ------------------
  |  Branch (857:15): [True: 419k, False: 31.5k]
  ------------------
  858|   419k|    {
  859|   419k|      const uint8_t *notes;
  860|   419k|      const uint8_t *notes_end;
  861|       |
  862|       |      /* The build-id is in a note section */
  863|   419k|      if (phdr->p_type != PT_NOTE)
  ------------------
  |  Branch (863:11): [True: 379k, False: 40.6k]
  ------------------
  864|   379k|        continue;
  865|       |
  866|  40.6k|      notes = elf_w (get_program_segment) (ei, phdr, &notes_end);
  ------------------
  |  |   45|  40.6k|# define elf_w(x)       _Uelf64_##x
  ------------------
  867|       |
  868|  76.7k|      while(notes < notes_end)
  ------------------
  |  Branch (868:13): [True: 40.6k, False: 36.1k]
  ------------------
  869|  40.6k|        {
  870|  40.6k|          const char prefix[] = "/usr/lib/debug/.build-id/";
  871|       |
  872|       |          /* See "man 5 elf" for notes about alignment in Nhdr */
  873|  40.6k|          const Elf_W(Nhdr) *nhdr = (const Elf_W(Nhdr) *) notes;
  874|  40.6k|          const Elf_W(Word) namesz = nhdr->n_namesz;
  875|  40.6k|          const Elf_W(Word) descsz = nhdr->n_descsz;
  876|  40.6k|          const Elf_W(Word) nameasz = UNW_ALIGN(namesz, 4); /* Aligned size */
  ------------------
  |  |  447|  40.6k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  877|  40.6k|          const char *name = (const char *) (nhdr + 1);
  878|  40.6k|          const uint8_t *desc = (const uint8_t *) name + nameasz;
  879|  40.6k|          unsigned j;
  880|       |
  881|  40.6k|          notes += sizeof(*nhdr) + nameasz + UNW_ALIGN(descsz, 4);
  ------------------
  |  |  447|  40.6k|#define UNW_ALIGN(x,a) (((size_t)(x) + (size_t)(a) - 1) & ~((size_t)(a) - 1))
  ------------------
  882|       |
  883|  40.6k|          if ((namesz != sizeof(ELF_NOTE_GNU)) ||  /* Spec says must be "GNU" with a NULL */
  ------------------
  |  Branch (883:15): [True: 0, False: 40.6k]
  ------------------
  884|  40.6k|              (nhdr->n_type != NT_GNU_BUILD_ID) || /* Spec says must be NT_GNU_BUILD_ID   */
  ------------------
  |  Branch (884:15): [True: 36.1k, False: 4.51k]
  ------------------
  885|  4.51k|              (strcmp(name, ELF_NOTE_GNU) != 0))   /* Must be "GNU" with NULL termination */
  ------------------
  |  Branch (885:15): [True: 0, False: 4.51k]
  ------------------
  886|  36.1k|            continue;
  887|       |
  888|       |          /* Validate that we have enough space */
  889|  4.51k|          if (path_len < (sizeof(prefix) +     /* Path prefix inc NULL */
  ------------------
  |  Branch (889:15): [True: 0, False: 4.51k]
  ------------------
  890|  4.51k|                          2 +                  /* Subdirectory         */
  891|  4.51k|                          1 +                  /* Directory separator  */
  892|  4.51k|                          (2 * (descsz - 1)) + /* Leaf filename        */
  893|  4.51k|                          6))                  /* .debug extension     */
  894|      0|            return -1;
  895|       |
  896|  4.51k|          memcpy(path, prefix, sizeof(prefix));
  897|       |
  898|  4.51k|          path = elf_w (add_hex_byte) (path + sizeof(prefix) - 1, *desc);
  ------------------
  |  |   45|  4.51k|# define elf_w(x)       _Uelf64_##x
  ------------------
  899|  4.51k|          *path++ = '/';
  900|       |
  901|  90.2k|          for(j = 1, ++desc; j < descsz; ++j, ++desc)
  ------------------
  |  Branch (901:30): [True: 85.7k, False: 4.51k]
  ------------------
  902|  85.7k|            path = elf_w (add_hex_byte) (path, *desc);
  ------------------
  |  |   45|  85.7k|# define elf_w(x)       _Uelf64_##x
  ------------------
  903|       |
  904|  4.51k|          strcat(path, ".debug");
  905|       |
  906|  4.51k|          return 0;
  907|  4.51k|        }
  908|  40.6k|    }
  909|  31.5k|#endif /* defined(ELF_NOTE_GNU) */
  910|       |
  911|  31.5k|  return -1;
  912|  36.1k|}
elf64.c:_Uelf64_add_hex_byte:
  829|  90.2k|{
  830|  90.2k|  const char hex[] = "0123456789abcdef";
  831|       |
  832|  90.2k|  *str++ = hex[byte >> 4];
  833|  90.2k|  *str++ = hex[byte & 0xf];
  834|  90.2k|  *str = 0;
  835|       |
  836|  90.2k|  return str;
  837|  90.2k|}
elf64.c:_Uelf64_load_debuglink_file:
  955|  13.5k|{
  956|  13.5k|  uint32_t file_crc;
  957|       |
  958|  13.5k|  if (elf_w (load_debuginfo) (file, ei, -1) != 0)
  ------------------
  |  |   45|  13.5k|# define elf_w(x)       _Uelf64_##x
  ------------------
  |  Branch (958:7): [True: 13.5k, False: 0]
  ------------------
  959|  13.5k|    {
  960|  13.5k|      ei->image = NULL;
  961|  13.5k|      return -1;
  962|  13.5k|    }
  963|       |
  964|      0|  file_crc = debuglink_crc32 (ei->image, ei->size);
  965|      0|  if (file_crc != crc)
  ------------------
  |  Branch (965:7): [True: 0, False: 0]
  ------------------
  966|      0|    {
  967|      0|      Debug (1, "CRC mismatch for debug file %s (%08x, expected %08x)\n",
  968|      0|             file, file_crc, crc);
  969|      0|      mi_munmap (ei->image, ei->size);
  970|      0|      ei->image = NULL;
  971|      0|      return -1;
  972|      0|    }
  973|       |
  974|      0|  return 0;
  975|      0|}

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

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

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

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

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

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

_ULx86_64_Iiterate_phdr_for_ip:
  111|     15|{
  112|     15|  intrmask_t saved_mask;
  113|     15|  int ret;
  114|       |
  115|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
  ------------------
  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  ------------------
  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  116|       |#if defined(HAVE__DL_FIND_OBJECT) && defined(HAVE_DL_ITERATE_PHDR)
  117|       |  if (as->iterate_phdr_function == dl_iterate_phdr)
  118|       |    {
  119|       |      struct dl_phdr_info info;
  120|       |
  121|       |      ret = find_object_phdr_info (ip, &info);
  122|       |      if (ret >= 0)
  123|       |        {
  124|       |          if (ret > 0)
  125|       |            ret = callback (&info, sizeof (info), data);
  126|       |          SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  127|       |          return ret;
  128|       |        }
  129|       |      Debug (3, "cannot locate program headers for IP=0x%lx, "
  130|       |             "falling back to dl_iterate_phdr\n", (long) ip);
  131|       |    }
  132|       |#endif
  133|     15|  ret = as->iterate_phdr_function (callback, data);
  134|       |  SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
  ------------------
  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  ------------------
  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  ------------------
  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  ------------------
  135|     15|  return ret;
  136|     15|}

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

_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|     15|{
  135|     15|  intrmask_t saved_mask;
  136|     15|  struct object *obj;
  137|       |
  138|     15|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     15|#define lock_acquire(l,m)                               \
  |  |  212|     15|do {                                                    \
  |  |  213|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     15|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     15|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  139|     15|  {
  140|     15|    if (pool->num_free <= pool->reserve)
  ------------------
  |  Branch (140:9): [True: 0, False: 15]
  ------------------
  141|      0|      expand (pool);
  142|       |
  143|     15|    assert (pool->num_free > 0);
  ------------------
  |  Branch (143:5): [True: 0, False: 15]
  |  Branch (143:5): [True: 15, False: 0]
  ------------------
  144|       |
  145|     15|    --pool->num_free;
  146|     15|    obj = pool->free_list;
  147|     15|    pool->free_list = obj->next;
  148|     15|  }
  149|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     15|#define lock_release(l,m)                       \
  |  |  217|     15|do {                                            \
  |  |  218|     15|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     15|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     15|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  150|     15|  return obj;
  151|     15|}
_UIx86_64__mempool_free:
  155|     15|{
  156|     15|  intrmask_t saved_mask;
  157|       |
  158|     15|  lock_acquire (&pool->lock, saved_mask);
  ------------------
  |  |  211|     15|#define lock_acquire(l,m)                               \
  |  |  212|     15|do {                                                    \
  |  |  213|     15|  SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m));     \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  214|     15|  mutex_lock (l);                                       \
  |  |  ------------------
  |  |  |  |  169|     15|        (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  215|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (215:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  159|     15|  {
  160|     15|    free_object (pool, object);
  161|     15|  }
  162|       |  lock_release (&pool->lock, saved_mask);
  ------------------
  |  |  216|     15|#define lock_release(l,m)                       \
  |  |  217|     15|do {                                            \
  |  |  218|     15|  mutex_unlock (l);                             \
  |  |  ------------------
  |  |  |  |  171|     15|        (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:10): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  219|     15|  SIGPROCMASK (SIG_SETMASK, &(m), NULL);        \
  |  |  ------------------
  |  |  |  |  195|     15|    (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (195:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  196|     15|     : sigprocmask((how), (new_mask), (old_mask)))
  |  |  ------------------
  |  |  220|     15|} while (0)
  |  |  ------------------
  |  |  |  Branch (220:10): [Folded, False: 15]
  |  |  ------------------
  ------------------
  163|     15|}
mempool.c:expand:
   88|      2|{
   89|      2|  size_t size;
   90|      2|  char *mem;
   91|       |
   92|      2|  size = pool->chunk_size;
   93|      2|  GET_MEMORY (mem, size);
  ------------------
  |  |  260|      2|#define GET_MEMORY(mem, size)                                               \
  |  |  261|      2|do {                                                                        \
  |  |  262|      2|  mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE,                        \
  |  |  263|      2|                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);                       \
  |  |  264|      2|  if (mem == MAP_FAILED)                                                    \
  |  |  ------------------
  |  |  |  Branch (264:7): [True: 0, False: 2]
  |  |  ------------------
  |  |  265|      2|    mem = NULL;                                                             \
  |  |  266|      2|} while (0)
  |  |  ------------------
  |  |  |  Branch (266:10): [Folded, False: 2]
  |  |  ------------------
  ------------------
   94|      2|  if (!mem)
  ------------------
  |  Branch (94:7): [True: 0, False: 2]
  ------------------
   95|      0|    {
   96|      0|      size = UNW_ALIGN(pool->obj_size, unw_page_size);
  ------------------
  |  |  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|     87|{
   70|     87|  struct object *obj = object;
   71|       |
   72|     87|  obj->next = pool->free_list;
   73|     87|  pool->free_list = obj;
   74|     87|  ++pool->num_free;
   75|     87|}

_Ux86_64_get_elf_image:
   53|  36.1k|{
   54|  36.1k|  struct map_iterator mi;
   55|  36.1k|  int found = 0, rc = UNW_ESUCCESS;
   56|  36.1k|  unsigned long hi;
   57|  36.1k|  char root[sizeof ("/proc/0123456789/root")], *cp;
   58|  36.1k|  char *full_path;
   59|  36.1k|  struct stat st;
   60|  36.1k|  unw_accessors_t *a;
   61|  36.1k|  unw_word_t magic;
   62|       |
   63|       |
   64|  36.1k|  if (maps_init (&mi, pid) < 0)
  ------------------
  |  Branch (64:7): [True: 0, False: 36.1k]
  ------------------
   65|      0|    return -1;
   66|       |
   67|   126k|  while (maps_next (&mi, segbase, &hi, mapoff, NULL))
  ------------------
  |  Branch (67:10): [True: 126k, False: 0]
  ------------------
   68|   126k|    if (ip >= *segbase && ip < hi)
  ------------------
  |  Branch (68:9): [True: 126k, False: 0]
  |  Branch (68:27): [True: 36.1k, False: 90.2k]
  ------------------
   69|  36.1k|      {
   70|  36.1k|        found = 1;
   71|  36.1k|        break;
   72|  36.1k|      }
   73|       |
   74|  36.1k|  if (!found)
  ------------------
  |  Branch (74:7): [True: 0, False: 36.1k]
  ------------------
   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|  36.1k|  if (!ei && path)
  ------------------
  |  Branch (81:7): [True: 0, False: 36.1k]
  |  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|  36.1k|  full_path = mi.path;
   93|       |
   94|       |  /* Get process root */
   95|  36.1k|  memcpy (root, "/proc/", 6);
   96|  36.1k|  cp = unw_ltoa (root + 6, pid);
   97|  36.1k|  assert (cp + 6 < root + sizeof (root));
  ------------------
  |  Branch (97:3): [True: 0, False: 36.1k]
  |  Branch (97:3): [True: 36.1k, False: 0]
  ------------------
   98|  36.1k|  memcpy (cp, "/root", 6);
   99|       |
  100|  36.1k|  size_t _len = strlen (mi.path) + 1;
  101|  36.1k|  if (!stat(root, &st) && S_ISDIR(st.st_mode))
  ------------------
  |  Branch (101:7): [True: 36.1k, False: 0]
  |  Branch (101:27): [True: 36.1k, False: 0]
  ------------------
  102|  36.1k|    _len += strlen (root);
  103|      0|  else
  104|      0|    root[0] = '\0';
  105|       |
  106|  36.1k|  full_path = path;
  107|  36.1k|  if(!path)
  ------------------
  |  Branch (107:6): [True: 0, False: 36.1k]
  ------------------
  108|      0|    full_path = (char*) malloc (_len);
  109|  36.1k|  else if(_len >= pathlen) // passed buffer is too small, fail
  ------------------
  |  Branch (109:11): [True: 0, False: 36.1k]
  ------------------
  110|      0|    {
  111|      0|      maps_close (&mi);
  112|      0|      return -1;
  113|      0|    }
  114|       |
  115|  36.1k|  strcpy (full_path, root);
  116|  36.1k|  strcat (full_path, mi.path);
  117|       |
  118|  36.1k|  if (stat(full_path, &st) || !S_ISREG(st.st_mode))
  ------------------
  |  Branch (118:7): [True: 0, False: 36.1k]
  |  Branch (118:31): [True: 0, False: 36.1k]
  ------------------
  119|      0|    strcpy(full_path, mi.path);
  120|       |
  121|  36.1k|  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|  36.1k|  if (rc != -1)
  ------------------
  |  Branch (128:7): [True: 36.1k, False: 0]
  ------------------
  129|  36.1k|  {
  130|  36.1k|    maps_close (&mi);
  131|  36.1k|    goto err_exit;
  132|  36.1k|  }
  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|  36.1k|err_exit:
  209|       |
  210|  36.1k|  if (!path)
  ------------------
  |  Branch (210:7): [True: 0, False: 36.1k]
  ------------------
  211|      0|    free (full_path);
  212|       |
  213|  36.1k|  maps_close (&mi);
  214|  36.1k|  return rc;
  215|      0|}

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

_ULx86_64_get_save_loc:
   32|  5.82k|{
   33|  5.82k|  struct cursor *c = (struct cursor *) cursor;
   34|  5.82k|  dwarf_loc_t loc;
   35|       |
   36|  5.82k|  loc = DWARF_NULL_LOC;         /* default to "not saved" */
  ------------------
  |  |  155|  5.82k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  150|  5.82k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   37|       |
   38|  5.82k|  switch (reg)
   39|  5.82k|    {
   40|     96|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|     96|#define RBX     3
  ------------------
  |  Branch (40:5): [True: 96, False: 5.72k]
  ------------------
   41|  1.41k|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|  1.41k|#define RSP     7
  ------------------
  |  Branch (41:5): [True: 1.41k, False: 4.40k]
  ------------------
   42|    104|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|    104|#define RBP     6
  ------------------
  |  Branch (42:5): [True: 104, False: 5.72k]
  ------------------
   43|     72|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|     72|#define R12     12
  ------------------
  |  Branch (43:5): [True: 72, False: 5.75k]
  ------------------
   44|    192|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|    192|#define R13     13
  ------------------
  |  Branch (44:5): [True: 192, False: 5.63k]
  ------------------
   45|     64|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|     64|#define R14     14
  ------------------
  |  Branch (45:5): [True: 64, False: 5.76k]
  ------------------
   46|    560|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|    560|#define R15     15
  ------------------
  |  Branch (46:5): [True: 560, False: 5.26k]
  ------------------
   47|    184|    case UNW_X86_64_RIP: loc = c->dwarf.loc[RIP]; break;
  ------------------
  |  |   59|    184|#define RIP     16
  ------------------
  |  Branch (47:5): [True: 184, False: 5.64k]
  ------------------
   48|       |
   49|  3.13k|    default:
  ------------------
  |  Branch (49:5): [True: 3.13k, False: 2.68k]
  ------------------
   50|  3.13k|      break;
   51|  5.82k|    }
   52|       |
   53|  5.82k|  memset (sloc, 0, sizeof (*sloc));
   54|       |
   55|  5.82k|  if (DWARF_IS_NULL_LOC (loc))
  ------------------
  |  |  156|  5.82k|# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
  |  |  ------------------
  |  |  |  |  139|  5.82k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  |  |  |  Branch (156:33): [True: 3.13k, False: 2.68k]
  |  |  ------------------
  ------------------
   56|  3.13k|    {
   57|  3.13k|      sloc->type = UNW_SLT_NONE;
   58|  3.13k|      return 0;
   59|  3.13k|    }
   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.68k|    {
   70|  2.68k|      sloc->type = UNW_SLT_MEMORY;
   71|  2.68k|      sloc->u.addr = DWARF_GET_MEM_LOC (loc);
  ------------------
  |  |  429|  2.68k|#define DWARF_GET_MEM_LOC(l)    DWARF_GET_LOC(l)
  |  |  ------------------
  |  |  |  |  139|  2.68k|#define DWARF_GET_LOC(l)        ((l).val)
  |  |  ------------------
  ------------------
   72|  2.68k|    }
   73|  2.68k|  return 0;
   74|  5.82k|}

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

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

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

_ULx86_64_access_reg:
   67|  73.2k|{
   68|  73.2k|  dwarf_loc_t loc = DWARF_NULL_LOC;
  ------------------
  |  |  155|  73.2k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  150|  73.2k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   69|  73.2k|  unsigned int mask;
   70|  73.2k|  int arg_num;
   71|       |
   72|  73.2k|  switch (reg)
   73|  73.2k|    {
   74|       |
   75|      0|    case UNW_X86_64_RIP:
  ------------------
  |  Branch (75:5): [True: 0, False: 73.2k]
  ------------------
   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|    224|    case UNW_X86_64_CFA:
  ------------------
  |  Branch (81:5): [True: 224, False: 73.0k]
  ------------------
   82|    224|      if (write)
  ------------------
  |  Branch (82:11): [True: 0, False: 224]
  ------------------
   83|      0|        return -UNW_EREADONLYREG;
   84|    224|      *valp = c->dwarf.cfa;
   85|    224|      return 0;
   86|       |
   87|    296|    case UNW_X86_64_RAX:
  ------------------
  |  Branch (87:5): [True: 296, False: 72.9k]
  ------------------
   88|  2.32k|    case UNW_X86_64_RDX:
  ------------------
  |  Branch (88:5): [True: 2.03k, False: 71.2k]
  ------------------
   89|  2.32k|      arg_num = reg - UNW_X86_64_RAX;
   90|  2.32k|      mask = (1 << arg_num);
   91|  2.32k|      if (write)
  ------------------
  |  Branch (91:11): [True: 0, False: 2.32k]
  ------------------
   92|      0|        {
   93|      0|          c->dwarf.eh_args[arg_num] = *valp;
   94|      0|          c->dwarf.eh_valid_mask |= mask;
   95|      0|          return 0;
   96|      0|        }
   97|  2.32k|      else if ((c->dwarf.eh_valid_mask & mask) != 0)
  ------------------
  |  Branch (97:16): [True: 0, False: 2.32k]
  ------------------
   98|      0|        {
   99|      0|          *valp = c->dwarf.eh_args[arg_num];
  100|      0|          return 0;
  101|      0|        }
  102|  2.32k|      else
  103|  2.32k|        loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   43|    296|#define RAX     0
  ------------------
                      loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   44|  2.03k|#define RDX     1
  ------------------
  |  Branch (103:28): [True: 296, False: 2.03k]
  ------------------
  104|  2.32k|      break;
  105|       |
  106|  2.32k|    case UNW_X86_64_RCX: loc = c->dwarf.loc[RCX]; break;
  ------------------
  |  |   45|    448|#define RCX     2
  ------------------
  |  Branch (106:5): [True: 448, False: 72.8k]
  ------------------
  107|    520|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|    520|#define RBX     3
  ------------------
  |  Branch (107:5): [True: 520, False: 72.7k]
  ------------------
  108|       |
  109|  14.0k|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|  14.0k|#define RSP     7
  ------------------
  |  Branch (109:5): [True: 14.0k, False: 59.2k]
  ------------------
  110|  48.7k|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|  48.7k|#define RBP     6
  ------------------
  |  Branch (110:5): [True: 48.7k, False: 24.4k]
  ------------------
  111|    848|    case UNW_X86_64_RSI: loc = c->dwarf.loc[RSI]; break;
  ------------------
  |  |   47|    848|#define RSI     4
  ------------------
  |  Branch (111:5): [True: 848, False: 72.4k]
  ------------------
  112|    616|    case UNW_X86_64_RDI: loc = c->dwarf.loc[RDI]; break;
  ------------------
  |  |   48|    616|#define RDI     5
  ------------------
  |  Branch (112:5): [True: 616, False: 72.6k]
  ------------------
  113|    240|    case UNW_X86_64_R8: loc = c->dwarf.loc[R8]; break;
  ------------------
  |  |   51|    240|#define R8      8
  ------------------
  |  Branch (113:5): [True: 240, False: 73.0k]
  ------------------
  114|    592|    case UNW_X86_64_R9: loc = c->dwarf.loc[R9]; break;
  ------------------
  |  |   52|    592|#define R9      9
  ------------------
  |  Branch (114:5): [True: 592, False: 72.6k]
  ------------------
  115|    480|    case UNW_X86_64_R10: loc = c->dwarf.loc[R10]; break;
  ------------------
  |  |   53|    480|#define R10     10
  ------------------
  |  Branch (115:5): [True: 480, False: 72.7k]
  ------------------
  116|    264|    case UNW_X86_64_R11: loc = c->dwarf.loc[R11]; break;
  ------------------
  |  |   54|    264|#define R11     11
  ------------------
  |  Branch (116:5): [True: 264, False: 72.9k]
  ------------------
  117|    208|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|    208|#define R12     12
  ------------------
  |  Branch (117:5): [True: 208, False: 73.0k]
  ------------------
  118|    696|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|    696|#define R13     13
  ------------------
  |  Branch (118:5): [True: 696, False: 72.5k]
  ------------------
  119|    552|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|    552|#define R14     14
  ------------------
  |  Branch (119:5): [True: 552, False: 72.7k]
  ------------------
  120|    344|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|    344|#define R15     15
  ------------------
  |  Branch (120:5): [True: 344, False: 72.9k]
  ------------------
  121|       |
  122|  2.07k|    default:
  ------------------
  |  Branch (122:5): [True: 2.07k, False: 71.1k]
  ------------------
  123|  2.07k|      Debug (1, "bad register number %u\n", reg);
  124|  2.07k|      return -UNW_EBADREG;
  125|  73.2k|    }
  126|       |
  127|  70.9k|  if (write)
  ------------------
  |  Branch (127:7): [True: 0, False: 70.9k]
  ------------------
  128|      0|    return dwarf_put (&c->dwarf, loc, *valp);
  129|  70.9k|  else
  130|  70.9k|    return dwarf_get (&c->dwarf, loc, valp);
  131|  70.9k|}

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

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

