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 PDELBKPT 3PROC 1643051d27SRobert Mustacchi.Os 1743051d27SRobert Mustacchi.Sh NAME 1843051d27SRobert Mustacchi.Nm Pdelbkpt 1943051d27SRobert Mustacchi.Nd clear a breakpoint in a process 20ab618543SJohn Levon.Sh LIBRARY 2143051d27SRobert Mustacchi.Lb libproc 22ab618543SJohn Levon.Sh SYNOPSIS 2343051d27SRobert Mustacchi.In libproc.h 2443051d27SRobert Mustacchi.Ft int 2543051d27SRobert Mustacchi.Fo Pdelbkpt 2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 2743051d27SRobert Mustacchi.Fa "uintptr_t address" 2843051d27SRobert Mustacchi.Fa "ulong_t saved" 2943051d27SRobert Mustacchi.Fc 3043051d27SRobert Mustacchi.Sh DESCRIPTION 3143051d27SRobert MustacchiThe 3243051d27SRobert Mustacchi.Fn Pdelbkpt 3343051d27SRobert Mustacchifunction removes the breakpoint installed at 3443051d27SRobert Mustacchi.Fa address 3543051d27SRobert Mustacchifrom process 3643051d27SRobert Mustacchi.Fa P . 3743051d27SRobert MustacchiRestoring the instruction present in 3843051d27SRobert Mustacchi.Fa saved . 3943051d27SRobert Mustacchi.Pp 4043051d27SRobert MustacchiIf the instruction at 4143051d27SRobert Mustacchi.Fa address 4243051d27SRobert Mustacchiis no longer the architecture-specific breakpoint instruction, then 4343051d27SRobert Mustacchi.Fa saved 4472d3dbb9SYuri Pankovis not restored, but the function still returns successfully. 4572d3dbb9SYuri PankovThis behavior is done due to the presence of setting breakpoints in 4643051d27SRobert Mustacchiself-modifying code, e.g. procedure linkage tables. 4743051d27SRobert Mustacchi.Pp 4843051d27SRobert MustacchiThe 4943051d27SRobert Mustacchi.Fn Pdelbkpt 5043051d27SRobert Mustacchifunction only works on running processes, such as those created through 5143051d27SRobert Mustacchi.Xr Pgrab 3PROC 5243051d27SRobert Mustacchiand 5343051d27SRobert Mustacchi.Xr Pcreate 3PROC . 5443051d27SRobert MustacchiAttempting to remove a breakpoint from process handles to core files, 5543051d27SRobert Mustacchizombie processes, or ELF objects will fail. 5643051d27SRobert Mustacchi.Sh RETURN VALUES 5743051d27SRobert MustacchiUpon successful completion, the 5843051d27SRobert Mustacchi.Fn Pdelbkpt 5943051d27SRobert Mustacchifunction removes the breakpoint and 6043051d27SRobert Mustacchireturns 6143051d27SRobert Mustacchi.Sy 0 . 6243051d27SRobert MustacchiOtherwise, 6343051d27SRobert Mustacchi.Sy -1 6443051d27SRobert Mustacchiis returned, and 6543051d27SRobert Mustacchi.Sy errno 6643051d27SRobert Mustacchiis set to indicate the error. 6743051d27SRobert Mustacchi.Sh ERRORS 6843051d27SRobert MustacchiFor a full list of possible errors see the 6943051d27SRobert Mustacchi.Sy DIAGNOSTICS 7043051d27SRobert Mustacchisection in 71*bbf21555SRichard Lowe.Xr proc 5 . 7243051d27SRobert Mustacchi.Pp 7343051d27SRobert MustacchiThe 7443051d27SRobert Mustacchi.Fn Pdelbkpt 7543051d27SRobert Mustacchifunction will fail with: 7643051d27SRobert Mustacchi.Bl -tag -width Er 7743051d27SRobert Mustacchi.It Er ENOENT 7843051d27SRobert MustacchiThe handle 7943051d27SRobert Mustacchi.Fa P 8043051d27SRobert Mustacchirefers to a grabbed core file, a zombie process, or an ELF object. 8143051d27SRobert Mustacchi.El 8243051d27SRobert Mustacchi.Sh INTERFACE STABILITY 8343051d27SRobert Mustacchi.Sy Uncommitted 8443051d27SRobert Mustacchi.Sh MT-LEVEL 8543051d27SRobert MustacchiSee 8643051d27SRobert Mustacchi.Sy LOCKING 8743051d27SRobert Mustacchiin 8843051d27SRobert Mustacchi.Xr libproc 3LIB . 8943051d27SRobert Mustacchi.Sh SEE ALSO 9043051d27SRobert Mustacchi.Xr libproc 3LIB , 9143051d27SRobert Mustacchi.Xr Pcreate 3PROC , 9243051d27SRobert Mustacchi.Xr Pgrab 3PROC , 9343051d27SRobert Mustacchi.Xr Pgrab_core 3PROC , 9443051d27SRobert Mustacchi.Xr Pgrab_file 3PROC , 9543051d27SRobert Mustacchi.Xr Psetbkpt 3PROC , 96*bbf21555SRichard Lowe.Xr proc 5 97