143051d27SRobert Mustacchi.\" 243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the 343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0. 443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version 543051d27SRobert Mustacchi.\" 1.0 of the CDDL. 643051d27SRobert Mustacchi.\" 743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this 843051d27SRobert Mustacchi.\" source. A copy of the CDDL is also available via the Internet at 943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL. 1043051d27SRobert Mustacchi.\" 1143051d27SRobert Mustacchi.\" 1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc. 1343051d27SRobert Mustacchi.\" 1443051d27SRobert Mustacchi.Dd May 11, 2016 1543051d27SRobert Mustacchi.Dt PADDR_TO_MAP 3PROC 1643051d27SRobert Mustacchi.Os 1743051d27SRobert Mustacchi.Sh NAME 1843051d27SRobert Mustacchi.Nm Paddr_to_map , 1943051d27SRobert Mustacchi.Nm Paddr_to_text_map , 2043051d27SRobert Mustacchi.Nm Plmid_to_map , 2143051d27SRobert Mustacchi.Nm Pname_to_map 2243051d27SRobert Mustacchi.Nd lookup memory map information 23ab618543SJohn Levon.Sh LIBRARY 2443051d27SRobert Mustacchi.Lb libproc 25ab618543SJohn Levon.Sh SYNOPSIS 2643051d27SRobert Mustacchi.In libproc.h 2743051d27SRobert Mustacchi.Ft "const prmap_t *" 2843051d27SRobert Mustacchi.Fo Paddr_to_map 2943051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 3043051d27SRobert Mustacchi.Fa "uintptr_t addr" 3143051d27SRobert Mustacchi.Fc 3243051d27SRobert Mustacchi.Ft "const prmap_t *" 3343051d27SRobert Mustacchi.Fo Paddr_to_text_map 3443051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 3543051d27SRobert Mustacchi.Fa "uintptr_t addr" 3643051d27SRobert Mustacchi.Fc 3743051d27SRobert Mustacchi.Ft "const prmap_t *" 3843051d27SRobert Mustacchi.Fo Plmid_to_map 3943051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 4043051d27SRobert Mustacchi.Fa "Lmid_t lmid" 4143051d27SRobert Mustacchi.Fa "const char *name" 4243051d27SRobert Mustacchi.Fc 4343051d27SRobert Mustacchi.Ft "const prmap_t *" 4443051d27SRobert Mustacchi.Fo Pname_to_map 4543051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 4643051d27SRobert Mustacchi.Fa "const char *name" 4743051d27SRobert Mustacchi.Fc 4843051d27SRobert Mustacchi.Sh DESCRIPTION 4943051d27SRobert MustacchiThe 5043051d27SRobert Mustacchi.Fn Paddr_to_map , 5143051d27SRobert Mustacchi.Fn Paddr_to_text_map , 5243051d27SRobert Mustacchi.Fn Plmid_to_map , 5343051d27SRobert Mustacchiand 5443051d27SRobert Mustacchi.Fn Pname_to_map 5543051d27SRobert Mustacchifunctions lookup memory map information in the process handle 5643051d27SRobert Mustacchi.Fa P . 5743051d27SRobert MustacchiThe 5843051d27SRobert Mustacchi.Sy prmap_t 5943051d27SRobert Mustacchistructure provides information such as the size, offset, and object of 6043051d27SRobert Mustacchithe mapping and is defined in 61*bbf21555SRichard Lowe.Xr proc 5 . 6243051d27SRobert Mustacchi.Pp 6343051d27SRobert MustacchiThe pointer to the data returned by the library will only be valid for 6443051d27SRobert Mustacchias long as the handle 6543051d27SRobert Mustacchi.Fa P 6672d3dbb9SYuri Pankovis valid. 6772d3dbb9SYuri PankovAny calls to 6843051d27SRobert Mustacchi.Xr Prelease 3PROC 6943051d27SRobert Mustacchiwill invalidate the data. 7043051d27SRobert Mustacchi.Pp 7143051d27SRobert MustacchiThe 7243051d27SRobert Mustacchi.Fn Paddr_to_map 7343051d27SRobert Mustacchifunction attempts to find the mapping information corresponding to the 7443051d27SRobert Mustacchiaddress 7543051d27SRobert Mustacchi.Fa addr . 7643051d27SRobert Mustacchi.Pp 7743051d27SRobert MustacchiThe 7843051d27SRobert Mustacchi.Fn Paddr_to_text_map 7943051d27SRobert Mustacchifunction is similar to the 8043051d27SRobert Mustacchi.Fn Paddr_to_map 8143051d27SRobert Mustacchifunction; however, it only returns successfully if the specified address 8243051d27SRobert Mustacchicorresponds to a text mapping as identified by the run-time link-editor. 8343051d27SRobert MustacchiOne use of this is to ensure that a mapping is actually a text-mapping 8443051d27SRobert Mustacchibefore inserting a breakpoint in it. 8543051d27SRobert Mustacchi.Pp 8643051d27SRobert MustacchiThe 8743051d27SRobert Mustacchi.Fn Pname_to_map 8843051d27SRobert Mustacchifunction looks up the object named 8943051d27SRobert Mustacchi.Fa name 9072d3dbb9SYuri Pankovand returns the corresponding mapping information. 9172d3dbb9SYuri PankovTwo special values may be used for name. 9272d3dbb9SYuri PankovThe macro 9343051d27SRobert Mustacchi.Dv PR_OBJ_EXEC 9443051d27SRobert Mustacchirefers to the executable object itself and the macro 9543051d27SRobert Mustacchi.Dv PR_OBJ_LDSO refers to the object ld.so.1 . 9643051d27SRobert Mustacchi.Pp 9743051d27SRobert MustacchiThe 9843051d27SRobert Mustacchi.Fn Plmid_to_map 9943051d27SRobert Mustacchifunction is similar to 10043051d27SRobert Mustacchi.Fn Pname_to_map . 10143051d27SRobert MustacchiIt allows passing a link-map identifier, 10243051d27SRobert Mustacchi.Fa lmid , 10343051d27SRobert Mustacchiwhich constricts the search of the object named with 10443051d27SRobert Mustacchi.Fa name 10572d3dbb9SYuri Pankovto that link-map. 10672d3dbb9SYuri PankovThe special value of 10743051d27SRobert Mustacchi.Dv PR_LMID_EVERY 10843051d27SRobert Mustacchimay be passed to indicate that every link-map should be searched, which 10943051d27SRobert Mustacchiis equivalent in behavior to the 11043051d27SRobert Mustacchi.Fn Pname_to_map 11143051d27SRobert Mustacchifunction. 11243051d27SRobert Mustacchi.Sh RETURN VALUES 11343051d27SRobert MustacchiUpon successful completion, the 11443051d27SRobert Mustacchi.Fn Paddr_to_map , 11543051d27SRobert Mustacchi.Fn Paddr_to_text_map , 11643051d27SRobert Mustacchi.Fn Plmid_to_map , 11743051d27SRobert Mustacchiand 11843051d27SRobert Mustacchi.Fn Pname_to_map 11943051d27SRobert Mustacchifunctions return a pointer to the corresponding mapping information. 12043051d27SRobert MustacchiIf none exists then 12143051d27SRobert Mustacchi.Dv NULL 12243051d27SRobert Mustacchiis returned. 12343051d27SRobert Mustacchi.Sh INTERFACE STABILITY 12443051d27SRobert Mustacchi.Sy Uncommitted 12543051d27SRobert Mustacchi.Sh MT-LEVEL 12643051d27SRobert MustacchiSee 12743051d27SRobert Mustacchi.Sy LOCKING 12843051d27SRobert Mustacchiin 12943051d27SRobert Mustacchi.Xr libproc 3LIB . 13043051d27SRobert Mustacchi.Sh SEE ALSO 13143051d27SRobert Mustacchi.Xr libproc 3LIB , 13243051d27SRobert Mustacchi.Xr Prelease 3PROC , 133*bbf21555SRichard Lowe.Xr proc 5 134