Print this page
4054 dis sometimes decides random symbols are functions

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dis/dis_target.c
          +++ new/usr/src/cmd/dis/dis_target.c
↓ open down ↓ 635 lines elided ↑ open up ↑
 636  636      size_t *size, int *isfunc)
 637  637  {
 638  638          int lo, hi, mid;
 639  639          sym_entry_t *sym, *osym, *match;
 640  640          int found;
 641  641  
 642  642          if (tgt->dt_symcache != NULL &&
 643  643              addr >= tgt->dt_symcache->se_sym.st_value &&
 644  644              addr < tgt->dt_symcache->se_sym.st_value +
 645  645              tgt->dt_symcache->se_sym.st_size) {
 646      -                *offset = addr - tgt->dt_symcache->se_sym.st_value;
 647      -                *size = tgt->dt_symcache->se_sym.st_size;
 648      -                return (tgt->dt_symcache->se_name);
      646 +                sym = tgt->dt_symcache;
      647 +                *offset = addr - sym->se_sym.st_value;
      648 +                *size = sym->se_sym.st_size;
      649 +                if (isfunc != NULL)
      650 +                        *isfunc = (GELF_ST_TYPE(sym->se_sym.st_info) ==
      651 +                            STT_FUNC);
      652 +                return (sym->se_name);
 649  653          }
 650  654  
 651  655          lo = 0;
 652  656          hi = (tgt->dt_symcount - 1);
 653  657          found = 0;
 654  658          match = osym = NULL;
 655  659          while (lo <= hi) {
 656  660                  mid = (lo + hi) / 2;
 657  661  
 658  662                  sym = &tgt->dt_symtab[mid];
↓ open down ↓ 303 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX