summaryrefslogtreecommitdiff
path: root/usr.bin/pmdb/pmdb.1
blob: d1d54f1e5740776a7b1fea650f751652909addc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\"	$OpenBSD: pmdb.1,v 1.2 2002/03/15 16:41:06 jason Exp $
.\"
.\" Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
.\" All rights reserved. 
.\"
.\" Redistribution and use in source and binary forms, with or without 
.\" modification, are permitted provided that the following conditions 
.\" are met: 
.\"
.\" 1. Redistributions of source code must retain the above copyright 
.\"    notice, this list of conditions and the following disclaimer. 
.\" 2. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission. 
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
.\" EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
.\"
.Dd Feb 20, 2002
.Dt PMDB 1
.Os
.Sh NAME
.Nm pmdb
.Nd debugger.
.Sh SYNOPSIS
.Nm pmdb
.Ar program Op Ar ...
.Sh DESCRIPTION
The
.Nm
utility can be used to see what is happening inside a running process or
to catch program crashes and examine the state at the time of the crash.
The only way to start
.Nm
at this moment is to specify the name of the prgram to be debugged and all
its arguments on the command line.
The program is controlled from a command line which usually gives the
prompt "pmdb>".
.Sh PROCESS STATES
A loaded program can be in one of three possible states:
.Bl -tag -width RUNNING
.It LOADED
This is the initial state.
The program is not running, it can't be examined (because it doesn't have
any state).
The only thing that can be done to the process is to start it with the
.Ic run
command.
.It RUNNING
When a process is
.Ic RUNNING ,
the only way to affect it is through signals sent to it.
Unless a signal is ignored with the
.Ic signal ignore
command, it will be catched by pmdb and the process will go into the
.Ic STOPPED
state.
.It STOPPED
A stopped process can be examined, changed and restarted with the
.Ic continue
command.
.El
.Sh COMMANDS
.Bl -tag -width continue
.It regs
Show the contents of the processor registers at the moment the process was
.Ic STOPPED .
.It trace
Show the function call trace of the currently
.Ic STOPPED
process.
.It run
Start running a
.Ic LOADED
process.
.It continue
Continue a
.Ic STOPPED
process.
.It kill
Unconditionally kills the debugged process and puts it in the
.Ic LOADED
state.
.It signal Ar ignore|stop Ar signum|signame
Sets the signal state for the specified signal to either ignore it and
pass it to the process or to stop the process.
.It sigstate
Shows which signals are currently ignored.
.It help
Shows a short help.
.It quit
Kills the process (if necessary) and exits
.Nm .
.It exit
Alias for
.Ic quit .
.El
.Sh HISTORY
The
.Nm
debugger was written because the author believed that
.Xr gdb 1
was too to bloated and hairy to run on OpenBSD/sparc64.