mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
470 lines
47 KiB
HTML
Executable file
470 lines
47 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.07">
|
|
<style type="text/css">
|
|
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;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF9>I64</span><span class=cF0> </span><span class=cFD>HasLower</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *src)
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
|
|
<a name="l4"></a>
|
|
<a name="l5"></a> </span><span class=cF1>while</span><span class=cF0> (ch = *src++)
|
|
<a name="l6"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'a'</span><span class=cF0> <= ch <= </span><span class=cF6>'z'</span><span class=cF0>)
|
|
<a name="l7"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l8"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l9"></a>}
|
|
<a name="l10"></a>
|
|
<a name="l11"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>HashFunSegFind</span><span class=cF0>(</span><span class=cF9>CHashTable</span><span class=cF0> *h, </span><span class=cF1>U8</span><span class=cF0> *addr, </span><span class=cF1>Bool</span><span class=cF0> *_has_lower, </span><span class=cF9>U64</span><span class=cF0> *_best, </span><span class=cF9>CHash</span><span class=cF0> **_res)
|
|
<a name="l12"></a>{
|
|
<a name="l13"></a> </span><span class=cF1>Bool</span><span class=cF0> *has_lower = *_has_lower;
|
|
<a name="l14"></a> </span><span class=cF9>CHashExport</span><span class=cF0> *tmpex;
|
|
<a name="l15"></a> </span><span class=cF9>U64</span><span class=cF0> i, j, best = *_best;
|
|
<a name="l16"></a> </span><span class=cF9>CHash</span><span class=cF0> *res = *_res;
|
|
<a name="l17"></a>
|
|
<a name="l18"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i <= h->mask; i++)
|
|
<a name="l19"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l20"></a> tmpex = h->body[i];
|
|
<a name="l21"></a> </span><span class=cF1>while</span><span class=cF0> (tmpex)
|
|
<a name="l22"></a> {
|
|
<a name="l23"></a> j = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_FUN</span><span class=cF0>)
|
|
<a name="l25"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&tmpex(</span><span class=cF9>CHashFun</span><span class=cF0> *)->flags, </span><span class=cF3>Cf_EXTERN</span><span class=cF7>)</span><span class=cF0> && !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&tmpex(</span><span class=cF9>CHashFun</span><span class=cF0> *)->flags, </span><span class=cF3>Ff_INTERNAL</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l27"></a> j = tmpex(</span><span class=cF9>CHashFun</span><span class=cF0> *)->exe_addr;
|
|
<a name="l28"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l29"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF0>)
|
|
<a name="l30"></a> j = tmpex->val;
|
|
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (j)
|
|
<a name="l32"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l33"></a> j = addr(</span><span class=cF9>I64</span><span class=cF0>) - j;
|
|
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= j <= best)
|
|
<a name="l35"></a> {
|
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF0>)
|
|
<a name="l37"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (j < best || j == best && !has_lower)
|
|
<a name="l39"></a> {
|
|
<a name="l40"></a> has_lower = </span><span class=cFD>HasLower</span><span class=cF0>(tmpex->str);
|
|
<a name="l41"></a> best = j;
|
|
<a name="l42"></a> res = tmpex;
|
|
<a name="l43"></a> }
|
|
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l45"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_FUN</span><span class=cF0>)
|
|
<a name="l46"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (j < best || j == best && </span><span class=cF7>(</span><span class=cF0>res && res->type & </span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF0> || !has_lower</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l48"></a> {
|
|
<a name="l49"></a> has_lower = </span><span class=cFD>HasLower</span><span class=cF0>(tmpex->str);
|
|
<a name="l50"></a> best = j;
|
|
<a name="l51"></a> res = tmpex;
|
|
<a name="l52"></a> }
|
|
<a name="l53"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l54"></a> }
|
|
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l56"></a> tmpex = tmpex->next;
|
|
<a name="l57"></a> }
|
|
<a name="l58"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l59"></a> *_has_lower = has_lower;
|
|
<a name="l60"></a> *_best = best;
|
|
<a name="l61"></a> *_res = res;
|
|
<a name="l62"></a>}
|
|
<a name="l63"></a>
|
|
<a name="l64"></a></span><span class=cF9>CHash</span><span class=cF0> *</span><span class=cF5>FunSegFind</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *addr, </span><span class=cF9>I64</span><span class=cF0> *_offset)
|
|
<a name="l65"></a>{</span><span class=cF2>//See </span><span class=cF4><u>Hash</u></span><span class=cF2>.</span><span class=cF0>
|
|
<a name="l66"></a> </span><span class=cF9>CHash</span><span class=cF0> *res = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l67"></a> </span><span class=cF1>Bool</span><span class=cF0> has_lower = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l68"></a> </span><span class=cF9>CTask</span><span class=cF0> *task;
|
|
<a name="l69"></a> </span><span class=cF9>CHashTable</span><span class=cF0> *h;
|
|
<a name="l70"></a> </span><span class=cF9>CCPU</span><span class=cF0> *c;
|
|
<a name="l71"></a> </span><span class=cF9>U64</span><span class=cF0> i, best = </span><span class=cFE>0xFFFF</span><span class=cF0>;
|
|
<a name="l72"></a>
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>CheckCodePtr</span><span class=cF7>(</span><span class=cF0>addr</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l74"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l75"></a> *_offset = best;
|
|
<a name="l76"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l78"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsDebugMode</span><span class=cF0>)
|
|
<a name="l79"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFB>mp_count</span><span class=cF0>; i++)
|
|
<a name="l80"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l81"></a> c = &</span><span class=cFB>cpu_structs</span><span class=cF0>[i];
|
|
<a name="l82"></a> task = c->executive_task;
|
|
<a name="l83"></a> </span><span class=cF1>do</span><span class=cF0>
|
|
<a name="l84"></a> {
|
|
<a name="l85"></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="l86"></a> </span><span class=cF1>goto</span><span class=cF0> fs_abort_task;
|
|
<a name="l87"></a>
|
|
<a name="l88"></a> h = task->hash_table;
|
|
<a name="l89"></a> </span><span class=cF1>while</span><span class=cF0> (h)
|
|
<a name="l90"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l91"></a> </span><span class=cFD>HashFunSegFind</span><span class=cF0>(h, addr, &has_lower, &best, &res);
|
|
<a name="l92"></a> h = h->next;
|
|
<a name="l93"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l94"></a> task = task->next_task;
|
|
<a name="l95"></a> }
|
|
<a name="l96"></a> </span><span class=cF1>while</span><span class=cF0> (task != c->executive_task);
|
|
<a name="l97"></a>
|
|
<a name="l98"></a>fs_abort_task:
|
|
<a name="l99"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l100"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l101"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l102"></a> h = </span><span class=cF5>Fs</span><span class=cF0>->hash_table;
|
|
<a name="l103"></a> </span><span class=cF1>while</span><span class=cF0> (h)
|
|
<a name="l104"></a> {
|
|
<a name="l105"></a> </span><span class=cFD>HashFunSegFind</span><span class=cF0>(h, addr, &has_lower, &best, &res);
|
|
<a name="l106"></a> h = h->next;
|
|
<a name="l107"></a> }
|
|
<a name="l108"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l109"></a> *_offset = best;
|
|
<a name="l110"></a>
|
|
<a name="l111"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l112"></a>}
|
|
<a name="l113"></a>
|
|
<a name="l114"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>FunSegCacheAdd</span><span class=cF0>(</span><span class=cF9>CHash</span><span class=cF0> *tmps, </span><span class=cF1>U8</span><span class=cF0> *addr)
|
|
<a name="l115"></a>{
|
|
<a name="l116"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l117"></a> </span><span class=cF9>CDebugInfo</span><span class=cF0> *debug_info;
|
|
<a name="l118"></a> </span><span class=cF9>CFunSegCache</span><span class=cF0> *tmpfsc;
|
|
<a name="l119"></a>
|
|
<a name="l120"></a> </span><span class=cF1>if</span><span class=cF0> (tmps && tmps->type & </span><span class=cF3>HTT_FUN</span><span class=cF0> && </span><span class=cF7>(</span><span class=cF0>debug_info = tmps(</span><span class=cF9>CHashFun</span><span class=cF0> *)->debug_info</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l121"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l122"></a> </span><span class=cF1>lock</span><span class=cF0> i = </span><span class=cFB>debug</span><span class=cF0>.fun_seg_cache_index++;
|
|
<a name="l123"></a> tmpfsc = &</span><span class=cFB>debug</span><span class=cF0>.fun_seg_cache[i & (</span><span class=cF3>FUN_SEG_CACHE_SIZE</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>)];
|
|
<a name="l124"></a> tmpfsc->base = debug_info->body[</span><span class=cFE>0</span><span class=cF0>];
|
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (addr < tmpfsc->base)
|
|
<a name="l126"></a> tmpfsc->base = addr;
|
|
<a name="l127"></a> tmpfsc->limit = debug_info->body[debug_info->max_line + </span><span class=cFE>1</span><span class=cF0> - debug_info->min_line];
|
|
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (addr >= tmpfsc->limit)
|
|
<a name="l129"></a> tmpfsc->limit = addr + </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l130"></a> i = </span><span class=cF5>MinI64</span><span class=cF0>(</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>tmps->str</span><span class=cF7>)</span><span class=cF0>, </span><span class=cF3>FUN_SEG_CACHE_STR_LEN</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l131"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(tmpfsc->str, tmps->str, i);
|
|
<a name="l132"></a> tmpfsc->str[i] = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l133"></a> tmpfsc->time_stamp = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l134"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l135"></a>}
|
|
<a name="l136"></a>
|
|
<a name="l137"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cFD>FunSegCacheFind</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *addr, </span><span class=cF9>I64</span><span class=cF0> *_offset)
|
|
<a name="l138"></a>{
|
|
<a name="l139"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l140"></a> </span><span class=cF1>F64</span><span class=cF0> timeout;
|
|
<a name="l141"></a> </span><span class=cF9>CFunSegCache</span><span class=cF0> *tmpfsc = </span><span class=cFB>debug</span><span class=cF0>.fun_seg_cache;
|
|
<a name="l142"></a>
|
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (addr == </span><span class=cFD>SYS_IDLE_PT</span><span class=cF0>)
|
|
<a name="l144"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l145"></a> *_offset = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l146"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF6>"SYS_IDLE_PT"</span><span class=cF0>;
|
|
<a name="l147"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l148"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l149"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l150"></a> timeout = </span><span class=cF5>tS</span><span class=cF0> + </span><span class=cFE>8</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l151"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cF3>FUN_SEG_CACHE_SIZE</span><span class=cF0>; i++, tmpfsc++)
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (tmpfsc->base <= addr < tmpfsc->limit && tmpfsc->time_stamp > timeout)
|
|
<a name="l153"></a> {
|
|
<a name="l154"></a> *_offset = addr - tmpfsc->base;
|
|
<a name="l155"></a> </span><span class=cF1>return</span><span class=cF0> tmpfsc->str;
|
|
<a name="l156"></a> }
|
|
<a name="l157"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l158"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l159"></a>}
|
|
<a name="l160"></a>
|
|
<a name="l161"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>StrPrintFunSeg</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *buf, </span><span class=cF9>I64</span><span class=cF0> addr, </span><span class=cF9>I64</span><span class=cF0> field_len, </span><span class=cF9>I64</span><span class=cF0> flags)
|
|
<a name="l162"></a>{
|
|
<a name="l163"></a> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l164"></a> </span><span class=cF9>CHashExport</span><span class=cF0> *tmpex;
|
|
<a name="l165"></a> </span><span class=cF1>U8</span><span class=cF0> *str, *str2;
|
|
<a name="l166"></a> </span><span class=cF1>Bool</span><span class=cF0> is_fun = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l167"></a>
|
|
<a name="l168"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>flags & </span><span class=cF3>PRINTF_TRUNCATE</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l169"></a> field_len = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (addr)
|
|
<a name="l171"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l172"></a> </span><span class=cF1>if</span><span class=cF0> (str = </span><span class=cFD>FunSegCacheFind</span><span class=cF7>(</span><span class=cF0>addr, &</span><span class=cF1>offset</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l173"></a> {
|
|
<a name="l174"></a> </span><span class=cF1>if</span><span class=cF0> (addr != </span><span class=cFD>SYS_IDLE_PT</span><span class=cF0>)
|
|
<a name="l175"></a> is_fun = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l176"></a> }
|
|
<a name="l177"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l178"></a> {
|
|
<a name="l179"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex = </span><span class=cF5>FunSegFind</span><span class=cF7>(</span><span class=cF0>addr, &</span><span class=cF1>offset</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l180"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_FUN</span><span class=cF0>)
|
|
<a name="l182"></a> is_fun = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l183"></a> </span><span class=cFD>FunSegCacheAdd</span><span class=cF0>(tmpex, addr);
|
|
<a name="l184"></a> str = tmpex->str;
|
|
<a name="l185"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l186"></a> }
|
|
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (str)
|
|
<a name="l188"></a> {
|
|
<a name="l189"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF1>offset</span><span class=cF0> > </span><span class=cFE>0xFFFF</span><span class=cF0>)
|
|
<a name="l190"></a> </span><span class=cF1>offset</span><span class=cF0> = </span><span class=cFE>0xFFFF</span><span class=cF0>;
|
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_COMMA</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> (is_fun)
|
|
<a name="l194"></a> {
|
|
<a name="l195"></a> str2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"&%s"</span><span class=cF0>, str);
|
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (!field_len)
|
|
<a name="l197"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(buf, str2);
|
|
<a name="l198"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_LEFT_JUSTIFY</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>str2</span><span class=cF7>)</span><span class=cF0> < field_len)
|
|
<a name="l199"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(buf, str2);
|
|
<a name="l200"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l201"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%*ts"</span><span class=cF0>, field_len, str2);
|
|
<a name="l202"></a> </span><span class=cF5>Free</span><span class=cF0>(str2);
|
|
<a name="l203"></a> }
|
|
<a name="l204"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l205"></a> {
|
|
<a name="l206"></a> </span><span class=cF1>if</span><span class=cF0> (!field_len)
|
|
<a name="l207"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(buf, str);
|
|
<a name="l208"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_LEFT_JUSTIFY</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>str</span><span class=cF7>)</span><span class=cF0> < field_len)
|
|
<a name="l209"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(buf, str);
|
|
<a name="l210"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l211"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%*ts"</span><span class=cF0>, field_len, str);
|
|
<a name="l212"></a> }
|
|
<a name="l213"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l214"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l215"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (is_fun)
|
|
<a name="l217"></a> {
|
|
<a name="l218"></a> str2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"&%s"</span><span class=cF0>, str);
|
|
<a name="l219"></a> </span><span class=cF1>if</span><span class=cF0> (field_len && field_len > </span><span class=cFE>7</span><span class=cF0>)
|
|
<a name="l220"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l221"></a> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_LEFT_JUSTIFY</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>str2</span><span class=cF7>)</span><span class=cF0> < field_len - </span><span class=cFE>7</span><span class=cF0>)
|
|
<a name="l222"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%s+0x%04X"</span><span class=cF0>, str2, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l223"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l224"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%*ts+0x%04X"</span><span class=cF0>, field_len - </span><span class=cFE>7</span><span class=cF0>, str2, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l225"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l226"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l227"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%s+0x%04X"</span><span class=cF0>, str2, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l228"></a> </span><span class=cF5>Free</span><span class=cF0>(str2);
|
|
<a name="l229"></a> }
|
|
<a name="l230"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l231"></a> {
|
|
<a name="l232"></a> </span><span class=cF1>if</span><span class=cF0> (field_len && field_len > </span><span class=cFE>7</span><span class=cF0>)
|
|
<a name="l233"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l234"></a> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_LEFT_JUSTIFY</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>str</span><span class=cF7>)</span><span class=cF0> < field_len - </span><span class=cFE>7</span><span class=cF0>)
|
|
<a name="l235"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%s+0x%04X"</span><span class=cF0>, str, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l236"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l237"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%*ts+0x%04X"</span><span class=cF0>, field_len - </span><span class=cFE>7</span><span class=cF0>, str, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l238"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l239"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l240"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%s+0x%04X"</span><span class=cF0>, str, </span><span class=cF1>offset</span><span class=cF0>);
|
|
<a name="l241"></a> }
|
|
<a name="l242"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l243"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l244"></a> }
|
|
<a name="l245"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_COMMA</span><span class=cF0>)
|
|
<a name="l247"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(buf, </span><span class=cF6>"."</span><span class=cF0>);
|
|
<a name="l248"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>PRINTF_TRUNCATE</span><span class=cF0> && field_len)
|
|
<a name="l249"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%*tX"</span><span class=cF0>, field_len, addr);
|
|
<a name="l250"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l251"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"%X"</span><span class=cF0>, addr);
|
|
<a name="l252"></a>}
|
|
<a name="l253"></a>
|
|
<a name="l254"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>SrcLineNum</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>1</span><span class=cF0>)
|
|
<a name="l255"></a>{</span><span class=cF2>//linenum for src of address.</span><span class=cF0>
|
|
<a name="l256"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
|
|
<a name="l257"></a> </span><span class=cF9>I64</span><span class=cF0> cur_line, first_line, last_line, num_lines, </span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l258"></a> </span><span class=cF9>CDebugInfo</span><span class=cF0> *debug_info;
|
|
<a name="l259"></a> </span><span class=cF9>U32</span><span class=cF0> *body;
|
|
<a name="l260"></a> </span><span class=cF1>U8</span><span class=cF0> *src, *src2;
|
|
<a name="l261"></a>
|
|
<a name="l262"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>FunSegFind</span><span class=cF7>(</span><span class=cF0>addr, &</span><span class=cF1>offset</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l263"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (tmph->type & </span><span class=cF7>(</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>)
|
|
<a name="l265"></a> {
|
|
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (debug_info = tmph->debug_info)
|
|
<a name="l267"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l268"></a> num_lines = debug_info->max_line - debug_info->min_line + </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l269"></a> body = debug_info->body;
|
|
<a name="l270"></a>
|
|
<a name="l271"></a> </span><span class=cF2>//find first nonzero</span><span class=cF0>
|
|
<a name="l272"></a> first_line = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l273"></a> </span><span class=cF1>while</span><span class=cF0> (!body[first_line])
|
|
<a name="l274"></a> {
|
|
<a name="l275"></a> first_line++;
|
|
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (first_line >= num_lines)
|
|
<a name="l277"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l278"></a> }
|
|
<a name="l279"></a>
|
|
<a name="l280"></a> </span><span class=cF2>//find last nonzero</span><span class=cF0>
|
|
<a name="l281"></a> last_line = num_lines - </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l282"></a> </span><span class=cF1>while</span><span class=cF0> (!body[last_line] && last_line > first_line)
|
|
<a name="l283"></a> last_line--;
|
|
<a name="l284"></a>
|
|
<a name="l285"></a> </span><span class=cF2>//interpolate to guess line num</span><span class=cF0>
|
|
<a name="l286"></a> cur_line = </span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cF5>ToF64</span><span class=cF7>(</span><span class=cF0>addr - body[first_line]</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF7>(</span><span class=cF0>last_line - first_line + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> /
|
|
<a name="l287"></a> </span><span class=cF7>(</span><span class=cF0>body[last_line] - body[first_line] + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0>,
|
|
<a name="l288"></a> first_line, last_line);
|
|
<a name="l289"></a>
|
|
<a name="l290"></a> </span><span class=cF2>//retreat while too high</span><span class=cF0>
|
|
<a name="l291"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>!body[cur_line] || body[cur_line] >= addr</span><span class=cF7>)</span><span class=cF0> && cur_line > first_line)
|
|
<a name="l292"></a> cur_line--;
|
|
<a name="l293"></a>
|
|
<a name="l294"></a> </span><span class=cF2>//advance while to low</span><span class=cF0>
|
|
<a name="l295"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>!body[cur_line] || body[cur_line] < addr</span><span class=cF7>)</span><span class=cF0> && cur_line < last_line)
|
|
<a name="l296"></a> cur_line++;
|
|
<a name="l297"></a>
|
|
<a name="l298"></a> </span><span class=cF1>if</span><span class=cF0> (addr < body[cur_line] + count)
|
|
<a name="l299"></a> </span><span class=cF1>return</span><span class=cF0> cur_line + debug_info->min_line;
|
|
<a name="l300"></a>
|
|
<a name="l301"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l302"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmph->src_link)
|
|
<a name="l303"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l304"></a> src = </span><span class=cF5>StrNew</span><span class=cF0>(tmph->src_link);
|
|
<a name="l305"></a> src2 = </span><span class=cF5>StrNew</span><span class=cF0>(tmph->src_link);
|
|
<a name="l306"></a> </span><span class=cF5>StrLastRemove</span><span class=cF0>(src, </span><span class=cF6>","</span><span class=cF0>, src2);
|
|
<a name="l307"></a> cur_line = </span><span class=cF5>Str2I64</span><span class=cF0>(src2);
|
|
<a name="l308"></a> </span><span class=cF5>Free</span><span class=cF0>(src);
|
|
<a name="l309"></a> </span><span class=cF5>Free</span><span class=cF0>(src2);
|
|
<a name="l310"></a> </span><span class=cF1>return</span><span class=cF0> cur_line;
|
|
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l312"></a> }
|
|
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l314"></a>
|
|
<a name="l315"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l316"></a>}
|
|
<a name="l317"></a>
|
|
<a name="l318"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>SrcFileName</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>1</span><span class=cF0>, </span><span class=cF9>CTask</span><span class=cF0> *mem_task=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l319"></a>{</span><span class=cF2>//MAlloc filename for src of address.</span><span class=cF0>
|
|
<a name="l320"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
|
|
<a name="l321"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, ii, </span><span class=cF1>offset</span><span class=cF0>, best = </span><span class=cF3>NULL</span><span class=cF0>, d, best_d;
|
|
<a name="l322"></a> </span><span class=cF9>U32</span><span class=cF0> *body;
|
|
<a name="l323"></a> </span><span class=cF9>CDebugInfo</span><span class=cF0> *debug_info;
|
|
<a name="l324"></a> </span><span class=cF1>U8</span><span class=cF0> *src;
|
|
<a name="l325"></a>
|
|
<a name="l326"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmph = </span><span class=cF5>FunSegFind</span><span class=cF0>(addr, &</span><span class=cF1>offset</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> && tmph->type & </span><span class=cF7>(</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>)
|
|
<a name="l327"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l328"></a> </span><span class=cF1>if</span><span class=cF0> (debug_info = tmph->debug_info)
|
|
<a name="l329"></a> {
|
|
<a name="l330"></a> j = debug_info->max_line - debug_info->min_line + </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l331"></a> body = debug_info->body;
|
|
<a name="l332"></a> best_d = </span><span class=cF3>I64_MAX</span><span class=cF0>;
|
|
<a name="l333"></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="l334"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l335"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> < body[i] <= addr < body[i] + count)
|
|
<a name="l336"></a> {
|
|
<a name="l337"></a> ii = i + </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l338"></a> </span><span class=cF1>while</span><span class=cF0> (!body[ii])
|
|
<a name="l339"></a> ii++;
|
|
<a name="l340"></a> </span><span class=cF1>if</span><span class=cF0> (addr < body[ii])
|
|
<a name="l341"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l342"></a> d = addr(</span><span class=cF9>I64</span><span class=cF0>) - body[i];
|
|
<a name="l343"></a> </span><span class=cF1>if</span><span class=cF0> (d < best_d)
|
|
<a name="l344"></a> {
|
|
<a name="l345"></a> best_d = d;
|
|
<a name="l346"></a> best = tmph->src_link;
|
|
<a name="l347"></a> }
|
|
<a name="l348"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l349"></a> }
|
|
<a name="l350"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l351"></a> }
|
|
<a name="l352"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l353"></a> best = tmph->src_link;
|
|
<a name="l354"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l355"></a> </span><span class=cF1>if</span><span class=cF0> (best)
|
|
<a name="l356"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l357"></a> src = </span><span class=cF5>StrNew</span><span class=cF0>(best, mem_task);
|
|
<a name="l358"></a> </span><span class=cF5>StrFirstRemove</span><span class=cF0>(src, </span><span class=cF6>":"</span><span class=cF0>);
|
|
<a name="l359"></a> </span><span class=cF5>StrLastRemove</span><span class=cF0>(src, </span><span class=cF6>","</span><span class=cF0>);
|
|
<a name="l360"></a> </span><span class=cF1>return</span><span class=cF0> src;
|
|
<a name="l361"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l362"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l363"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l364"></a>}
|
|
<a name="l365"></a>
|
|
<a name="l366"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>SrcEdLink</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>1</span><span class=cF0>, </span><span class=cF9>CTask</span><span class=cF0> *mem_task=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l367"></a>{</span><span class=cF2>//MAlloc file,line link to src of address.</span><span class=cF0>
|
|
<a name="l368"></a> </span><span class=cF1>U8</span><span class=cF0> *filename, *st, *st2;
|
|
<a name="l369"></a> </span><span class=cF9>I64</span><span class=cF0> linenum;
|
|
<a name="l370"></a>
|
|
<a name="l371"></a> </span><span class=cF1>if</span><span class=cF0> (filename = </span><span class=cF5>SrcFileName</span><span class=cF7>(</span><span class=cF0>addr, count</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l372"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l373"></a> linenum = </span><span class=cF5>SrcLineNum</span><span class=cF0>(addr, count);
|
|
<a name="l374"></a> </span><span class=cF1>if</span><span class=cF0> (linenum < </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l375"></a> linenum = </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l376"></a> st2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"FL:%s,%d"</span><span class=cF0>, filename, linenum);
|
|
<a name="l377"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
|
<a name="l378"></a> st = </span><span class=cF5>StrNew</span><span class=cF0>(st2, mem_task);
|
|
<a name="l379"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l380"></a> </span><span class=cF1>return</span><span class=cF0> st;
|
|
<a name="l381"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l382"></a>
|
|
<a name="l383"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l384"></a>}
|
|
<a name="l385"></a>
|
|
<a name="l386"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>PutSrcLink</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>1</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l387"></a>{</span><span class=cF2>//Put to StdOut a </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/DolDocOverview.DD.html#l1"><span class=cF4>DolDoc</span></a><span class=cF2> file,line link to src of address.</span><span class=cF0>
|
|
<a name="l388"></a> </span><span class=cF1>U8</span><span class=cF0> *src;
|
|
<a name="l389"></a>
|
|
<a name="l390"></a> </span><span class=cF1>if</span><span class=cF0> (src = </span><span class=cF5>SrcEdLink</span><span class=cF7>(</span><span class=cF0>addr, count</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l391"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l392"></a> </span><span class=cF1>if</span><span class=cF0> (buf)
|
|
<a name="l393"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>"$LK,\"%p\",A=\"%s\"$"</span><span class=cF0>, addr, src);
|
|
<a name="l394"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l395"></a> </span><span class=cF6>"$LK,\"%p\",A=\"%s\"$"</span><span class=cF0>, addr, src;
|
|
<a name="l396"></a> </span><span class=cF5>Free</span><span class=cF0>(src);
|
|
<a name="l397"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l398"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l399"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (buf)
|
|
<a name="l400"></a> *buf = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l401"></a>
|
|
<a name="l402"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l403"></a>}
|
|
<a name="l404"></a>
|
|
<a name="l405"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>E</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>512</span><span class=cF0>, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags=</span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l406"></a>{</span><span class=cF2>//Edit src at address.</span><span class=cF0>
|
|
<a name="l407"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
|
<a name="l408"></a> </span><span class=cF1>Bool</span><span class=cF0> res = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l409"></a>
|
|
<a name="l410"></a> </span><span class=cF1>if</span><span class=cF0> (st = </span><span class=cF5>SrcEdLink</span><span class=cF7>(</span><span class=cF0>addr, count</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l411"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l412"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
|
|
<a name="l413"></a> res = </span><span class=cF5>EdLiteFileLine</span><span class=cF0>(st, edf_dof_flags);
|
|
<a name="l414"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l415"></a> res = </span><span class=cF5>Ed</span><span class=cF0>(st, edf_dof_flags);
|
|
<a name="l416"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l417"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l418"></a>
|
|
<a name="l419"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l420"></a>}
|
|
<a name="l421"></a>
|
|
<a name="l422"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Man</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st, </span><span class=cF9>I64</span><span class=cF0> edf_dof_flags=</span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l423"></a>{</span><span class=cF2>//Owner's manual for symbol. Edit src code for symbol.</span><span class=cF0>
|
|
<a name="l424"></a> </span><span class=cF1>Bool</span><span class=cF0> res = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l425"></a> </span><span class=cF1>U8</span><span class=cF0> **st2;
|
|
<a name="l426"></a> </span><span class=cF9>CHashSrcSym</span><span class=cF0> *tmph;
|
|
<a name="l427"></a>
|
|
<a name="l428"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsRaw</span><span class=cF0>)
|
|
<a name="l429"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l430"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmph = </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>HTG_SRC_SYM</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> && tmph->src_link)
|
|
<a name="l431"></a> res = </span><span class=cF5>EdLiteFileLine</span><span class=cF0>(tmph->src_link, edf_dof_flags);
|
|
<a name="l432"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l433"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l434"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l435"></a> st2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"MN:%s"</span><span class=cF0>, st);
|
|
<a name="l436"></a> res = </span><span class=cF5>Ed</span><span class=cF0>(st2, edf_dof_flags);
|
|
<a name="l437"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l438"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l439"></a>
|
|
<a name="l440"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l441"></a>}
|
|
</span></pre></body>
|
|
</html>
|