Fixed bug printing 29050 instructions.
[deliverable/binutils-gdb.git] / gdb / Convex.notes
CommitLineData
dd3b648e
RP
1
2@node Convex,,, Top
3@appendix Convex-specific info
4@cindex Convex notes
5
6Scalar registers are 64 bits long, which is a pain since
7left half of an S register frequently contains noise.
8Therefore there are two ways to obtain the value of an S register.
9
10@table @kbd
11@item $s0
12returns the low half of the register as an int
13
14@item $S0
15returns the whole register as a long long
16@end table
17
18You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
19to print a single or double precision value.
20
21@cindex vector registers
22Vector registers are handled similarly, with @samp{$V0} denoting the whole
2364-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
24or @samp{p/f $V0} can be used to examine the register in floating point.
25The length of the vector registers is taken from @samp{$vl}.
26
27Individual elements of a vector register are denoted in the obvious way;
28@samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
29@samp{set $v3[9] = 1234} alters it.
30
31@kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
32Elements of @kbd{$vm} can't be assigned to.
33
34@cindex communication registers
35@kindex info comm-registers
36Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
37denoting the low-order halves. @samp{info comm-registers} will print them
38all out, and tell which are locked. (A communication register is
39locked when a value is sent to it, and unlocked when the value is
40received.) Communication registers are, of course, global to all
41threads, so it does not matter what the currently selected thread is.
42@samp{info comm-reg @var{name}} prints just that one communication
43register; @samp{name} may also be a communication register number
44@samp{nn} or @samp{0xnn}.
45@samp{info comm-reg @var{address}} prints the contents of the resource
46structure at that address.
47
48@kindex info psw
49The command @samp{info psw} prints the processor status word @kbd{$ps}
50bit by bit.
51
52@kindex set base
53GDB normally prints all integers in base 10, but the leading
54@kbd{0x80000000} of pointers is intolerable in decimal, so the default
55output radix has been changed to try to print addresses appropriately.
56The @samp{set base} command can be used to change this.
57
58@table @code
59@item set base 10
60Integer values always print in decimal.
61
62@item set base 16
63Integer values always print in hex.
64
65@item set base
66Go back to the initial state, which prints integer values in hex if they
67look like pointers (specifically, if they start with 0x8 or 0xf in the
68stack), otherwise in decimal.
69@end table
70
71@kindex set pipeline
72When an exception such as a bus error or overflow happens, usually the PC
73is several instructions ahead by the time the exception is detected.
74The @samp{set pipe} command will disable this.
75
76@table @code
77@item set pipeline off
78Forces serial execution of instructions; no vector chaining and no
79scalar instruction overlap. With this, exceptions are detected with
80the PC pointing to the instruction after the one in error.
81
82@item set pipeline on
83Returns to normal, fast, execution. This is the default.
84@end table
85
86@cindex parallel
87In a parallel program, multiple threads may be executing, each
88with its own registers, stack, and local memory. When one of them
89hits a breakpoint, that thread is selected. Other threads do
90not run while the thread is in the breakpoint.
91
92@kindex 1cont
93The selected thread can be single-stepped, given signals, and so
94on. Any other threads remain stopped. When a @samp{cont} command is given,
95all threads are resumed. To resume just the selected thread, use
96the command @samp{1cont}.
97
98@kindex thread
99The @samp{thread} command will show the active threads and the
100instruction they are about to execute. The selected thread is marked
101with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
102shifting the debugger's attention to it for single-stepping,
103registers, local memory, and so on.
104
105@kindex info threads
106The @samp{info threads} command will show what threads, if any, have
107invisibly hit breakpoints or signals and are waiting to be noticed.
108
109@kindex set parallel
110The @samp{set parallel} command controls how many threads can be active.
111
112@table @code
113@item set parallel off
114One thread. Requests by the program that other threads join in
115(spawn and pfork instructions) do not cause other threads to start up.
116This does the same thing as the @samp{limit concurrency 1} command.
117
118@item set parallel fixed
119All CPUs are assigned to your program whenever it runs. When it
120executes a pfork or spawn instruction, it begins parallel execution
121immediately. This does the same thing as the @samp{mpa -f} command.
122
123@item set parallel on
124One or more threads. Spawn and pfork cause CPUs to join in when and if
125they are free. This is the default. It is very good for system
126throughput, but not very good for finding bugs in parallel code. If you
127suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
128@end table
129
130@subsection Limitations
131
132WARNING: Convex GDB evaluates expressions in long long, because S
133registers are 64 bits long. However, GDB expression semantics are not
134exactly C semantics. This is a bug, strictly speaking, but it's not one I
135know how to fix. If @samp{x} is a program variable of type int, then it
136is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
137or any other expression requiring computation. So is the expression
138@samp{1}, or any other constant. You only really have to watch out for
139calls. The innocuous expression @samp{list_node (0x80001234)} has an
140argument of type long long. You must explicitly cast it to int.
141
142It is not possible to continue after an uncaught fatal signal by using
143@samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
144Unix, not GDB.
145
146I have made no big effort to make such things as single-stepping a
147@kbd{join} instruction do something reasonable. If the program seems to
148hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
149@samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
150instruction apparently causes new threads to be born with their T bit set;
151this is not handled gracefully. When a thread has hit a breakpoint, other
152threads may have invisibly hit the breakpoint in the background; if you
153clear the breakpoint gdb will be surprised when threads seem to continue
154to stop at it. All of these situations produce spurious signal 5 traps;
155if this happens, just type @samp{cont}. If it becomes a nuisance, use
156@samp{handle 5 nostop}. (It will ask if you are sure. You are.)
157
158There is no way in GDB to store a float in a register, as with
159@kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
160and like any C expression which assigns to an integer variable, the
161right-hand side is casted to type int. If you should need to do
162something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
163and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.
This page took 0.041119 seconds and 4 git commands to generate.