diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-03-10 01:40:43 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-03-10 01:40:47 -0800 |
commit | 9be4a67f426a7cec62cb00d1ecd5021def9afb3a (patch) | |
tree | 5f0388f0c18e1f1d5c733791efa145ee36cb9541 /html/100trace_browser.cc.html | |
parent | 9b68d7b60a306acf79e5b00496ebaf4e2b13cbf5 (diff) | |
download | mu-9be4a67f426a7cec62cb00d1ecd5021def9afb3a.tar.gz |
3785
Don't show empty hidden counts in the trace-browser.
Diffstat (limited to 'html/100trace_browser.cc.html')
-rw-r--r-- | html/100trace_browser.cc.html | 210 |
1 files changed, 106 insertions, 104 deletions
diff --git a/html/100trace_browser.cc.html b/html/100trace_browser.cc.html index 5f481652..ac36518f 100644 --- a/html/100trace_browser.cc.html +++ b/html/100trace_browser.cc.html @@ -137,7 +137,7 @@ if ('onhashchange' in window) { <span id="L77" class="LineNr"> 77 </span><span class="Comment">//: browse a trace loaded from a file</span> <span id="L78" class="LineNr"> 78 </span><span class="Delimiter">:(after "Commandline Parsing")</span> <span id="L79" class="LineNr"> 79 </span><span class="Normal">if</span> <span class="Delimiter">(</span>argc == <span class="Constant">3</span> && <a href='001help.cc.html#L70'>is_equal</a><span class="Delimiter">(</span>argv[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">"browse-trace"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L80" class="LineNr"> 80 </span> <a href='100trace_browser.cc.html#L457'>load_trace</a><span class="Delimiter">(</span>argv[<span class="Constant">2</span>]<span class="Delimiter">);</span> +<span id="L80" class="LineNr"> 80 </span> <a href='100trace_browser.cc.html#L459'>load_trace</a><span class="Delimiter">(</span>argv[<span class="Constant">2</span>]<span class="Delimiter">);</span> <span id="L81" class="LineNr"> 81 </span> <a href='100trace_browser.cc.html#L94'>start_trace_browser</a><span class="Delimiter">();</span> <span id="L82" class="LineNr"> 82 </span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L83" class="LineNr"> 83 </span><span class="Delimiter">}</span> @@ -171,7 +171,7 @@ if ('onhashchange' in window) { <span id="L111" class="LineNr">111 </span> <a href='100trace_browser.cc.html#L367'>refresh_screen_rows</a><span class="Delimiter">();</span> <span id="L112" class="LineNr">112 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L113" class="LineNr">113 </span> <span class="Conceal">¦</span> <a href='100trace_browser.cc.html#L382'>render</a><span class="Delimiter">();</span> -<span id="L114" class="LineNr">114 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> key = <a href='100trace_browser.cc.html#L485'>read_key</a><span class="Delimiter">();</span> +<span id="L114" class="LineNr">114 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> key = <a href='100trace_browser.cc.html#L487'>read_key</a><span class="Delimiter">();</span> <span id="L115" class="LineNr">115 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>key == <span class="Constant">'q'</span> || key == <span class="Constant">'Q'</span> || key == TB_KEY_CTRL_C<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L116" class="LineNr">116 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>key == <span class="Constant">'j'</span> || key == TB_KEY_ARROW_DOWN<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L117" class="LineNr">117 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// move cursor one line down</span> @@ -328,7 +328,7 @@ if ('onhashchange' in window) { <span id="L268" class="LineNr">268 </span> tb_present<span class="Delimiter">();</span> <span id="L269" class="LineNr">269 </span> string pattern<span class="Delimiter">;</span> <span id="L270" class="LineNr">270 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L271" class="LineNr">271 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> key = <a href='100trace_browser.cc.html#L485'>read_key</a><span class="Delimiter">();</span> +<span id="L271" class="LineNr">271 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> key = <a href='100trace_browser.cc.html#L487'>read_key</a><span class="Delimiter">();</span> <span id="L272" class="LineNr">272 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>key == TB_KEY_ENTER<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L273" class="LineNr">273 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!pattern<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span id="L274" class="LineNr">274 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> Current_search_pattern = pattern<span class="Delimiter">;</span> @@ -447,108 +447,110 @@ if ('onhashchange' in window) { <span id="L387" class="LineNr">387 </span> <span class="Conceal">¦</span> ostringstream out<span class="Delimiter">;</span> <span id="L388" class="LineNr">388 </span> <span class="Conceal">¦</span> out << std::setw<span class="Delimiter">(</span><span class="Constant">4</span><span class="Delimiter">)</span> << curr_line<span class="Delimiter">.</span>depth << <span class="Constant">' '</span> << curr_line<span class="Delimiter">.</span>label << <span class="Constant">": "</span> << curr_line<span class="Delimiter">.</span>contents<span class="Delimiter">;</span> <span id="L389" class="LineNr">389 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>screen_row < tb_height<span class="Delimiter">()</span>-<span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L390" class="LineNr">390 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">int</span> delta = <a href='100trace_browser.cc.html#L407'>lines_hidden</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">);</span> +<span id="L390" class="LineNr">390 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">int</span> delta = <a href='100trace_browser.cc.html#L409'>lines_hidden</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">);</span> <span id="L391" class="LineNr">391 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// home-brew escape sequence for red</span> -<span id="L392" class="LineNr">392 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>delta > <span class="Constant">999</span><span class="Delimiter">)</span> out << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L393" class="LineNr">393 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> out << <span class="Constant">" ("</span> << delta << <span class="Constant">")"</span><span class="Delimiter">;</span> -<span id="L394" class="LineNr">394 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>delta > <span class="Constant">999</span><span class="Delimiter">)</span> out << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span><span class="Constant">2</span><span class="Delimiter">);</span> -<span id="L395" class="LineNr">395 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> -<span id="L396" class="LineNr">396 </span> <span class="Conceal">¦</span> <a href='100trace_browser.cc.html#L415'>render_line</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">,</span> out<span class="Delimiter">.</span>str<span class="Delimiter">(),</span> screen_row == Display_row<span class="Delimiter">);</span> -<span id="L397" class="LineNr">397 </span> <span class="Delimiter">}</span> -<span id="L398" class="LineNr">398 </span> <span class="Comment">// clear rest of screen</span> -<span id="L399" class="LineNr">399 </span> Last_printed_row = screen_row-<span class="Constant">1</span><span class="Delimiter">;</span> -<span id="L400" class="LineNr">400 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> screen_row < tb_height<span class="Delimiter">();</span> ++screen_row<span class="Delimiter">)</span> -<span id="L401" class="LineNr">401 </span> <span class="Conceal">¦</span> <a href='100trace_browser.cc.html#L415'>render_line</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">,</span> <span class="Constant">"~"</span><span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">cursor_line?</span><span class="Comment">*/</span><span class="Constant">false</span><span class="Delimiter">);</span> -<span id="L402" class="LineNr">402 </span> <span class="Comment">// move cursor back to display row at the end</span> -<span id="L403" class="LineNr">403 </span> tb_set_cursor<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> Display_row<span class="Delimiter">);</span> -<span id="L404" class="LineNr">404 </span> tb_present<span class="Delimiter">();</span> -<span id="L405" class="LineNr">405 </span><span class="Delimiter">}</span> -<span id="L406" class="LineNr">406 </span> -<span id="L407" class="LineNr">407 </span><span class="Normal">int</span> <a href='100trace_browser.cc.html#L407'>lines_hidden</a><span class="Delimiter">(</span><span class="Normal">int</span> screen_row<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L408" class="LineNr">408 </span> assert<span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">));</span> -<span id="L409" class="LineNr">409 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row+<span class="Constant">1</span><span class="Delimiter">))</span> -<span id="L410" class="LineNr">410 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">)</span> - get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">);</span> -<span id="L411" class="LineNr">411 </span> <span class="Normal">else</span> -<span id="L412" class="LineNr">412 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row+<span class="Constant">1</span><span class="Delimiter">)</span> - get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">);</span> -<span id="L413" class="LineNr">413 </span><span class="Delimiter">}</span> -<span id="L414" class="LineNr">414 </span> -<span id="L415" class="LineNr">415 </span><span class="Normal">void</span> <a href='100trace_browser.cc.html#L415'>render_line</a><span class="Delimiter">(</span><span class="Normal">int</span> screen_row<span class="Delimiter">,</span> <span class="Normal">const</span> string& s<span class="Delimiter">,</span> <span class="Normal">bool</span> cursor_line<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L416" class="LineNr">416 </span> <span class="Normal">int</span> col = <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L417" class="LineNr">417 </span> <span class="Normal">int</span> color = TB_WHITE<span class="Delimiter">;</span> -<span id="L418" class="LineNr">418 </span> <span class="Normal">int</span> background_color = cursor_line ? <span class="Comment">/*</span><span class="Comment">subtle grey</span><span class="Comment">*/</span><span class="Constant">240</span> : TB_BLACK<span class="Delimiter">;</span> -<span id="L419" class="LineNr">419 </span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > highlight_ranges = <a href='100trace_browser.cc.html#L435'>find_all_occurrences</a><span class="Delimiter">(</span>s<span class="Delimiter">,</span> Current_search_pattern<span class="Delimiter">);</span> -<span id="L420" class="LineNr">420 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>col = <span class="Constant">0</span><span class="Delimiter">;</span> col < tb_width<span class="Delimiter">()</span> && col+Left_of_screen < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>s<span class="Delimiter">);</span> ++col<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L421" class="LineNr">421 </span> <span class="Conceal">¦</span> <span class="Normal">char</span> c = s<span class="Delimiter">.</span>at<span class="Delimiter">(</span>col+Left_of_screen<span class="Delimiter">);</span> <span class="Comment">// todo: unicode</span> -<span id="L422" class="LineNr">422 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> c = <span class="Constant">';'</span><span class="Delimiter">;</span> <span class="Comment">// replace newlines with semi-colons</span> -<span id="L423" class="LineNr">423 </span> <span class="Conceal">¦</span> <span class="Comment">// escapes. hack: can't start a line with them.</span> -<span id="L424" class="LineNr">424 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\1'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> color = <span class="Comment">/*</span><span class="Comment">red</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> c = <span class="Constant">' '</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> -<span id="L425" class="LineNr">425 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\2'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> color = TB_WHITE<span class="Delimiter">;</span> c = <span class="Constant">' '</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> -<span id="L426" class="LineNr">426 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='100trace_browser.cc.html#L448'>in_range</a><span class="Delimiter">(</span>highlight_ranges<span class="Delimiter">,</span> col+Left_of_screen<span class="Delimiter">))</span> -<span id="L427" class="LineNr">427 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> c<span class="Delimiter">,</span> TB_BLACK<span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">yellow</span><span class="Comment">*/</span><span class="Constant">11</span><span class="Delimiter">);</span> -<span id="L428" class="LineNr">428 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> -<span id="L429" class="LineNr">429 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> c<span class="Delimiter">,</span> color<span class="Delimiter">,</span> background_color<span class="Delimiter">);</span> -<span id="L430" class="LineNr">430 </span> <span class="Delimiter">}</span> -<span id="L431" class="LineNr">431 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> col < tb_width<span class="Delimiter">();</span> ++col<span class="Delimiter">)</span> -<span id="L432" class="LineNr">432 </span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> <span class="Constant">' '</span><span class="Delimiter">,</span> TB_WHITE<span class="Delimiter">,</span> background_color<span class="Delimiter">);</span> -<span id="L433" class="LineNr">433 </span><span class="Delimiter">}</span> -<span id="L434" class="LineNr">434 </span> -<span id="L435" class="LineNr">435 </span>vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > <a href='100trace_browser.cc.html#L435'>find_all_occurrences</a><span class="Delimiter">(</span><span class="Normal">const</span> string& s<span class="Delimiter">,</span> <span class="Normal">const</span> string& pat<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L436" class="LineNr">436 </span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > result<span class="Delimiter">;</span> -<span id="L437" class="LineNr">437 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>pat<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> -<span id="L438" class="LineNr">438 </span> <span class="Normal">size_t</span> idx = <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L439" class="LineNr">439 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L440" class="LineNr">440 </span> <span class="Conceal">¦</span> <span class="Normal">size_t</span> next_idx = s<span class="Delimiter">.</span>find<span class="Delimiter">(</span>pat<span class="Delimiter">,</span> idx<span class="Delimiter">);</span> -<span id="L441" class="LineNr">441 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>next_idx == string::npos<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L442" class="LineNr">442 </span> <span class="Conceal">¦</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>><span class="Delimiter">(</span>next_idx<span class="Delimiter">,</span> next_idx+SIZE<span class="Delimiter">(</span>pat<span class="Delimiter">)));</span> -<span id="L443" class="LineNr">443 </span> <span class="Conceal">¦</span> idx = next_idx+SIZE<span class="Delimiter">(</span>pat<span class="Delimiter">);</span> -<span id="L444" class="LineNr">444 </span> <span class="Delimiter">}</span> -<span id="L445" class="LineNr">445 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> -<span id="L446" class="LineNr">446 </span><span class="Delimiter">}</span> -<span id="L447" class="LineNr">447 </span> -<span id="L448" class="LineNr">448 </span><span class="Normal">bool</span> <a href='100trace_browser.cc.html#L448'>in_range</a><span class="Delimiter">(</span><span class="Normal">const</span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> >& highlight_ranges<span class="Delimiter">,</span> <span class="Normal">size_t</span> idx<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L449" class="LineNr">449 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>highlight_ranges<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L450" class="LineNr">450 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>idx >= highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first && idx < highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> -<span id="L451" class="LineNr">451 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> -<span id="L452" class="LineNr">452 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>idx < highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L453" class="LineNr">453 </span> <span class="Delimiter">}</span> -<span id="L454" class="LineNr">454 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L455" class="LineNr">455 </span><span class="Delimiter">}</span> -<span id="L456" class="LineNr">456 </span> -<span id="L457" class="LineNr">457 </span><span class="Normal">void</span> <a href='100trace_browser.cc.html#L457'>load_trace</a><span class="Delimiter">(</span><span class="Normal">const</span> <span class="Normal">char</span>* filename<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L458" class="LineNr">458 </span> ifstream tin<span class="Delimiter">(</span>filename<span class="Delimiter">);</span> -<span id="L459" class="LineNr">459 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!tin<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L460" class="LineNr">460 </span> <span class="Conceal">¦</span> cerr << <span class="Constant">"no such file: "</span> << filename << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> -<span id="L461" class="LineNr">461 </span> <span class="Conceal">¦</span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L462" class="LineNr">462 </span> <span class="Delimiter">}</span> -<span id="L463" class="LineNr">463 </span> Trace_stream = <span class="Normal">new</span> trace_stream<span class="Delimiter">;</span> -<span id="L464" class="LineNr">464 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>tin<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L465" class="LineNr">465 </span> <span class="Conceal">¦</span> tin >> std::noskipws<span class="Delimiter">;</span> -<span id="L466" class="LineNr">466 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>tin<span class="Delimiter">);</span> -<span id="L467" class="LineNr">467 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!isdigit<span class="Delimiter">(</span>tin<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> <span class="Delimiter">{</span> -<span id="L468" class="LineNr">468 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> string dummy<span class="Delimiter">;</span> -<span id="L469" class="LineNr">469 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> getline<span class="Delimiter">(</span>tin<span class="Delimiter">,</span> dummy<span class="Delimiter">);</span> -<span id="L470" class="LineNr">470 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> -<span id="L471" class="LineNr">471 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> -<span id="L472" class="LineNr">472 </span> <span class="Conceal">¦</span> tin >> std::skipws<span class="Delimiter">;</span> -<span id="L473" class="LineNr">473 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> depth<span class="Delimiter">;</span> -<span id="L474" class="LineNr">474 </span> <span class="Conceal">¦</span> tin >> depth<span class="Delimiter">;</span> -<span id="L475" class="LineNr">475 </span> <span class="Conceal">¦</span> string label<span class="Delimiter">;</span> -<span id="L476" class="LineNr">476 </span> <span class="Conceal">¦</span> tin >> label<span class="Delimiter">;</span> -<span id="L477" class="LineNr">477 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*--label<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">()</span> == <span class="Constant">':'</span><span class="Delimiter">)</span> label<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--label<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">());</span> -<span id="L478" class="LineNr">478 </span> <span class="Conceal">¦</span> string line<span class="Delimiter">;</span> -<span id="L479" class="LineNr">479 </span> <span class="Conceal">¦</span> getline<span class="Delimiter">(</span>tin<span class="Delimiter">,</span> line<span class="Delimiter">);</span> -<span id="L480" class="LineNr">480 </span> <span class="Conceal">¦</span> Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span>depth<span class="Delimiter">,</span> label<span class="Delimiter">,</span> line<span class="Delimiter">));</span> -<span id="L481" class="LineNr">481 </span> <span class="Delimiter">}</span> -<span id="L482" class="LineNr">482 </span> cerr << <span class="Constant">"lines read: "</span> << Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>size<span class="Delimiter">()</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> -<span id="L483" class="LineNr">483 </span><span class="Delimiter">}</span> -<span id="L484" class="LineNr">484 </span> -<span id="L485" class="LineNr">485 </span><span class="Normal">int</span> <a href='100trace_browser.cc.html#L485'>read_key</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L486" class="LineNr">486 </span> tb_event event<span class="Delimiter">;</span> -<span id="L487" class="LineNr">487 </span> <span class="Normal">do</span> <span class="Delimiter">{</span> -<span id="L488" class="LineNr">488 </span> <span class="Conceal">¦</span> tb_poll_event<span class="Delimiter">(</span>&event<span class="Delimiter">);</span> -<span id="L489" class="LineNr">489 </span> <span class="Delimiter">}</span> <span class="Normal">while</span> <span class="Delimiter">(</span>event<span class="Delimiter">.</span>type != TB_EVENT_KEY<span class="Delimiter">);</span> -<span id="L490" class="LineNr">490 </span> <span class="Identifier">return</span> event<span class="Delimiter">.</span>key ? event<span class="Delimiter">.</span>key : event<span class="Delimiter">.</span>ch<span class="Delimiter">;</span> -<span id="L491" class="LineNr">491 </span><span class="Delimiter">}</span> +<span id="L392" class="LineNr">392 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>delta > <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L393" class="LineNr">393 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>delta > <span class="Constant">999</span><span class="Delimiter">)</span> out << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L394" class="LineNr">394 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> out << <span class="Constant">" ("</span> << delta << <span class="Constant">")"</span><span class="Delimiter">;</span> +<span id="L395" class="LineNr">395 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>delta > <span class="Constant">999</span><span class="Delimiter">)</span> out << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span><span class="Constant">2</span><span class="Delimiter">);</span> +<span id="L396" class="LineNr">396 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L397" class="LineNr">397 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L398" class="LineNr">398 </span> <span class="Conceal">¦</span> <a href='100trace_browser.cc.html#L417'>render_line</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">,</span> out<span class="Delimiter">.</span>str<span class="Delimiter">(),</span> screen_row == Display_row<span class="Delimiter">);</span> +<span id="L399" class="LineNr">399 </span> <span class="Delimiter">}</span> +<span id="L400" class="LineNr">400 </span> <span class="Comment">// clear rest of screen</span> +<span id="L401" class="LineNr">401 </span> Last_printed_row = screen_row-<span class="Constant">1</span><span class="Delimiter">;</span> +<span id="L402" class="LineNr">402 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> screen_row < tb_height<span class="Delimiter">();</span> ++screen_row<span class="Delimiter">)</span> +<span id="L403" class="LineNr">403 </span> <span class="Conceal">¦</span> <a href='100trace_browser.cc.html#L417'>render_line</a><span class="Delimiter">(</span>screen_row<span class="Delimiter">,</span> <span class="Constant">"~"</span><span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">cursor_line?</span><span class="Comment">*/</span><span class="Constant">false</span><span class="Delimiter">);</span> +<span id="L404" class="LineNr">404 </span> <span class="Comment">// move cursor back to display row at the end</span> +<span id="L405" class="LineNr">405 </span> tb_set_cursor<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> Display_row<span class="Delimiter">);</span> +<span id="L406" class="LineNr">406 </span> tb_present<span class="Delimiter">();</span> +<span id="L407" class="LineNr">407 </span><span class="Delimiter">}</span> +<span id="L408" class="LineNr">408 </span> +<span id="L409" class="LineNr">409 </span><span class="Normal">int</span> <a href='100trace_browser.cc.html#L409'>lines_hidden</a><span class="Delimiter">(</span><span class="Normal">int</span> screen_row<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L410" class="LineNr">410 </span> assert<span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">));</span> +<span id="L411" class="LineNr">411 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row+<span class="Constant">1</span><span class="Delimiter">))</span> +<span id="L412" class="LineNr">412 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">)</span> - get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">);</span> +<span id="L413" class="LineNr">413 </span> <span class="Normal">else</span> +<span id="L414" class="LineNr">414 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row+<span class="Constant">1</span><span class="Delimiter">)</span> - get<span class="Delimiter">(</span>Trace_index<span class="Delimiter">,</span> screen_row<span class="Delimiter">);</span> +<span id="L415" class="LineNr">415 </span><span class="Delimiter">}</span> +<span id="L416" class="LineNr">416 </span> +<span id="L417" class="LineNr">417 </span><span class="Normal">void</span> <a href='100trace_browser.cc.html#L417'>render_line</a><span class="Delimiter">(</span><span class="Normal">int</span> screen_row<span class="Delimiter">,</span> <span class="Normal">const</span> string& s<span class="Delimiter">,</span> <span class="Normal">bool</span> cursor_line<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L418" class="LineNr">418 </span> <span class="Normal">int</span> col = <span class="Constant">0</span><span class="Delimiter">;</span> +<span id="L419" class="LineNr">419 </span> <span class="Normal">int</span> color = TB_WHITE<span class="Delimiter">;</span> +<span id="L420" class="LineNr">420 </span> <span class="Normal">int</span> background_color = cursor_line ? <span class="Comment">/*</span><span class="Comment">subtle grey</span><span class="Comment">*/</span><span class="Constant">240</span> : TB_BLACK<span class="Delimiter">;</span> +<span id="L421" class="LineNr">421 </span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > highlight_ranges = <a href='100trace_browser.cc.html#L437'>find_all_occurrences</a><span class="Delimiter">(</span>s<span class="Delimiter">,</span> Current_search_pattern<span class="Delimiter">);</span> +<span id="L422" class="LineNr">422 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>col = <span class="Constant">0</span><span class="Delimiter">;</span> col < tb_width<span class="Delimiter">()</span> && col+Left_of_screen < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>s<span class="Delimiter">);</span> ++col<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L423" class="LineNr">423 </span> <span class="Conceal">¦</span> <span class="Normal">char</span> c = s<span class="Delimiter">.</span>at<span class="Delimiter">(</span>col+Left_of_screen<span class="Delimiter">);</span> <span class="Comment">// todo: unicode</span> +<span id="L424" class="LineNr">424 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> c = <span class="Constant">';'</span><span class="Delimiter">;</span> <span class="Comment">// replace newlines with semi-colons</span> +<span id="L425" class="LineNr">425 </span> <span class="Conceal">¦</span> <span class="Comment">// escapes. hack: can't start a line with them.</span> +<span id="L426" class="LineNr">426 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\1'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> color = <span class="Comment">/*</span><span class="Comment">red</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> c = <span class="Constant">' '</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> +<span id="L427" class="LineNr">427 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>c == <span class="cSpecial">'\2'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> color = TB_WHITE<span class="Delimiter">;</span> c = <span class="Constant">' '</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> +<span id="L428" class="LineNr">428 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='100trace_browser.cc.html#L450'>in_range</a><span class="Delimiter">(</span>highlight_ranges<span class="Delimiter">,</span> col+Left_of_screen<span class="Delimiter">))</span> +<span id="L429" class="LineNr">429 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> c<span class="Delimiter">,</span> TB_BLACK<span class="Delimiter">,</span> <span class="Comment">/*</span><span class="Comment">yellow</span><span class="Comment">*/</span><span class="Constant">11</span><span class="Delimiter">);</span> +<span id="L430" class="LineNr">430 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> +<span id="L431" class="LineNr">431 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> c<span class="Delimiter">,</span> color<span class="Delimiter">,</span> background_color<span class="Delimiter">);</span> +<span id="L432" class="LineNr">432 </span> <span class="Delimiter">}</span> +<span id="L433" class="LineNr">433 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> col < tb_width<span class="Delimiter">();</span> ++col<span class="Delimiter">)</span> +<span id="L434" class="LineNr">434 </span> <span class="Conceal">¦</span> tb_change_cell<span class="Delimiter">(</span>col<span class="Delimiter">,</span> screen_row<span class="Delimiter">,</span> <span class="Constant">' '</span><span class="Delimiter">,</span> TB_WHITE<span class="Delimiter">,</span> background_color<span class="Delimiter">);</span> +<span id="L435" class="LineNr">435 </span><span class="Delimiter">}</span> +<span id="L436" class="LineNr">436 </span> +<span id="L437" class="LineNr">437 </span>vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > <a href='100trace_browser.cc.html#L437'>find_all_occurrences</a><span class="Delimiter">(</span><span class="Normal">const</span> string& s<span class="Delimiter">,</span> <span class="Normal">const</span> string& pat<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L438" class="LineNr">438 </span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> > result<span class="Delimiter">;</span> +<span id="L439" class="LineNr">439 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>pat<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> +<span id="L440" class="LineNr">440 </span> <span class="Normal">size_t</span> idx = <span class="Constant">0</span><span class="Delimiter">;</span> +<span id="L441" class="LineNr">441 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L442" class="LineNr">442 </span> <span class="Conceal">¦</span> <span class="Normal">size_t</span> next_idx = s<span class="Delimiter">.</span>find<span class="Delimiter">(</span>pat<span class="Delimiter">,</span> idx<span class="Delimiter">);</span> +<span id="L443" class="LineNr">443 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>next_idx == string::npos<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L444" class="LineNr">444 </span> <span class="Conceal">¦</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>><span class="Delimiter">(</span>next_idx<span class="Delimiter">,</span> next_idx+SIZE<span class="Delimiter">(</span>pat<span class="Delimiter">)));</span> +<span id="L445" class="LineNr">445 </span> <span class="Conceal">¦</span> idx = next_idx+SIZE<span class="Delimiter">(</span>pat<span class="Delimiter">);</span> +<span id="L446" class="LineNr">446 </span> <span class="Delimiter">}</span> +<span id="L447" class="LineNr">447 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> +<span id="L448" class="LineNr">448 </span><span class="Delimiter">}</span> +<span id="L449" class="LineNr">449 </span> +<span id="L450" class="LineNr">450 </span><span class="Normal">bool</span> <a href='100trace_browser.cc.html#L450'>in_range</a><span class="Delimiter">(</span><span class="Normal">const</span> vector<pair<<span class="Normal">size_t</span><span class="Delimiter">,</span> <span class="Normal">size_t</span>> >& highlight_ranges<span class="Delimiter">,</span> <span class="Normal">size_t</span> idx<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L451" class="LineNr">451 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>highlight_ranges<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L452" class="LineNr">452 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>idx >= highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first && idx < highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> +<span id="L453" class="LineNr">453 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> +<span id="L454" class="LineNr">454 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>idx < highlight_ranges<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L455" class="LineNr">455 </span> <span class="Delimiter">}</span> +<span id="L456" class="LineNr">456 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L457" class="LineNr">457 </span><span class="Delimiter">}</span> +<span id="L458" class="LineNr">458 </span> +<span id="L459" class="LineNr">459 </span><span class="Normal">void</span> <a href='100trace_browser.cc.html#L459'>load_trace</a><span class="Delimiter">(</span><span class="Normal">const</span> <span class="Normal">char</span>* filename<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L460" class="LineNr">460 </span> ifstream tin<span class="Delimiter">(</span>filename<span class="Delimiter">);</span> +<span id="L461" class="LineNr">461 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!tin<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L462" class="LineNr">462 </span> <span class="Conceal">¦</span> cerr << <span class="Constant">"no such file: "</span> << filename << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L463" class="LineNr">463 </span> <span class="Conceal">¦</span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L464" class="LineNr">464 </span> <span class="Delimiter">}</span> +<span id="L465" class="LineNr">465 </span> Trace_stream = <span class="Normal">new</span> trace_stream<span class="Delimiter">;</span> +<span id="L466" class="LineNr">466 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>tin<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L467" class="LineNr">467 </span> <span class="Conceal">¦</span> tin >> std::noskipws<span class="Delimiter">;</span> +<span id="L468" class="LineNr">468 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>tin<span class="Delimiter">);</span> +<span id="L469" class="LineNr">469 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!isdigit<span class="Delimiter">(</span>tin<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> <span class="Delimiter">{</span> +<span id="L470" class="LineNr">470 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> string dummy<span class="Delimiter">;</span> +<span id="L471" class="LineNr">471 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> getline<span class="Delimiter">(</span>tin<span class="Delimiter">,</span> dummy<span class="Delimiter">);</span> +<span id="L472" class="LineNr">472 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L473" class="LineNr">473 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L474" class="LineNr">474 </span> <span class="Conceal">¦</span> tin >> std::skipws<span class="Delimiter">;</span> +<span id="L475" class="LineNr">475 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> depth<span class="Delimiter">;</span> +<span id="L476" class="LineNr">476 </span> <span class="Conceal">¦</span> tin >> depth<span class="Delimiter">;</span> +<span id="L477" class="LineNr">477 </span> <span class="Conceal">¦</span> string label<span class="Delimiter">;</span> +<span id="L478" class="LineNr">478 </span> <span class="Conceal">¦</span> tin >> label<span class="Delimiter">;</span> +<span id="L479" class="LineNr">479 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*--label<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">()</span> == <span class="Constant">':'</span><span class="Delimiter">)</span> label<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--label<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">());</span> +<span id="L480" class="LineNr">480 </span> <span class="Conceal">¦</span> string line<span class="Delimiter">;</span> +<span id="L481" class="LineNr">481 </span> <span class="Conceal">¦</span> getline<span class="Delimiter">(</span>tin<span class="Delimiter">,</span> line<span class="Delimiter">);</span> +<span id="L482" class="LineNr">482 </span> <span class="Conceal">¦</span> Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span>depth<span class="Delimiter">,</span> label<span class="Delimiter">,</span> line<span class="Delimiter">));</span> +<span id="L483" class="LineNr">483 </span> <span class="Delimiter">}</span> +<span id="L484" class="LineNr">484 </span> cerr << <span class="Constant">"lines read: "</span> << Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>size<span class="Delimiter">()</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L485" class="LineNr">485 </span><span class="Delimiter">}</span> +<span id="L486" class="LineNr">486 </span> +<span id="L487" class="LineNr">487 </span><span class="Normal">int</span> <a href='100trace_browser.cc.html#L487'>read_key</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> +<span id="L488" class="LineNr">488 </span> tb_event event<span class="Delimiter">;</span> +<span id="L489" class="LineNr">489 </span> <span class="Normal">do</span> <span class="Delimiter">{</span> +<span id="L490" class="LineNr">490 </span> <span class="Conceal">¦</span> tb_poll_event<span class="Delimiter">(</span>&event<span class="Delimiter">);</span> +<span id="L491" class="LineNr">491 </span> <span class="Delimiter">}</span> <span class="Normal">while</span> <span class="Delimiter">(</span>event<span class="Delimiter">.</span>type != TB_EVENT_KEY<span class="Delimiter">);</span> +<span id="L492" class="LineNr">492 </span> <span class="Identifier">return</span> event<span class="Delimiter">.</span>key ? event<span class="Delimiter">.</span>key : event<span class="Delimiter">.</span>ch<span class="Delimiter">;</span> +<span id="L493" class="LineNr">493 </span><span class="Delimiter">}</span> </pre> </body> </html> |