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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ULx86_64_access_reg:
   67|   148k|{
   68|   148k|  dwarf_loc_t loc = DWARF_NULL_LOC;
  ------------------
  |  |  156|   148k|# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
  |  |  ------------------
  |  |  |  |  151|   148k|# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
  |  |  ------------------
  ------------------
   69|   148k|  unsigned int mask;
   70|   148k|  int arg_num;
   71|       |
   72|   148k|  switch (reg)
   73|   148k|    {
   74|       |
   75|      0|    case UNW_X86_64_RIP:
  ------------------
  |  Branch (75:5): [True: 0, False: 148k]
  ------------------
   76|      0|      if (write)
  ------------------
  |  Branch (76:11): [True: 0, False: 0]
  ------------------
   77|      0|        c->dwarf.ip = *valp;            /* also update the RIP cache */
   78|      0|      loc = c->dwarf.loc[RIP];
  ------------------
  |  |   59|      0|#define RIP     16
  ------------------
   79|      0|      break;
   80|       |
   81|  2.01k|    case UNW_X86_64_CFA:
  ------------------
  |  Branch (81:5): [True: 2.01k, False: 146k]
  ------------------
   82|  2.01k|      if (write)
  ------------------
  |  Branch (82:11): [True: 0, False: 2.01k]
  ------------------
   83|      0|        return -UNW_EREADONLYREG;
   84|  2.01k|      *valp = c->dwarf.cfa;
   85|  2.01k|      return 0;
   86|       |
   87|  2.28k|    case UNW_X86_64_RAX:
  ------------------
  |  Branch (87:5): [True: 2.28k, False: 146k]
  ------------------
   88|  6.52k|    case UNW_X86_64_RDX:
  ------------------
  |  Branch (88:5): [True: 4.23k, False: 144k]
  ------------------
   89|  6.52k|      arg_num = reg - UNW_X86_64_RAX;
   90|  6.52k|      mask = (1 << arg_num);
   91|  6.52k|      if (write)
  ------------------
  |  Branch (91:11): [True: 0, False: 6.52k]
  ------------------
   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|  6.52k|      else if ((c->dwarf.eh_valid_mask & mask) != 0)
  ------------------
  |  Branch (97:16): [True: 0, False: 6.52k]
  ------------------
   98|      0|        {
   99|      0|          *valp = c->dwarf.eh_args[arg_num];
  100|      0|          return 0;
  101|      0|        }
  102|  6.52k|      else
  103|  6.52k|        loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   43|  2.28k|#define RAX     0
  ------------------
                      loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX];
  ------------------
  |  |   44|  4.23k|#define RDX     1
  ------------------
  |  Branch (103:28): [True: 2.28k, False: 4.23k]
  ------------------
  104|  6.52k|      break;
  105|       |
  106|  6.52k|    case UNW_X86_64_RCX: loc = c->dwarf.loc[RCX]; break;
  ------------------
  |  |   45|  2.21k|#define RCX     2
  ------------------
  |  Branch (106:5): [True: 2.21k, False: 146k]
  ------------------
  107|  3.55k|    case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break;
  ------------------
  |  |   46|  3.55k|#define RBX     3
  ------------------
  |  Branch (107:5): [True: 3.55k, False: 145k]
  ------------------
  108|       |
  109|  10.7k|    case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break;
  ------------------
  |  |   50|  10.7k|#define RSP     7
  ------------------
  |  Branch (109:5): [True: 10.7k, False: 137k]
  ------------------
  110|  95.6k|    case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break;
  ------------------
  |  |   49|  95.6k|#define RBP     6
  ------------------
  |  Branch (110:5): [True: 95.6k, False: 52.8k]
  ------------------
  111|  2.10k|    case UNW_X86_64_RSI: loc = c->dwarf.loc[RSI]; break;
  ------------------
  |  |   47|  2.10k|#define RSI     4
  ------------------
  |  Branch (111:5): [True: 2.10k, False: 146k]
  ------------------
  112|  2.18k|    case UNW_X86_64_RDI: loc = c->dwarf.loc[RDI]; break;
  ------------------
  |  |   48|  2.18k|#define RDI     5
  ------------------
  |  Branch (112:5): [True: 2.18k, False: 146k]
  ------------------
  113|  2.21k|    case UNW_X86_64_R8: loc = c->dwarf.loc[R8]; break;
  ------------------
  |  |   51|  2.21k|#define R8      8
  ------------------
  |  Branch (113:5): [True: 2.21k, False: 146k]
  ------------------
  114|  2.36k|    case UNW_X86_64_R9: loc = c->dwarf.loc[R9]; break;
  ------------------
  |  |   52|  2.36k|#define R9      9
  ------------------
  |  Branch (114:5): [True: 2.36k, False: 146k]
  ------------------
  115|  2.24k|    case UNW_X86_64_R10: loc = c->dwarf.loc[R10]; break;
  ------------------
  |  |   53|  2.24k|#define R10     10
  ------------------
  |  Branch (115:5): [True: 2.24k, False: 146k]
  ------------------
  116|  2.07k|    case UNW_X86_64_R11: loc = c->dwarf.loc[R11]; break;
  ------------------
  |  |   54|  2.07k|#define R11     11
  ------------------
  |  Branch (116:5): [True: 2.07k, False: 146k]
  ------------------
  117|  2.76k|    case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break;
  ------------------
  |  |   55|  2.76k|#define R12     12
  ------------------
  |  Branch (117:5): [True: 2.76k, False: 145k]
  ------------------
  118|  3.39k|    case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break;
  ------------------
  |  |   56|  3.39k|#define R13     13
  ------------------
  |  Branch (118:5): [True: 3.39k, False: 145k]
  ------------------
  119|  2.38k|    case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break;
  ------------------
  |  |   57|  2.38k|#define R14     14
  ------------------
  |  Branch (119:5): [True: 2.38k, False: 146k]
  ------------------
  120|  2.05k|    case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break;
  ------------------
  |  |   58|  2.05k|#define R15     15
  ------------------
  |  Branch (120:5): [True: 2.05k, False: 146k]
  ------------------
  121|       |
  122|  4.07k|    default:
  ------------------
  |  Branch (122:5): [True: 4.07k, False: 144k]
  ------------------
  123|  4.07k|      Debug (1, "bad register number %u\n", reg);
  124|  4.07k|      return -UNW_EBADREG;
  125|   148k|    }
  126|       |
  127|   142k|  if (write)
  ------------------
  |  Branch (127:7): [True: 0, False: 142k]
  ------------------
  128|      0|    return dwarf_put (&c->dwarf, loc, *valp);
  129|   142k|  else
  130|   142k|    return dwarf_get (&c->dwarf, loc, valp);
  131|   142k|}

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

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

