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