Comments (6)
I don't think modifying the compiler is the right solution here. I can look at this a bit over break.
from c0vm-ts.
This is an expected behavior. Since the project is actually running compiled bc0
bytecodes behind the curtain (you can see it if you open Settings (little gear on bottom) > Advanced Settings > Expose Bytecode
The compiled bytecode does not contain any type information so I'm doing lots of acrobatics to "reconstruct type" from bytecode and their comments.
While some information (like field name) is available by parsing through the bytecode file directly (regex match on comment), many information like type of field in struct is not available until we actually execute the aaddf
pointer arithmetic command on some pointer. Therefore, all the fields that are not touched yet will be invisible from debug console. (We need type information to interpret the binary content in heap and display it properly on debug console!)
(^ This is what heap content looks like under the hood)
This is addressed a little bit, however, by "type reuse" (Settings > Advanced Settings > Experimental - Type Reuse). If you run the code to some intermediate breakpoint and click "Restart", the struct type information (offset, and type of field with that offset) is preserved. In this way, you can see the initial value of fields even before they are touched.
from c0vm-ts.
It is possible, however, to directly parse the C0 source code and figure out the type, offset and name of each field in struct. In fact, such tokenizer & parser for C0 already exists right now (the syntax highlighting is based on it). Maybe, MAYBE, I will try to implement something like this in the future.
from c0vm-ts.
It really sounds like just implementing a tree-walk interpreter (or something else more complex, but that would seem to me to be sufficient) instead of trying to consume bytecode is what needs to be done, at least for the memory diagram relevant featureset.
Even if this is currently the expected behaviour, I would consider this a prerequisite to using this to show examples to students.
from c0vm-ts.
Yeah... That makes sense. Or maybe I can ask iliano to dump more type information in the extended bytecode format (not exposed to students) by changing the behavior of cc0 compiler.
from c0vm-ts.
I'm trying to fix this problem by searching through the syntax tree of source code and extract the type information of structs.
from c0vm-ts.
Related Issues (20)
- Drag and drop not working HOT 7
- [Feature] Shortcut key for Run/Step
- [Bug Report] Breakpoints are missing when switching between C0 and BC0 mode of the editor HOT 1
- [Feature] Import C0 source code Folder (C0 Project)
- [Feature] Replace breakpoint 🔴 emoji into CSS-styled HTML Element
- Unexpected type error when dereferencing Null pointer HOT 1
- [Bug Report] Editor Tab Name not updated properly HOT 5
- [Bug Report] Incorrect Variable Name
- [Bug Report] Negation Mod does not work as expected HOT 1
- [Bug Report] Memory Diagram not showing edges properly HOT 4
- [Bug Report] VM Step does not abort when dereference null pointer HOT 1
- [Feature] Using the compile command provided in README.txt HOT 1
- [Feature Request] Friendly Error Message on array index out of bound HOT 1
- [Feature] Hide detailed data structure from object files in debugger (can turn on/off)
- [Feature Request] Add garbage collection sign to the released memory blocks
- [Feature Request] Highlight the editor tab where execution is happening right now
- [Feature Request] Flexible UI grid
- [Feature Request] Support wildcard matching in README.txt while importing 122 Project
- [Feature Request] Highlight active function frame, Highlight editor tab currently executing
- [Feature Request] When close last editor tab, create a new untitled empty tab instead
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c0vm-ts.