1 PADDR_TO_MAP(3PROC)    Process Control Library Functions   PADDR_TO_MAP(3PROC)
   2 
   3 NAME
   4      Paddr_to_map, Paddr_to_text_map, Plmid_to_map, Pname_to_map - lookup
   5      memory map information
   6 
   7 LIBRARY
   8      Process Control Library (libproc, -lproc)
   9 
  10 SYNOPSIS
  11      #include <libproc.h>
  12 
  13      const prmap_t *
  14      Paddr_to_map(struct ps_prochandle *P, uintptr_t addr);
  15 
  16      const prmap_t *
  17      Paddr_to_text_map(struct ps_prochandle *P, uintptr_t addr);
  18 
  19      const prmap_t *
  20      Plmid_to_map(struct ps_prochandle *P, Lmid_t lmid, const char *name);
  21 
  22      const prmap_t *
  23      Pname_to_map(struct ps_prochandle *P, const char *name);
  24 
  25 DESCRIPTION
  26      The Paddr_to_map(), Paddr_to_text_map(), Plmid_to_map(), and
  27      Pname_to_map() functions lookup memory map information in the process
  28      handle P.  The prmap_t structure provides information such as the size,
  29      offset, and object of the mapping and is defined in proc(4).
  30 
  31      The pointer to the data returned by the library will only be valid for as
  32      long as the handle P is valid.  Any calls to Prelease(3PROC) will
  33      invalidate the data.
  34 
  35      The Paddr_to_map() function attempts to find the mapping information
  36      corresponding to the address addr.
  37 
  38      The Paddr_to_text_map() function is similar to the Paddr_to_map()
  39      function; however, it only returns successfully if the specified address
  40      corresponds to a text mapping as identified by the run-time link-editor.
  41      One use of this is to ensure that a mapping is actually a text-mapping
  42      before inserting a breakpoint in it.
  43 
  44      The Pname_to_map() function looks up the object named name and returns
  45      the corresponding mapping information.  Two special values may be used
  46      for name.  The macro PR_OBJ_EXEC refers to the executable object itself
  47      and the macro PR_OBJ_LDSO refers to the object ld.so.1.
  48 
  49      The Plmid_to_map() function is similar to Pname_to_map().  It allows
  50      passing a link-map identifier, lmid, which constricts the search of the
  51      object named with name to that link-map.  The special value of
  52      PR_LMID_EVERY may be passed to indicate that every link-map should be
  53      searched, which is equivalent in behavior to the Pname_to_map() function.
  54 
  55 RETURN VALUES
  56      Upon successful completion, the Paddr_to_map(), Paddr_to_text_map(),
  57      Plmid_to_map(), and Pname_to_map() functions return a pointer to the
  58      corresponding mapping information.  If none exists then NULL is returned.
  59 
  60 INTERFACE STABILITY
  61      Uncommitted
  62 
  63 MT-LEVEL
  64      See LOCKING in libproc(3LIB).
  65 
  66 SEE ALSO
  67      libproc(3LIB), Prelease(3PROC), proc(4)
  68 
  69 illumos                          May 11, 2016                          illumos