302 lines
35 KiB
Plaintext
302 lines
35 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Debugging/Dump"</span><span class=cF0>
|
||
|
<a name="l2"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>ClassRep2</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF1>U8</span><span class=cF0> *_d,</span><span class=cF1>U8</span><span class=cF0> *class_name=</span><span class=cF1>lastclass</span><span class=cF0>,
|
||
|
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> depth,</span><span class=cF9>I64</span><span class=cF0> max_depth,</span><span class=cF1>Bool</span><span class=cF0> dynamic,</span><span class=cF9>I64</span><span class=cF0> types=</span><span class=cF3>HTT_CLASS</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>offset</span><span class=cF0>=0)
|
||
|
<a name="l4"></a>{</span><span class=cF2>//See </span><a href="/Wb/Demo/LastClass.HC.HTML#l1"><span class=cF4>::/Demo/LastClass.HC</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l5"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,stars,*ptr;
|
||
|
<a name="l6"></a> </span><span class=cF9>CMemberLst</span><span class=cF0> *ml;
|
||
|
<a name="l7"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
||
|
<a name="l8"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
|
||
|
<a name="l9"></a> </span><span class=cF9>CHashClass</span><span class=cF0> *tmpc,*tmpc2;
|
||
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (depth>=max_depth) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpc=</span><span class=cF5>HashFind</span><span class=cF0>(class_name,</span><span class=cF5>Fs</span><span class=cF0>->hash_table,types)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l12"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"Class Not Found.\n"</span><span class=cF0>);
|
||
|
<a name="l13"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l14"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l15"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>ChkPtr</span><span class=cF7>(</span><span class=cF0>_d</span><span class=cF7>)</span><span class=cF0> || !</span><span class=cF5>ChkPtr</span><span class=cF7>(</span><span class=cF0>_d(</span><span class=cF1>U8</span><span class=cF0> *)+tmpc->size</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l16"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"Bad Ptr:%016X\n"</span><span class=cF0>,_d);
|
||
|
<a name="l17"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l18"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->base_class && !</span><span class=cF5>ClassRep2</span><span class=cF7>(</span><span class=cF0>doc,_d,tmpc->base_class->str,
|
||
|
<a name="l20"></a> depth,max_depth,dynamic,types,</span><span class=cF1>offset</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l21"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l22"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l23"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"Class:\"%s\"\n"</span><span class=cF0>,class_name);
|
||
|
<a name="l24"></a> ml=tmpc->member_lst_and_root;
|
||
|
<a name="l25"></a> </span><span class=cF1>while</span><span class=cF0> (ml) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l26"></a> tmpc2=ml->member_class;
|
||
|
<a name="l27"></a> ptr=_d(</span><span class=cF1>U8</span><span class=cF0> *)+ml-></span><span class=cF1>offset</span><span class=cF0>;
|
||
|
<a name="l28"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%08X "</span><span class=cF0>,ptr</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF1>offset</span><span class=cF0>);
|
||
|
<a name="l29"></a> stars=tmpc2->ptr_stars_cnt;
|
||
|
<a name="l30"></a> tmpc2=</span><span class=cF5>OptClassFwd</span><span class=cF0>(tmpc2);
|
||
|
<a name="l31"></a> tmpc2-=tmpc2->ptr_stars_cnt;
|
||
|
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc2->type & </span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>) {
|
||
|
<a name="l33"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$GREEN$%-20ts:$FG$"</span><span class=cF0>,ml->str);
|
||
|
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (stars==1 && </span><span class=cF7>(</span><span class=cF0>tmpc2->raw_type==</span><span class=cF3>RT_I8</span><span class=cF0> || tmpc2->raw_type==</span><span class=cF3>RT_U8</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l35"></a> ptr=*ptr;
|
||
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>ChkPtr</span><span class=cF7>(</span><span class=cF0>ptr</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l38"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$\n"</span><span class=cF0>);
|
||
|
<a name="l39"></a> doc_e->data=ptr;
|
||
|
<a name="l40"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l41"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l42"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%40ts\n"</span><span class=cF0>,ptr);
|
||
|
<a name="l43"></a> }
|
||
|
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!stars) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l45"></a> j=</span><span class=cF5>MinI64</span><span class=cF0>(ml->dim.total_cnt,32);
|
||
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc2->raw_type==</span><span class=cF3>RT_I8</span><span class=cF0> || tmpc2->raw_type==</span><span class=cF3>RT_U8</span><span class=cF0>) {
|
||
|
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (j==1) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l49"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$\n"</span><span class=cF0>);
|
||
|
<a name="l50"></a> doc_e->data=ptr;
|
||
|
<a name="l51"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l52"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%c\n"</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l53"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l55"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$\n"</span><span class=cF0>);
|
||
|
<a name="l56"></a> doc_e->data=ptr;
|
||
|
<a name="l57"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l58"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l59"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%40ts\n"</span><span class=cF0>,ptr);
|
||
|
<a name="l60"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l61"></a> }
|
||
|
<a name="l62"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<j;i++) {
|
||
|
<a name="l63"></a> </span><span class=cF1>switch</span><span class=cF0> (tmpc2->raw_type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l64"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_I0</span><span class=cF0>:
|
||
|
<a name="l65"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_U0</span><span class=cF0>:
|
||
|
<a name="l66"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l67"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_I8</span><span class=cF0>:
|
||
|
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l69"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$ "</span><span class=cF0>);
|
||
|
<a name="l70"></a> doc_e->data=ptr(</span><span class=cF1>I8</span><span class=cF0> *)++;
|
||
|
<a name="l71"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l72"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%02X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF1>I8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l73"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l74"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_U8</span><span class=cF0>:
|
||
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l76"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$ "</span><span class=cF0>);
|
||
|
<a name="l77"></a> doc_e->data=ptr(</span><span class=cF1>U8</span><span class=cF0> *)++;
|
||
|
<a name="l78"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l79"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%02X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l80"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l81"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_I16</span><span class=cF0>:
|
||
|
<a name="l82"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l83"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$ "</span><span class=cF0>);
|
||
|
<a name="l84"></a> doc_e->data=ptr(</span><span class=cF9>I16</span><span class=cF0> *)++;
|
||
|
<a name="l85"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l86"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%04X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>I16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l87"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l88"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_U16</span><span class=cF0>:
|
||
|
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l90"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$ "</span><span class=cF0>);
|
||
|
<a name="l91"></a> doc_e->data=ptr(</span><span class=cF9>U16</span><span class=cF0> *)++;
|
||
|
<a name="l92"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l93"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%04X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>U16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l94"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l95"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_I32</span><span class=cF0>:
|
||
|
<a name="l96"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l97"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$ "</span><span class=cF0>);
|
||
|
<a name="l98"></a> doc_e->data=ptr(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l99"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l100"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%08X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>I32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l101"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l102"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_U32</span><span class=cF0>:
|
||
|
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l104"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$ "</span><span class=cF0>);
|
||
|
<a name="l105"></a> doc_e->data=ptr(</span><span class=cF9>U32</span><span class=cF0> *)++;
|
||
|
<a name="l106"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l107"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%08X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l108"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l109"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_U64</span><span class=cF0>:
|
||
|
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l111"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$ "</span><span class=cF0>);
|
||
|
<a name="l112"></a> doc_e->data=ptr(</span><span class=cF9>U64</span><span class=cF0> *)++;
|
||
|
<a name="l113"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l114"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%08X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l115"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l116"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>RT_F64</span><span class=cF0>:
|
||
|
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l118"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$ "</span><span class=cF0>);
|
||
|
<a name="l119"></a> doc_e->data=ptr(</span><span class=cF1>F64</span><span class=cF0> *)++;
|
||
|
<a name="l120"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l121"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%16g "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l122"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l123"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l124"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic) {
|
||
|
<a name="l125"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$DA-TRM+RD+UD,A=\"%%016X\"$ "</span><span class=cF0>);
|
||
|
<a name="l126"></a> doc_e->data=ptr(</span><span class=cF9>I64</span><span class=cF0> *)++;
|
||
|
<a name="l127"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l128"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%016X "</span><span class=cF0>,*ptr</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l129"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (dynamic)
|
||
|
<a name="l131"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l132"></a> }
|
||
|
<a name="l133"></a> </span><span class=cF1>if</span><span class=cF0> (j<ml->dim.total_cnt)
|
||
|
<a name="l134"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"..."</span><span class=cF0>);
|
||
|
<a name="l135"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l136"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%016X"</span><span class=cF0>,*ptr);
|
||
|
<a name="l137"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\n"</span><span class=cF0>);
|
||
|
<a name="l138"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (depth<2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l140"></a> </span><span class=cF1>if</span><span class=cF0> (stars==1 && !</span><span class=cF5>ChkPtr</span><span class=cF7>(</span><span class=cF0>*ptr</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l141"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%-20ts:%016X\n"</span><span class=cF0>,ml->str,*ptr);
|
||
|
<a name="l142"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l143"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$TR,\"%s\"$\n"</span><span class=cF0>,ml->str);
|
||
|
<a name="l144"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$ID,2$"</span><span class=cF0>);
|
||
|
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (!stars)
|
||
|
<a name="l146"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,ptr,tmpc2->str,depth+1,max_depth,dynamic);
|
||
|
<a name="l147"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (stars==1)
|
||
|
<a name="l148"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,*ptr,tmpc2->str,depth+1,max_depth,dynamic);
|
||
|
<a name="l149"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$ID,-2$"</span><span class=cF0>);
|
||
|
<a name="l150"></a> }
|
||
|
<a name="l151"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l152"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%-20ts\n"</span><span class=cF0>,ml->str);
|
||
|
<a name="l153"></a> }
|
||
|
<a name="l154"></a> ml=ml->next;
|
||
|
<a name="l155"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l156"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l157"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l158"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l159"></a>}
|
||
|
<a name="l160"></a>
|
||
|
<a name="l161"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ClassRep</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *_d,</span><span class=cF1>U8</span><span class=cF0> *class_name=</span><span class=cF1>lastclass</span><span class=cF0>,
|
||
|
<a name="l162"></a> </span><span class=cF9>I64</span><span class=cF0> max_depth=2,</span><span class=cF1>Bool</span><span class=cF0> fun=</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>offset</span><span class=cF0>=0)
|
||
|
<a name="l163"></a>{</span><span class=cF2>//Displays members of a record by using the compiler's info.</span><span class=cF0>
|
||
|
<a name="l164"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
||
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
|
||
|
<a name="l166"></a> doc=</span><span class=cF5>DocNew</span><span class=cF0>;
|
||
|
<a name="l167"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l168"></a> </span><span class=cF5>DocMax</span><span class=cF0>;
|
||
|
<a name="l169"></a> doc=</span><span class=cF5>DocPut</span><span class=cF0>;
|
||
|
<a name="l170"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l171"></a> </span><span class=cF1>if</span><span class=cF0> (fun)
|
||
|
<a name="l172"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,_d,class_name,0,max_depth,</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>HTT_FUN</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF0>);
|
||
|
<a name="l173"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l174"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,_d,class_name,0,max_depth,</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>HTT_CLASS</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF0>);
|
||
|
<a name="l175"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\n"</span><span class=cF0>);
|
||
|
<a name="l176"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
||
|
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l178"></a> </span><span class=cF5>DocDump</span><span class=cF0>(doc,100000);
|
||
|
<a name="l179"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l180"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l181"></a>}
|
||
|
<a name="l182"></a>
|
||
|
<a name="l183"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ClassRepD</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *_d,</span><span class=cF1>U8</span><span class=cF0> *class_name=</span><span class=cF1>lastclass</span><span class=cF0>,
|
||
|
<a name="l184"></a> </span><span class=cF9>I64</span><span class=cF0> max_depth=2,</span><span class=cF1>Bool</span><span class=cF0> fun=</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>offset</span><span class=cF0>=0)
|
||
|
<a name="l185"></a>{</span><span class=cF2>//Dynamic ClassRep. Uses hex_ed widgit for live changes.</span><span class=cF0>
|
||
|
<a name="l186"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
||
|
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
|
||
|
<a name="l188"></a> doc=</span><span class=cF5>DocNew</span><span class=cF0>;
|
||
|
<a name="l189"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l190"></a> </span><span class=cF5>DocMax</span><span class=cF0>;
|
||
|
<a name="l191"></a> doc=</span><span class=cF5>DocPut</span><span class=cF0>;
|
||
|
<a name="l192"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l193"></a> </span><span class=cF1>if</span><span class=cF0> (fun)
|
||
|
<a name="l194"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,_d,class_name,0,max_depth,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF3>HTT_FUN</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF0>);
|
||
|
<a name="l195"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l196"></a> </span><span class=cF5>ClassRep2</span><span class=cF0>(doc,_d,class_name,0,max_depth,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF3>HTT_CLASS</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF0>);
|
||
|
<a name="l197"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\n"</span><span class=cF0>);
|
||
|
<a name="l198"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
||
|
<a name="l199"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l200"></a> </span><span class=cF5>DocDump</span><span class=cF0>(doc,100000);
|
||
|
<a name="l201"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l202"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l203"></a>}
|
||
|
<a name="l204"></a>
|
||
|
<a name="l205"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>UpdateRegVarImg</span><span class=cF0>(</span><span class=cF9>CHashFun</span><span class=cF0> *tmpf,</span><span class=cF1>U8</span><span class=cF0> *_b,</span><span class=cF9>CTask</span><span class=cF0> *task)
|
||
|
<a name="l206"></a>{
|
||
|
<a name="l207"></a> </span><span class=cF9>CMemberLst</span><span class=cF0> *ml;
|
||
|
<a name="l208"></a> </span><span class=cF9>CHashClass</span><span class=cF0> *tmpc;
|
||
|
<a name="l209"></a> ml=tmpf->member_lst_and_root;
|
||
|
<a name="l210"></a> </span><span class=cF1>while</span><span class=cF0> (ml) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (ml-></span><span class=cF1>reg</span><span class=cF0>!=</span><span class=cF3>REG_NONE</span><span class=cF0>) {
|
||
|
<a name="l212"></a> tmpc=</span><span class=cF5>OptClassFwd</span><span class=cF0>(ml->member_class);
|
||
|
<a name="l213"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(_b+ml-></span><span class=cF1>offset</span><span class=cF0>,</span><span class=cF5>TaskRegAddr</span><span class=cF7>(</span><span class=cF0>task,ml-></span><span class=cF1>reg</span><span class=cF7>)</span><span class=cF0>,tmpc->size);
|
||
|
<a name="l214"></a> }
|
||
|
<a name="l215"></a> ml=ml->next;
|
||
|
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l217"></a>}
|
||
|
<a name="l218"></a>
|
||
|
<a name="l219"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>FunRep</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF1>U8</span><span class=cF0> *rbp=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> max_depth=2,</span><span class=cF9>CTask</span><span class=cF0> *task=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l220"></a>{</span><span class=cF2>//Shows names and vals of a fun's local vars using compiler's info.</span><span class=cF0>
|
||
|
<a name="l221"></a> </span><span class=cF9>I64</span><span class=cF0> size;
|
||
|
<a name="l222"></a> </span><span class=cF1>U8</span><span class=cF0> *img;
|
||
|
<a name="l223"></a> </span><span class=cF9>CHashFun</span><span class=cF0> *tmpf=</span><span class=cF5>HashFind</span><span class=cF0>(st,</span><span class=cF5>Fs</span><span class=cF0>->hash_table,</span><span class=cF3>HTT_FUN</span><span class=cF0>);
|
||
|
<a name="l224"></a> </span><span class=cF9>CMemberLst</span><span class=cF0> *tmpm;
|
||
|
<a name="l225"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l226"></a> </span><span class=cF1>if</span><span class=cF0> (rbp) {
|
||
|
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (task) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l228"></a></span><span class=cF2>//tmpf->size is negative. It's the bottom</span><span class=cF0>
|
||
|
<a name="l229"></a> </span><span class=cF2>//of the fun local var space relative to RBP .</span><span class=cF0>
|
||
|
<a name="l230"></a> size=tmpf->arg_cnt*8-tmpf->size+16;
|
||
|
<a name="l231"></a>
|
||
|
<a name="l232"></a> img=</span><span class=cF5>MAlloc</span><span class=cF0>(size);
|
||
|
<a name="l233"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(img,rbp+tmpf->size,size);
|
||
|
<a name="l234"></a> </span><span class=cF5>UpdateRegVarImg</span><span class=cF0>(tmpf,img-tmpf->size,task);
|
||
|
<a name="l235"></a> </span><span class=cF5>ClassRep</span><span class=cF0>(img-tmpf->size,st,max_depth,</span><span class=cF3>TRUE</span><span class=cF0>,rbp-img+tmpf->size);
|
||
|
<a name="l236"></a> </span><span class=cF5>Free</span><span class=cF0>(img);
|
||
|
<a name="l237"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l238"></a> </span><span class=cF5>ClassRep</span><span class=cF0>(rbp,st,max_depth,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l239"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l240"></a> tmpm=tmpf->member_lst_and_root;
|
||
|
<a name="l241"></a> </span><span class=cF1>while</span><span class=cF0> (tmpm) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l242"></a> </span><span class=cF1>if</span><span class=cF0> (0<=tmpm-></span><span class=cF1>reg</span><span class=cF0><</span><span class=cF3>REG_REGS_NUM</span><span class=cF0>)
|
||
|
<a name="l243"></a> </span><span class=cF6>"%08Z %s\n"</span><span class=cF0>,tmpm-></span><span class=cF1>reg</span><span class=cF0>,</span><span class=cF6>"ST_U64_REGS"</span><span class=cF0>,tmpm->str;
|
||
|
<a name="l244"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l245"></a> </span><span class=cF6>"%08tX %s\n"</span><span class=cF0>,tmpm-></span><span class=cF1>offset</span><span class=cF0>,tmpm->str;
|
||
|
<a name="l246"></a> tmpm=tmpm->next;
|
||
|
<a name="l247"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l248"></a> </span><span class=cF6>"%08tX Stk Size\n"</span><span class=cF0>,tmpf->size;
|
||
|
<a name="l249"></a> }
|
||
|
<a name="l250"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l251"></a>}
|
||
|
<a name="l252"></a>
|
||
|
<a name="l253"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Debugging/Unassemble"</span><span class=cF0>
|
||
|
<a name="l254"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Uf</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st)
|
||
|
<a name="l255"></a>{</span><span class=cF2>//Unassembles a named fun</span><span class=cF0>
|
||
|
<a name="l256"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l257"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmpf;
|
||
|
<a name="l258"></a> </span><span class=cF9>CDbgInfo</span><span class=cF0> *dbg_info;
|
||
|
<a name="l259"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf=</span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>st,</span><span class=cF5>Fs</span><span class=cF0>->hash_table,</span><span class=cF3>HTT_FUN</span><span class=cF0>|</span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l260"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->type&</span><span class=cF3>HTT_FUN</span><span class=cF0>)
|
||
|
<a name="l261"></a> </span><span class=cF5>FunRep</span><span class=cF0>(st);
|
||
|
<a name="l262"></a> </span><span class=cF1>if</span><span class=cF0> (dbg_info=tmpf->dbg_info) {
|
||
|
<a name="l263"></a> i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
|
||
|
<a name="l264"></a> -dbg_info->body[0];
|
||
|
<a name="l265"></a> </span><span class=cF5>Un</span><span class=cF0>(dbg_info->body[0],i);
|
||
|
<a name="l266"></a> </span><span class=cF6>"Code Size:%04X\n"</span><span class=cF0>,i;
|
||
|
<a name="l267"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l268"></a> </span><span class=cF5>U</span><span class=cF0>(</span><span class=cF5>HashVal</span><span class=cF7>(</span><span class=cF0>tmpf</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l269"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l270"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|