Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libproc/common/Psymtab.c
          +++ new/usr/src/lib/libproc/common/Psymtab.c
↓ open down ↓ 736 lines elided ↑ open up ↑
 737  737  
 738  738          return (mptr->map_file->file_lo);
 739  739  }
 740  740  
 741  741  const rd_loadobj_t *
 742  742  Pname_to_loadobj(struct ps_prochandle *P, const char *name)
 743  743  {
 744  744          return (Plmid_to_loadobj(P, PR_LMID_EVERY, name));
 745  745  }
 746  746  
 747      -/*
 748      - * We've been given a file_info_t which doesn't have any CTF. However, it may
 749      - * have information that's in a format that we could convert if on the fly.
 750      - * We'll first try to convert the alternate debug file, if present, and then
 751      - * move onto the default file. The reason we prefer the alternate debug file is
 752      - * that if both exist, then it likely has any usable debugging information.
 753      - */
 754      -static ctf_file_t *
 755      -Pconvert_file_ctf(file_info_t *fptr)
 756      -{
 757      -        int err;
 758      -        ctf_file_t *fp;
 759      -        char errmsg[1024];
 760      -
 761      -        /*
 762      -         * Provide an opt in.
 763      -         */
 764      -        if (getenv("LIBPROC_CTFCONVERT") == NULL)
 765      -                return (NULL);
 766      -
 767      -        /*
 768      -         * If we've already attempted to call this, then that's it. No reason to
 769      -         * pretend we'll be more successful again another time.
 770      -         */
 771      -        if (fptr->file_cvt == B_TRUE)
 772      -                return (NULL);
 773      -        fptr->file_cvt = B_TRUE;
 774      -
 775      -        fp = NULL;
 776      -        if (fptr->file_dbgelf != NULL) {
 777      -                fp = ctf_elfconvert(fptr->file_fd, fptr->file_dbgelf, NULL, 1,
 778      -                    0, &err, errmsg, sizeof (errmsg));
 779      -                if (fp == NULL) {
 780      -                        dprintf("failed to convert %s: %s\n", fptr->file_pname,
 781      -                            err == ECTF_CONVBKERR ? errmsg : ctf_errmsg(err));
 782      -                }
 783      -        }
 784      -        if (fp == NULL) {
 785      -                fp = ctf_elfconvert(fptr->file_fd, fptr->file_elf, NULL, 1,
 786      -                    0, &err, errmsg, sizeof (errmsg));
 787      -                if (fp == NULL) {
 788      -                        dprintf("failed to convert %s: %s\n", fptr->file_pname,
 789      -                            err == ECTF_CONVBKERR ? errmsg : ctf_errmsg(err));
 790      -                }
 791      -        }
 792      -        if (fp != NULL) {
 793      -                fptr->file_ctfp = fp;
 794      -        }
 795      -
 796      -        return (NULL);
 797      -}
 798      -
 799  747  ctf_file_t *
 800  748  Pbuild_file_ctf(struct ps_prochandle *P, file_info_t *fptr)
 801  749  {
 802  750          ctf_sect_t ctdata, symtab, strtab;
 803  751          sym_tbl_t *symp;
 804  752          int err;
 805  753  
 806  754          if (fptr->file_ctfp != NULL)
 807  755                  return (fptr->file_ctfp);
 808  756  
 809  757          Pbuild_file_symtab(P, fptr);
 810  758  
 811      -        if (fptr->file_ctf_size == 0) {
 812      -                return (Pconvert_file_ctf(fptr));
 813      -        }
      759 +        if (fptr->file_ctf_size == 0)
      760 +                return (NULL);
 814  761  
 815  762          symp = fptr->file_ctf_dyn ? &fptr->file_dynsym : &fptr->file_symtab;
 816  763          if (symp->sym_data_pri == NULL)
 817  764                  return (NULL);
 818  765  
 819  766          /*
 820  767           * The buffer may alread be allocated if this is a core file that
 821  768           * contained CTF data for this file.
 822  769           */
 823  770          if (fptr->file_ctf_buf == NULL) {
↓ open down ↓ 2788 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX