about summary refs log tree commit diff stats
path: root/subx/003trace.cc
Commit message (Collapse)AuthorAgeFilesLines
* 5405Kartik Agaram2019-07-151-0/+9
|
* 5089Kartik Agaram2019-04-131-4/+4
| | | | Fix CI; unfortunately it runs C++98.
* Add support for escape sequences in string literals fixed traces so they can ↵nc2019-04-131-4/+20
| | | | handle newlines
* 5001 - drop the :(scenario) DSLKartik Agaram2019-03-121-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been saying for a while[1][2][3] that adding extra abstractions makes things harder for newcomers, and adding new notations doubly so. And then I notice this DSL in my own backyard. Makes me feel like a hypocrite. [1] https://news.ycombinator.com/item?id=13565743#13570092 [2] https://lobste.rs/s/to8wpr/configuration_files_are_canary_warning [3] https://lobste.rs/s/mdmcdi/little_languages_by_jon_bentley_1986#c_3miuf2 The implementation of the DSL was also highly hacky: a) It was happening in the tangle/ tool, but was utterly unrelated to tangling layers. b) There were several persnickety constraints on the different kinds of lines and the specific order they were expected in. I kept finding bugs where the translator would silently do the wrong thing. Or the error messages sucked, and readers may be stuck looking at the generated code to figure out what happened. Fixing error messages would require a lot more code, which is one of my arguments against DSLs in the first place: they may be easy to implement, but they're hard to design to go with the grain of the underlying platform. They require lots of iteration. Is that effort worth prioritizing in this project? On the other hand, the DSL did make at least some readers' life easier, the ones who weren't immediately put off by having to learn a strange syntax. There were fewer quotes to parse, fewer backslash escapes. Anyway, since there are also people who dislike having to put up with strange syntaxes, we'll call that consideration a wash and tear this DSL out. --- This commit was sheer drudgery. Hopefully it won't need to be redone with a new DSL because I grow sick of backslashes.
* 4994Kartik Agaram2019-03-031-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring back support for incrementally printing the trace to the screen (stderr). I previously thought I didn't need this as long as I'm always incrementally saving to the 'last_run' trace file. But I quickly ran into a use for it: when I want to see a complete trace including switching into the sandbox's trace and back out again. So there are now two separate commandline flags: --trace to save the trace to file --dump to print the trace to screen The former won't handle sandbox traces. But the latter will. I'm deemphasizing --dump in the help message since it should be rarely used. One other situation where I've used stderr in the past is for just raw convenience. But trying to always use the trace was a foolish consistency. Conclusion: a) For simple debugging, feel free to just use cout/cerr. Delete them before committing. b) If the prints get too complex, switch to the trace and browse_trace tool. c) If using nested sandboxes, emit to stderr, redirect to file, and browse_trace. I've gone back and forth on these questions in the past; now I'm trying to be a little more rigorous about capturing reasoning.
* 4992Kartik Agaram2019-02-271-0/+3
|
* 4987 - support `browse_trace` tool in SubXKartik Agaram2019-02-251-179/+250
| | | | | | | | | | | | | | | | | | I've extracted it into a separate binary, independent of my Mu prototype. I also cleaned up my tracing layer to be a little nicer. Major improvements: - Realized that incremental tracing really ought to be the default. And to minimize printing traces to screen. - Finally figured out how to combine layers and call stack frames in a single dimension of depth. The answer: optimize for the experience of `browse_trace`. Instructions occupy a range of depths based on their call stack frame, and minor details of an instruction lie one level deeper in each case. Other than that, I spent some time adjusting levels everywhere to make `browse_trace` useful.
* 4857Kartik Agaram2018-12-061-26/+2
| | | | | | Clean up the debugging flow, and go over help messages for inconsistencies. They predate the new Readme, which takes some time to describe the x86 instruction set.
* 4656Kartik Agaram2018-10-021-2/+1
|
* 4515Kartik K. Agaram2018-09-241-1/+9
| | | | | New '--dump' commandline arg to incrementally print trace lines to stderr as they're emitted.
* 4573Kartik Agaram2018-09-211-1/+1
|
* 4517Kartik Agaram2018-08-131-0/+1
| | | | | We want to always print numbers in hex. This should make that a little more comprehensive.
* 4507Kartik Agaram2018-08-121-0/+4
| | | | | Side effect: better error messages when the tangler does something unexpected.
* 4495 - nail down a few more error statesKartik Agaram2018-08-081-0/+1
| | | | | It would be confusing to use negative numbers in raw hex. But we'll rely on programmer taste there.
* 4490Kartik Agaram2018-08-051-14/+0
|
* 4489Kartik Agaram2018-08-051-0/+3
| | | | | | The current approach to warnings is workable. We'll just never print warnings to the screen in tests. In tests you can do whatever you want. This is simpler than messing with levels of warnings.
* 4488Kartik Agaram2018-08-051-2/+1
|
* 4487Kartik Agaram2018-08-051-1/+4
| | | | | | | | | | | Draft attempt at cleaning up warnings, but this isn't quite right. We still emit warnings for every level-1 scenario, and hiding for each of them seems painful. Even if we do that, level-2 scenarios would want to hide level-3 and over warnings, but *not* level-1 warnings. So we need a cardinal number rather than booleans.
* 4486Kartik Agaram2018-08-051-9/+9
|
* 4484 - warn when programming in raw hexKartik Agaram2018-08-041-1/+1
|
* 4477Kartik Agaram2018-08-041-1/+3
|
* 4427 - support for '--trace' argvKartik Agaram2018-07-261-11/+34
| | | | This ports commit 4421 to the subx/ program.
* 4413Kartik Agaram2018-07-251-1/+1
| | | | | Never mind, let's drop unused/vestigial altogether. Use absence of names to signal unused arguments.
* 4411Kartik Agaram2018-07-251-1/+1
| | | | Port commit 4235 to subx.
* 4381Kartik Agaram2018-07-201-2/+0
| | | | Fix CI.
* 4033Kartik K. Agaram2017-10-121-1/+0
|
* 4011 - start of sub-x86 VMKartik K. Agaram2017-10-091-1/+1
|
* 3930 - experimental bytecode interpreterKartik K. Agaram2017-06-191-0/+399