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