⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 convex.notes

📁 早期freebsd实现
💻 NOTES
字号:
@node Convex,,, Top@appendix Convex-specific info@cindex Convex notesScalar registers are 64 bits long, which is a pain sinceleft half of an S register frequently contains noise.Therefore there are two ways to obtain the value of an S register.@table @kbd@item $s0returns the low half of the register as an int@item $S0returns the whole register as a long long@end tableYou can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}to print a single or double precision value.@cindex vector registersVector registers are handled similarly, with @samp{$V0} denoting the whole64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}or @samp{p/f $V0} can be used to examine the register in floating point.The length of the vector registers is taken from @samp{$vl}.  Individual elements of a vector register are denoted in the obvious way;@samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and@samp{set $v3[9] = 1234} alters it.@kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.Elements of @kbd{$vm} can't be assigned to.@cindex communication registers@kindex info comm-registersCommunication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}denoting the low-order halves.  @samp{info comm-registers} will print themall out, and tell which are locked.  (A communication register islocked when a value is sent to it, and unlocked when the value isreceived.)  Communication registers are, of course, global to allthreads, so it does not matter what the currently selected thread is.@samp{info comm-reg @var{name}} prints just that one communicationregister; @samp{name} may also be a communication register number@samp{nn} or @samp{0xnn}.@samp{info comm-reg @var{address}} prints the contents of the resourcestructure at that address.@kindex info pswThe command @samp{info psw} prints the processor status word @kbd{$ps}bit by bit.@kindex set baseGDB normally prints all integers in base 10, but the leading@kbd{0x80000000} of pointers is intolerable in decimal, so the defaultoutput radix has been changed to try to print addresses appropriately.The @samp{set base} command can be used to change this.@table @code@item set base 10Integer values always print in decimal.@item set base 16Integer values always print in hex.@item set baseGo back to the initial state, which prints integer values in hex if theylook like pointers (specifically, if they start with 0x8 or 0xf in thestack), otherwise in decimal.@end table@kindex set pipelineWhen an exception such as a bus error or overflow happens, usually the PCis several instructions ahead by the time the exception is detected.The @samp{set pipe} command will disable this.@table @code@item set pipeline offForces serial execution of instructions; no vector chaining and no scalar instruction overlap.  With this, exceptions are detected with the PC pointing to the instruction after the one in error.@item set pipeline onReturns to normal, fast, execution.  This is the default.@end table@cindex parallelIn a parallel program, multiple threads may be executing, eachwith its own registers, stack, and local memory.  When one of themhits a breakpoint, that thread is selected.  Other threads donot run while the thread is in the breakpoint.@kindex 1contThe selected thread can be single-stepped, given signals, and soon.  Any other threads remain stopped.  When a @samp{cont} command is given,all threads are resumed.  To resume just the selected thread, usethe command @samp{1cont}.@kindex threadThe @samp{thread} command will show the active threads and theinstruction they are about to execute.  The selected thread is markedwith an asterisk.  The command @samp{thread @var{n}} will select thread @var{n},shifting the debugger's attention to it for single-stepping,registers, local memory, and so on.@kindex info threadsThe @samp{info threads} command will show what threads, if any, haveinvisibly hit breakpoints or signals and are waiting to be noticed.@kindex set parallelThe @samp{set parallel} command controls how many threads can be active.@table @code@item set parallel offOne thread.  Requests by the program that other threads join in(spawn and pfork instructions) do not cause other threads to start up.This does the same thing as the @samp{limit concurrency 1} command.@item set parallel fixedAll CPUs are assigned to your program whenever it runs.  When itexecutes a pfork or spawn instruction, it begins parallel executionimmediately.  This does the same thing as the @samp{mpa -f} command.@item set parallel onOne or more threads.  Spawn and pfork cause CPUs to join in when and ifthey are free.  This is the default.  It is very good for systemthroughput, but not very good for finding bugs in parallel code.  If yoususpect a bug in parallel code, you probably want @samp{set parallel fixed.}@end table@subsection LimitationsWARNING: Convex GDB evaluates expressions in long long, because Sregisters are 64 bits long.  However, GDB expression semantics are notexactly C semantics.  This is a bug, strictly speaking, but it's not one Iknow how to fix.  If @samp{x} is a program variable of type int, then itis also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}or any other expression requiring computation.  So is the expression@samp{1}, or any other constant.  You only really have to watch out forcalls.  The innocuous expression @samp{list_node (0x80001234)} has anargument of type long long.  You must explicitly cast it to int.It is not possible to continue after an uncaught fatal signal by using@samp{signal 0}, @samp{return}, @samp{jump}, or anything else.  The difficulty is withUnix, not GDB.I have made no big effort to make such things as single-stepping a@kbd{join} instruction do something reasonable.  If the program seems tohang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use@samp{thread} to shift to a live thread.  Single-stepping a @kbd{spawn}instruction apparently causes new threads to be born with their T bit set;this is not handled gracefully.  When a thread has hit a breakpoint, otherthreads may have invisibly hit the breakpoint in the background; if youclear the breakpoint gdb will be surprised when threads seem to continueto stop at it.  All of these situations produce spurious signal 5 traps;if this happens, just type @samp{cont}.  If it becomes a nuisance, use@samp{handle 5 nostop}.  (It will ask if you are sure.  You are.)There is no way in GDB to store a float in a register, as with@kbd{set $s0 = 3.1416}.  The identifier @kbd{$s0} denotes an integer,and like any C expression which assigns to an integer variable, theright-hand side is casted to type int.  If you should need to dosomething like this, you can assign the value to @kbd{@{float@} ($sp-4)}and then do @kbd{set $s0 = $sp[-4]}.  Same deal with @kbd{set $v0[69] = 6.9}.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -