Skip to content

Commit

Permalink
🐛 Change stack display sequence to make it easier to interpret
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkChenYutian committed Nov 19, 2022
1 parent db1e148 commit 8e45bd3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"files": {
"main.css": "/static/css/main.e6303579.css",
"main.js": "/static/js/main.145e27b5.js",
"main.js": "/static/js/main.6f8622a3.js",
"static/media/ts-logo-128.svg": "/static/media/ts-logo-128.c76204988f8496c480cbab87d1604986.svg",
"index.html": "/index.html"
},
"entrypoints": [
"static/css/main.e6303579.css",
"static/js/main.145e27b5.js"
"static/js/main.6f8622a3.js"
]
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Run and Visualize C0 Source Code on Any Device"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script type="text/javascript">!function(t,e,c,n,a,r,s){t[c]=t[c]||function(){(t[c].q=t[c].q||[]).push(arguments)},(r=e.createElement(n)).async=1,r.src="https://www.clarity.ms/tag/dbxcqcl0xu",(s=e.getElementsByTagName(n)[0]).parentNode.insertBefore(r,s)}(window,document,"clarity","script")</script><title>C0 Visualizer (Beta)</title><script defer="defer" src="/static/js/main.145e27b5.js"></script><link href="/static/css/main.e6303579.css" rel="stylesheet"></head><body><noscript>Run and Visualize C0 on modern browser</noscript><div id="c0vm-root" data-mode="full-page" data-stdoutput="on" data-debugconsole="on"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Run and Visualize C0 Source Code on Any Device"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script type="text/javascript">!function(t,e,c,n,a,r,s){t[c]=t[c]||function(){(t[c].q=t[c].q||[]).push(arguments)},(r=e.createElement(n)).async=1,r.src="https://www.clarity.ms/tag/dbxcqcl0xu",(s=e.getElementsByTagName(n)[0]).parentNode.insertBefore(r,s)}(window,document,"clarity","script")</script><title>C0 Visualizer (Beta)</title><script defer="defer" src="/static/js/main.6f8622a3.js"></script><link href="/static/css/main.e6303579.css" rel="stylesheet"></head><body><noscript>Run and Visualize C0 on modern browser</noscript><div id="c0vm-root" data-mode="full-page" data-stdoutput="on" data-debugconsole="on"></div></body></html>
2 changes: 0 additions & 2 deletions docs/static/js/main.145e27b5.js

This file was deleted.

2 changes: 2 additions & 0 deletions docs/static/js/main.6f8622a3.js

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class DetailStackFrame extends React.Component<

// Evaluate All variables in stack
const stack_info : React.ReactNode[] = [];
for (let i = 0; i < this.props.frame.S.length; i ++) {
for (let i = this.props.frame.S.length - 1; i >= 0; i --) {
const to_be_rendered = this.props.frame.S[i];
stack_info.push(
<p key={i + "-stack-name"}>{i} - <code>{Type2String(to_be_rendered.type, this.props.typedefRec)}</code></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React from "react";
import { faCaretDown, faCaretRight } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

import { isNullPtr, read_ptr } from "../../../utility/pointer_utility";
import { isNullPtr, read_ptr, render_address } from "../../../utility/pointer_utility";
import { loadString } from "../../../utility/string_utility";

import { deref_C0Value, expand_C0Array, expand_C0Struct, c0_value_cvt2_js_string } from "../../../utility/c0_value_utility";
Expand Down Expand Up @@ -63,13 +63,16 @@ export default class C0ValueTabularDisplay extends React.Component<
</li>
);
}

const [addr, offset, ] = read_ptr(this.props.value.value);

return (
<div>
<button className="implicit-btn dbg-evaluate-tabular-btn" onClick={() => this.setState({expand: false})}>
<FontAwesomeIcon icon={faCaretDown}/>
</button>
<div className="dbg-evaluate-tabular-content">
Array [
Array [ <span className="dbg-extra-information">0x{render_address(addr + offset, 8)}</span>
<ul>
{content}
</ul>
Expand Down

0 comments on commit 8e45bd3

Please sign in to comment.