2021-07-03 05:07:57 +01:00
<!DOCTYPE HTML>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=US-ASCII" >
2021-12-31 03:21:33 +00:00
< meta name = "generator" content = "ZealOS V1.08" >
2021-07-03 05:07:57 +01:00
< style type = "text/css" >
2021-10-08 07:06:11 +01:00
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
2021-07-03 05:07:57 +01:00
< / style >
< / head >
< body >
2021-07-05 01:12:38 +01:00
< pre style = "font-family:monospace;font-size:12pt" >
2021-07-03 05:07:57 +01:00
< a name = "l1" > < / a > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > CheckPtr< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ptr)
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l2" > < / a > {< / span > < span class = cF2 > //Check if address is valid pointer.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l3" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > mem_heap_base< / span > < span class = cF0 > < = ptr < = < / span > < span class = cFB > mem_mapped_space< / span > < span class = cF0 > )
< a name = "l4" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > *< / span > < span class = cF5 > MemPageTable< / span > < span class = cF0 > (ptr) & < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l5" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l6" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cFB > mem_boot_base< / span > < span class = cF0 > < ptr < < / span > < span class = cF3 > VGAM_GRAPHICS< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l7" > < / a > }
< a name = "l8" > < / a >
< a name = "l9" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > CheckCodePtr< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ptr)
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l10" > < / a > {< / span > < span class = cF2 > //Check if address is valid code address.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l11" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > mem_heap_base< / span > < span class = cF0 > < = ptr < = < / span > < span class = cFB > mem_heap_limit< / span > < span class = cF0 > )
< a name = "l12" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > *< / span > < span class = cF5 > MemPageTable< / span > < span class = cF0 > (ptr) & < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l13" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l14" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cFB > mem_boot_base< / span > < span class = cF0 > < ptr < < / span > < span class = cF3 > VGAM_GRAPHICS< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l15" > < / a > }
< a name = "l16" > < / a >
< a name = "l17" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > CheckOnStack< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ptr, < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l18" > < / a > {< / span > < span class = cF2 > //Check if address is valid stack address.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l19" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > res = < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l20" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l21" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l22" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l23" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task)
< a name = "l24" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l25" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (& task-> stack-> stack_base < = ptr < = < / span > < span class = cF7 > (< / span > < span class = cF0 > & task-> stack-> stack_base< / span > < span class = cF7 > )(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cF7 > )< / span > < span class = cF0 > + task-> stack-> stack_size)
< a name = "l26" > < / a > res = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l27" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l28" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > mem_heap_base< / span > < span class = cF0 > < = ptr < = < / span > < span class = cFB > mem_heap_limit< / span > < span class = cF0 > )
< a name = "l29" > < / a > res = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l30" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l31" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l32" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
2021-07-03 05:07:57 +01:00
< a name = "l33" > < / a > }
< a name = "l34" > < / a >
< a name = "l35" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cF5 > UnusedStack< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l36" > < / a > {< / span > < span class = cF2 > //Count of usused bytes in task's stack.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l37" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > res;
2021-07-03 05:07:57 +01:00
< a name = "l38" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l39" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l40" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l41" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l42" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l43" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l44" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l45" > < / a > res = < / span > < span class = cF5 > RSPGet< / span > < span class = cF0 > ()(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *) - (& task-> stack-> stack_base)(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *);
< a name = "l46" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l47" > < / a > res = task-> rsp(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *) - (& task-> stack-> stack_base)(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *);
< a name = "l48" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l49" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l50" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
2021-07-03 05:07:57 +01:00
< a name = "l51" > < / a > }
< a name = "l52" > < / a >
< a name = "l53" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cF5 > Caller< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > num=< / span > < span class = cFE > 1< / span > < span class = cF0 > )
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l54" > < / a > {< / span > < span class = cF2 > //Returns the address of the function which called this one,< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l55" > < / a > < / span > < span class = cF2 > //or the caller of the caller, etc.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l56" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > **rbp = < / span > < span class = cF5 > RBPGet< / span > < span class = cF0 > , **ptr;
2021-07-03 05:07:57 +01:00
< a name = "l57" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l58" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (num--)
< a name = "l59" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l60" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rbp > = *rbp)
< a name = "l61" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l62" > < / a > rbp = *rbp;
< a name = "l63" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > CheckOnStack< / span > < span class = cF7 > (< / span > < span class = cF0 > rbp, < / span > < span class = cF5 > Fs< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l64" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l65" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l66" > < / a > ptr = rbp + < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l67" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > *ptr;
2021-07-03 05:07:57 +01:00
< a name = "l68" > < / a > }
< a name = "l69" > < / a >
< a name = "l70" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cF5 > TaskCaller< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF9 > I64< / span > < span class = cF0 > num=< / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > saved_context=< / span > < span class = cF3 > FALSE< / span > < span class = cF0 > )
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
< a name = "l71" > < / a > {< / span > < span class = cF2 > //Fetches address of Nth caller on task's stack.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l72" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > **ptr, **rbp, **rsp;
2021-07-03 05:07:57 +01:00
< a name = "l73" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l74" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l75" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l76" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!saved_context & & task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l77" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF5 > Caller< / span > < span class = cF0 > (num + < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l78" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > TaskValidate< / span > < span class = cF7 > (< / span > < span class = cF0 > task< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l79" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l80" > < / a > rbp = task-> rbp;
< a name = "l81" > < / a > rsp = task-> rsp;
< a name = "l82" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (num)
< a name = "l83" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l84" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF5 > CheckOnStack< / span > < span class = cF7 > (< / span > < span class = cF0 > rbp, task< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l85" > < / a > {
< a name = "l86" > < / a > ptr = rbp + < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l87" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (! --num)
< a name = "l88" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > *ptr;
< a name = "l89" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rbp > = *rbp)
< a name = "l90" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l91" > < / a > rbp = *rbp;
< a name = "l92" > < / a > }
< a name = "l93" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l94" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l95" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l96" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l97" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task-> rip == < / span > < span class = cFD > _RET< / span > < span class = cF0 > )
< a name = "l98" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > *rsp;
< a name = "l99" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l100" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > task-> rip;
< a name = "l101" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l102" > < / a > }
< a name = "l103" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > STACK_REP_LEN < / span > < span class = cFE > 32< / span > < span class = cF0 >
< a name = "l104" > < / a >
< a name = "l105" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > StackRep< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l106" > < / a > {< / span > < span class = cF2 > //Reports whats on the stack.< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l107" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, j, addr, **rbp, **rsp, *my_rsp[STACK_REP_LEN];
< a name = "l108" > < / a > < / span > < span class = cF9 > CHashTable< / span > < span class = cF0 > *old_hash = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> hash_table;
2021-07-03 05:07:57 +01:00
< a name = "l109" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l110" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l111" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l112" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > TaskValidate< / span > < span class = cF7 > (< / span > < span class = cF0 > task< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l113" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l114" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l115" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l116" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l117" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l118" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l119" > < / a > rbp = < / span > < span class = cF5 > RBPGet< / span > < span class = cF0 > ;
< a name = "l120" > < / a > rsp = rbp + < / span > < span class = cFE > 3< / span > < span class = cF0 > ;
< a name = "l121" > < / a > rbp = *rbp;
< a name = "l122" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l123" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l124" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l125" > < / a > rsp = task-> rsp;
< a name = "l126" > < / a > rbp = task-> rbp;
< a name = "l127" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l128" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task-> rip == < / span > < span class = cFD > _RET< / span > < span class = cF0 > )
< a name = "l129" > < / a > addr = *rsp;
< a name = "l130" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l131" > < / a > addr = task-> rip;
< a name = "l132" > < / a > < / span > < span class = cF5 > MemCopy< / span > < span class = cF0 > (my_rsp, rsp, STACK_REP_LEN * < / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cF7 > )< / span > < span class = cF0 > );
< a name = "l133" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l134" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l135" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> hash_table = task-> hash_table;
2021-10-30 10:12:52 +01:00
< a name = "l136" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l137" > < / a > < / span > < span class = cF6 > " $LTCYAN$" < / span > < span class = cF0 > ;
< a name = "l138" > < / a > < / span > < span class = cF6 > " RSP RSP+Offset: Value Value/Link\n" < / span > < span class = cF0 > ;
< a name = "l139" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l140" > < / a > < / span > < span class = cF6 > " $FG$" < / span > < span class = cF0 > ;
< a name = "l141" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < STACK_REP_LEN; i++)
< a name = "l142" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l143" > < / a > < / span > < span class = cF6 > " %08X [RSP+%04X]: %016X " < / span > < span class = cF0 > , rsp + i, i * < / span > < span class = cF1 > sizeof< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *), my_rsp[i];
< a name = "l144" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l145" > < / a > {
< a name = "l146" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF7 > (< / span > < span class = cF0 > & task-> stack-> stack_base < = rbp < (& task-> stack-> stack_base)(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *) + task-> stack-> stack_size< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l147" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l148" > < / a > j = rbp - rsp;
< a name = "l149" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (j > = i)
< a name = "l150" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l151" > < / a > addr = my_rsp[j + < / span > < span class = cFE > 1< / span > < span class = cF0 > ];
< a name = "l152" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rbp > = my_rsp[j])
< a name = "l153" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l154" > < / a > rbp = my_rsp[j];
< a name = "l155" > < / a > }
< a name = "l156" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (my_rsp[i] == addr & & !< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l157" > < / a > < / span > < span class = cF6 > " $BG,YELLOW$" < / span > < span class = cF0 > ;
< a name = "l158" > < / a > < / span > < span class = cF6 > " %P" < / span > < span class = cF0 > , my_rsp[i];
< a name = "l159" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l160" > < / a > < / span > < span class = cF6 > " $BG$" < / span > < span class = cF0 > ;
< a name = "l161" > < / a > < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > ;
< a name = "l162" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l163" > < / a > < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > ;
< a name = "l164" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> hash_table = old_hash;
< a name = "l165" > < / a > }
< a name = "l166" > < / a >
< a name = "l167" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > CallerRep< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > **rbp=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l168" > < / a > {< / span > < span class = cF2 > //Prints a report of calling routines.< / span > < span class = cF0 >
< a name = "l169" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > **ptr;
< a name = "l170" > < / a >
< a name = "l171" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l172" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l173" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!rbp)
< a name = "l174" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l175" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l176" > < / a > rbp = < / span > < span class = cF5 > RBPGet< / span > < span class = cF0 > ;
< a name = "l177" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l178" > < / a > rbp = task-> rbp;
< a name = "l179" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l180" > < / a > < / span > < span class = cF6 > " CallerRep:\n" < / span > < span class = cF0 > ;
< a name = "l181" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l182" > < / a > < / span > < span class = cF6 > " $LTCYAN$RBP: *RBP: *RBP:$FG$\n" < / span > < span class = cF0 > ;
< a name = "l183" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l184" > < / a > < / span > < span class = cF6 > " RBP: *RBP: *RBP\n" < / span > < span class = cF0 > ;
< a name = "l185" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF5 > CheckOnStack< / span > < span class = cF7 > (< / span > < span class = cF0 > rbp, task< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l186" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l187" > < / a > ptr = rbp + < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l188" > < / a > < / span > < span class = cF6 > " %08X: %08tX: %P\n" < / span > < span class = cF0 > , ptr, *ptr, *ptr;
< a name = "l189" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rbp > = *rbp)
< a name = "l190" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l191" > < / a > rbp = *rbp;
< a name = "l192" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l193" > < / a > }
< a name = "l194" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l195" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > Dump< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > I64< / span > < span class = cF0 > count=< / span > < span class = cFE > 0x80< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > show_offset=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
2021-10-30 10:12:52 +01:00
< a name = "l196" > < / a > {< / span > < span class = cF2 > //Dump mem, showing offsets.< / span > < span class = cF0 >
2021-12-11 11:10:58 +00:00
< a name = "l197" > < / a > < / span > < span class = cF2 > //See < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/System/DolDoc/DocPutS.ZC.html#l366" > < span class = cF4 > DocDump< / span > < / a > < span class = cF2 > () for a live dump.< / span > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l198" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, j, ch;
< a name = "l199" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *ptr = addr;
< a name = "l200" > < / a >
< a name = "l201" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (count)
< a name = "l202" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l203" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (show_offset)
< a name = "l204" > < / a > < / span > < span class = cF6 > " %08X " < / span > < span class = cF0 > , ptr - addr;
< a name = "l205" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l206" > < / a > < / span > < span class = cF6 > " %010X " < / span > < span class = cF0 > , ptr;
< a name = "l207" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (count > < / span > < span class = cFE > 16< / span > < span class = cF0 > )
< a name = "l208" > < / a > j = < / span > < span class = cFE > 16< / span > < span class = cF0 > ;
< a name = "l209" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l210" > < / a > j = count;
< a name = "l211" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < j; i++)
< a name = "l212" > < / a > < / span > < span class = cF6 > " %02X " < / span > < span class = cF0 > , ptr[i];
< a name = "l213" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (; i < < / span > < span class = cFE > 16< / span > < span class = cF0 > ; i++)
< a name = "l214" > < / a > < / span > < span class = cF6 > " " < / span > < span class = cF0 > ;
< a name = "l215" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < j; i++)
< a name = "l216" > < / a > {
< a name = "l217" > < / a > ch = ptr[i];
< a name = "l218" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (ch < < / span > < span class = cF3 > CH_SPACE< / span > < span class = cF0 > || ch == < / span > < span class = cF3 > CH_BACKSPACE< / span > < span class = cF0 > )
< a name = "l219" > < / a > ch = < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l220" > < / a > < / span > < span class = cF6 > ''< / span > < span class = cF0 > ch;
< a name = "l221" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (ch == < / span > < span class = cF6 > '$'< / span > < span class = cF0 > )
< a name = "l222" > < / a > < / span > < span class = cF6 > ''< / span > < span class = cF0 > ch;
< a name = "l223" > < / a > }
< a name = "l224" > < / a > < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > ;
< a name = "l225" > < / a > count -= j;
< a name = "l226" > < / a > ptr += j;
< a name = "l227" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l228" > < / a > }
< a name = "l229" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l230" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > DumpMem< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > I64< / span > < span class = cF0 > count=< / span > < span class = cFE > 0x80< / span > < span class = cF0 > )
2021-10-30 10:12:52 +01:00
< a name = "l231" > < / a > {< / span > < span class = cF2 > //Show mem address, not offsets.< / span > < span class = cF0 >
2021-11-30 22:24:57 +00:00
< a name = "l232" > < / a > < / span > < span class = cF5 > Dump< / span > < span class = cF0 > (addr, count, < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
2021-08-04 20:25:55 +01:00
< a name = "l233" > < / a > }
< a name = "l234" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l235" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > DumpAddress< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > **addr, < / span > < span class = cF9 > I64< / span > < span class = cF0 > count=< / span > < span class = cFE > 0x10< / span > < span class = cF0 > )
2021-10-30 10:12:52 +01:00
< a name = "l236" > < / a > {< / span > < span class = cF2 > //Dump mem, showing symbolic addresses.< / span > < span class = cF0 >
< a name = "l237" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (count-- > < / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l238" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l239" > < / a > < / span > < span class = cF6 > " %08X:%08X,%P\n" < / span > < span class = cF0 > , addr, *addr, *addr;
< a name = "l240" > < / a > addr++;
< a name = "l241" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l242" > < / a > }
< a name = "l243" > < / a >
< a name = "l244" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RawPrint< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > mS=< / span > < span class = cFE > 100< / span > < span class = cF0 > , < / span > < span class = cF1 > U8< / span > < span class = cF0 > *format, ...)
2021-12-11 11:10:58 +00:00
< a name = "l245" > < / a > {< / span > < span class = cF2 > //Print using < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.ZC.html#l257" > < span class = cF4 > Raw< / span > < / a > < span class = cF2 > screen output for a length of time.< / span > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l246" > < / a > < / span > < span class = cF2 > //Your heap must be good.< / span > < span class = cF0 >
< a name = "l247" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *buf = < / span > < span class = cF5 > StrPrintJoin< / span > < span class = cF0 > (< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , format, argc, argv);
< a name = "l248" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > old_raw, old_input_filter;
< a name = "l249" > < / a >
< a name = "l250" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l251" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l252" > < / a > old_raw = < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l253" > < / a > old_input_filter = < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > );
< a name = "l254" > < / a > < / span > < span class = cF6 > " %s" < / span > < span class = cF0 > , buf;
< a name = "l255" > < / a > < / span > < span class = cF5 > Busy< / span > < span class = cF0 > (mS < < < / span > < span class = cFE > 10< / span > < span class = cF0 > );
< a name = "l256" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l257" > < / a >
< a name = "l258" > < / a > < / span > < span class = cF5 > LBEqual< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > , old_input_filter);
< a name = "l259" > < / a > < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (old_raw);
< a name = "l260" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (buf);
< a name = "l261" > < / a > }
< a name = "l262" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l263" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RawDump< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > mS=< / span > < span class = cFE > 100< / span > < span class = cF0 > , < / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > I64< / span > < span class = cF0 > count=< / span > < span class = cFE > 0x80< / span > < span class = cF0 > )
2021-12-11 11:10:58 +00:00
< a name = "l264" > < / a > {< / span > < span class = cF2 > //Dumps a block of mem using < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.ZC.html#l257" > < span class = cF4 > Raw< / span > < / a > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l265" > < / a > < / span > < span class = cF2 > //screen output for a fixed length< / span > < span class = cF0 >
< a name = "l266" > < / a > < / span > < span class = cF2 > //of time.< / span > < span class = cF0 >
< a name = "l267" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > old_raw, old_input_filter;
< a name = "l268" > < / a >
< a name = "l269" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l270" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l271" > < / a > old_raw = < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l272" > < / a > old_input_filter = < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > );
2021-11-30 22:24:57 +00:00
< a name = "l273" > < / a > < / span > < span class = cF5 > Dump< / span > < span class = cF0 > (addr, count);
2021-10-30 10:12:52 +01:00
< a name = "l274" > < / a > < / span > < span class = cF5 > Busy< / span > < span class = cF0 > (mS < < < / span > < span class = cFE > 10< / span > < span class = cF0 > );
< a name = "l275" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l276" > < / a >
< a name = "l277" > < / a > < / span > < span class = cF5 > LBEqual< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > , old_input_filter);
< a name = "l278" > < / a > < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (old_raw);
< a name = "l279" > < / a > }
< a name = "l280" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l281" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RawDumpMem< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > mS=< / span > < span class = cFE > 100< / span > < span class = cF0 > , < / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > I64< / span > < span class = cF0 > count=< / span > < span class = cFE > 0x80< / span > < span class = cF0 > )
2021-12-11 11:10:58 +00:00
< a name = "l282" > < / a > {< / span > < span class = cF2 > //Dumps a block of mem using < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.ZC.html#l257" > < span class = cF4 > Raw< / span > < / a > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l283" > < / a > < / span > < span class = cF2 > //screen output for a fixed length< / span > < span class = cF0 >
< a name = "l284" > < / a > < / span > < span class = cF2 > //of time.< / span > < span class = cF0 >
< a name = "l285" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > old_raw, old_input_filter;
< a name = "l286" > < / a >
< a name = "l287" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l288" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l289" > < / a > old_raw = < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l290" > < / a > old_input_filter = < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > );
2021-11-30 22:24:57 +00:00
< a name = "l291" > < / a > < / span > < span class = cF5 > DumpMem< / span > < span class = cF0 > (addr, count);
2021-10-30 10:12:52 +01:00
< a name = "l292" > < / a > < / span > < span class = cF5 > Busy< / span > < span class = cF0 > (mS < < < / span > < span class = cFE > 10< / span > < span class = cF0 > );
< a name = "l293" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l294" > < / a >
< a name = "l295" > < / a > < / span > < span class = cF5 > LBEqual< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_INPUT_FILTER_TASK< / span > < span class = cF0 > , old_input_filter);
< a name = "l296" > < / a > < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (old_raw);
< a name = "l297" > < / a > }
< a name = "l298" > < / a >
< a name = "l299" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > *< / span > < span class = cF5 > TaskRegAddr< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task, < / span > < span class = cF9 > I64< / span > < span class = cF0 > reg_num)
< a name = "l300" > < / a > {
< a name = "l301" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (reg_num)
< a name = "l302" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l303" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RAX< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rax;
< a name = "l304" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RCX< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rcx;
< a name = "l305" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RDX< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rdx;
< a name = "l306" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RBX< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rbx;
< a name = "l307" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RSP< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rsp;
< a name = "l308" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RBP< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rbp;
< a name = "l309" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RSI< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rsi;
< a name = "l310" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > REG_RDI< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> rdi;
< a name = "l311" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 8< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r8;
< a name = "l312" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 9< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r9;
< a name = "l313" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 10< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r10;
< a name = "l314" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 11< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r11;
< a name = "l315" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 12< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r12;
< a name = "l316" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 13< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r13;
< a name = "l317" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 14< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r14;
< a name = "l318" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 15< / span > < span class = cF0 > : < / span > < span class = cF1 > return< / span > < span class = cF0 > & task-> r15;
< a name = "l319" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l320" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l321" > < / a > }
< a name = "l322" > < / a >
< a name = "l323" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > RAWDR_COL (< / span > < span class = cFB > text< / span > < span class = cF0 > .cols - < / span > < span class = cFE > 40< / span > < span class = cF0 > )
2021-08-04 20:25:55 +01:00
< a name = "l324" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l325" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > RawDumpRegs< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
2021-10-30 10:12:52 +01:00
< a name = "l326" > < / a > {
< a name = "l327" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, j, old_col = < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col;
< a name = "l328" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > old_raw = < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l329" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > buf[< / span > < span class = cFE > 200< / span > < span class = cF0 > ];
< a name = "l330" > < / a >
< a name = "l331" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l332" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l333" > < / a >
< a name = "l334" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = RAWDR_COL;
< a name = "l335" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l336" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (j = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; j < < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - RAWDR_COL - < / span > < span class = cFE > 1< / span > < span class = cF0 > ; j++)
< a name = "l337" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l338" > < / a >
< a name = "l339" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cFE > 16< / span > < span class = cF0 > ; i++)
< a name = "l340" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l341" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = (i + < / span > < span class = cFE > 1< / span > < span class = cF0 > ) * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols + RAWDR_COL;
< a name = "l342" > < / a > < / span > < span class = cF6 > " .%3Z: %016X\n" < / span > < span class = cF0 > , i, < / span > < span class = cF6 > " ST_U64_REGS" < / span > < span class = cF0 > , *< / span > < span class = cF5 > TaskRegAddr< / span > < span class = cF0 > (task, i);
< a name = "l343" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l344" > < / a >
< a name = "l345" > < / a > i++;
< a name = "l346" > < / a >
< a name = "l347" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = i++ * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols + RAWDR_COL;
< a name = "l348" > < / a > < / span > < span class = cF6 > " .RIP: %016X\n" < / span > < span class = cF0 > , task-> rip;
< a name = "l349" > < / a >
< a name = "l350" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = i++ * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols + RAWDR_COL;
< a name = "l351" > < / a > < / span > < span class = cF6 > " .%-*tp\n" < / span > < span class = cF0 > , < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - (RAWDR_COL + < / span > < span class = cFE > 1< / span > < span class = cF0 > ) - < / span > < span class = cFE > 1< / span > < span class = cF0 > , < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip;
< a name = "l352" > < / a >
< a name = "l353" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = i++ * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols + RAWDR_COL;
< a name = "l354" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l355" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Bt< / span > < span class = cF7 > (< / span > < span class = cF0 > & < / span > < span class = cFB > sys_run_level< / span > < span class = cF0 > , < / span > < span class = cF3 > RLf_COMPILER< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l356" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l357" > < / a > j = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip;
< a name = "l358" > < / a > < / span > < span class = cF5 > Ui< / span > < span class = cF0 > (buf, & j,,, < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > );
< a name = "l359" > < / a > < / span > < span class = cF6 > " %s" < / span > < span class = cF0 > , buf;
< a name = "l360" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l361" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l362" > < / a > < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > ;
< a name = "l363" > < / a >
< a name = "l364" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = i * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols + RAWDR_COL;
< a name = "l365" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l366" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (j = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; j < < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - RAWDR_COL - < / span > < span class = cFE > 1< / span > < span class = cF0 > ; j++)
< a name = "l367" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l368" > < / a >
< a name = "l369" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l370" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l371" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (j = < / span > < span class = cFE > 2< / span > < span class = cF0 > ; j < i + < / span > < span class = cFE > 1< / span > < span class = cF0 > ; j++)
< a name = "l372" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l373" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = j * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l374" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l375" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l376" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = j * < / span > < span class = cFB > text< / span > < span class = cF0 > .cols - < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l377" > < / a > < / span > < span class = cF6 > '.'< / span > < span class = cF0 > ;
< a name = "l378" > < / a >
< a name = "l379" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_col = old_col;
< a name = "l380" > < / a > < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (old_raw);
< a name = "l381" > < / a > }
< a name = "l382" > < / a >
2021-11-30 22:24:57 +00:00
< a name = "l383" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > DumpRegs< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
2021-10-30 10:12:52 +01:00
< a name = "l384" > < / a > {< / span > < span class = cF2 > //Dump registers< / span > < span class = cF0 >
< a name = "l385" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i;
< a name = "l386" > < / a >
< a name = "l387" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l388" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l389" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < < / span > < span class = cFE > 16< / span > < span class = cF0 > ; i++)
< a name = "l390" > < / a > < / span > < span class = cF6 > " %3Z: %016X\n" < / span > < span class = cF0 > , i, < / span > < span class = cF6 > " ST_U64_REGS" < / span > < span class = cF0 > , *< / span > < span class = cF5 > TaskRegAddr< / span > < span class = cF0 > (task, i);
< a name = "l391" > < / a > < / span > < span class = cF6 > " RIP: %016X\n" < / span > < span class = cF0 > , task-> rip;
< a name = "l392" > < / a > }
< a name = "l393" > < / a >
< a name = "l394" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *< / span > < span class = cFD > SysGetStr2< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > )
< a name = "l395" > < / a > {
< a name = "l396" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > buf[< / span > < span class = cFE > 512< / span > < span class = cF0 > ];
< a name = "l397" > < / a >
< a name = "l398" > < / a > < / span > < span class = cF5 > StrNGet< / span > < span class = cF0 > (buf, < / span > < span class = cFE > 512< / span > < span class = cF0 > , < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l399" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF5 > StrNew< / span > < span class = cF0 > (buf);
< a name = "l400" > < / a > }
< a name = "l401" > < / a >
< a name = "l402" > < / a > < / span > < span class = cF9 > CBpt< / span > < span class = cF0 > *< / span > < span class = cF5 > BptFind< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *needle_addr, < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *haystack_task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > rem=< / span > < span class = cF3 > FALSE< / span > < span class = cF0 > )
< a name = "l403" > < / a > {
< a name = "l404" > < / a > < / span > < span class = cF9 > CBpt< / span > < span class = cF0 > *res=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , *tmpb, *tmpb1, *tmpb2;
< a name = "l405" > < / a >
< a name = "l406" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!haystack_task)
< a name = "l407" > < / a > haystack_task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l408" > < / a >
< a name = "l409" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l410" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l411" > < / a > tmpb1 = & haystack_task-> bpt_list;
< a name = "l412" > < / a > tmpb = haystack_task-> bpt_list;
< a name = "l413" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (tmpb)
< a name = "l414" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l415" > < / a > tmpb2 = tmpb-> next;
< a name = "l416" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tmpb-> addr == needle_addr)
< a name = "l417" > < / a > {
< a name = "l418" > < / a > res = tmpb;
< a name = "l419" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rem)
< a name = "l420" > < / a > tmpb1-> next = tmpb2;
< a name = "l421" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l422" > < / a > tmpb1 = & tmpb-> next;
< a name = "l423" > < / a > }
< a name = "l424" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l425" > < / a > tmpb1 = & tmpb-> next;
< a name = "l426" > < / a > tmpb = tmpb2;
< a name = "l427" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l428" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l429" > < / a >
< a name = "l430" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l431" > < / a > }
< a name = "l432" > < / a >
< a name = "l433" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > BptS< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > live=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l434" > < / a > {< / span > < span class = cF2 > //Set breakpoint.< / span > < span class = cF0 >
< a name = "l435" > < / a > < / span > < span class = cF9 > CBpt< / span > < span class = cF0 > *tmpb;
< a name = "l436" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > res = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l437" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l438" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l439" > < / a >
< a name = "l440" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l441" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l442" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF7 > (< / span > < span class = cF0 > tmpb = < / span > < span class = cF5 > BptFind< / span > < span class = cF0 > (addr, task, < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > )< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l443" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l444" > < / a > tmpb = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (< / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF9 > CBpt< / span > < span class = cF7 > )< / span > < span class = cF0 > , task);
< a name = "l445" > < / a > tmpb-> addr = addr;
< a name = "l446" > < / a > tmpb-> val = *addr;
< a name = "l447" > < / a > res = < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l448" > < / a > tmpb-> next = task-> bpt_list;
2021-08-04 20:25:55 +01:00
< a name = "l449" > < / a >
2021-10-30 10:12:52 +01:00
< a name = "l450" > < / a > task-> bpt_list = tmpb;
< a name = "l451" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > & & live)
< a name = "l452" > < / a > *addr = < / span > < span class = cF3 > OC_BPT< / span > < span class = cF0 > ;
< a name = "l453" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l454" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l455" > < / a >
< a name = "l456" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l457" > < / a > }
< a name = "l458" > < / a >
< a name = "l459" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > BptR< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > live=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > rem=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l460" > < / a > {< / span > < span class = cF2 > //Remove breakpoint.< / span > < span class = cF0 >
< a name = "l461" > < / a > < / span > < span class = cF9 > CBpt< / span > < span class = cF0 > *tmpb;
< a name = "l462" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > res = < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l463" > < / a >
< a name = "l464" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l465" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l466" > < / a >
< a name = "l467" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l468" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l469" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tmpb = < / span > < span class = cF5 > BptFind< / span > < span class = cF7 > (< / span > < span class = cF0 > addr, task, rem< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l470" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l471" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > & & live)
< a name = "l472" > < / a > *tmpb-> addr = tmpb-> val;
< a name = "l473" > < / a > res = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l474" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (rem)
< a name = "l475" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (tmpb);
< a name = "l476" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l477" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l478" > < / a >
< a name = "l479" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l480" > < / a > }
< a name = "l481" > < / a >
< a name = "l482" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > < / span > < span class = cF5 > B< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *addr, < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > live=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l483" > < / a > {< / span > < span class = cF2 > //Toggle breakpoint.< / span > < span class = cF0 >
< a name = "l484" > < / a > < / span > < span class = cF2 > //Return: TRUE if removed.< / span > < span class = cF0 >
< a name = "l485" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > res = < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l486" > < / a >
< a name = "l487" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l488" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l489" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > BptFind< / span > < span class = cF7 > (< / span > < span class = cF0 > addr, task, < / span > < span class = cF3 > FALSE< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l490" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l491" > < / a > < / span > < span class = cF5 > BptR< / span > < span class = cF0 > (addr, task, live, < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > );
< a name = "l492" > < / a > res = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l493" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l494" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l495" > < / a > < / span > < span class = cF5 > BptS< / span > < span class = cF0 > (addr, task, live);
< a name = "l496" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
2021-07-14 23:38:02 +01:00
< a name = "l497" > < / a >
2021-10-30 10:12:52 +01:00
< a name = "l498" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l499" > < / a > }
2021-08-04 20:25:55 +01:00
< a name = "l500" > < / a >
2021-10-30 10:12:52 +01:00
< a name = "l501" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > < / span > < span class = cF5 > B2< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > live=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l502" > < / a > {< / span > < span class = cF2 > //Remove all breakpoints.< / span > < span class = cF0 >
< a name = "l503" > < / a > < / span > < span class = cF2 > //Return: count of removed.< / span > < span class = cF0 >
< a name = "l504" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > res = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l505" > < / a > < / span > < span class = cF9 > CBpt< / span > < span class = cF0 > *tmpb, *tmpb1;
< a name = "l506" > < / a >
< a name = "l507" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l508" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l509" > < / a >
< a name = "l510" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l511" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l512" > < / a > tmpb = task-> bpt_list;
< a name = "l513" > < / a > task-> bpt_list = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l514" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (tmpb)
< a name = "l515" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l516" > < / a > tmpb1 = tmpb-> next;
< a name = "l517" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > & & live)
< a name = "l518" > < / a > *tmpb-> addr = tmpb-> val;
< a name = "l519" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (tmpb);
< a name = "l520" > < / a > tmpb = tmpb1;
< a name = "l521" > < / a > res++;
< a name = "l522" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l523" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l524" > < / a >
< a name = "l525" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > res;
< a name = "l526" > < / a > }
< a name = "l527" > < / a >
< a name = "l528" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > G< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ip=< / span > < span class = cF3 > INVALID_PTR< / span > < span class = cF0 > , < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l529" > < / a > {< / span > < span class = cF2 > //Go< / span > < span class = cF0 >
< a name = "l530" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l531" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l532" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (ip != < / span > < span class = cF3 > INVALID_PTR< / span > < span class = cF0 > )
< a name = "l533" > < / a > task-> rip = ip;
< a name = "l534" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > BptFind< / span > < span class = cF7 > (< / span > < span class = cF0 > task-> rip, task< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l535" > < / a > < / span > < span class = cF6 > " \nBreakpoints found.\n" < / span > < span class = cF0 >
< a name = "l536" > < / a > < / span > < span class = cF6 > " Do one of the following, first:\n" < / span > < span class = cF0 >
< a name = "l537" > < / a > < / span > < span class = cF6 > " > S;\t\t\t//Single step\n" < / span > < span class = cF0 >
< a name = "l538" > < / a > < / span > < span class = cF6 > " > B2;\t\t//Clear all break points\n" < / span > < span class = cF0 >
< a name = "l539" > < / a > < / span > < span class = cF6 > " > G2;\t\t//Clear all break points and Go\n\n" < / span > < span class = cF0 >
< a name = "l540" > < / a > < / span > < span class = cF6 > " After resuming, < CTRL-ALT-n> next focus task\n" < / span > < span class = cF0 >
< a name = "l541" > < / a > < / span > < span class = cF6 > " After resuming, < CTRL-ALT-v> flushes screen VGA cache\n" < / span > < span class = cF0 > ;
< a name = "l542" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l543" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l544" > < / a > < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& task-> task_flags, < / span > < span class = cF3 > TASKf_DISABLE_BPTS< / span > < span class = cF0 > );
< a name = "l545" > < / a > < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& task-> rflags, < / span > < span class = cF3 > RFLAGf_TRAP< / span > < span class = cF0 > );< / span > < span class = cF2 > //No single step< / span > < span class = cF0 >
< a name = "l546" > < / a > < / span > < span class = cF5 > Suspend< / span > < span class = cF0 > (task, < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l547" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l548" > < / a > {
< a name = "l549" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > IsDebugMode< / span > < span class = cF0 > & & task-> next_cc != & task-> next_cc)
< a name = "l550" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l551" > < / a > < / span > < span class = cF6 > " Exit Debug\n" < / span > < span class = cF0 > ;
< a name = "l552" > < / a > < / span > < span class = cF5 > Btr< / span > < span class = cF0 > (& task-> last_cc-> flags, < / span > < span class = cF3 > CCf_PROMPT< / span > < span class = cF0 > );
< a name = "l553" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l554" > < / a > }
< a name = "l555" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l556" > < / a > < / span > < span class = cF5 > Exit< / span > < span class = cF0 > ;
< a name = "l557" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l558" > < / a > }
< a name = "l559" > < / a >
< a name = "l560" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > G2< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ip=< / span > < span class = cF3 > INVALID_PTR< / span > < span class = cF0 > , < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > )
< a name = "l561" > < / a > {< / span > < span class = cF2 > //Remove all breakpoints and Go.< / span > < span class = cF0 >
< a name = "l562" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l563" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l564" > < / a > < / span > < span class = cF5 > B2< / span > < span class = cF0 > (task);
< a name = "l565" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > ext< / span > < span class = cF0 > [< / span > < span class = cF3 > EXT_WIN_FOCUS< / span > < span class = cF0 > ])
< a name = "l566" > < / a > < / span > < span class = cF5 > CallExtNum< / span > < span class = cF0 > (< / span > < span class = cF3 > EXT_WIN_FOCUS< / span > < span class = cF0 > , < / span > < span class = cFB > debug< / span > < span class = cF0 > .focus_task);
< a name = "l567" > < / a > < / span > < span class = cF5 > LFBFlush< / span > < span class = cF0 > ;
< a name = "l568" > < / a > < / span > < span class = cF5 > G< / span > < span class = cF0 > (ip, task);
< a name = "l569" > < / a > }
< a name = "l570" > < / a >
< a name = "l571" > < / a > < / span > < span class = cF1 > public< / span > < span class = cF0 > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > S< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *ip=< / span > < span class = cF3 > INVALID_PTR< / span > < span class = cF0 > , < / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > ) < / span > < span class = cF2 > //Single-step.< / span > < span class = cF0 >
< a name = "l572" > < / a > {< / span > < span class = cF2 > //Single step.< / span > < span class = cF0 >
< a name = "l573" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!task)
< a name = "l574" > < / a > task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l575" > < / a >
< a name = "l576" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l577" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l578" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (ip != < / span > < span class = cF3 > INVALID_PTR< / span > < span class = cF0 > )
< a name = "l579" > < / a > task-> rip = ip;
< a name = "l580" > < / a > < / span > < span class = cF5 > LBts< / span > < span class = cF0 > (& task-> task_flags, < / span > < span class = cF3 > TASKf_DISABLE_BPTS< / span > < span class = cF0 > );
< a name = "l581" > < / a > < / span > < span class = cF5 > LBts< / span > < span class = cF0 > (& task-> rflags, < / span > < span class = cF3 > RFLAGf_TRAP< / span > < span class = cF0 > );
< a name = "l582" > < / a > < / span > < span class = cF5 > Suspend< / span > < span class = cF0 > (task, < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l583" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task == < / span > < span class = cF5 > Fs< / span > < span class = cF0 > )
< a name = "l584" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l585" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > IsDebugMode< / span > < span class = cF0 > )
< a name = "l586" > < / a > {
< a name = "l587" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (task-> next_cc != & task-> next_cc)
< a name = "l588" > < / a > < / span > < span class = cF5 > Btr< / span > < span class = cF0 > (& task-> last_cc-> flags, < / span > < span class = cF3 > CCf_PROMPT< / span > < span class = cF0 > );
< a name = "l589" > < / a > }
< a name = "l590" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l591" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l592" > < / a > < / span > < span class = cF5 > Exit< / span > < span class = cF0 > ;
< a name = "l593" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l594" > < / a > }
< a name = "l595" > < / a >
< a name = "l596" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > DebugHelp< / span > < span class = cF0 > ()
< a name = "l597" > < / a > {
< a name = "l598" > < / a > < / span > < span class = cF6 > " \n" < / span > < span class = cF0 >
< a name = "l599" > < / a > < / span > < span class = cF6 > " The cmd line is basically the same as normal.< / span > < span class = cF0 > < / span > < span class = cF6 > Here are some common\n" < / span > < span class = cF0 >
< a name = "l600" > < / a > < / span > < span class = cF6 > " debugging commands.\n\n" < / span > < span class = cF0 >
< a name = "l601" > < / a > < / span > < span class = cF6 > " > EdLite(\" FileName\" );\t\t\t\t// Edit file.\n" < / span > < span class = cF0 >
2021-11-30 22:24:57 +00:00
< a name = "l602" > < / a > < / span > < span class = cF6 > " > Dump(0x100000);\t\t\t\t\t// Dump page tables.\n" < / span > < span class = cF0 >
< a name = "l603" > < / a > < / span > < span class = cF6 > " > DumpMem(0x100000);\t\t\t\t\t// Dump page tables.\n" < / span > < span class = cF0 >
< a name = "l604" > < / a > < / span > < span class = cF6 > " > DumpMem(Fs, sizeof(CTask));\t\t// Dump current task record.\n" < / span > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l605" > < / a > < / span > < span class = cF6 > " > ClassRep(Fs, \" CTask\" , 1);\t\t\t// Dump current task record.\n" < / span > < span class = cF0 >
< a name = "l606" > < / a > < / span > < span class = cF6 > " > ClassRep(Fs,, 1);\t\t\t\t\t// (It knows lastclass.)\n" < / span > < span class = cF0 >
< a name = "l607" > < / a > < / span > < span class = cF6 > " > CallerRep;\t\t\t\t\t\t\t// Stack trace report.\n" < / span > < span class = cF0 >
2021-11-30 22:24:57 +00:00
< a name = "l608" > < / a > < / span > < span class = cF6 > " > DumpAddress(_RSP);\t\t\t\t\t// Dump stack.\n" < / span > < span class = cF0 >
< a name = "l609" > < / a > < / span > < span class = cF6 > " > DumpRegs;\t\t\t\t\t\t\t// Dump Registers.\n" < / span > < span class = cF0 >
2021-10-30 10:12:52 +01:00
< a name = "l610" > < / a > < / span > < span class = cF6 > " > 1 + 2 * 3 + & Print;\t\t\t\t// Show calculation res.\n" < / span > < span class = cF0 >
< a name = "l611" > < / a > < / span > < span class = cF6 > " > *(0x70000)(I64 *) = 0x123456789;\t// Assign value to 0x70000-0x70007.\n" < / span > < span class = cF0 >
< a name = "l612" > < / a > < / span > < span class = cF6 > " > _RAX = 0x1234;\t\t\t\t\t\t// Set RAX to 0x1234.\n" < / span > < span class = cF0 >
< a name = "l613" > < / a > < / span > < span class = cF6 > " > _RIP = & Break;\t\t\t\t\t\t// Set RIP.\n" < / span > < span class = cF0 >
< a name = "l614" > < / a > < / span > < span class = cF6 > " > I64 i;\t\t\t\t\t\t\t\t// Declare variable.\n" < / span > < span class = cF0 >
< a name = "l615" > < / a > < / span > < span class = cF6 > " > i = _RCX + _RDX;\t\t\t\t\t// Assign to variable.\n" < / span > < span class = cF0 >
< a name = "l616" > < / a > < / span > < span class = cF6 > " > U(& Print+0x8);\t\t\t\t\t\t// Unassemble Print.\n" < / span > < span class = cF0 >
< a name = "l617" > < / a > < / span > < span class = cF6 > " > Uf(\" Print\" );\t\t\t\t\t\t// Unassembler function \" Print\" .\n" < / span > < span class = cF0 >
< a name = "l618" > < / a > < / span > < span class = cF6 > " > Man(\" Print\" );\t\t\t\t\t\t// Edit Src for \" Print\" .\n" < / span > < span class = cF0 >
< a name = "l619" > < / a > < / span > < span class = cF6 > " > E(_RIP);\t\t\t\t\t\t\t// Edit Src Code.\n" < / span > < span class = cF0 >
< a name = "l620" > < / a > < / span > < span class = cF6 > " > Fix;\t\t\t\t\t\t\t\t// Edit Last Err Src Code.\n" < / span > < span class = cF0 >
< a name = "l621" > < / a > < / span > < span class = cF6 > " > B(& Main+0x20);\t\t\t\t\t\t// Toggle break point.\n\n" < / span > < span class = cF0 >
< a name = "l622" > < / a > < / span > < span class = cF6 > " > B2;\t\t\t\t\t\t\t\t// Clear all break points.\n" < / span > < span class = cF0 >
< a name = "l623" > < / a > < / span > < span class = cF6 > " > S;\t\t\t\t\t\t\t\t\t// Single step.\n" < / span > < span class = cF0 >
< a name = "l624" > < / a > < / span > < span class = cF6 > " > G;\t\t\t\t\t\t\t\t\t// Resume execution.\n" < / span > < span class = cF0 >
< a name = "l625" > < / a > < / span > < span class = cF6 > " > G2;\t\t\t\t\t\t\t\t// B2;LFBFlush;WinFocus;G;\n" < / span > < span class = cF0 >
< a name = "l626" > < / a > < / span > < span class = cF6 > " > Exit;\t\t\t\t\t\t\t\t// Exit (kill) task.\n\n" < / span > < span class = cF0 >
< a name = "l627" > < / a > < / span > < span class = cF6 > " After resuming, < CTRL-ALT-n> next focus task.\n" < / span > < span class = cF0 >
< a name = "l628" > < / a > < / span > < span class = cF6 > " After resuming, < CTRL-ALT-v> flushes screen VGA cache.\n\n" < / span > < span class = cF0 > ;
< a name = "l629" > < / a > }
< a name = "l630" > < / a >
< a name = "l631" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > Debug2< / span > < span class = cF0 > ()
< a name = "l632" > < / a > {
< a name = "l633" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > old_win_inhibit, old_waiting_message, old_single;
< a name = "l634" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, old_getstr2;
< a name = "l635" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > buf[< / span > < span class = cFE > 200< / span > < span class = cF0 > ];
< a name = "l636" > < / a >
< a name = "l637" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > debug< / span > < span class = cF0 > .panic)
< a name = "l638" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l639" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > IsRaw< / span > < span class = cF0 > )
< a name = "l640" > < / a > {
< a name = "l641" > < / a > i = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip;
< a name = "l642" > < / a > < / span > < span class = cF5 > Ui< / span > < span class = cF0 > (buf, & i);
< a name = "l643" > < / a > < / span > < span class = cF6 > " %s" < / span > < span class = cF0 > , buf;
< a name = "l644" > < / a > }
< a name = "l645" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l646" > < / a > < / span > < span class = cF5 > U< / span > < span class = cF0 > (< / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip, < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l647" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l648" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l649" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .panic = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
2021-11-30 22:24:57 +00:00
< a name = "l650" > < / a > < / span > < span class = cF6 > " \n" < / span > < span class = cF0 > ;
< a name = "l651" > < / a > old_waiting_message = < / span > < span class = cF5 > LBtr< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_AWAITING_MESSAGE< / span > < span class = cF0 > );
< a name = "l652" > < / a > old_win_inhibit = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> win_inhibit;
< a name = "l653" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> win_inhibit = < / span > < span class = cF3 > WIG_USER_TASK_DEFAULT< / span > < span class = cF0 > ;
< a name = "l654" > < / a > < / span > < span class = cFB > sys_focus_task< / span > < span class = cF0 > = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l655" > < / a > < / span > < span class = cFB > kbd< / span > < span class = cF0 > .scan_code = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l656" > < / a > old_getstr2 = < / span > < span class = cFB > fp_getstr2< / span > < span class = cF0 > ;
< a name = "l657" > < / a > < / span > < span class = cFB > fp_getstr2< / span > < span class = cF0 > = & < / span > < span class = cFD > SysGetStr2< / span > < span class = cF0 > ;
< a name = "l658" > < / a > old_single = < / span > < span class = cF5 > SingleUser< / span > < span class = cF0 > (< / span > < span class = cF3 > OFF< / span > < span class = cF0 > );
< a name = "l659" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (!< / span > < span class = cFB > mouse_hard< / span > < span class = cF0 > .install_attempts)
< a name = "l660" > < / a > < / span > < span class = cF5 > Yield< / span > < span class = cF0 > ;
< a name = "l661" > < / a > < / span > < span class = cF5 > SingleUser< / span > < span class = cF0 > (old_single);
< a name = "l662" > < / a > < / span > < span class = cF5 > UserTaskCont< / span > < span class = cF0 > ;
< a name = "l663" > < / a > < / span > < span class = cFB > fp_getstr2< / span > < span class = cF0 > = old_getstr2;
< a name = "l664" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> win_inhibit = old_win_inhibit;
< a name = "l665" > < / a > < / span > < span class = cF5 > LBEqual< / span > < span class = cF0 > (& < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_AWAITING_MESSAGE< / span > < span class = cF0 > , old_waiting_message);
< a name = "l666" > < / a > }
< a name = "l667" > < / a >
< a name = "l668" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > Fault3< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > fault_num, < / span > < span class = cF9 > I64< / span > < span class = cF0 > fault_err_code)
< a name = "l669" > < / a > {
< a name = "l670" > < / a > < / span > < span class = cF1 > no_warn< / span > < span class = cF0 > fault_err_code;
< a name = "l671" > < / a >
< a name = "l672" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l673" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l674" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Gs< / span > < span class = cF0 > -> num & & < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash)
< a name = "l675" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l676" > < / a > < / span > < span class = cFB > mp_count< / span > < span class = cF0 > = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l677" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash-> cpu_num = < / span > < span class = cF5 > Gs< / span > < span class = cF0 > -> num;
< a name = "l678" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash-> task = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > ;
< a name = "l679" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash-> rip = < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip;
< a name = "l680" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash-> message = < / span > < span class = cFB > debug< / span > < span class = cF0 > .message;
< a name = "l681" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .mp_crash-> message_num = < / span > < span class = cFB > debug< / span > < span class = cF0 > .message_num;
< a name = "l682" > < / a > < / span > < span class = cF5 > MPInt< / span > < span class = cF0 > (< / span > < span class = cF3 > I_MP_CRASH< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > );
< a name = "l683" > < / a > < / span > < span class = cF5 > SysHlt< / span > < span class = cF0 > ;
< a name = "l684" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l685" > < / a >
< a name = "l686" > < / a > < / span > < span class = cF6 > " \n\tZealOS Debugger\n\n" < / span > < span class = cF0 >
< a name = "l687" > < / a > < / span > < span class = cF6 > " Type Help; for help.\n\n" < / span > < span class = cF0 > ;
< a name = "l688" > < / a >
< a name = "l689" > < / a > < / span > < span class = cF5 > Beep< / span > < span class = cF0 > (< / span > < span class = cFE > 62< / span > < span class = cF0 > , < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > );
< a name = "l690" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (fault_num == < / span > < span class = cF3 > I_DEBUG< / span > < span class = cF0 > )
< a name = "l691" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l692" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > debug< / span > < span class = cF0 > .message)
< a name = "l693" > < / a > {
< a name = "l694" > < / a > < / span > < span class = cF6 > " \n!!! %s" < / span > < span class = cF0 > , < / span > < span class = cFB > debug< / span > < span class = cF0 > .message;
< a name = "l695" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > debug< / span > < span class = cF0 > .message_num)
< a name = "l696" > < / a > < / span > < span class = cF6 > " %016X" < / span > < span class = cF0 > , < / span > < span class = cFB > debug< / span > < span class = cF0 > .message_num;
< a name = "l697" > < / a > < / span > < span class = cF6 > " !!!\n\n" < / span > < span class = cF0 > ;
< a name = "l698" > < / a > }
< a name = "l699" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l700" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFB > debug< / span > < span class = cF0 > .panic)
< a name = "l701" > < / a > < / span > < span class = cF5 > CallerRep< / span > < span class = cF0 > ;
< a name = "l702" > < / a > < / span > < span class = cFD > Debug2< / span > < span class = cF0 > ;
< a name = "l703" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l704" > < / a > }
< a name = "l705" > < / a >
< a name = "l706" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cFD > Fault2< / span > < span class = cF0 > (< / span > < span class = cF9 > I64< / span > < span class = cF0 > fault_num, < / span > < span class = cF9 > I64< / span > < span class = cF0 > fault_err_code)
2021-12-11 11:10:58 +00:00
< a name = "l707" > < / a > {< / span > < span class = cF2 > //Called from < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Kernel/KInterrupts.ZC.html#l91" > < span class = cF4 > Fault2< / span > < / a > < span class = cF2 > .< / span > < span class = cF0 >
2021-11-30 22:24:57 +00:00
< a name = "l708" > < / a > < / span > < span class = cF2 > //Be careful not to swap-out and ruin the saved context< / span > < span class = cF0 >
< a name = "l709" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > was_raw, was_single_user, was_silent, was_in_debug, was_mouse_enabled;
< a name = "l710" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, old_raw_flags = < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_flags;
< a name = "l711" > < / a >
< a name = "l712" > < / a > was_single_user = < / span > < span class = cF5 > SingleUser< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l713" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!< / span > < span class = cF5 > IsDebugMode< / span > < span class = cF0 > )
< a name = "l714" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .focus_task = < / span > < span class = cFB > sys_focus_task< / span > < span class = cF0 > ;
< a name = "l715" > < / a > < / span > < span class = cFB > sys_focus_task< / span > < span class = cF0 > = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l716" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (fault_num == < / span > < span class = cF3 > I_BPT< / span > < span class = cF0 > )
< a name = "l717" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip--;
< a name = "l718" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> debug_task)
< a name = "l719" > < / a > < / span > < span class = cF5 > CallExtNum< / span > < span class = cF0 > (< / span > < span class = cF3 > EXT_DEBUG_RESUME< / span > < span class = cF0 > , fault_num, fault_err_code);
< a name = "l720" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l721" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l722" > < / a > was_mouse_enabled = < / span > < span class = cF5 > CallExtStr< / span > < span class = cF0 > (< / span > < span class = cF6 > " MouseHardEnable" < / span > < span class = cF0 > , < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l723" > < / a > was_raw = < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l724" > < / a > was_silent = < / span > < span class = cF5 > Silent< / span > < span class = cF0 > (< / span > < span class = cF3 > OFF< / span > < span class = cF0 > );
2021-12-04 10:03:02 +00:00
< a name = "l725" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_flags |= < / span > < span class = cF3 > RAWF_SHOW_DOLLAR< / span > < span class = cF0 > | < / span > < span class = cF3 > RAWF_SCROLL< / span > < span class = cF0 > ;
2021-11-30 22:24:57 +00:00
< a name = "l726" > < / a >
< a name = "l727" > < / a > < / span > < span class = cF6 > " Task \" " < / span > < span class = cF0 > ;
< a name = "l728" > < / a > < / span > < span class = cF6 > " %s" < / span > < span class = cF0 > , < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_title;
< a name = "l729" > < / a > < / span > < span class = cF6 > " \" \n\n" < / span > < span class = cF0 > ;
< a name = "l730" > < / a > < / span > < span class = cF6 > " Fault: 0x%02X %Z\n" < / span > < span class = cF0 > , fault_num, fault_num, < / span > < span class = cF6 > " ST_INT_NAMES" < / span > < span class = cF0 > ;
< a name = "l731" > < / a > < / span > < span class = cF6 > " Err Code: %08X\n" < / span > < span class = cF0 > , fault_err_code;
< a name = "l732" > < / a > was_in_debug = < / span > < span class = cF5 > DebugMode< / span > < span class = cF0 > (< / span > < span class = cF3 > ON< / span > < span class = cF0 > );
< a name = "l733" > < / a > < / span > < span class = cF6 > " RIP: %08X" < / span > < span class = cF0 > , < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip; < / span > < span class = cF2 > //Sometimes crashes on %p, so do this first< / span > < span class = cF0 >
< a name = "l734" > < / a > < / span > < span class = cF6 > " :%p\nRSP: %08X\n" < / span > < span class = cF0 > , < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rip, < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> rsp;
< a name = "l735" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (fault_num == < / span > < span class = cF3 > I_PAGE_FAULT< / span > < span class = cF0 > )
< a name = "l736" > < / a > {
< a name = "l737" > < / a > < / span > < span class = cF1 > MOV_RAX_CR2< / span > < span class = cF0 >
< a name = "l738" > < / a > i = < / span > < span class = cF5 > RAXGet< / span > < span class = cF0 > ;
< a name = "l739" > < / a > < / span > < span class = cF6 > " Fault Addr: %08X:%p\n" < / span > < span class = cF0 > , i, i;
< a name = "l740" > < / a > }
< a name = "l741" > < / a > < / span > < span class = cFD > Fault3< / span > < span class = cF0 > (fault_num, fault_err_code);
< a name = "l742" > < / a > < / span > < span class = cF5 > DebugMode< / span > < span class = cF0 > (was_in_debug);
< a name = "l743" > < / a > < / span > < span class = cF5 > Silent< / span > < span class = cF0 > (was_silent);
< a name = "l744" > < / a > < / span > < span class = cF5 > Raw< / span > < span class = cF0 > (was_raw);
< a name = "l745" > < / a > < / span > < span class = cF5 > CallExtStr< / span > < span class = cF0 > (< / span > < span class = cF6 > " MouseHardEnable" < / span > < span class = cF0 > , was_mouse_enabled);
< a name = "l746" > < / a > < / span > < span class = cFB > text< / span > < span class = cF0 > .raw_flags = old_raw_flags;
< a name = "l747" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l748" > < / a > < / span > < span class = cF5 > SingleUser< / span > < span class = cF0 > (was_single_user);
< a name = "l749" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > LBtr< / span > < span class = cF7 > (< / span > < span class = cF0 > & < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_flags, < / span > < span class = cF3 > TASKf_KILL_AFTER_DEBUG< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l750" > < / a > < / span > < span class = cF5 > Exit< / span > < span class = cF0 > ;
< a name = "l751" > < / a > }
< a name = "l752" > < / a >
< a name = "l753" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > Panic< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *message=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF9 > I64< / span > < span class = cF0 > message_num=< / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cF1 > Bool< / span > < span class = cF0 > panic=< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l754" > < / a > {< / span > < span class = cF2 > //Enter the debugger with panic?< / span > < span class = cF0 >
< a name = "l755" > < / a > < / span > < span class = cF1 > PUSHFD< / span > < span class = cF0 >
< a name = "l756" > < / a > < / span > < span class = cF1 > CLI< / span > < span class = cF0 >
< a name = "l757" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .message = message;
< a name = "l758" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .message_num = message_num;
< a name = "l759" > < / a > < / span > < span class = cFB > debug< / span > < span class = cF0 > .panic = panic;
< a name = "l760" > < / a > < / span > < span class = cF1 > INT< / span > < span class = cF0 > < / span > < span class = cF3 > I_DEBUG< / span > < span class = cF0 >
< a name = "l761" > < / a > < / span > < span class = cF1 > POPFD< / span > < span class = cF0 >
< a name = "l762" > < / a > }
< a name = "l763" > < / a >
< a name = "l764" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > Debug< / span > < span class = cF0 > (< / span > < span class = cF1 > U8< / span > < span class = cF0 > *message=< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF9 > I64< / span > < span class = cF0 > message_num=< / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l765" > < / a > {< / span > < span class = cF2 > //Enter debugger, no panic.< / span > < span class = cF0 >
< a name = "l766" > < / a > < / span > < span class = cF5 > Panic< / span > < span class = cF0 > (message, message_num, < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > );
< a name = "l767" > < / a > }
2021-07-03 05:07:57 +01:00
< / span > < / pre > < / body >
< / html >