Print this page
remove crap I didnt end up using
take to dis and libdisasm with an axe; does not yet compile

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dis/dis_target.c
          +++ new/usr/src/cmd/dis/dis_target.c
↓ open down ↓ 701 lines elided ↑ open up ↑
 702  702                  tgt->dt_symcache = sym;
 703  703  
 704  704          *offset = addr - sym->se_sym.st_value;
 705  705          *size = sym->se_sym.st_size;
 706  706          if (isfunc)
 707  707                  *isfunc = (GELF_ST_TYPE(sym->se_sym.st_info) == STT_FUNC);
 708  708  
 709  709          return (sym->se_name);
 710  710  }
 711  711  
 712      -#if !defined(__sparc)
 713  712  /*
 714  713   * Given an address, return the starting offset of the next symbol in the file.
 715  714   * Only needed on variable length instruction architectures.
 716  715   */
 717  716  off_t
 718  717  dis_tgt_next_symbol(dis_tgt_t *tgt, uint64_t addr)
 719  718  {
 720  719          sym_entry_t *sym;
 721  720  
 722  721          for (sym = tgt->dt_symcache;
 723  722              sym != tgt->dt_symtab + tgt->dt_symcount;
 724  723              sym++) {
 725  724                  if (sym->se_sym.st_value >= addr)
 726  725                          return (sym->se_sym.st_value - addr);
 727  726          }
 728  727  
 729  728          return (0);
 730  729  }
 731      -#endif
 732  730  
 733  731  /*
 734  732   * Iterate over all sections in the target, executing the given callback for
 735  733   * each.
 736  734   */
 737  735  void
 738  736  dis_tgt_section_iter(dis_tgt_t *tgt, section_iter_f func, void *data)
 739  737  {
 740  738          dis_scn_t sdata;
 741  739          Elf_Scn *scn;
↓ open down ↓ 219 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX