Author SHA1 Message Date
Ryan Fleury 489ae56223 fix moduleless unwinding and find-threads without debug info 2024-05-23 16:17:31 -07:00
Ryan Fleury 35b97d9c20 process name on stop-reason strings 2024-05-23 15:38:51 -07:00
Ryan Fleury bafc2170ca do not consume passthrough --s in command line parser 2024-05-23 15:21:53 -07:00
Ryan Fleury 6837d8d71a move rdi_dump over to dbgi layer 2024-05-23 15:16:53 -07:00
Ryan Fleury 35c599dea3 raddbgi -> rdi 2024-05-23 15:09:53 -07:00
Ryan Fleury dc5dda3f71 visualize handle basic types 2024-05-23 14:47:42 -07:00
Ryan Fleury fdfee37228 oops - only d3d11 flush on resize 2024-05-23 14:45:32 -07:00
Ryan Fleury ece414c575 prioritize title-bar-client-areas over built-in window borders; expand top bar rect a bit to ensure edge of window coverage 2024-05-23 14:40:23 -07:00
Ryan Fleury f431ac7f80 rewrite ipc communication; do ipc message reception on separate thread, wake up main thread; fix various robustness issues. do not necessarily initialize slower-to-initialize layers in conversion/ipc instances 2024-05-23 14:34:01 -07:00
Ryan Fleury e850f6fc93 c++ module extensions 2024-05-23 12:39:14 -07:00
Ryan Fleury 68a9802357 re-implement keyboard-driven path for opening dedicated view rule tabs 2024-05-23 11:36:51 -07:00
Ryan Fleury 905d04ab0b adjust disasm window limits; too often hitting non-read-only memory 2024-05-23 11:34:23 -07:00
Ryan Fleury bc40d1c0b0 rewrite frontend unwind cache to always preserve stale results until a new unwind successfully completes 2024-05-23 11:16:34 -07:00
Ryan Fleury f26b4c3b06 eliminate path-tree-based keying of debug info on frontend; use dbgi-layer-defined debug info keys, which can be more robust to changes to the same debug info path across time (e.g. during hot reloads 2024-05-23 10:30:23 -07:00
Ryan Fleury 68a92e910a eliminate old dbgi layer 2024-05-23 08:26:16 -07:00
Ryan Fleury 1621dc0637 correct nil rdi top-level-info 2024-05-23 07:54:28 -07:00
Ryan Fleury 21fcfd28a4 appease clang 2024-05-23 07:38:30 -07:00
Ryan Fleury 4a3d439c44 adjust symbol lister to apply to all loaded debug infos, rather than just the selected thread's debug info 2024-05-23 07:34:24 -07:00
Ryan Fleury 30f8e1675e new multi-dbgi-capable fuzzy search layer first pass 2024-05-23 07:01:34 -07:00
Ryan Fleury c17072053b adjust d3d11 resize path 2024-05-22 15:27:39 -07:00
Ryan Fleury a5e2235fc6 fix deadlocks on di_close contending with passive scoped dbgi access 2024-05-22 11:54:27 -07:00
Ryan Fleury 0160d05e8a further tweaks to mule_peb_trample 2024-05-22 11:39:23 -07:00
Ryan Fleury 7a4e939886 fix incorrectly referring to root entity for debug info if missing; fix thread register cache issues; fix new dbgi layer issues 2024-05-22 11:13:08 -07:00
Ryan Fleury b33559b081 tweaks to mule_peb_trample 2024-05-21 12:40:21 -07:00
Ryan Fleury b74db17375 peb trampling mule 2024-05-21 11:29:19 -07:00
Ryan Fleury a019115b95 get ctrl and debug frontend layers onto new pdb-path-based debug info loader layer; sketch out standalone fuzzy search layer, to replace old dbgi searching functionality; shift all debug frontend code from referring to debug info via 'binaries' to referring to debug info via 'dbgis', just file entities at the location of o.g. debug info 2024-05-21 10:08:28 -07:00
Ryan Fleury b9ac104276 begin stitching new dbgi layer usage code into ctrl layer; keep track of per-module preferred pdb paths via event-synchronized ctrl entity tree; still need conversion 2024-05-20 17:15:11 -07:00
Ryan Fleury 6e41bdf11b first pass at loader portion of new dbgi layer replacement; set up ctrl entity for per-module debug info selection path info 2024-05-20 16:28:52 -07:00
Ryan Fleury 49eb834e2b eliminate old unwind code 2024-05-20 12:58:02 -07:00
Ryan Fleury fd6befecc3 get tls address calculation off of binary parsing path; do based on in-process memory 2024-05-20 12:55:20 -07:00
Ryan Fleury 5342fab86b bugfix in new unwinder; applying stack ptr read & unwind when doing epilog unwinds 2024-05-20 11:12:29 -07:00
Ryan Fleury 9919ac59bb move module image info parse / cache management to ctrl thread, directly tie to module lifetime as ctrl thread sees it; reduce load from each unwind 2024-05-20 10:58:45 -07:00
Ryan Fleury 2d1fcd7475 fix some unwanted frontend unwind cache behavior; fix staleness calculation in ctrl process memory cache 2024-05-20 08:23:41 -07:00
Ryan Fleury 393fb9e5f2 eliminate old unwinder usage code; more regression fixing 2024-05-17 15:07:21 -07:00
Ryan Fleury 301cf6b7ac regression fixes, better integration, and tightening up the new unwinder 2024-05-17 14:15:11 -07:00
Ryan Fleury 578a56d231 further progress on new unwinder 2024-05-16 17:12:37 -07:00
Ryan Fleury 33ab26dfb3 begin porting unwinder to ctrl layer, just built purely on in-process memory, and getting completely off of parsed binary image artifacts 2024-05-16 15:39:57 -07:00
Ryan Fleury 8901dd30ec eliminate old pending entity code; do not build missing entity interface if data is actually present (but frontend cache still suggests missing) 2024-05-16 10:35:56 -07:00
Ryan Fleury e1a5d131c8 fix clang... sigh 2024-05-15 15:41:03 -07:00
Ryan Fleury 55c1674ec6 notes 2024-05-15 13:38:38 -07:00
Ryan Fleury 364a2160af correctly register jit debugger exe; collect jit_debug_info into dmn win32; notes 2024-05-15 13:25:20 -07:00
Ryan Fleury 56afe8ca60 watch window reordering 2024-05-15 11:57:46 -07:00
Ryan Fleury 6e039430a5 mouse controls for new watch window editing mechanism 2024-05-15 11:22:05 -07:00
Ryan Fleury f1af166fd4 expand ui events to contain semantic 'controls' info, to eliminate most hardcoded escs/returns/f2s/etc; formalize these things as proper commands; keyboard-driven expansions; other various fixes 2024-05-15 10:53:26 -07:00
Ryan Fleury 03844d81d2 further progress on watch window pass; multi-cursor, multi-selection, autocomplete lister, etc 2024-05-15 09:26:16 -07:00
Ryan Fleury aa73e62240 fix clang 2024-05-14 16:31:34 -07:00
Ryan Fleury 16de33245c first half of first pass at multi-cursor watch window 2024-05-14 16:25:24 -07:00
Ryan Fleury f8b688096a fix crash on tpi-less pdbs 2024-05-14 11:39:18 -07:00
Ryan Fleury 4dd1f6f579 eval watch -> watch; prep for more organized event-driven editing path for watch windows, beginning of multi-selection support 2024-05-14 10:33:03 -07:00
Ryan Fleury 58b8ed8974 floating line-nums/margins in source & disasm views, when horizontally scrolled 2024-05-14 09:07:44 -07:00
Ryan Fleury ac9a908464 automatically support insert-based copy/paste shortcuts 2024-05-14 08:27:59 -07:00
Ryan Fleury 5d459d9b7a skip/chop whitespace on launch parameters 2024-05-14 08:23:28 -07:00
Ryan Fleury 3085482e34 expand base layer logging mechanism with bucketing info; make one bucket for passive log collection, another for user-facing errors; always consume user errors at the top-level and display; use user-error mechanism to communicate bad 32-bit app launches from demon 2024-05-14 08:10:02 -07:00
Ryan Fleury 6c200a59cd bugfixes for new autocompletion system 2024-05-14 07:50:13 -07:00
Ryan Fleury 362bcbcda5 fix clang 2024-05-13 16:28:13 -07:00
Ryan Fleury 897949d33a notes 2024-05-13 16:27:15 -07:00
Ryan Fleury 70479e0399 fix autocompletion query word calculation 2024-05-13 16:26:54 -07:00
Ryan Fleury 90fc289ef0 extend autocompletion lister parameter detection, based on cursor position; feed through view rule parameters; correctly support cursor position with multi-arguments, regardless of which argument the cursor is on 2024-05-13 16:19:32 -07:00
Ryan Fleury 7c0f92ab3d sketch out view rule schemas; use them to determine autocompletion lister flags via partial parse of view rule input & matching to cursor; expand autocompletion lister to support lists of various things used in view rule arguments 2024-05-13 15:45:35 -07:00
Ryan Fleury 036d94fff0 autocompletion lister improvements - completions now can be used for sub-expression parts 2024-05-13 14:24:28 -07:00
Ryan Fleury 37dd5cea2d oops - this was not dead code! 2024-05-13 13:11:34 -07:00
Ryan Fleury 05f2cde2ee fix clang 2024-05-13 13:10:49 -07:00
Ryan Fleury e59d71893b bugfix copying & other accidental event consumption issues with new ui events 2024-05-13 12:57:45 -07:00
Ryan Fleury e41eb9430f finish pass to convert everything over to ui events, eliminate nav actions; intermix os events & ui event production with commands 2024-05-13 11:48:42 -07:00
Ryan Fleury 58192b8356 move all ui/df codepaths onto new ui event consumption, rather than os/nav events in parallel 2024-05-13 10:33:30 -07:00
Ryan Fleury 38e38eaf3b sketch out ui event type, to unify type & stream for text ops, nav actions, and all other user inputs 2024-05-13 07:48:48 -07:00
Ryan Fleury 9f89735b01 preserve jeff notes from emails - put into todo list 2024-05-12 14:11:08 -07:00
Ryan Fleury 4cb0073909 stop non-x64 builds with less cryptic errors 2024-05-10 16:32:01 -07:00
Ryan Fleury 6fb8db4d3d getting started view improvements 2024-05-10 10:15:10 -07:00
Ryan Fleury 123276a1c6 choose compact layout by default with smaller monitor size 2024-05-10 09:59:23 -07:00
Ryan Fleury 6e8753f1e1 formalize more compact panel layout 2024-05-10 09:56:06 -07:00
Ryan Fleury dda0e012bf support getting started view in default panel layout 2024-05-10 09:35:03 -07:00
Ryan Fleury 6660446bdd auto-close panels if final tabs are closed; simplify empty panel view, move 'helper' stuff to dedicated 'getting started' tab 2024-05-10 08:48:42 -07:00
Nikita SmithandRyan Fleury ef175baae4 fix chained unwind info count 2024-05-10 08:47:25 -07:00
Ryan Fleury f45ea18f24 full line bounds check in intermixed dasm 2024-05-01 05:13:17 -07:00
Ryan Fleury 4aeb6d7d03 notes 2024-04-30 11:38:02 -07:00
Ryan Fleury ed0ec4b34d last fixes, improvements, & split operation coverage for new tab drag/drop system 2024-04-30 11:14:24 -07:00
Ryan Fleury 2e971f9e39 do not force contain tooltip if it is above some threshold - otherwise it can occlude important ui 2024-04-30 10:02:50 -07:00
Ryan Fleury d65c263266 new/fixed panel animation 2024-04-30 09:41:57 -07:00
Ryan Fleury cd9437534c remove old animation method for panel pcts; since panels are often rearranged in a hierarchy, having pcts being based on parent rectangle (as opposed to the root rectangle) is unstable and often looks bad 2024-04-30 09:17:00 -07:00
Ryan Fleury 3b2656675e root-level non-split-axis splits; less noisy tab drag/drop ui 2024-04-30 05:39:34 -07:00
Ryan Fleury b4dab84235 always resolve to address mode evaluation when doing a member access 2024-04-29 18:13:50 -07:00
Ryan Fleury 2fc34ffb3d further coverage of split-drop drag/drop sites, for splitting options at non-leaf-panels 2024-04-29 12:17:03 -07:00
Ryan Fleury d419c6e15c formal drop-hot mechanism in ui core; further cleanup/fixes in drop-split combined operation ui 2024-04-29 11:06:18 -07:00
Ryan Fleury 15a2e708a0 hook up new combined move-tab-and-split ui with actual operation; auto-close panels which have their last tab dragged away; etc 2024-04-29 06:15:43 -07:00
Ryan Fleury 5a84fe4949 first half of pass to enable combined, standard split+movetab drag/drop fast-paths; just visualizations, next need the combo mutations 2024-04-28 18:51:57 -07:00
Ryan Fleury 9177299488 improve tab drag/drop 2024-04-28 17:29:41 -07:00
Ryan Fleury b6eb13761f fix breakpad_from_pdb build; robustify to typeless global vars 2024-04-25 11:53:23 -07:00
Ryan Fleury 67eede7513 hot-reloading for dasm_cache, in case of filesystem changes; file stream layer -> expose filesystem-wide generation number, for very coarse-grained generation number to gracefully depend on filesystem changes passively 2024-04-25 09:37:16 -07:00
Ryan Fleury f4ea9e66b0 bugfix on-demand process-dependent breakpoint resolution path & user breakpoint hit logic in stepping machine; more logging 2024-04-25 08:59:00 -07:00
Ryan Fleury 0dbde584bd jump destination symbol name visualization in disassembly 2024-04-23 19:12:58 -07:00
Ryan Fleury 579e3e9637 adjust source code intermixing symbol 2024-04-23 14:01:11 -07:00
Ryan Fleury 425626a275 first pass over mixed-mode disassembly 2024-04-23 13:52:44 -07:00
Ryan Fleury 5b87c2b64a bundle disassembly parameterizations into single dasm params type; extend with exe path & base address, to begin using debug info in the disassembly pass itself 2024-04-23 12:37:53 -07:00
Ryan Fleury 879e649d0e more frontend logging 2024-04-23 10:07:59 -07:00
Ryan Fleury 15e9dec60a fix incorrect entity destruction logging 2024-04-23 10:04:05 -07:00
Ryan Fleury ec13092a35 ui thread logging; more ctrl thread logging 2024-04-23 09:57:17 -07:00
Ryan Fleury 757cd9b9d2 correct createfile params for appending 2024-04-23 08:34:32 -07:00
Ryan Fleury 856c59a949 set up ctrl thread log scopes; ditch ctrl -> user log stuff, just make each log site in control of exporting to a separate file 2024-04-18 15:09:43 -07:00
Ryan Fleury 62d1c6b130 scoped log gathering; communicate ctrl logs -> user via events 2024-04-18 14:48:03 -07:00
Ryan Fleury b995909997 sketch out logging stub, to begin marking up debugger layers with logging - high level stuff still wip 2024-04-17 14:32:09 -07:00
Ryan Fleury a954317500 fix new issues with confirmation popup & top bar 2024-04-17 12:41:49 -07:00
Ryan Fleury b307d3bbed fix top bar issues 2024-04-17 11:50:38 -07:00
Ryan Fleury 8890284f97 zig lexing (syntax highlighting & hover-on-eval) 2024-04-17 11:36:01 -07:00
Ryan Fleury b41e762393 jai syntax highlighting & hover-eval support 2024-04-17 11:12:05 -07:00
Ryan Fleury 72e8ae6e30 actually do redraw on resize - need that win32 window class style.. 2024-04-17 09:58:03 -07:00
Ryan Fleury 9f4aade2e1 stepping fast-paths in top bar 2024-04-17 09:47:36 -07:00
Ryan Fleury 27fef06b6c remove unnecessary window class styles 2024-04-17 09:19:00 -07:00
Ryan Fleury 572fad1f03 first pass at custom window border 2024-04-17 08:46:21 -07:00
Ryan Fleury c31847f785 improve min sampling when applying transforms in ui 2024-04-13 12:18:01 -07:00
Ryan Fleury 9719688bb3 improve query visualization in tabs; don't collapse title before query string 2024-04-13 11:46:55 -07:00
Ryan Fleury a6bed27dff errr, reverse last change 2024-04-10 13:37:32 -07:00
Ryan Fleury b7a14aa41c explicitly show error if decoding line machine code or line info fails 2024-04-10 13:36:52 -07:00
Ryan Fleury 56bc399fd5 initial pass for compression in converter; decompression in debuggerdbgi layer 2024-04-10 09:33:55 -07:00
Ryan Fleury d560f8c734 fix backslash escaping rules in cfg serialization; fix small scrolling (e.g. from trackpad) often being truncated to having no effect; fixed hanging when set-thread-name specifies a non-readable address 2024-04-09 07:37:53 -07:00
Ryan Fleury 36b50981ff fix conditional breakpoints, post demon2/ctrl passes 2024-04-05 11:38:14 -07:00
Ryan Fleury 32114c3215 begin cleanup/naming pass over view rules 2024-04-05 10:17:38 -07:00
Ryan Fleury a8ece647c1 simplify and remove temporary polish from minified bitmap viewer 2024-04-02 15:31:02 -07:00
Ryan Fleury e0879ac569 stub out graph view rule 2024-04-02 15:18:16 -07:00
Ryan Fleury 0eb8216ea0 first pass at dedicated bitmap tab view, & all the machinery of going from watch window w/ view rule -> dedicated ui 2024-04-02 14:33:17 -07:00
Ryan Fleury cd1a0a4cb5 tab query serialization/deserialization; only enable for view rule defined view specs 2024-04-02 10:42:31 -07:00
Ryan Fleury 1b95eacd08 stub out visualizer tab view hooks for bitmap, geo, text, disasm viewers; pass down cfg node trees for open-tab command; visualize query string in tab titles 2024-04-02 10:35:19 -07:00
Ryan Fleury 546c544ae0 eliminate eval-viewer view - instead we can have the gfx view rule spec table optionally define tab view specs itself, and those can be separately registered from the sort of 'base' tab views. then we can map from gfx-view-rule -> dedicated-tab-view-spec 2024-04-02 10:16:53 -07:00
Ryan Fleury 3ea67dd7cf eliminate old disasm layer initialization 2024-04-01 15:09:41 -07:00
Ryan Fleury 52295e5e06 first pass at view rule lookup cache... this might not be the right thing here 2024-04-01 14:48:48 -07:00
Ryan Fleury 63123d69d1 set up auto view rule entities, serialization, & editor ui, for automatically mapping specific types to specific view rules 2024-04-01 14:30:48 -07:00
Ryan Fleury 835eae208a extend eval viz pipeline with split between edit/display expression strings per-block and per-row. this allows reconstruction of the string that would lead to the same eval as a row (even if it is auto-generated by e.g. expanding a root-level row; also allow -- to extend eval expressions with passthrough text, used for view rules 2024-04-01 13:56:07 -07:00
Ryan Fleury cfb34ec560 C++ namespace examples 2024-04-01 11:11:27 -07:00
Ryan Fleury c45b12cfac only export executable name, not full cmdline specified path in converter 2024-04-01 10:25:27 -07:00
Ryan Fleury 7c0ce2ab54 fix incorrect skip-to-end in new pdb -> raddbgi converter member parsing, in some cases (particularly noticeable in C++ structs with vtable members) 2024-03-30 19:44:20 -07:00
Ryan Fleury 693d20ec1a fix incorrect generation of modifier flags, container types, and out-of-order pointer/modifier types in new pdb -> raddbgi converter. fixes many 'nil type' issues, missing this ptr, etc. 2024-03-30 19:29:16 -07:00
Ryan Fleury a6db711f2d quick fix to not omit opl line records in breakpad_from_pdb 2024-03-29 15:53:18 -07:00
110 changed files with 22090 additions and 6457 deletions
+34 -55
View File
@@ -20,26 +20,20 @@ You can download pre-built binaries for the debugger
[here](https://github.com/EpicGames/raddebugger/releases).
The RAD Debugger project aims to simplify the debugger by simplifying and
unifying the underlying debug info format. In that pursuit we've built
the RADDBGI debug info format, which is what the debugger parses and uses. To
work with existing toolchains, we convert PDB (and eventually PE/ELF files
with embedded DWARF) into the RADDBGI format on-demand. This conversion process
is currently an unoptimized reference version. Nevertheless it's still quite
fast for smaller PDB files (in many cases faster than many other programs
simply deserialize the PDBs). It is much slower for much larger projects at the
moment, but we expect this will vastly improve overtime.
unifying the underlying debug info format. In that pursuit we've built the RAD
Debug Info (RDI) format, which is what the debugger parses and uses. To work
with existing toolchains, we convert PDB (and eventually PE/ELF files with
embedded DWARF) into the RDI format on-demand.
The RADDBGI format is currently specified in code, in the files within the
`src/lib_raddbgi_format` folder. The other relevant folders for working with
the format are:
The RDI format is currently specified in code, in the files within the
`src/lib_rdi_format` folder. The other relevant folders for working with the
format are:
- `lib_raddbgi_make`: The "RAD Debug Info Make" library, for making RADDBGI
debug info.
- `raddbgi_from_pdb`: Our PDB-to-RADDBGI converter. Can be used as a helper
codebase layer, or built as an executable with a command line interface
frontend.
- `raddbgi_from_dwarf`: Our in-progress DWARF-to-RADDBGI converter.
- `raddbgi_dump`: Our RADDBGI textual dumping utility.
- `lib_rdi_make`: The "RAD Debug Info Make" library, for making RDI debug info.
- `rdi_from_pdb`: Our PDB-to-RDI converter. Can be used as a helper codebase
layer, or built as an executable with a command line interface frontend.
- `rdi_from_dwarf`: Our in-progress DWARF-to-RDI converter.
- `rdi_dump`: Our RDI textual dumping utility.
## Development Setup Instructions
@@ -126,18 +120,6 @@ there are still cases where the debugger has not been tested, and so there are
still issues. So, we feel that the top priority is eliminating these issues,
such that the debugging experience is rock solid.
Additionally, the debug info conversion process is not fast (nor wide) enough
to support extremely large projects. This is for two reasons: (a) the
PDB-to-RADDBGI converter is an unoptimized reference implementation, and (b)
the debugger learns of new modules (and thus which PDBs to load) in a
serially-dependent way (this is necessarily the case for correct debugging
results). We expect that the conversion process' performance can be massively
improved, and also that some heuristics can be used to begin converting PDBs
to RADDBGIs before the debugger knows those PDBs are needed, thus ensuring the
associated RADDBGI files are ready instantaneously when the associated modules
are finally loaded by the debugger. Improving this situation is a major part of
this phase, as it will make the debugger much more usable for large projects.
### Local x64 Linux Debugging Phase
The next priority for the project is to take the rock solid x64 Windows
@@ -152,11 +134,10 @@ The major parts of this phase are:
- Porting the `src/demon` layer to implement the Demon local process control
abstraction API.
- Porting the `src/unwind` layer to support x64 ELF unwinding (currently, there
is only an x64 PE unwinding implementation).
- Creating a DWARF-to-RADDBGI converter (in the same way that we've built a
PDB-to-RADDBGI converter). A partial implementation of this is in
`src/raddbgi_from_dwarf`.
- Implementing an x64 ELF Linux unwinder in the `src/ctrl` layer.
- Creating a DWARF-to-RDI converter (in the same way that we've built a
PDB-to-RDI converter). A partial implementation of this is in
`src/rdi_from_dwarf`.
- Porting the `src/render` layer to implement all of the rendering features the
frontend needs on a Linux-compatible API (the backend used on Windows is D3D11).
- Porting the `src/font_provider` layer to a Linux-compatible font
@@ -218,7 +199,7 @@ so in other words, layers are arranged into a directed acyclic graph.
A few layers are built to be used completely independently from the rest of the
codebase, as libraries in other codebases and projects. As such, these layers do
not depend on any other layers in the codebase. The folders which contain these
layers are prefixed with `lib_`, like `lib_raddbgi_format`.
layers are prefixed with `lib_`, like `lib_rdi_format`.
A list of the layers in the codebase and their associated namespaces is below:
- `base` (no namespace): Universal, codebase-wide constructs. Strings, math,
@@ -235,11 +216,11 @@ A list of the layers in the codebase and their associated namespaces is below:
- `dasm` (`DASM_`): An asynchronous disassembly decoder and cache. Users ask for
disassembly for a particular virtual address range in a process, and threads
implemented in this layer decode and cache the disassembly for that range.
- `dbgi` (`DBGI_`): An asynchronous debug info loader and cache. Loads debug
info stored in the RADDBGI format. Users ask for debug info for a particular
executable, and on separate threads, this layer loads the associated debug
info file. If necessary, it will launch a separate conversion process to
convert original debug info into the RADDBGI format.
- `dbgi` (`DI_`): An asynchronous debug info loader and cache. Loads debug info
stored in the RDI format. Users ask for debug info for a particular path, and
on separate threads, this layer loads the associated debug info file. If
necessary, it will launch a separate conversion process to convert original
debug info into the RDI format.
- `demon` (`DEMON_`): An abstraction layer for local-machine, low-level process
control. The abstraction is used to provide a common interface for process
control on target platforms. Used to implement part of `ctrl`.
@@ -274,13 +255,13 @@ A list of the layers in the codebase and their associated namespaces is below:
- `lib_raddbg_markup` (`RADDBG_`): Standalone library for marking up user
programs to work with various features in the `raddbg` debugger. Does not
depend on `base`, and can be independently relocated to other codebases.
- `lib_raddbgi_make` (`RDIM_`): Standalone library for constructing RADDBGI
debug info data. Does not depend on `base`, and can be independently relocated
- `lib_rdi_make` (`RDIM_`): Standalone library for constructing RDI debug info
data. Does not depend on `base`, and can be independently relocated
to other codebases.
- `lib_raddbgi_format` (`RDI_`): Standalone library which defines the core
RADDBGI types and helper functions for reading and writing the RADDBGI debug
info file format. Does not depend on `base`, and can be independently
relocated to other codebases.
- `lib_rdi_format` (`RDI_`): Standalone library which defines the core RDI types
and helper functions for reading and writing the RDI debug info file format.
Does not depend on `base`, and can be independently relocated to other
codebases.
- `metagen` (`MG_`): A metaprogram which is used to generate primarily code and
data tables. Consumes Metadesk files, stored with the extension `.mdesk`, and
generates C code which is then included by hand-written C code. Currently, it
@@ -315,11 +296,11 @@ A list of the layers in the codebase and their associated namespaces is below:
- `raddbg` (no namespace): The layer which ties everything together for the main
graphical debugger. Not much "meat", just drives `df`, implements command line
options, and so on.
- `raddbgi_from_pdb` (`P2R_`): Our implementation of PDB-to-RADDBGI conversion.
- `raddbgi_from_dwarf` (`D2R_`): Our in-progress implementation of
DWARF-to-RADDBGI conversion.
- `raddbgi_dump` (`RADDBGIDUMP_`): A dumper utility program for dumping
textualizations of RADDBGI debug info files.
- `rdi_from_pdb` (`P2R_`): Our implementation of PDB-to-RDI conversion.
- `rdi_from_dwarf` (`D2R_`): Our in-progress implementation of DWARF-to-RDI
conversion.
- `rdi_dump` (no namespace): A dumper utility program for dumping
textualizations of RDI debug info files.
- `regs` (`REGS_`): Types, helper functions, and metadata for registers on
supported architectures. Used in reading/writing registers in `demon`, or in
looking up register metadata.
@@ -338,11 +319,9 @@ A list of the layers in the codebase and their associated namespaces is below:
Used by the debugger to visualize source code files. Users ask for text lines,
tokens, and metadata, and it is prepared on background threads.
- `type_graph` (`TG_`): Code for analyzing and navigating type structures from
RADDBGI debug info files, with the additional capability of constructing
RDI debug info files, with the additional capability of constructing
synthetic types *not* found in debug info. Used in `eval` and for various
visualization features.
- `ui` (`UI_`): Machinery for building graphical user interfaces. Provides a
core immediate mode hierarchical user interface data structure building
API, and has helper layers for building some higher-level widgets.
- `unwind` (`UNW_`): Code for generating unwind information from threads, for
supported operating systems and architectures.
+21 -12
View File
@@ -15,7 +15,7 @@ cd /D "%~dp0"
:: `build raddbg clang`
:: `build raddbg release`
:: `build raddbg asan telemetry`
:: `build raddbgi_from_pdb`
:: `build rdi_from_pdb`
::
:: For a full list of possible build targets and their build command lines,
:: search for @build_targets in this file.
@@ -54,12 +54,14 @@ set clang_out= -o
:: --- Per-Build Settings -----------------------------------------------------
set link_dll=-DLL
if "%msvc%"=="1" set only_compile=/c
if "%clang%"=="1" set only_compile=-c
if "%msvc%"=="1" set EHsc=/EHsc
if "%clang%"=="1" set EHsc=
if "%msvc%"=="1" set rc=rc.exe
if "%clang%"=="1" set rc=llvm-rc.exe
if "%msvc%"=="1" set only_compile=/c
if "%clang%"=="1" set only_compile=-c
if "%msvc%"=="1" set EHsc=/EHsc
if "%clang%"=="1" set EHsc=
if "%msvc%"=="1" set no_aslr=/DYNAMICBASE:NO
if "%clang%"=="1" set no_aslr=
if "%msvc%"=="1" set rc=rc.exe
if "%clang%"=="1" set rc=llvm-rc.exe
:: --- Choose Compile/Link Lines ----------------------------------------------
if "%msvc%"=="1" set compile_debug=%cl_debug%
@@ -97,16 +99,23 @@ if not "%no_meta%"=="1" (
:: --- Build Everything (@build_targets) --------------------------------------
pushd build
if "%raddbg%"=="1" %compile% %gfx% ..\src\raddbg\raddbg_main.cpp %compile_link% %out%raddbg.exe || exit /b 1
if "%raddbgi_from_pdb%"=="1" %compile% ..\src\raddbgi_from_pdb\raddbgi_from_pdb_main.c %compile_link% %out%raddbgi_from_pdb.exe || exit /b 1
if "%raddbgi_from_dwarf%"=="1" %compile% ..\src\raddbgi_from_dwarf\raddbgi_from_dwarf.c %compile_link% %out%raddbgi_from_dwarf.exe || exit /b 1
if "%raddbgi_dump%"=="1" %compile% ..\src\raddbgi_dump\raddbgi_dump_main.c %compile_link% %out%raddbgi_dump.exe || exit /b 1
if "%raddbgi_breakpad_from_pdb%"=="1" %compile% ..\src\raddbgi_breakpad_from_pdb\raddbgi_breakpad_from_pdb_main.c %compile_link% %out%raddbgi_breakpad_from_pdb.exe || exit /b 1
if "%rdi_from_pdb%"=="1" %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
if "%rdi_from_dwarf%"=="1" %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
if "%rdi_dump%"=="1" %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
if "%rdi_breakpad_from_pdb%"=="1" %compile% ..\src\rdi_breakpad_from_pdb\rdi_breakpad_from_pdb_main.c %compile_link% %out%rdi_breakpad_from_pdb.exe || exit /b 1
if "%ryan_scratch%"=="1" %compile% ..\src\scratch\ryan_scratch.c %compile_link% %out%ryan_scratch.exe || exit /b 1
if "%cpp_tests%"=="1" %compile% ..\src\scratch\i_hate_c_plus_plus.cpp %compile_link% %out%cpp_tests.exe || exit /b 1
if "%look_at_raddbg%"=="1" %compile% ..\src\scratch\look_at_raddbg.c %compile_link% %out%look_at_raddbg.exe || exit /b 1
if "%mule_main%"=="1" del vc*.pdb mule*.pdb && %compile_release% %only_compile% ..\src\mule\mule_inline.cpp && %compile_release% %only_compile% ..\src\mule\mule_o2.cpp && %compile_debug% %EHsc% ..\src\mule\mule_main.cpp ..\src\mule\mule_c.c mule_inline.obj mule_o2.obj %compile_link% %out%mule_main.exe || exit /b 1
if "%mule_main%"=="1" del vc*.pdb mule*.pdb && %compile_release% %only_compile% ..\src\mule\mule_inline.cpp && %compile_release% %only_compile% ..\src\mule\mule_o2.cpp && %compile_debug% %EHsc% ..\src\mule\mule_main.cpp ..\src\mule\mule_c.c mule_inline.obj mule_o2.obj %compile_link% %no_aslr% %out%mule_main.exe || exit /b 1
if "%mule_module%"=="1" %compile% ..\src\mule\mule_module.cpp %compile_link% %link_dll% %out%mule_module.dll || exit /b 1
if "%mule_hotload%"=="1" %compile% ..\src\mule\mule_hotload_main.c %compile_link% %out%mule_hotload.exe & %compile% ..\src\mule\mule_hotload_module_main.c %compile_link% %link_dll% %out%mule_hotload_module.dll || exit /b 1
if "%mule_peb_trample%"=="1" (
if exist mule_peb_trample.exe move mule_peb_trample.exe mule_peb_trample_old_%random%.exe
if exist mule_peb_trample_new.pdb move mule_peb_trample_new.pdb mule_peb_trample_old_%random%.pdb
if exist mule_peb_trample_new.rdi move mule_peb_trample_new.rdi mule_peb_trample_old_%random%.rdi
%compile% ..\src\mule\mule_peb_trample.c %compile_link% %out%mule_peb_trample_new.exe || exit /b 1
move mule_peb_trample_new.exe mule_peb_trample.exe
)
popd
:: --- Unset ------------------------------------------------------------------
+7 -7
View File
@@ -56,7 +56,7 @@ commands =
},
.rjf_f2 =
{
.win = "build raddbgi_from_pdb telemetry release",
.win = "build mule_peb_trample",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -74,7 +74,7 @@ commands =
},
.rjf_f4 =
{
.win = "build raddbgi_from_pdb release telemetry && pushd build && raddbgi_from_pdb.exe --exe:UnrealEditorFortnite.exe --pdb:UnrealEditorFortnite.pdb --out:UnrealEditorFortnite.raddbgi --capture && popd",
.win = "build rdi_from_pdb release telemetry && pushd build && rdi_from_pdb.exe --exe:UnrealEditorFortnite.exe --pdb:UnrealEditorFortnite.pdb --out:UnrealEditorFortnite.rdi --capture && popd",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -83,7 +83,7 @@ commands =
},
.rjf_f5 =
{
.win = "pushd build && raddbgi_from_pdb.exe --exe:raddbg.exe --pdb:raddbg.pdb --out:raddbg.raddbg --capture && popd",
.win = "pushd build && rdi_from_pdb.exe --exe:raddbg.exe --pdb:raddbg.pdb --out:raddbg.rdi --capture && popd",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
@@ -108,18 +108,18 @@ commands =
.save_dirty_files = true,
.cursor_at_end = false,
},
.build_raddbgi_from_pdb =
.build_rdi_from_pdb =
{
.win = "build raddbgi_from_pdb",
.win = "build rdi_from_pdb",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
.save_dirty_files = true,
.cursor_at_end = false,
},
.build_raddbgi_dump =
.build_rdi_dump =
{
.win = "build raddbgi_dump",
.win = "build rdi_dump",
.linux = "",
.out = "*compilation*",
.footer_panel = true,
+3 -1
View File
@@ -92,6 +92,7 @@ cmd_line_from_string_list(Arena *arena, String8List command_line)
// NOTE(rjf): Parse command line.
B32 after_passthrough_option = 0;
B32 first_passthrough = 1;
for(String8Node *node = command_line.first->next, *next = 0; node != 0; node = next)
{
next = node->next;
@@ -175,10 +176,11 @@ cmd_line_from_string_list(Arena *arena, String8List command_line)
// NOTE(rjf): Default path, treat as a passthrough config option to be
// handled by tool-specific code.
else if(!str8_match(node->string, str8_lit("--"), 0))
else if(!str8_match(node->string, str8_lit("--"), 0) || !first_passthrough)
{
str8_list_push(arena, &parsed.inputs, node->string);
after_passthrough_option = 1;
first_passthrough = 0;
}
}
+10
View File
@@ -234,4 +234,14 @@
# define LANG_C 0
#endif
////////////////////////////////
//~ rjf: Unsupported Errors
#if ARCH_X86
# error You tried to build in x86 (32 bit) mode, but currently, only building in x64 (64 bit) mode is supported.
#endif
#if !ARCH_X64
# error You tried to build with an unsupported architecture. Currently, only building in x64 mode is supported.
#endif
#endif // BASE_CONTEXT_CRACKING_H
+14
View File
@@ -168,6 +168,7 @@
# define ins_atomic_u64_dec_eval(x) InterlockedDecrement64((volatile __int64 *)(x))
# define ins_atomic_u64_eval_assign(x,c) InterlockedExchange64((volatile __int64 *)(x),(c))
# define ins_atomic_u64_add_eval(x,c) InterlockedAdd64((volatile __int64 *)(x), c)
# define ins_atomic_u64_eval_cond_assign(x,k,c) InterlockedCompareExchange64((volatile __int64 *)(x),(k),(c))
# define ins_atomic_u32_eval(x,c) InterlockedAdd((volatile LONG *)(x), 0)
# define ins_atomic_u32_eval_assign(x,c) InterlockedExchange((volatile LONG *)(x),(c))
# define ins_atomic_u32_eval_cond_assign(x,k,c) InterlockedCompareExchange((volatile LONG *)(x),(k),(c))
@@ -390,6 +391,19 @@ typedef enum Corner
}
Corner;
typedef enum Dir2
{
Dir2_Invalid = -1,
Dir2_Left,
Dir2_Up,
Dir2_Right,
Dir2_Down,
Dir2_COUNT
}
Dir2;
#define axis2_from_dir2(d) (((d) & 1) ? Axis2_Y : Axis2_X)
#define side_from_dir2(d) (((d) < Dir2_Right) ? Side_Min : Side_Max)
////////////////////////////////
//~ rjf: Toolchain/Environment Enums
+22 -22
View File
@@ -18,62 +18,62 @@ main_thread_base_entry_point(void (*entry_point)(CmdLine *cmdline), char **argum
{
ProfBeginCapture(arguments[0]);
}
#if defined(OS_CORE_H)
#if defined(OS_CORE_H) && !defined(OS_INIT_MANUAL)
os_init();
#endif
#if defined(TASK_SYSTEM_H)
#if defined(TASK_SYSTEM_H) && !defined(TS_INIT_MANUAL)
ts_init();
#endif
#if defined(HASH_STORE_H)
#if defined(HASH_STORE_H) && !defined(HS_INIT_MANUAL)
hs_init();
#endif
#if defined(FILE_STREAM_H)
#if defined(FILE_STREAM_H) && !defined(FS_INIT_MANUAL)
fs_init();
#endif
#if defined(TEXT_CACHE_H)
#if defined(TEXT_CACHE_H) && !defined(TXT_INIT_MANUAL)
txt_init();
#endif
#if defined(DASM_CACHE_H)
#if defined(DASM_CACHE_H) && !defined(DASM_INIT_MANUAL)
dasm_init();
#endif
#if defined(DBGI_H)
dbgi_init();
#if defined(DI_H) && !defined(DI_INIT_MANUAL)
di_init();
#endif
#if defined(TXTI_H)
#if defined(FUZZY_SEARCH_H) && !defined(FZY_INIT_MANUAL)
fzy_init();
#endif
#if defined(TXTI_H) && !defined(TXTI_INIT_MANUAL)
txti_init();
#endif
#if defined(DEMON_CORE_H)
#if defined(DEMON_CORE_H) && !defined(DMN_INIT_MANUAL)
dmn_init();
#endif
#if defined(CTRL_CORE_H)
#if defined(CTRL_CORE_H) && !defined(CTRL_INIT_MANUAL)
ctrl_init();
#endif
#if defined(DASM_H)
dasmi_init();
#endif
#if defined(OS_GRAPHICAL_H)
#if defined(OS_GRAPHICAL_H) && !defined(OS_GFX_INIT_MANUAL)
os_graphical_init();
#endif
#if defined(FONT_PROVIDER_H)
#if defined(FONT_PROVIDER_H) && !defined(FP_INIT_MANUAL)
fp_init();
#endif
#if defined(RENDER_CORE_H)
#if defined(RENDER_CORE_H) && !defined(R_INIT_MANUAL)
r_init(&cmdline);
#endif
#if defined(TEXTURE_CACHE_H)
#if defined(TEXTURE_CACHE_H) && !defined(TEX_INIT_MANUAL)
tex_init();
#endif
#if defined(GEO_CACHE_H)
#if defined(GEO_CACHE_H) && !defined(GEO_INIT_MANUAL)
geo_init();
#endif
#if defined(FONT_CACHE_H)
#if defined(FONT_CACHE_H) && !defined(F_INIT_MANUAL)
f_init();
#endif
#if defined(DF_CORE_H)
#if defined(DF_CORE_H) && !defined(DF_INIT_MANUAL)
DF_StateDeltaHistory *hist = df_state_delta_history_alloc();
df_core_init(&cmdline, hist);
#endif
#if defined(DF_GFX_H)
#if defined(DF_GFX_H) && !defined(DF_GFX_INIT_MANUAL)
df_gfx_init(update_and_render, df_state_delta_history());
#endif
entry_point(&cmdline);
+1
View File
@@ -15,4 +15,5 @@
#include "base_thread_context.c"
#include "base_command_line.c"
#include "base_markup.c"
#include "base_log.c"
#include "base_entry_point.c"
+1
View File
@@ -17,6 +17,7 @@
#include "base_thread_context.h"
#include "base_command_line.h"
#include "base_markup.h"
#include "base_log.h"
#include "base_entry_point.h"
#endif // BASE_INC_H
+100
View File
@@ -0,0 +1,100 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Globals/Thread-Locals
C_LINKAGE thread_static Log *log_active;
#if !BUILD_SUPPLEMENTARY_UNIT
C_LINKAGE thread_static Log *log_active = 0;
#endif
////////////////////////////////
//~ rjf: Log Creation/Selection
internal Log *
log_alloc(void)
{
Arena *arena = arena_alloc();
Log *log = push_array(arena, Log, 1);
log->arena = arena;
return log;
}
internal void
log_release(Log *log)
{
arena_release(log->arena);
}
internal void
log_select(Log *log)
{
log_active = log;
}
////////////////////////////////
//~ rjf: Log Building/Clearing
internal void
log_msg(LogMsgKind kind, String8 string)
{
if(log_active != 0 && log_active->top_scope != 0)
{
String8 string_copy = push_str8_copy(log_active->arena, string);
str8_list_push(log_active->arena, &log_active->top_scope->strings[kind], string_copy);
}
}
internal void
log_msgf(LogMsgKind kind, char *fmt, ...)
{
if(log_active != 0)
{
Temp scratch = scratch_begin(0, 0);
va_list args;
va_start(args, fmt);
String8 string = push_str8fv(scratch.arena, fmt, args);
log_msg(kind, string);
va_end(args);
scratch_end(scratch);
}
}
////////////////////////////////
//~ rjf: Log Scopes
internal void
log_scope_begin(void)
{
if(log_active != 0)
{
U64 pos = arena_pos(log_active->arena);
LogScope *scope = push_array(log_active->arena, LogScope, 1);
scope->pos = pos;
SLLStackPush(log_active->top_scope, scope);
}
}
internal LogScopeResult
log_scope_end(Arena *arena)
{
LogScopeResult result = {0};
if(log_active != 0)
{
LogScope *scope = log_active->top_scope;
if(scope != 0)
{
SLLStackPop(log_active->top_scope);
if(arena != 0)
{
for(EachEnumVal(LogMsgKind, kind))
{
result.strings[kind] = str8_list_join(arena, &scope->strings[kind], 0);
}
}
arena_pop_to(log_active->arena, scope->pos);
}
}
return result;
}
+62
View File
@@ -0,0 +1,62 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef BASE_LOG_H
#define BASE_LOG_H
////////////////////////////////
//~ rjf: Log Types
typedef enum LogMsgKind
{
LogMsgKind_Info,
LogMsgKind_UserError,
LogMsgKind_COUNT
}
LogMsgKind;
typedef struct LogScope LogScope;
struct LogScope
{
LogScope *next;
U64 pos;
String8List strings[LogMsgKind_COUNT];
};
typedef struct LogScopeResult LogScopeResult;
struct LogScopeResult
{
String8 strings[LogMsgKind_COUNT];
};
typedef struct Log Log;
struct Log
{
Arena *arena;
LogScope *top_scope;
};
////////////////////////////////
//~ rjf: Log Creation/Selection
internal Log *log_alloc(void);
internal void log_release(Log *log);
internal void log_select(Log *log);
////////////////////////////////
//~ rjf: Log Building
internal void log_msg(LogMsgKind kind, String8 string);
internal void log_msgf(LogMsgKind kind, char *fmt, ...);
#define log_info(s) log_msg(LogMsgKind_Info, (s))
#define log_infof(fmt, ...) log_msgf(LogMsgKind_Info, (fmt), __VA_ARGS__)
#define log_user_error(s) log_msg(LogMsgKind_UserError, (s))
#define log_user_errorf(fmt, ...) log_msgf(LogMsgKind_UserError, (fmt), __VA_ARGS__)
////////////////////////////////
//~ rjf: Log Scopes
internal void log_scope_begin(void);
internal LogScopeResult log_scope_end(Arena *arena);
#endif // BASE_LOG_H
+2 -2
View File
@@ -4,9 +4,9 @@
#ifndef BASE_MARKUP_H
#define BASE_MARKUP_H
internal void thread_namef(char *fmt, ...);
internal void thread_name(String8 string);
internal void thread_namef(char *fmt, ...);
#define ThreadNameF(...) (ProfThreadName(__VA_ARGS__), thread_namef(__VA_ARGS__))
#define ThreadName(str) (ProfThreadName("%s", str8_varg(str)), thread_name(str))
#define ThreadName(str) (ProfThreadName("%.*s", str8_varg(str)), thread_name(str))
#endif // BASE_MARKUP_H
+1631 -137
View File
File diff suppressed because it is too large Load Diff
+118 -7
View File
@@ -49,6 +49,7 @@ typedef enum CTRL_EntityKind
CTRL_EntityKind_Thread,
CTRL_EntityKind_Module,
CTRL_EntityKind_EntryPoint,
CTRL_EntityKind_DebugInfoPath,
CTRL_EntityKind_COUNT
}
CTRL_EntityKind;
@@ -67,6 +68,7 @@ struct CTRL_Entity
DMN_Handle handle;
U64 id;
Rng1U64 vaddr_range;
U64 timestamp;
String8 string;
};
@@ -107,22 +109,45 @@ struct CTRL_EntityStore
////////////////////////////////
//~ rjf: Unwind Types
typedef U32 CTRL_UnwindFlags;
enum
{
CTRL_UnwindFlag_Error = (1<<0),
CTRL_UnwindFlag_Stale = (1<<1),
};
typedef struct CTRL_UnwindStepResult CTRL_UnwindStepResult;
struct CTRL_UnwindStepResult
{
CTRL_UnwindFlags flags;
};
typedef struct CTRL_UnwindFrame CTRL_UnwindFrame;
struct CTRL_UnwindFrame
{
CTRL_UnwindFrame *next;
CTRL_UnwindFrame *prev;
U64 rip;
void *regs;
};
typedef struct CTRL_UnwindFrameNode CTRL_UnwindFrameNode;
struct CTRL_UnwindFrameNode
{
CTRL_UnwindFrameNode *next;
CTRL_UnwindFrameNode *prev;
CTRL_UnwindFrame v;
};
typedef struct CTRL_UnwindFrameArray CTRL_UnwindFrameArray;
struct CTRL_UnwindFrameArray
{
CTRL_UnwindFrame *v;
U64 count;
};
typedef struct CTRL_Unwind CTRL_Unwind;
struct CTRL_Unwind
{
CTRL_UnwindFrame *first;
CTRL_UnwindFrame *last;
U64 count;
B32 error;
CTRL_UnwindFrameArray frames;
CTRL_UnwindFlags flags;
};
////////////////////////////////
@@ -224,6 +249,7 @@ typedef enum CTRL_MsgKind
CTRL_MsgKind_Run,
CTRL_MsgKind_SingleStep,
CTRL_MsgKind_SetUserEntryPoints,
CTRL_MsgKind_SetModuleDebugInfoPath,
CTRL_MsgKind_COUNT,
}
CTRL_MsgKind;
@@ -292,6 +318,9 @@ typedef enum CTRL_EventKind
CTRL_EventKind_EndThread,
CTRL_EventKind_EndModule,
//- rjf: debug info changes
CTRL_EventKind_ModuleDebugInfoPathChange,
//- rjf: debug strings
CTRL_EventKind_DebugString,
CTRL_EventKind_ThreadName,
@@ -348,6 +377,7 @@ struct CTRL_Event
U64 rip_vaddr;
U64 stack_base;
U64 tls_root;
U64 timestamp;
U32 exception_code;
String8 string;
};
@@ -474,6 +504,47 @@ struct CTRL_ThreadRegCache
CTRL_ThreadRegCacheStripe *stripes;
};
////////////////////////////////
//~ rjf: Module Image Info Cache Types
typedef struct CTRL_ModuleImageInfoCacheNode CTRL_ModuleImageInfoCacheNode;
struct CTRL_ModuleImageInfoCacheNode
{
CTRL_ModuleImageInfoCacheNode *next;
CTRL_ModuleImageInfoCacheNode *prev;
CTRL_MachineID machine_id;
DMN_Handle module;
Arena *arena;
PE_IntelPdata *pdatas;
U64 pdatas_count;
U64 entry_point_voff;
Rng1U64 tls_vaddr_range;
String8 initial_debug_info_path;
};
typedef struct CTRL_ModuleImageInfoCacheSlot CTRL_ModuleImageInfoCacheSlot;
struct CTRL_ModuleImageInfoCacheSlot
{
CTRL_ModuleImageInfoCacheNode *first;
CTRL_ModuleImageInfoCacheNode *last;
};
typedef struct CTRL_ModuleImageInfoCacheStripe CTRL_ModuleImageInfoCacheStripe;
struct CTRL_ModuleImageInfoCacheStripe
{
Arena *arena;
OS_Handle rw_mutex;
};
typedef struct CTRL_ModuleImageInfoCache CTRL_ModuleImageInfoCache;
struct CTRL_ModuleImageInfoCache
{
U64 slots_count;
CTRL_ModuleImageInfoCacheSlot *slots;
U64 stripes_count;
CTRL_ModuleImageInfoCacheStripe *stripes;
};
////////////////////////////////
//~ rjf: Wakeup Hook Function Types
@@ -496,6 +567,7 @@ struct CTRL_State
// rjf: caches
CTRL_ProcessMemoryCache process_memory_cache;
CTRL_ThreadRegCache thread_reg_cache;
CTRL_ModuleImageInfoCache module_image_info_cache;
// rjf: user -> ctrl msg ring buffer
U64 u2c_ring_size;
@@ -514,7 +586,9 @@ struct CTRL_State
OS_Handle c2u_ring_cv;
// rjf: ctrl thread state
String8 ctrl_thread_log_path;
OS_Handle ctrl_thread;
Log *ctrl_thread_log;
CTRL_EntityStore *ctrl_thread_entity_store;
Arena *dmn_event_arena;
DMN_EventNode *first_dmn_event_node;
@@ -551,6 +625,11 @@ read_only global CTRL_Entity ctrl_entity_nil =
&ctrl_entity_nil,
};
////////////////////////////////
//~ rjf: Logging Markup
#define CTRL_CtrlThreadLogScope DeferLoop(log_scope_begin(), ctrl_thread__end_and_flush_info_log())
////////////////////////////////
//~ rjf: Basic Type Functions
@@ -608,6 +687,7 @@ internal CTRL_EntityStore *ctrl_entity_store_alloc(void);
internal void ctrl_entity_store_release(CTRL_EntityStore *store);
//- rjf: string allocation/deletion
internal U64 ctrl_name_bucket_idx_from_string_size(U64 size);
internal String8 ctrl_entity_string_alloc(CTRL_EntityStore *store, String8 string);
internal void ctrl_entity_string_release(CTRL_EntityStore *store, String8 string);
@@ -620,6 +700,7 @@ internal void ctrl_entity_equip_string(CTRL_EntityStore *store, CTRL_Entity *ent
//- rjf: entity store lookups
internal CTRL_Entity *ctrl_entity_from_machine_id_handle(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle handle);
internal CTRL_Entity *ctrl_entity_child_from_kind(CTRL_Entity *parent, CTRL_EntityKind kind);
//- rjf: applying events to entity caches
internal void ctrl_entity_store_apply_events(CTRL_EntityStore *store, CTRL_EventList *list);
@@ -647,6 +728,8 @@ internal U128 ctrl_hash_store_key_from_process_vaddr_range(CTRL_MachineID machin
//- rjf: process memory cache reading helpers
internal CTRL_ProcessMemorySlice ctrl_query_cached_data_from_process_vaddr_range(Arena *arena, CTRL_MachineID machine_id, DMN_Handle process, Rng1U64 range, U64 endt_us);
internal CTRL_ProcessMemorySlice ctrl_query_cached_zero_terminated_data_from_process_vaddr_limit(Arena *arena, CTRL_MachineID machine_id, DMN_Handle process, U64 vaddr, U64 limit, U64 element_size, U64 endt_us);
internal B32 ctrl_read_cached_process_memory(CTRL_MachineID machine_id, DMN_Handle process, Rng1U64 range, B32 *is_stale_out, void *out, U64 endt_us);
#define ctrl_read_cached_process_memory_struct(machine_id, process, vaddr, is_stale_out, ptr, endt_us) ctrl_read_cached_process_memory((machine_id), (process), r1u64((vaddr), (vaddr)+(sizeof(*(ptr)))), (is_stale_out), (ptr), (endt_us))
//- rjf: process memory writing
internal B32 ctrl_process_write(CTRL_MachineID machine_id, DMN_Handle process, Rng1U64 range, void *src);
@@ -662,9 +745,29 @@ internal U64 ctrl_query_cached_rip_from_thread(CTRL_EntityStore *store, CTRL_Mac
//- rjf: thread register writing
internal B32 ctrl_thread_write_reg_block(CTRL_MachineID machine_id, DMN_Handle thread, void *block);
////////////////////////////////
//~ rjf: Module Image Info Functions
//- rjf: cache lookups
internal PE_IntelPdata *ctrl_intel_pdata_from_module_voff(Arena *arena, CTRL_MachineID machine_id, DMN_Handle module_handle, U64 voff);
internal U64 ctrl_entry_point_voff_from_module(CTRL_MachineID machine_id, DMN_Handle module_handle);
internal Rng1U64 ctrl_tls_vaddr_range_from_module(CTRL_MachineID machine_id, DMN_Handle module_handle);
internal String8 ctrl_initial_debug_info_path_from_module(Arena *arena, CTRL_MachineID machine_id, DMN_Handle module_handle);
////////////////////////////////
//~ rjf: Unwinding Functions
//- rjf: unwind deep copier
internal CTRL_Unwind ctrl_unwind_deep_copy(Arena *arena, Architecture arch, CTRL_Unwind *src);
//- rjf: [x64]
internal REGS_Reg64 *ctrl_unwind_reg_from_pe_gpr_reg__pe_x64(REGS_RegBlockX64 *regs, PE_UnwindGprRegX64 gpr_reg);
internal CTRL_UnwindStepResult ctrl_unwind_step__pe_x64(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle process_handle, DMN_Handle module, REGS_RegBlockX64 *regs, U64 endt_us);
//- rjf: abstracted unwind step
internal CTRL_UnwindStepResult ctrl_unwind_step(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle process_handle, DMN_Handle module, Architecture arch, void *reg_block, U64 endt_us);
//- rjf: abstracted full unwind
internal CTRL_Unwind ctrl_unwind_from_thread(Arena *arena, CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle thread, U64 endt_us);
////////////////////////////////
@@ -702,12 +805,20 @@ internal void ctrl_thread__entry_point(void *p);
internal void ctrl_thread__append_resolved_module_user_bp_traps(Arena *arena, CTRL_MachineID machine_id, DMN_Handle process, DMN_Handle module, CTRL_UserBreakpointList *user_bps, DMN_TrapChunkList *traps_out);
internal void ctrl_thread__append_resolved_process_user_bp_traps(Arena *arena, CTRL_MachineID machine_id, DMN_Handle process, CTRL_UserBreakpointList *user_bps, DMN_TrapChunkList *traps_out);
//- rjf: module lifetime open/close work
internal void ctrl_thread__module_open(CTRL_MachineID machine_id, DMN_Handle process, DMN_Handle module, Rng1U64 vaddr_range, String8 path, U64 exe_timestamp);
internal void ctrl_thread__module_close(CTRL_MachineID machine_id, DMN_Handle module, String8 path);
//- rjf: attached process running/event gathering
internal DMN_Event *ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg, DMN_RunCtrls *run_ctrls, CTRL_Spoof *spoof);
//- rjf: eval helpers
internal B32 ctrl_eval_memory_read(void *u, void *out, U64 addr, U64 size);
//- rjf: log flusher
internal void ctrl_thread__flush_info_log(String8 string);
internal void ctrl_thread__end_and_flush_info_log(void);
//- rjf: msg kind implementations
internal void ctrl_thread__launch(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg);
internal void ctrl_thread__attach(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg);
+222 -96
View File
@@ -13,6 +13,21 @@
#include "third_party/udis86/libudis86/syn.c"
#include "third_party/udis86/libudis86/udis86.c"
////////////////////////////////
//~ rjf: Parameter Type Functions
internal B32
dasm_params_match(DASM_Params *a, DASM_Params *b)
{
B32 result = (a->vaddr == b->vaddr &&
a->arch == b->arch &&
a->style_flags == b->style_flags &&
a->syntax == b->syntax &&
a->base_vaddr == b->base_vaddr &&
di_key_match(&a->dbgi_key, &b->dbgi_key));
return result;
}
////////////////////////////////
//~ rjf: Instruction Type Functions
@@ -103,7 +118,7 @@ dasm_init(void)
{
dasm_shared->parse_threads[idx] = os_launch_thread(dasm_parse_thread__entry_point, (void *)idx, 0);
}
dasm_shared->evictor_thread = os_launch_thread(dasm_evictor_thread__entry_point, 0, 0);
dasm_shared->evictor_detector_thread = os_launch_thread(dasm_evictor_detector_thread__entry_point, 0, 0);
}
////////////////////////////////
@@ -134,16 +149,9 @@ dasm_scope_open(void)
dasm_tctx = push_array(arena, DASM_TCTX, 1);
dasm_tctx->arena = arena;
}
DASM_Scope *scope = dasm_tctx->free_scope;
if(scope != 0)
{
SLLStackPop(dasm_tctx->free_scope);
}
else
{
scope = push_array_no_zero(dasm_tctx->arena, DASM_Scope, 1);
}
MemoryZeroStruct(scope);
U64 base_pos = arena_pos(dasm_tctx->arena);
DASM_Scope *scope = push_array(dasm_tctx->arena, DASM_Scope, 1);
scope->base_pos = base_pos;
return scope;
}
@@ -161,43 +169,27 @@ dasm_scope_close(DASM_Scope *scope)
{
for(DASM_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(t->hash, n->hash) &&
t->addr == n->addr &&
t->arch == n->arch &&
t->style_flags == n->style_flags &&
t->syntax == n->syntax)
if(u128_match(t->hash, n->hash) && dasm_params_match(&t->params, &n->params))
{
ins_atomic_u64_dec_eval(&n->scope_ref_count);
break;
}
}
}
SLLStackPush(dasm_tctx->free_touch, t);
}
SLLStackPush(dasm_tctx->free_scope, scope);
arena_pop_to(dasm_tctx->arena, scope->base_pos);
}
internal void
dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_Node *node)
{
DASM_Touch *touch = dasm_tctx->free_touch;
DASM_Touch *touch = push_array(dasm_tctx->arena, DASM_Touch, 1);
ins_atomic_u64_inc_eval(&node->scope_ref_count);
ins_atomic_u64_eval_assign(&node->last_time_touched_us, os_now_microseconds());
ins_atomic_u64_eval_assign(&node->last_user_clock_idx_touched, dasm_user_clock_idx());
if(touch != 0)
{
SLLStackPop(dasm_tctx->free_touch);
}
else
{
touch = push_array_no_zero(dasm_tctx->arena, DASM_Touch, 1);
}
MemoryZeroStruct(touch);
touch->hash = node->hash;
touch->addr = node->addr;
touch->arch = node->arch;
touch->style_flags = node->style_flags;
touch->syntax = node->syntax;
MemoryCopyStruct(&touch->params, &node->params);
touch->params.dbgi_key = di_key_copy(dasm_tctx->arena, &touch->params.dbgi_key);
SLLStackPush(scope->top_touch, touch);
}
@@ -205,7 +197,7 @@ dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_Node *node)
//~ rjf: Cache Lookups
internal DASM_Info
dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax)
dasm_info_from_hash_params(DASM_Scope *scope, U128 hash, DASM_Params *params)
{
DASM_Info info = {0};
if(!u128_match(hash, u128_zero()))
@@ -219,11 +211,7 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
{
for(DASM_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(hash, n->hash) &&
addr == n->addr &&
arch == n->arch &&
style_flags == n->style_flags &&
syntax == n->syntax)
if(u128_match(hash, n->hash) && dasm_params_match(params, &n->params))
{
MemoryCopyStruct(&info, &n->info);
found = 1;
@@ -240,11 +228,7 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
DASM_Node *node = 0;
for(DASM_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(hash, n->hash) &&
addr == n->addr &&
arch == n->arch &&
style_flags == n->style_flags &&
syntax == n->syntax)
if(u128_match(hash, n->hash) && dasm_params_match(params, &n->params))
{
node = n;
break;
@@ -252,6 +236,14 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
}
if(node == 0)
{
log_infof("[dasm] cache miss, creating node...\n");
log_infof(" hash: [0x%I64x 0x%I64x]\n", hash.u64[0], hash.u64[1]);
log_infof(" vaddr: 0x%I64x\n", params->vaddr);
log_infof(" arch: %S\n", string_from_architecture(params->arch));
log_infof(" style_flags: 0x%x\n", params->style_flags);
log_infof(" syntax: %i\n", params->syntax);
log_infof(" base_vaddr: 0x%I64x\n", params->base_vaddr);
log_infof(" dbgi_key: [%S 0x%I64x]\n", params->dbgi_key.path, params->dbgi_key.min_timestamp);
node = stripe->free_node;
if(node)
{
@@ -264,30 +256,29 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
MemoryZeroStruct(node);
DLLPushBack(slot->first, slot->last, node);
node->hash = hash;
node->addr = addr;
node->arch = arch;
node->style_flags = style_flags;
node->syntax = syntax;
MemoryCopyStruct(&node->params, params);
// TODO(rjf): need to make this releasable - currently all exe_paths just leak
node->params.dbgi_key = di_key_copy(stripe->arena, &node->params.dbgi_key);
node_is_new = 1;
}
}
}
if(node_is_new)
{
dasm_u2p_enqueue_req(hash, addr, arch, style_flags, syntax, max_U64);
dasm_u2p_enqueue_req(hash, params, max_U64);
}
}
return info;
}
internal DASM_Info
dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U128 *hash_out)
dasm_info_from_key_params(DASM_Scope *scope, U128 key, DASM_Params *params, U128 *hash_out)
{
DASM_Info result = {0};
for(U64 rewind_idx = 0; rewind_idx < 2; rewind_idx += 1)
{
U128 hash = hs_hash_from_key(key, rewind_idx);
result = dasm_info_from_hash_addr_arch_style(scope, hash, addr, arch, style_flags, syntax);
result = dasm_info_from_hash_params(scope, hash, params);
if(result.insts.count != 0)
{
if(hash_out)
@@ -304,21 +295,27 @@ dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Archit
//~ rjf: Parse Threads
internal B32
dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U64 endt_us)
dasm_u2p_enqueue_req(U128 hash, DASM_Params *params, U64 endt_us)
{
B32 good = 0;
OS_MutexScope(dasm_shared->u2p_ring_mutex) for(;;)
{
U64 unconsumed_size = dasm_shared->u2p_ring_write_pos - dasm_shared->u2p_ring_read_pos;
U64 available_size = dasm_shared->u2p_ring_size - unconsumed_size;
if(available_size >= sizeof(hash)+sizeof(addr)+sizeof(arch))
if(available_size >= sizeof(hash)+sizeof(U64)+sizeof(Architecture)+sizeof(DASM_StyleFlags)+sizeof(DASM_Syntax)+sizeof(U64)+sizeof(U64)+params->dbgi_key.path.size+sizeof(U64))
{
good = 1;
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &hash);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &addr);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &arch);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &style_flags);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &syntax);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->vaddr);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->arch);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->style_flags);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->syntax);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->base_vaddr);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->dbgi_key.path.size);
dasm_shared->u2p_ring_write_pos += ring_write(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, params->dbgi_key.path.str, params->dbgi_key.path.size);
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &params->dbgi_key.min_timestamp);
dasm_shared->u2p_ring_write_pos += 7;
dasm_shared->u2p_ring_write_pos -= dasm_shared->u2p_ring_write_pos%8;
break;
}
if(os_now_microseconds() >= endt_us)
@@ -335,18 +332,25 @@ dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags sty
}
internal void
dasm_u2p_dequeue_req(U128 *hash_out, U64 *addr_out, Architecture *arch_out, DASM_StyleFlags *style_flags_out, DASM_Syntax *syntax_out)
dasm_u2p_dequeue_req(Arena *arena, U128 *hash_out, DASM_Params *params_out)
{
OS_MutexScope(dasm_shared->u2p_ring_mutex) for(;;)
{
U64 unconsumed_size = dasm_shared->u2p_ring_write_pos - dasm_shared->u2p_ring_read_pos;
if(unconsumed_size >= sizeof(*hash_out)+sizeof(*addr_out)+sizeof(*arch_out))
if(unconsumed_size >= sizeof(*hash_out)+sizeof(U64)+sizeof(Architecture)+sizeof(DASM_StyleFlags)+sizeof(DASM_Syntax)+sizeof(U64)+sizeof(U64)+sizeof(U64))
{
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, hash_out);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, addr_out);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, arch_out);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, style_flags_out);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, syntax_out);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->vaddr);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->arch);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->style_flags);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->syntax);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->base_vaddr);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->dbgi_key.path.size);
params_out->dbgi_key.path.str = push_array(arena, U8, params_out->dbgi_key.path.size);
dasm_shared->u2p_ring_read_pos += ring_read(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, params_out->dbgi_key.path.str, params_out->dbgi_key.path.size);
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, &params_out->dbgi_key.min_timestamp);
dasm_shared->u2p_ring_read_pos += 7;
dasm_shared->u2p_ring_read_pos -= dasm_shared->u2p_ring_read_pos%8;
break;
}
os_condition_variable_wait(dasm_shared->u2p_ring_cv, dasm_shared->u2p_ring_mutex, max_U64);
@@ -364,12 +368,12 @@ dasm_parse_thread__entry_point(void *p)
//- rjf: get next request
U128 hash = {0};
U64 addr = 0;
Architecture arch = Architecture_Null;
DASM_StyleFlags style_flags = 0;
DASM_Syntax syntax = DASM_Syntax_Intel;
dasm_u2p_dequeue_req(&hash, &addr, &arch, &style_flags, &syntax);
DASM_Params params = {0};
dasm_u2p_dequeue_req(scratch.arena, &hash, &params);
U64 change_gen = fs_change_gen();
HS_Scope *hs_scope = hs_scope_open();
DI_Scope *di_scope = di_scope_open();
TXT_Scope *txt_scope = txt_scope_open();
//- rjf: unpack hash
U64 slot_idx = hash.u64[1]%dasm_shared->slots_count;
@@ -383,11 +387,7 @@ dasm_parse_thread__entry_point(void *p)
{
for(DASM_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->hash, hash) &&
n->addr == addr &&
n->arch == arch &&
n->style_flags == style_flags &&
n->syntax == syntax)
if(u128_match(n->hash, hash) && dasm_params_match(&n->params, &params))
{
got_task = !ins_atomic_u32_eval_cond_assign(&n->is_working, 1, 0);
break;
@@ -395,6 +395,13 @@ dasm_parse_thread__entry_point(void *p)
}
}
//- rjf: get dbg info
RDI_Parsed *rdi = &di_rdi_parsed_nil;
if(got_task && params.dbgi_key.path.size != 0)
{
rdi = di_rdi_from_key(di_scope, &params.dbgi_key, max_U64);
}
//- rjf: hash -> data
String8 data = {0};
if(got_task)
@@ -402,12 +409,12 @@ dasm_parse_thread__entry_point(void *p)
data = hs_data_from_hash(hs_scope, hash);
}
//- rjf: data * arch * addr -> decode artifacts
//- rjf: data * arch * addr * dbg -> decode artifacts
DASM_InstChunkList inst_list = {0};
String8List inst_strings = {0};
if(got_task)
{
switch(arch)
switch(params.arch)
{
default:{}break;
@@ -418,14 +425,15 @@ dasm_parse_thread__entry_point(void *p)
// rjf: grab context
struct ud udc;
ud_init(&udc);
ud_set_mode(&udc, bit_size_from_arch(arch));
ud_set_pc(&udc, addr);
ud_set_mode(&udc, bit_size_from_arch(params.arch));
ud_set_pc(&udc, params.vaddr);
ud_set_input_buffer(&udc, data.str, data.size);
ud_set_vendor(&udc, UD_VENDOR_ANY);
ud_set_syntax(&udc, syntax == DASM_Syntax_Intel ? UD_SYN_INTEL : UD_SYN_ATT);
ud_set_syntax(&udc, params.syntax == DASM_Syntax_Intel ? UD_SYN_INTEL : UD_SYN_ATT);
// rjf: disassemble
U64 byte_process_start_off = 0;
RDI_SourceFile *last_file = &rdi_source_file_nil;
RDI_Line *last_line = 0;
for(U64 off = 0; off < data.size;)
{
// rjf: disassemble one instruction
@@ -438,15 +446,90 @@ dasm_parse_thread__entry_point(void *p)
// rjf: analyze
struct ud_operand *first_op = (struct ud_operand *)ud_insn_opr(&udc, 0);
U64 rel_voff = (first_op != 0 && first_op->type == UD_OP_JIMM) ? ud_syn_rel_target(&udc, first_op) : 0;
U64 jump_dst_vaddr = rel_voff;
// rjf: push strings derived from voff -> line info
if(params.style_flags & (DASM_StyleFlag_SourceFilesNames|DASM_StyleFlag_SourceLines))
{
if(rdi != &di_rdi_parsed_nil)
{
U64 voff = (params.vaddr+off) - params.base_vaddr;
U32 unit_idx = rdi_vmap_idx_from_voff(rdi->unit_vmap, rdi->unit_vmap_count, voff);
RDI_Unit *unit = rdi_element_from_idx(rdi, units, unit_idx);
RDI_ParsedLineInfo unit_line_info = {0};
rdi_line_info_from_unit(rdi, unit, &unit_line_info);
U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, voff);
if(line_info_idx < unit_line_info.count)
{
RDI_Line *line = &unit_line_info.lines[line_info_idx];
RDI_SourceFile *file = rdi_element_from_idx(rdi, source_files, line->file_idx);
String8 file_normalized_full_path = {0};
file_normalized_full_path.str = rdi_string_from_idx(rdi, file->normal_full_path_string_idx, &file_normalized_full_path.size);
if(file != last_file)
{
if(params.style_flags & DASM_StyleFlag_SourceFilesNames &&
file->normal_full_path_string_idx != 0 && file_normalized_full_path.size != 0)
{
DASM_Inst inst = {0};
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
str8_list_pushf(scratch.arena, &inst_strings, "> %S", file_normalized_full_path);
}
if(params.style_flags & DASM_StyleFlag_SourceFilesNames && file->normal_full_path_string_idx == 0)
{
DASM_Inst inst = {0};
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
str8_list_pushf(scratch.arena, &inst_strings, ">");
}
last_file = file;
}
if(line && line != last_line && file->normal_full_path_string_idx != 0 &&
params.style_flags & DASM_StyleFlag_SourceLines &&
file_normalized_full_path.size != 0)
{
FileProperties props = os_properties_from_file_path(file_normalized_full_path);
if(props.modified != 0)
{
// TODO(rjf): need redirection path - this may map to a different path on the local machine,
// need frontend to communicate path remapping info to this layer
U128 key = fs_key_from_path(file_normalized_full_path);
TXT_LangKind lang_kind = txt_lang_kind_from_extension(file_normalized_full_path);
U64 endt_us = max_U64;
U128 hash = {0};
TXT_TextInfo text_info = {0};
for(;os_now_microseconds() <= endt_us;)
{
text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash);
if(!u128_match(hash, u128_zero()))
{
break;
}
}
if(0 < line->line_num && line->line_num < text_info.lines_count)
{
String8 data = hs_data_from_hash(hs_scope, hash);
String8 line_text = str8_skip_chop_whitespace(str8_substr(data, text_info.lines_ranges[line->line_num-1]));
if(line_text.size != 0)
{
DASM_Inst inst = {0};
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
str8_list_pushf(scratch.arena, &inst_strings, "> %S", line_text);
}
}
}
last_line = line;
}
}
}
}
// rjf: push
String8 addr_part = {0};
if(style_flags & DASM_StyleFlag_Addresses)
if(params.style_flags & DASM_StyleFlag_Addresses)
{
addr_part = push_str8f(scratch.arena, "%016I64X ", addr+off);
addr_part = push_str8f(scratch.arena, "%s%016I64X ", rdi != &di_rdi_parsed_nil ? " " : "", params.vaddr+off);
}
String8 code_bytes_part = {0};
if(style_flags & DASM_StyleFlag_CodeBytes)
if(params.style_flags & DASM_StyleFlag_CodeBytes)
{
String8List code_bytes_strings = {0};
str8_list_push(scratch.arena, &code_bytes_strings, str8_lit("{"));
@@ -464,7 +547,24 @@ dasm_parse_thread__entry_point(void *p)
str8_list_push(scratch.arena, &code_bytes_strings, str8_lit(" "));
code_bytes_part = str8_list_join(scratch.arena, &code_bytes_strings, 0);
}
String8 inst_string = push_str8f(scratch.arena, "%S%S%s", addr_part, code_bytes_part, udc.asm_buf);
String8 symbol_part = {0};
if(jump_dst_vaddr != 0 && rdi != &di_rdi_parsed_nil && params.style_flags & DASM_StyleFlag_SymbolNames)
{
RDI_U32 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, jump_dst_vaddr-params.base_vaddr);
if(scope_idx != 0)
{
RDI_Scope *scope = rdi_element_from_idx(rdi, scopes, scope_idx);
RDI_U32 procedure_idx = scope->proc_idx;
RDI_Procedure *procedure = rdi_element_from_idx(rdi, procedures, procedure_idx);
String8 procedure_name = {0};
procedure_name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &procedure_name.size);
if(procedure_name.size != 0)
{
symbol_part = push_str8f(scratch.arena, " (%S)", procedure_name);
}
}
}
String8 inst_string = push_str8f(scratch.arena, "%S%S%s%S", addr_part, code_bytes_part, udc.asm_buf, symbol_part);
DASM_Inst inst = {off, rel_voff, r1u64(inst_strings.total_size + inst_strings.node_count,
inst_strings.total_size + inst_strings.node_count + inst_string.size)};
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
@@ -495,10 +595,11 @@ dasm_parse_thread__entry_point(void *p)
{
hash.u64[0],
hash.u64[1],
addr,
(U64)arch,
(U64)style_flags,
(U64)syntax,
params.vaddr,
(U64)params.arch,
(U64)params.style_flags,
(U64)params.syntax,
(U64)rdi,
0x4d534144,
};
text_key = hs_hash_from_data(str8((U8 *)hash_data, sizeof(hash_data)));
@@ -518,14 +619,18 @@ dasm_parse_thread__entry_point(void *p)
{
for(DASM_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->hash, hash) &&
addr == n->addr &&
arch == n->arch &&
style_flags == n->style_flags &&
syntax == n->syntax)
if(u128_match(n->hash, hash) && dasm_params_match(&n->params, &params))
{
n->info_arena = info_arena;
MemoryCopyStruct(&n->info, &info);
if(rdi != &di_rdi_parsed_nil && params.style_flags & (DASM_StyleFlag_SourceLines|DASM_StyleFlag_SourceFilesNames))
{
n->change_gen = change_gen;
}
else
{
n->change_gen = 0;
}
ins_atomic_u32_eval_assign(&n->is_working, 0);
ins_atomic_u64_inc_eval(&n->load_count);
break;
@@ -533,24 +638,29 @@ dasm_parse_thread__entry_point(void *p)
}
}
txt_scope_close(txt_scope);
di_scope_close(di_scope);
hs_scope_close(hs_scope);
scratch_end(scratch);
}
}
////////////////////////////////
//~ rjf: Evictor Threads
//~ rjf: Evictor/Detector Thread
internal void
dasm_evictor_thread__entry_point(void *p)
dasm_evictor_detector_thread__entry_point(void *p)
{
ThreadNameF("[dasm] evictor thread");
ThreadNameF("[dasm] evictor/detector thread");
for(;;)
{
U64 change_gen = fs_change_gen();
U64 check_time_us = os_now_microseconds();
U64 check_time_user_clocks = dasm_user_clock_idx();
U64 evict_threshold_us = 10*1000000;
U64 retry_threshold_us = 1*1000000;
U64 evict_threshold_user_clocks = 10;
U64 retry_threshold_user_clocks = 10;
for(U64 slot_idx = 0; slot_idx < dasm_shared->slots_count; slot_idx += 1)
{
U64 stripe_idx = slot_idx%dasm_shared->stripes_count;
@@ -570,6 +680,13 @@ dasm_evictor_thread__entry_point(void *p)
slot_has_work = 1;
break;
}
if(n->change_gen != 0 && n->change_gen != change_gen &&
n->last_time_requested_us+retry_threshold_us <= check_time_us &&
n->last_user_clock_idx_requested+retry_threshold_user_clocks <= check_time_user_clocks)
{
slot_has_work = 1;
break;
}
}
}
if(slot_has_work) OS_MutexScopeW(stripe->rw_mutex)
@@ -590,10 +707,19 @@ dasm_evictor_thread__entry_point(void *p)
}
SLLStackPush(stripe->free_node, n);
}
if(n->change_gen != 0 && n->change_gen != change_gen &&
n->last_time_requested_us+retry_threshold_us <= check_time_us &&
n->last_user_clock_idx_requested+retry_threshold_user_clocks <= check_time_user_clocks)
{
if(dasm_u2p_enqueue_req(n->hash, &n->params, max_U64))
{
n->last_time_requested_us = os_now_microseconds();
n->last_user_clock_idx_requested = check_time_user_clocks;
}
}
}
}
os_sleep_milliseconds(5);
}
os_sleep_milliseconds(1000);
os_sleep_milliseconds(100);
}
}
+40 -20
View File
@@ -10,8 +10,11 @@
typedef U32 DASM_StyleFlags;
enum
{
DASM_StyleFlag_Addresses = (1<<0),
DASM_StyleFlag_CodeBytes = (1<<1),
DASM_StyleFlag_Addresses = (1<<0),
DASM_StyleFlag_CodeBytes = (1<<1),
DASM_StyleFlag_SourceFilesNames = (1<<2),
DASM_StyleFlag_SourceLines = (1<<3),
DASM_StyleFlag_SymbolNames = (1<<4),
};
typedef enum DASM_Syntax
@@ -22,6 +25,20 @@ typedef enum DASM_Syntax
}
DASM_Syntax;
////////////////////////////////
//~ rjf: Disassembling Parameters Bundle
typedef struct DASM_Params DASM_Params;
struct DASM_Params
{
U64 vaddr;
Architecture arch;
DASM_StyleFlags style_flags;
DASM_Syntax syntax;
U64 base_vaddr;
DI_Key dbgi_key;
};
////////////////////////////////
//~ rjf: Instruction Types
@@ -80,10 +97,10 @@ struct DASM_Node
// rjf: key
U128 hash;
U64 addr;
Architecture arch;
DASM_StyleFlags style_flags;
DASM_Syntax syntax;
DASM_Params params;
// rjf: generations
U64 change_gen;
// rjf: value
Arena *info_arena;
@@ -95,6 +112,8 @@ struct DASM_Node
U64 last_time_touched_us;
U64 last_user_clock_idx_touched;
U64 load_count;
U64 last_time_requested_us;
U64 last_user_clock_idx_requested;
};
typedef struct DASM_Slot DASM_Slot;
@@ -121,10 +140,7 @@ struct DASM_Touch
{
DASM_Touch *next;
U128 hash;
U64 addr;
Architecture arch;
DASM_StyleFlags style_flags;
DASM_Syntax syntax;
DASM_Params params;
};
typedef struct DASM_Scope DASM_Scope;
@@ -132,6 +148,7 @@ struct DASM_Scope
{
DASM_Scope *next;
DASM_Touch *top_touch;
U64 base_pos;
};
////////////////////////////////
@@ -141,8 +158,6 @@ typedef struct DASM_TCTX DASM_TCTX;
struct DASM_TCTX
{
Arena *arena;
DASM_Scope *free_scope;
DASM_Touch *free_touch;
};
////////////////////////////////
@@ -174,8 +189,8 @@ struct DASM_Shared
U64 parse_thread_count;
OS_Handle *parse_threads;
// rjf: evictor thread
OS_Handle evictor_thread;
// rjf: evictor/detector thread
OS_Handle evictor_detector_thread;
};
////////////////////////////////
@@ -184,6 +199,11 @@ struct DASM_Shared
thread_static DASM_TCTX *dasm_tctx = 0;
global DASM_Shared *dasm_shared = 0;
////////////////////////////////
//~ rjf: Parameter Type Functions
internal B32 dasm_params_match(DASM_Params *a, DASM_Params *b);
////////////////////////////////
//~ rjf: Instruction Type Functions
@@ -213,19 +233,19 @@ internal void dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_No
////////////////////////////////
//~ rjf: Cache Lookups
internal DASM_Info dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax);
internal DASM_Info dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U128 *hash_out);
internal DASM_Info dasm_info_from_hash_params(DASM_Scope *scope, U128 hash, DASM_Params *params);
internal DASM_Info dasm_info_from_key_params(DASM_Scope *scope, U128 key, DASM_Params *params, U128 *hash_out);
////////////////////////////////
//~ rjf: Parse Threads
internal B32 dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U64 endt_us);
internal void dasm_u2p_dequeue_req(U128 *hash_out, U64 *addr_out, Architecture *arch_out, DASM_StyleFlags *style_flags_out, DASM_Syntax *syntax_out);
internal B32 dasm_u2p_enqueue_req(U128 hash, DASM_Params *params, U64 endt_us);
internal void dasm_u2p_dequeue_req(Arena *arena, U128 *hash_out, DASM_Params *params_out);
internal void dasm_parse_thread__entry_point(void *p);
////////////////////////////////
//~ rjf: Evictor Threads
//~ rjf: Evictor/Detector Thread
internal void dasm_evictor_thread__entry_point(void *p);
internal void dasm_evictor_detector_thread__entry_point(void *p);
#endif // DASM_CACHE_H
+656 -1076
View File
File diff suppressed because it is too large Load Diff
+194 -337
View File
@@ -1,294 +1,170 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef DBGI_H
#define DBGI_H
#ifndef DI_H
#define DI_H
////////////////////////////////
//~ rjf: Info Bundle Types
//~ rjf: Cache Key Type
typedef struct DBGI_Parse DBGI_Parse;
struct DBGI_Parse
typedef struct DI_Key DI_Key;
struct DI_Key
{
U64 gen;
Arena *arena;
void *exe_base;
FileProperties exe_props;
String8 dbg_path;
void *dbg_base;
FileProperties dbg_props;
PE_BinInfo pe;
RDI_Parsed rdi;
String8 path;
U64 min_timestamp;
};
////////////////////////////////
//~ rjf: Exe -> Debug Forced Override Cache Types
typedef struct DBGI_ForceNode DBGI_ForceNode;
struct DBGI_ForceNode
typedef struct DI_KeyNode DI_KeyNode;
struct DI_KeyNode
{
DBGI_ForceNode *next;
String8 exe_path;
U64 dbg_path_cap;
U64 dbg_path_size;
U8 *dbg_path_base;
DI_KeyNode *next;
DI_Key v;
};
typedef struct DBGI_ForceSlot DBGI_ForceSlot;
struct DBGI_ForceSlot
typedef struct DI_KeyList DI_KeyList;
struct DI_KeyList
{
DBGI_ForceNode *first;
DBGI_ForceNode *last;
};
typedef struct DBGI_ForceStripe DBGI_ForceStripe;
struct DBGI_ForceStripe
{
Arena *arena;
OS_Handle rw_mutex;
OS_Handle cv;
};
////////////////////////////////
//~ rjf: Binary Cache State Types
typedef U32 DBGI_BinaryFlags;
enum
{
DBGI_BinaryFlag_ParseInFlight = (1<<0),
};
typedef struct DBGI_Binary DBGI_Binary;
struct DBGI_Binary
{
// rjf: links & metadata
DBGI_Binary *next;
String8 exe_path;
U64 refcount;
U64 scope_touch_count;
U64 last_time_enqueued_for_parse_us;
DBGI_BinaryFlags flags;
U64 gen;
// rjf: exe handles
OS_Handle exe_file;
OS_Handle exe_file_map;
// rjf: debug handles
OS_Handle dbg_file;
OS_Handle dbg_file_map;
// rjf: analysis results
DBGI_Parse parse;
};
typedef struct DBGI_BinarySlot DBGI_BinarySlot;
struct DBGI_BinarySlot
{
DBGI_Binary *first;
DBGI_Binary *last;
};
typedef struct DBGI_BinaryStripe DBGI_BinaryStripe;
struct DBGI_BinaryStripe
{
Arena *arena;
OS_Handle rw_mutex;
OS_Handle cv;
};
////////////////////////////////
//~ rjf: Fuzzy Search Cache Types
typedef enum DBGI_FuzzySearchTarget
{
DBGI_FuzzySearchTarget_Procedures,
DBGI_FuzzySearchTarget_GlobalVariables,
DBGI_FuzzySearchTarget_ThreadVariables,
DBGI_FuzzySearchTarget_UDTs,
DBGI_FuzzySearchTarget_COUNT
}
DBGI_FuzzySearchTarget;
typedef struct DBGI_FuzzySearchItem DBGI_FuzzySearchItem;
struct DBGI_FuzzySearchItem
{
U64 idx;
U64 missed_size;
FuzzyMatchRangeList match_ranges;
};
typedef struct DBGI_FuzzySearchItemChunk DBGI_FuzzySearchItemChunk;
struct DBGI_FuzzySearchItemChunk
{
DBGI_FuzzySearchItemChunk *next;
DBGI_FuzzySearchItem *v;
U64 count;
U64 cap;
};
typedef struct DBGI_FuzzySearchItemChunkList DBGI_FuzzySearchItemChunkList;
struct DBGI_FuzzySearchItemChunkList
{
DBGI_FuzzySearchItemChunk *first;
DBGI_FuzzySearchItemChunk *last;
U64 chunk_count;
U64 total_count;
};
typedef struct DBGI_FuzzySearchItemArray DBGI_FuzzySearchItemArray;
struct DBGI_FuzzySearchItemArray
{
DBGI_FuzzySearchItem *v;
DI_KeyNode *first;
DI_KeyNode *last;
U64 count;
};
typedef struct DBGI_FuzzySearchBucket DBGI_FuzzySearchBucket;
struct DBGI_FuzzySearchBucket
typedef struct DI_KeyArray DI_KeyArray;
struct DI_KeyArray
{
Arena *arena;
String8 exe_path;
String8 query;
DBGI_FuzzySearchTarget target;
};
typedef struct DBGI_FuzzySearchNode DBGI_FuzzySearchNode;
struct DBGI_FuzzySearchNode
{
DBGI_FuzzySearchNode *next;
U128 key;
U64 scope_touch_count;
U64 last_time_submitted_us;
DBGI_FuzzySearchBucket buckets[3];
U64 gen;
U64 submit_gen;
DBGI_FuzzySearchItemArray gen_items;
};
typedef struct DBGI_FuzzySearchSlot DBGI_FuzzySearchSlot;
struct DBGI_FuzzySearchSlot
{
DBGI_FuzzySearchNode *first;
DBGI_FuzzySearchNode *last;
};
typedef struct DBGI_FuzzySearchStripe DBGI_FuzzySearchStripe;
struct DBGI_FuzzySearchStripe
{
Arena *arena;
OS_Handle rw_mutex;
OS_Handle cv;
};
typedef struct DBGI_FuzzySearchThread DBGI_FuzzySearchThread;
struct DBGI_FuzzySearchThread
{
OS_Handle thread;
OS_Handle u2f_ring_mutex;
OS_Handle u2f_ring_cv;
U64 u2f_ring_size;
U8 *u2f_ring_base;
U64 u2f_ring_write_pos;
U64 u2f_ring_read_pos;
};
////////////////////////////////
//~ rjf: Weak Access Scope Types
typedef struct DBGI_TouchedBinary DBGI_TouchedBinary;
struct DBGI_TouchedBinary
{
DBGI_TouchedBinary *next;
DBGI_Binary *binary;
};
typedef struct DBGI_TouchedFuzzySearch DBGI_TouchedFuzzySearch;
struct DBGI_TouchedFuzzySearch
{
DBGI_TouchedFuzzySearch *next;
DBGI_FuzzySearchNode *node;
};
typedef struct DBGI_Scope DBGI_Scope;
struct DBGI_Scope
{
DBGI_Scope *next;
DBGI_TouchedBinary *first_tb;
DBGI_TouchedBinary *last_tb;
DBGI_TouchedFuzzySearch *first_tfs;
DBGI_TouchedFuzzySearch *last_tfs;
};
typedef struct DBGI_ThreadCtx DBGI_ThreadCtx;
struct DBGI_ThreadCtx
{
Arena *arena;
DBGI_Scope *free_scope;
DBGI_TouchedBinary *free_tb;
DBGI_TouchedFuzzySearch *free_tfs;
DI_Key *v;
U64 count;
};
////////////////////////////////
//~ rjf: Event Types
typedef enum DBGI_EventKind
typedef enum DI_EventKind
{
DBGI_EventKind_Null,
DBGI_EventKind_ConversionStarted,
DBGI_EventKind_ConversionEnded,
DBGI_EventKind_ConversionFailureUnsupportedFormat,
DBGI_EventKind_COUNT
DI_EventKind_Null,
DI_EventKind_ConversionStarted,
DI_EventKind_ConversionEnded,
DI_EventKind_ConversionFailureUnsupportedFormat,
DI_EventKind_COUNT
}
DBGI_EventKind;
DI_EventKind;
typedef struct DBGI_Event DBGI_Event;
struct DBGI_Event
typedef struct DI_Event DI_Event;
struct DI_Event
{
DBGI_EventKind kind;
DI_EventKind kind;
String8 string;
};
typedef struct DBGI_EventNode DBGI_EventNode;
struct DBGI_EventNode
typedef struct DI_EventNode DI_EventNode;
struct DI_EventNode
{
DBGI_EventNode *next;
DBGI_Event v;
DI_EventNode *next;
DI_Event v;
};
typedef struct DBGI_EventList DBGI_EventList;
struct DBGI_EventList
typedef struct DI_EventList DI_EventList;
struct DI_EventList
{
DBGI_EventNode *first;
DBGI_EventNode *last;
DI_EventNode *first;
DI_EventNode *last;
U64 count;
};
////////////////////////////////
//~ rjf: Cross-Thread Shared State
//~ rjf: Cache Types
typedef struct DBGI_Shared DBGI_Shared;
struct DBGI_Shared
typedef struct DI_StringChunkNode DI_StringChunkNode;
struct DI_StringChunkNode
{
DI_StringChunkNode *next;
U64 size;
};
typedef struct DI_Node DI_Node;
struct DI_Node
{
// rjf: links
DI_Node *next;
DI_Node *prev;
// rjf: metadata
U64 ref_count;
U64 touch_count;
U64 is_working;
U64 last_time_requested_us;
// rjf: key
DI_Key key;
// rjf: file handles
OS_Handle file;
OS_Handle file_map;
void *file_base;
FileProperties file_props;
// rjf: parse artifacts
Arena *arena;
RDI_Parsed rdi;
B32 parse_done;
};
typedef struct DI_Slot DI_Slot;
struct DI_Slot
{
DI_Node *first;
DI_Node *last;
};
typedef struct DI_Stripe DI_Stripe;
struct DI_Stripe
{
Arena *arena;
DI_Node *free_node;
DI_StringChunkNode *free_string_chunks[8];
OS_Handle rw_mutex;
OS_Handle cv;
};
////////////////////////////////
//~ rjf: Scoped Access Types
typedef struct DI_Touch DI_Touch;
struct DI_Touch
{
DI_Touch *next;
DI_Node *node;
};
typedef struct DI_Scope DI_Scope;
struct DI_Scope
{
DI_Scope *next;
DI_Touch *first_touch;
DI_Touch *last_touch;
};
typedef struct DI_TCTX DI_TCTX;
struct DI_TCTX
{
Arena *arena;
DI_Scope *free_scope;
DI_Touch *free_touch;
};
////////////////////////////////
//~ rjf: Shared State Types
typedef struct DI_Shared DI_Shared;
struct DI_Shared
{
// rjf: arena
Arena *arena;
// rjf: forced override table
U64 force_slots_count;
U64 force_stripes_count;
DBGI_ForceSlot *force_slots;
DBGI_ForceStripe *force_stripes;
// rjf: binary table
U64 binary_slots_count;
U64 binary_stripes_count;
DBGI_BinarySlot *binary_slots;
DBGI_BinaryStripe *binary_stripes;
// rjf: fuzzy search cache table
U64 fuzzy_search_slots_count;
U64 fuzzy_search_stripes_count;
DBGI_FuzzySearchSlot *fuzzy_search_slots;
DBGI_FuzzySearchStripe *fuzzy_search_stripes;
// rjf: node cache
U64 slots_count;
DI_Slot *slots;
U64 stripes_count;
DI_Stripe *stripes;
// rjf: user -> parse ring
OS_Handle u2p_ring_mutex;
@@ -309,123 +185,104 @@ struct DBGI_Shared
// rjf: threads
U64 parse_thread_count;
OS_Handle *parse_threads;
U64 fuzzy_thread_count;
DBGI_FuzzySearchThread *fuzzy_threads;
};
////////////////////////////////
//~ rjf: Globals
global DBGI_Shared *dbgi_shared = 0;
thread_static DBGI_ThreadCtx *dbgi_tctx = 0;
global DBGI_Parse dbgi_parse_nil =
global DI_Shared *di_shared = 0;
thread_static DI_TCTX *di_tctx = 0;
global RDI_Parsed di_rdi_parsed_nil =
{
0,
0,
0,
{0},
{0},
0,
{0},
{0},
{
0,
0,
0,
0,
{0},
0,
0,
0,
0,
0,
0,
0,
&rdi_binary_section_nil, 1,
&rdi_file_path_node_nil, 1,
&rdi_source_file_nil, 1,
&rdi_unit_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_type_node_nil, 1,
&rdi_udt_nil, 1,
&rdi_member_nil, 1,
&rdi_enum_member_nil, 1,
&rdi_global_variable_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_thread_variable_nil, 1,
&rdi_procedure_nil, 1,
&rdi_scope_nil, 1,
&rdi_voff_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_local_nil, 1,
&rdi_location_block_nil, 1,
0, 0,
0, 0,
},
0,
0,
0,
0,
0,
0,
&rdi_top_level_info_nil,
&rdi_binary_section_nil, 1,
&rdi_file_path_node_nil, 1,
&rdi_source_file_nil, 1,
&rdi_unit_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_type_node_nil, 1,
&rdi_udt_nil, 1,
&rdi_member_nil, 1,
&rdi_enum_member_nil, 1,
&rdi_global_variable_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_thread_variable_nil, 1,
&rdi_procedure_nil, 1,
&rdi_scope_nil, 1,
&rdi_voff_nil, 1,
&rdi_vmap_entry_nil, 1,
&rdi_local_nil, 1,
&rdi_location_block_nil, 1,
0, 0,
0, 0,
};
////////////////////////////////
//~ rjf: Basic Helpers
internal U64 di_hash_from_string(String8 string, StringMatchFlags match_flags);
internal U64 di_hash_from_key(DI_Key *k);
internal B32 di_key_match(DI_Key *a, DI_Key *b);
internal DI_Key di_key_copy(Arena *arena, DI_Key *src);
internal DI_Key di_normalized_key_from_key(Arena *arena, DI_Key *src);
internal void di_key_list_push(Arena *arena, DI_KeyList *list, DI_Key *key);
internal DI_KeyArray di_key_array_from_list(Arena *arena, DI_KeyList *list);
////////////////////////////////
//~ rjf: Main Layer Initialization
internal void dbgi_init(void);
////////////////////////////////
//~ rjf: Thread-Context Idempotent Initialization
internal void dbgi_ensure_tctx_inited(void);
////////////////////////////////
//~ rjf: Helpers
internal U64 dbgi_hash_from_string(String8 string, StringMatchFlags match_flags);
internal U64 dbgi_fuzzy_item_num_from_array_element_idx__linear_search(DBGI_FuzzySearchItemArray *array, U64 element_idx);
internal String8 dbgi_fuzzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, DBGI_FuzzySearchTarget target, U64 element_idx);
////////////////////////////////
//~ rjf: Forced Override Cache Functions
internal void dbgi_force_exe_path_dbg_path(String8 exe_path, String8 dbg_path);
internal String8 dbgi_forced_dbg_path_from_exe_path(Arena *arena, String8 exe_path);
internal void di_init(void);
////////////////////////////////
//~ rjf: Scope Functions
internal DBGI_Scope *dbgi_scope_open(void);
internal void dbgi_scope_close(DBGI_Scope *scope);
internal void dbgi_scope_touch_binary__stripe_mutex_r_guarded(DBGI_Scope *scope, DBGI_Binary *binary);
internal void dbgi_scope_touch_fuzzy_search__stripe_mutex_r_guarded(DBGI_Scope *scope, DBGI_FuzzySearchNode *node);
internal DI_Scope *di_scope_open(void);
internal void di_scope_close(DI_Scope *scope);
internal void di_scope_touch_node__stripe_mutex_r_guarded(DI_Scope *scope, DI_Node *node);
////////////////////////////////
//~ rjf: Binary Cache Functions
//~ rjf: Per-Slot Functions
internal void dbgi_binary_open(String8 exe_path);
internal void dbgi_binary_close(String8 exe_path);
internal DBGI_Parse *dbgi_parse_from_exe_path(DBGI_Scope *scope, String8 exe_path, U64 endt_us);
internal DI_Node *di_node_from_key_slot__stripe_mutex_r_guarded(DI_Slot *slot, DI_Key *key);
////////////////////////////////
//~ rjf: Fuzzy Search Cache Functions
//~ rjf: Per-Stripe Functions
internal DBGI_FuzzySearchItemArray dbgi_fuzzy_search_items_from_key_exe_query(DBGI_Scope *scope, U128 key, String8 exe_path, String8 query, DBGI_FuzzySearchTarget target, U64 endt_us, B32 *stale_out);
internal U64 di_string_bucket_idx_from_string_size(U64 size);
internal String8 di_string_alloc__stripe_mutex_w_guarded(DI_Stripe *stripe, String8 string);
internal void di_string_release__stripe_mutex_w_guarded(DI_Stripe *stripe, String8 string);
////////////////////////////////
//~ rjf: Key Opening/Closing
internal void di_open(DI_Key *key);
internal void di_close(DI_Key *key);
////////////////////////////////
//~ rjf: Cache Lookups
internal RDI_Parsed *di_rdi_from_key(DI_Scope *scope, DI_Key *key, U64 endt_us);
////////////////////////////////
//~ rjf: Parse Threads
internal B32 dbgi_u2p_enqueue_exe_path(String8 exe_path, U64 endt_us);
internal String8 dbgi_u2p_dequeue_exe_path(Arena *arena);
internal B32 di_u2p_enqueue_key(DI_Key *key, U64 endt_us);
internal void di_u2p_dequeue_key(Arena *arena, DI_Key *out_key);
internal void dbgi_p2u_push_event(DBGI_Event *event);
internal DBGI_EventList dbgi_p2u_pop_events(Arena *arena, U64 endt_us);
internal void di_p2u_push_event(DI_Event *event);
internal DI_EventList di_p2u_pop_events(Arena *arena, U64 endt_us);
internal void dbgi_parse_thread_entry_point(void *p);
internal void di_parse_thread__entry_point(void *p);
////////////////////////////////
//~ rjf: Fuzzy Searching Threads
internal B32 dbgi_u2f_enqueue_req(U128 key, U64 endt_us);
internal void dbgi_u2f_dequeue_req(Arena *arena, DBGI_FuzzySearchThread *thread, U128 *key_out);
internal int dbgi_qsort_compare_fuzzy_search_items(DBGI_FuzzySearchItem *a, DBGI_FuzzySearchItem *b);
internal void dbgi_fuzzy_thread__entry_point(void *p);
#endif //DBGI_H
#endif // DI_H
+5
View File
@@ -1,6 +1,11 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Generated Code
#include "generated/demon.meta.c"
////////////////////////////////
//~ rjf: Basic Type Functions (Helpers, Implemented Once)
+10
View File
@@ -61,6 +61,11 @@ DMN_ExceptionKindTable:
COUNT
}
@data(String8) dmn_event_kind_string_table:
{
@expand(DMN_EventKindTable a) `str8_lit_comp("$(a.name)")`
}
@enum DMN_ErrorKind:
{
@expand(DMN_ErrorKindTable a) `$(a.name)`,
@@ -78,3 +83,8 @@ DMN_ExceptionKindTable:
@expand(DMN_ExceptionKindTable a) `$(a.name)`,
COUNT
}
@data(String8) dmn_exception_kind_string_table:
{
@expand(DMN_ExceptionKindTable a) `str8_lit_comp("$(a.name)")`
}
+30
View File
@@ -4,5 +4,35 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
String8 dmn_event_kind_string_table[17] =
{
str8_lit_comp("Null"),
str8_lit_comp("Error"),
str8_lit_comp("HandshakeComplete"),
str8_lit_comp("CreateProcess"),
str8_lit_comp("ExitProcess"),
str8_lit_comp("CreateThread"),
str8_lit_comp("ExitThread"),
str8_lit_comp("LoadModule"),
str8_lit_comp("UnloadModule"),
str8_lit_comp("Breakpoint"),
str8_lit_comp("Trap"),
str8_lit_comp("SingleStep"),
str8_lit_comp("Exception"),
str8_lit_comp("Halt"),
str8_lit_comp("Memory"),
str8_lit_comp("DebugString"),
str8_lit_comp("SetThreadName"),
};
String8 dmn_exception_kind_string_table[5] =
{
str8_lit_comp("Null"),
str8_lit_comp("MemoryRead"),
str8_lit_comp("MemoryWrite"),
str8_lit_comp("MemoryExecute"),
str8_lit_comp("CppThrow"),
};
C_LINKAGE_END
+2
View File
@@ -58,6 +58,8 @@ DMN_ExceptionKind_COUNT,
} DMN_ExceptionKind;
C_LINKAGE_BEGIN
extern String8 dmn_event_kind_string_table[17];
extern String8 dmn_exception_kind_string_table[5];
C_LINKAGE_END
#endif // DEMON_META_H
+24 -2
View File
@@ -1205,7 +1205,7 @@ dmn_ctrl_launch(DMN_CtrlCtx *ctx, OS_LaunchOptions *options)
IsWow64Process(process_info.hProcess, &is_wow);
if(is_wow)
{
MessageBox(0, "Sorry, The RAD Debugger only debugs 64-bit applications currently.", "Process error", MB_OK|MB_ICONSTOP);
log_user_errorf("Only 64-bit applications can be debugged currently.");
DebugActiveProcessStop(process_info.dwProcessId);
TerminateProcess(process_info.hProcess,0xffffffff);
}
@@ -1242,6 +1242,23 @@ dmn_ctrl_attach(DMN_CtrlCtx *ctx, U32 pid)
{
result = 1;
dmn_w32_shared->new_process_pending = 1;
#if 0
// TODO(rjf): JIT debugging info
{
typedef struct JIT_DEBUG_INFO JIT_DEBUG_INFO;
struct JIT_DEBUG_INFO
{
DWORD dwSize;
DWORD dwProcessorArchitecture;
DWORD dwThreadID;
DWORD dwReserved0;
ULONG64 lpExceptionAddress;
ULONG64 lpExceptionRecord;
ULONG64 lpContextRecord;
};
}
#endif
}
return result;
}
@@ -1732,6 +1749,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
{
switch(child->kind)
{
default:{}break;
case DMN_W32_EntityKind_Thread:
{
DMN_Event *e = dmn_event_list_push(arena, &events);
@@ -2114,7 +2132,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
U64 total_string_size = 0;
for(;total_string_size < KB(4);)
{
U8 *buffer = push_array_no_zero(scratch.arena, U8, 256);
U8 *buffer = push_array(scratch.arena, U8, 256);
B32 good_read = dmn_w32_process_read(process->handle, r1u64(read_addr, read_addr+256), buffer);
if(good_read)
{
@@ -2136,6 +2154,10 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
break;
}
}
else
{
break;
}
}
}
e->kind = DMN_EventKind_SetThreadName;
+455 -307
View File
File diff suppressed because it is too large Load Diff
+76 -55
View File
@@ -265,10 +265,10 @@ struct DF_Eval
////////////////////////////////
//~ rjf: View Rule Hook Types
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, struct DF_CfgVal *val)
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, struct DF_CfgVal *val)
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name) df_core_view_rule_eval_resolution__##name
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name))
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, String8 string, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name) df_core_view_rule_viz_block_prod__##name
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name))
typedef DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CoreViewRuleEvalResolutionHookFunctionType);
@@ -354,6 +354,7 @@ struct DF_CoreViewRuleSpecInfo
{
String8 string;
String8 display_string;
String8 schema;
String8 description;
DF_CoreViewRuleSpecInfoFlags flags;
DF_CoreViewRuleEvalResolutionHookFunctionType *eval_resolution;
@@ -520,7 +521,7 @@ struct DF_TextLineSrc2DasmInfo
{
Rng1U64 voff_range;
S64 remap_line;
DF_Entity *binary;
DI_Key dbgi_key;
};
typedef struct DF_TextLineSrc2DasmInfoNode DF_TextLineSrc2DasmInfoNode;
@@ -542,7 +543,7 @@ typedef struct DF_TextLineSrc2DasmInfoListArray DF_TextLineSrc2DasmInfoListArray
struct DF_TextLineSrc2DasmInfoListArray
{
DF_TextLineSrc2DasmInfoList *v;
DF_EntityList binaries;
DI_KeyList dbgi_keys;
U64 count;
};
@@ -551,7 +552,7 @@ struct DF_TextLineSrc2DasmInfoListArray
typedef struct DF_TextLineDasm2SrcInfo DF_TextLineDasm2SrcInfo;
struct DF_TextLineDasm2SrcInfo
{
DF_Entity *binary;
DI_Key dbgi_key;
DF_Entity *file;
TxtPt pt;
Rng1U64 voff_range;
@@ -707,8 +708,8 @@ struct DF_EvalVizBlock
// rjf: info about ranges that this block spans
Rng1U64 visual_idx_range;
Rng1U64 semantic_idx_range;
DBGI_FuzzySearchTarget dbgi_target;
DBGI_FuzzySearchItemArray backing_search_items;
FZY_Target fzy_target;
FZY_ItemArray fzy_backing_items;
// rjf: visualization config extensions
DF_CfgTable cfg_table;
@@ -774,7 +775,8 @@ struct DF_EvalVizRow
DF_Eval eval;
// rjf: basic visualization contents
String8 expr;
String8 display_expr;
String8 edit_expr;
String8 display_value;
String8 edit_value;
TG_KeyList inherited_type_key_chain;
@@ -919,29 +921,58 @@ struct DF_EntityListCache
DF_EntityList list;
};
//- rjf: per-run unwind cache
//- rjf: auto view rules hash table cache
typedef struct DF_RunUnwindCacheNode DF_RunUnwindCacheNode;
struct DF_RunUnwindCacheNode
typedef struct DF_AutoViewRuleNode DF_AutoViewRuleNode;
struct DF_AutoViewRuleNode
{
DF_RunUnwindCacheNode *hash_next;
DF_AutoViewRuleNode *next;
String8 type;
String8 view_rule;
};
typedef struct DF_AutoViewRuleSlot DF_AutoViewRuleSlot;
struct DF_AutoViewRuleSlot
{
DF_AutoViewRuleNode *first;
DF_AutoViewRuleNode *last;
};
typedef struct DF_AutoViewRuleMapCache DF_AutoViewRuleMapCache;
struct DF_AutoViewRuleMapCache
{
Arena *arena;
U64 slots_count;
DF_AutoViewRuleSlot *slots;
};
//- rjf: per-thread unwind cache
typedef struct DF_UnwindCacheNode DF_UnwindCacheNode;
struct DF_UnwindCacheNode
{
DF_UnwindCacheNode *next;
DF_UnwindCacheNode *prev;
U64 reggen;
U64 memgen;
Arena *arena;
DF_Handle thread;
CTRL_Unwind unwind;
};
typedef struct DF_RunUnwindCacheSlot DF_RunUnwindCacheSlot;
struct DF_RunUnwindCacheSlot
typedef struct DF_UnwindCacheSlot DF_UnwindCacheSlot;
struct DF_UnwindCacheSlot
{
DF_RunUnwindCacheNode *first;
DF_RunUnwindCacheNode *last;
DF_UnwindCacheNode *first;
DF_UnwindCacheNode *last;
};
typedef struct DF_RunUnwindCache DF_RunUnwindCache;
struct DF_RunUnwindCache
typedef struct DF_UnwindCache DF_UnwindCache;
struct DF_UnwindCache
{
Arena *arena;
U64 slots_count;
DF_RunUnwindCacheSlot *slots;
DF_UnwindCacheSlot *slots;
DF_UnwindCacheNode *free_node;
};
//- rjf: per-run tls-base-vaddr cache
@@ -977,7 +1008,7 @@ typedef struct DF_RunLocalsCacheNode DF_RunLocalsCacheNode;
struct DF_RunLocalsCacheNode
{
DF_RunLocalsCacheNode *hash_next;
DF_Handle binary;
DI_Key dbgi_key;
U64 voff;
EVAL_String2NumMap *locals_map;
};
@@ -1116,14 +1147,10 @@ struct DF_State
// rjf: entity query caches
U64 kind_alloc_gens[DF_EntityKind_COUNT];
DF_EntityListCache kind_caches[DF_EntityKind_COUNT];
DF_EntityListCache dbg_info_cache;
DF_EntityListCache bin_file_cache;
DF_AutoViewRuleMapCache auto_view_rule_cache;
// rjf: per-run caches
U64 unwind_cache_reggen_idx;
U64 unwind_cache_memgen_idx;
DF_RunUnwindCache unwind_caches[2];
U64 unwind_cache_gen;
DF_UnwindCache unwind_cache;
U64 tls_base_cache_reggen_idx;
U64 tls_base_cache_memgen_idx;
DF_RunTLSBaseCache tls_base_caches[2];
@@ -1433,6 +1460,7 @@ internal void df_entity_equip_color_rgba(DF_Entity *entity, Vec4F32 rgba);
internal void df_entity_equip_color_hsva(DF_Entity *entity, Vec4F32 hsva);
internal void df_entity_equip_death_timer(DF_Entity *entity, F32 seconds_til_death);
internal void df_entity_equip_cfg_src(DF_Entity *entity, DF_CfgSrc cfg_src);
internal void df_entity_equip_timestamp(DF_Entity *entity, U64 timestamp);
//- rjf: control layer correllation equipment
internal void df_entity_equip_ctrl_machine_id(DF_Entity *entity, CTRL_MachineID machine_id);
@@ -1481,11 +1509,6 @@ internal DF_CmdSpecList df_push_cmd_spec_list(Arena *arena);
internal void df_register_core_view_rule_specs(DF_CoreViewRuleSpecInfoArray specs);
internal DF_CoreViewRuleSpec *df_core_view_rule_spec_from_string(String8 string);
////////////////////////////////
//~ rjf: Debug Info Mapping
internal String8 df_debug_info_path_from_module(Arena *arena, DF_Entity *module);
////////////////////////////////
//~ rjf: Stepping "Trap Net" Builders
@@ -1496,9 +1519,9 @@ internal CTRL_TrapList df_trap_net_from_thread__step_into_line(Arena *arena, DF_
////////////////////////////////
//~ rjf: Modules & Debug Info Mappings
//- rjf: module <=> binary file
internal DF_Entity *df_binary_file_from_module(DF_Entity *module);
internal DF_EntityList df_modules_from_binary_file(Arena *arena, DF_Entity *binary_info);
//- rjf: module <=> debug info keys
internal DI_Key df_dbgi_key_from_module(DF_Entity *module);
internal DF_EntityList df_modules_from_dbgi_key(Arena *arena, DI_Key *dbgi_key);
//- rjf: voff <=> vaddr
internal U64 df_base_vaddr_from_module(DF_Entity *module);
@@ -1510,33 +1533,29 @@ internal Rng1U64 df_vaddr_range_from_voff_range(DF_Entity *module, Rng1U64 voff_
////////////////////////////////
//~ rjf: Debug Info Lookups
//- rjf: binary file -> dbgi parse
internal DBGI_Parse *df_dbgi_parse_from_binary_file(DBGI_Scope *scope, DF_Entity *binary);
//- rjf: voff|vaddr -> symbol lookups
internal String8 df_symbol_name_from_binary_voff(Arena *arena, DF_Entity *binary, U64 voff);
internal String8 df_symbol_name_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff);
internal String8 df_symbol_name_from_process_vaddr(Arena *arena, DF_Entity *process, U64 vaddr);
//- rjf: src -> voff lookups
internal DF_TextLineSrc2DasmInfoListArray df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
//- rjf: voff -> src lookups
internal DF_TextLineDasm2SrcInfo df_text_line_dasm2src_info_from_binary_voff(DF_Entity *binary, U64 voff);
internal DF_TextLineDasm2SrcInfo df_text_line_dasm2src_info_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
//- rjf: symbol -> voff lookups
internal U64 df_voff_from_binary_symbol_name(DF_Entity *binary, String8 symbol_name);
internal U64 df_type_num_from_binary_name(DF_Entity *binary, String8 name);
internal U64 df_voff_from_dbgi_key_symbol_name(DI_Key *dbgi_key, String8 symbol_name);
internal U64 df_type_num_from_dbgi_key_name(DI_Key *dbgi_key, String8 name);
////////////////////////////////
//~ rjf: Process/Thread Info Lookups
//~ rjf: Process/Thread/Module Info Lookups
//- rjf: thread info extraction helpers
internal DF_Entity *df_module_from_process_vaddr(DF_Entity *process, U64 vaddr);
internal DF_Entity *df_module_from_thread(DF_Entity *thread);
internal U64 df_tls_base_vaddr_from_process_root_rip(DF_Entity *process, U64 root_vaddr, U64 rip_vaddr);
internal Architecture df_architecture_from_entity(DF_Entity *entity);
internal EVAL_String2NumMap *df_push_locals_map_from_binary_voff(Arena *arena, DBGI_Scope *scope, DF_Entity *binary, U64 voff);
internal EVAL_String2NumMap *df_push_member_map_from_binary_voff(Arena *arena, DBGI_Scope *scope, DF_Entity *binary, U64 voff);
internal EVAL_String2NumMap *df_push_locals_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
internal EVAL_String2NumMap *df_push_member_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
internal B32 df_set_thread_rip(DF_Entity *thread, U64 vaddr);
internal DF_Entity *df_module_from_thread_candidates(DF_Entity *thread, DF_EntityList *candidates);
@@ -1561,12 +1580,12 @@ internal CTRL_Event df_ctrl_last_stop_event(void);
//~ rjf: Evaluation
internal B32 df_eval_memory_read(void *u, void *out, U64 addr, U64 size);
internal EVAL_ParseCtx df_eval_parse_ctx_from_process_vaddr(DBGI_Scope *scope, DF_Entity *process, U64 vaddr);
internal EVAL_ParseCtx df_eval_parse_ctx_from_src_loc(DBGI_Scope *scope, DF_Entity *file, TxtPt pt);
internal DF_Eval df_eval_from_string(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, String8 string);
internal EVAL_ParseCtx df_eval_parse_ctx_from_process_vaddr(DI_Scope *scope, DF_Entity *process, U64 vaddr);
internal EVAL_ParseCtx df_eval_parse_ctx_from_src_loc(DI_Scope *scope, DF_Entity *file, TxtPt pt);
internal DF_Eval df_eval_from_string(Arena *arena, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, String8 string);
internal DF_Eval df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
internal DF_Eval df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
internal DF_Eval df_eval_from_eval_cfg_table(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgTable *cfg);
internal DF_Eval df_eval_from_eval_cfg_table(Arena *arena, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgTable *cfg);
////////////////////////////////
//~ rjf: Evaluation Views
@@ -1604,8 +1623,8 @@ internal DF_EvalLinkBaseArray df_eval_link_base_array_from_chunk_list(Arena *are
internal DF_EvalVizBlock *df_eval_viz_block_begin(Arena *arena, DF_EvalVizBlockKind kind, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth);
internal DF_EvalVizBlock *df_eval_viz_block_split_and_continue(Arena *arena, DF_EvalVizBlockList *list, DF_EvalVizBlock *split_block, U64 split_idx);
internal void df_eval_viz_block_end(DF_EvalVizBlockList *list, DF_EvalVizBlock *block);
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalView *view, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out);
internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView *view, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out);
internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
internal void df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBlockList *to_push);
//- rjf: viz block list <-> table coordinates
@@ -1658,7 +1677,9 @@ internal String8 df_info_summary_from_string(Architecture arch, String8 string);
//- rjf: entity kind cache
internal DF_EntityList df_query_cached_entity_list_with_kind(DF_EntityKind kind);
internal DF_EntityList df_push_active_binary_list(Arena *arena);
//- rjf: active entity based queries
internal DI_KeyList df_push_active_dbgi_key_list(Arena *arena);
internal DF_EntityList df_push_active_target_list(Arena *arena);
//- rjf: per-run caches
@@ -1666,8 +1687,8 @@ internal CTRL_Unwind df_query_cached_unwind_from_thread(DF_Entity *thread);
internal U64 df_query_cached_rip_from_thread(DF_Entity *thread);
internal U64 df_query_cached_rip_from_thread_unwind(DF_Entity *thread, U64 unwind_count);
internal U64 df_query_cached_tls_base_vaddr_from_process_root_rip(DF_Entity *process, U64 root_vaddr, U64 rip_vaddr);
internal EVAL_String2NumMap *df_query_cached_locals_map_from_binary_voff(DF_Entity *binary, U64 voff);
internal EVAL_String2NumMap *df_query_cached_member_map_from_binary_voff(DF_Entity *binary, U64 voff);
internal EVAL_String2NumMap *df_query_cached_locals_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
internal EVAL_String2NumMap *df_query_cached_member_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
//- rjf: top-level command dispatch
internal void df_push_cmd__root(DF_CmdParams *params, DF_CmdSpec *spec);
+52 -31
View File
@@ -26,10 +26,9 @@ DF_EntityKindTable:
//- rjf: filesystem modeling
{File file 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "File" }
{OverrideFileLink override_file_link 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Override File Link" }
{PendingFileChange pending_file_change 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Pending File Change" }
//- rjf: diagnostics log
{DiagLog diag_log 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Diagnostics Log" }
//- rjf: auto view rules
{AutoViewRule auto_view_rule 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 "Label" Binoculars "Auto View Rule" }
//- rjf: text attachments
{FlashMarker flash_marker 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Flash Marker" }
@@ -56,8 +55,8 @@ DF_EntityKindTable:
{Process process 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Threads "Process" }
{Thread thread 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Thread "Thread" }
{Module module 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Module" }
{DebugInfoOverride debug_info_override 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 "Label" Null "Debug Info Override" }
{PendingThreadName pending_thread_name 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Threads "Pending Thread Name" }
{DebugInfoPath debug_info_path 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Debug Info Path" }
//- rjf: parser task entities
{ConversionTask conversion_task 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Conversion Task" }
@@ -85,12 +84,15 @@ DF_CmdParamSlotTable:
{TextPoint text_point `TxtPt`}
{CmdSpec cmd_spec `struct DF_CmdSpec *`}
{ViewSpec view_spec `struct DF_ViewSpec *`}
{CfgNode cfg_node `struct DF_CfgNode *`}
{OSEvent os_event `struct OS_Event *`}
{VirtualAddr vaddr `U64`}
{VirtualOff voff `U64`}
{Index index `U64`}
{ID id `U64`}
{PreferDisassembly prefer_dasm `B32`}
{ForceConfirm force_confirm `B32`}
{Dir2 dir2 `Dir2`}
}
@table(name lister_omit q_slot q_ent_kind q_allow_files q_allow_folders q_keep_oi q_select_oi q_is_code q_required canonical_icon string display_name desc search_tags )
@@ -109,6 +111,9 @@ DF_CoreCmdTable:// | | |
//- rjf: notifications
{Error 1 Null Nil 0 0 0 0 0 0 Null "error" "Error" "Notifies of an error." "" }
//- rjf: os event passthrough
{OSEvent 1 Null Nil 0 0 0 0 0 0 Null "os_event" "OS Event" "" "" }
//- rjf: low-level target control operations
{LaunchAndRun 0 EntityList Target 0 0 0 0 0 1 Play "launch_and_run" "Launch and Run" "Starts debugging a new instance of a target, then runs." "launch,start,run,target" }
{LaunchAndInit 0 EntityList Target 0 0 0 0 0 1 PlayStepForward "launch_and_init" "Launch and Initialize" "Starts debugging a new instance of a target, then stops at the program's entry point." "launch,start,entry,point" }
@@ -172,8 +177,12 @@ DF_CoreCmdTable:// | | |
//- rjf: panel splitting
{ResetToDefaultPanels 0 Null Nil 0 0 0 0 0 0 Window "reset_to_default_panels" "Reset To Default Panel Layout" "Resets the window to the default panel layout." "panel" }
{NewPanelRight 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_right" "Split Panel Vertically" "Creates a new panel to the right of the active panel." "panel" }
{NewPanelDown 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_down" "Split Panel Horizontally" "Creates a new panel at the bottom of the active panel." "panel" }
{ResetToCompactPanels 0 Null Nil 0 0 0 0 0 0 Window "reset_to_compact_panels" "Reset To Compact Panel Layout" "Resets the window to the compact panel layout." "panel" }
{NewPanelLeft 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_left" "Split Panel Left" "Creates a new panel to the left of the active panel." "panel" }
{NewPanelUp 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_up" "Split Panel Up" "Creates a new panel at the top of the active panel." "panel" }
{NewPanelRight 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_right" "Split Panel Right" "Creates a new panel to the right of the active panel." "panel" }
{NewPanelDown 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_down" "Split Panel Down" "Creates a new panel at the bottom of the active panel." "panel" }
{SplitPanel 1 Null Nil 0 0 0 0 0 0 Null "split_panel" "Split Panel" "Creates a new panel in a given direction, and moves a tab to it, if specified." "" }
//- rjf: panel rotation
{RotatePanelColumns 0 Null Nil 0 0 0 0 0 0 Null "rotate_panel_columns" "Rotate Panel Columns" "Rotates all panels at the closest column level of the panel hierarchy." "" }
@@ -222,6 +231,10 @@ DF_CoreCmdTable:// | | |
{SetFileOverrideLinkDst 1 Null Nil 0 0 0 0 0 0 Null "set_file_override_link_dst" "Set File Override Link Destination" "Sets the destination path for an override file link." "" }
{SetFileReplacementPath 1 Null Nil 0 0 0 0 0 0 Null "set_file_replacement_path" "Set File Replacement Path" "Sets the path which should be used as the replacement for the passed file." "" }
//- rjf: auto view rules
{SetAutoViewRuleType 1 Null Nil 0 0 0 0 0 0 Null "set_auto_view_rule_type" "Set Auto View Rule Type" "Sets the type for an auto view rule." "" }
{SetAutoViewRuleViewRule 1 Null Nil 0 0 0 0 0 0 Null "set_auto_view_rule_view_rule""Set Auto View Rule View Rule" "Sets the view rule string for an auto view rule." "" }
//- rjf: setting config paths
{OpenUser 0 FilePath Nil 1 0 0 0 0 1 Person "open_user" "Open User" "Opens a user file path, immediately loading it, and begins autosaving to it." "load,user,profile,layout" }
{OpenProfile 0 FilePath Nil 1 0 0 0 0 1 Briefcase "open_profile" "Open Profile" "Opens a profile file path, immediately loading it, and begins autosaving to it." "profile,project,session" }
@@ -234,6 +247,11 @@ DF_CoreCmdTable:// | | |
{WriteUserData 1 Null Nil 0 0 0 0 0 0 Null "write_user_data" "Write User Data" "Writes user data to the active user file." "" }
{WriteProfileData 1 Null Nil 0 0 0 0 0 0 Null "write_profile_data" "Write Profile Data" "Writes profile data to the active profile file." "" }
//- rjf: meta controls
{Edit 0 Null Nil 0 0 0 0 0 0 Pencil "edit" "Edit" "Edits the current selection." "" }
{Accept 0 Null Nil 0 0 0 0 0 0 CheckFilled "accept" "Accept" "Accepts current changes, or answers prompts in the affirmative." "" }
{Cancel 0 Null Nil 0 0 0 0 0 0 X "cancel" "Cancel" "Rejects current changes, exits temporary menus, or answers prompts in the negative." "" }
//- rjf: directional movement & text controls
{MoveLeft 0 Null Nil 0 0 0 0 0 0 Null "move_left" "Move Left" "Moves the cursor or selection left." "" }
{MoveRight 0 Null Nil 0 0 0 0 0 0 Null "move_right" "Move Right" "Moves the cursor or selection right." "" }
@@ -259,6 +277,8 @@ DF_CoreCmdTable:// | | |
{MoveDownPageSelect 0 Null Nil 0 0 0 0 0 0 Null "move_down_page_select" "Move Down Page Select" "Moves the cursor or selection down one page, while selecting." "" }
{MoveUpWholeSelect 0 Null Nil 0 0 0 0 0 0 Null "move_up_whole_select" "Move Up Whole Select" "Moves the cursor or selection to the beginning of the relevant content, while selecting." "" }
{MoveDownWholeSelect 0 Null Nil 0 0 0 0 0 0 Null "move_down_whole_select" "Move Down Whole Select" "Moves the cursor or selection to the end of the relevant content, while selecting." "" }
{MoveUpReorder 0 Null Nil 0 0 0 0 0 0 Null "move_up_reorder" "Move Up Reorder" "Moves the cursor or selection up, while swapping the currently selected element with that upward." "" }
{MoveDownReorder 0 Null Nil 0 0 0 0 0 0 Null "move_down_reorder" "Move Down Reorder" "Moves the cursor or selection down, while swapping the currently selected element with that downward." "" }
{MoveHome 0 Null Nil 0 0 0 0 0 0 Null "move_home" "Move Home" "Moves the cursor to the beginning of the line." "" }
{MoveEnd 0 Null Nil 0 0 0 0 0 0 Null "move_end" "Move End" "Moves the cursor to the end of the line." "" }
{MoveHomeSelect 0 Null Nil 0 0 0 0 0 0 Null "move_home_select" "Move Home Select" "Moves the cursor to the beginning of the line, while selecting." "" }
@@ -313,7 +333,7 @@ DF_CoreCmdTable:// | | |
{DuplicateEntity 1 Null Nil 0 0 0 0 0 0 Null "duplicate_entity" "Duplicate Entity" "Duplicates an entity." "" }
//- rjf: breakpoints
{TextBreakpoint 1 Null Nil 0 0 0 0 0 0 CircleFilled "text_breakpoint" "Text Breakpoint" "Places or removes a breakpoint on the specified line of source code." "" }
{TextBreakpoint 1 FilePath Nil 0 0 0 0 0 0 CircleFilled "text_breakpoint" "Text Breakpoint" "Places or removes a breakpoint on the specified line of source code." "" }
{AddressBreakpoint 0 VirtualAddr Nil 0 0 0 0 1 1 CircleFilled "address_breakpoint" "Address Breakpoint" "Places or removes a breakpoint on the specified address." "" }
{FunctionBreakpoint 0 String Nil 0 0 0 0 1 1 CircleFilled "function_breakpoint" "Function Breakpoint" "Places or removes a breakpoint on the first address(es) of the specified function." "" }
{ToggleBreakpointAtCursor 0 Null Nil 0 0 0 0 0 0 CircleFilled "toggle_breakpoint_cursor" "Toggle Breakpoint At Cursor" "Places or removes a breakpoint on the line on which the active cursor sits." "" }
@@ -351,10 +371,12 @@ DF_CoreCmdTable:// | | |
{ClearFilter 0 Null Nil 0 0 0 0 0 0 Find "clear_filter" "Clear Filter" "Clears the filter applied to the active view." "sort,search,filter,find,clear" }
//- rjf: view drivers
{GettingStarted 0 Null Nil 0 0 0 0 0 0 QuestionMark "getting_started" "Getting Started" "Opens the menu for information on getting started." "tutorial,help" }
{Commands 1 Null Nil 0 0 0 0 0 0 List "commands" "Commands" "Opens the list of all commands." "" }
{Target 1 Null Nil 0 0 0 0 0 0 Target "target" "Target" "Opens the editor for a target." "" }
{Targets 0 Null Nil 0 0 0 0 0 0 Target "targets" "Targets" "Opens the list of all targets." "" }
{FilePathMap 0 Null Nil 0 0 0 0 0 0 FileOutline "file_path_map" "File Path Map" "Opens the file path mapping editor." "" }
{AutoViewRules 0 Null Nil 0 0 0 0 0 0 Binoculars "auto_view_rules" "Auto View Rules" "Opens the auto view rule editor." "" }
{Scheduler 0 Null Nil 0 0 0 0 0 0 Scheduler "scheduler" "Scheduler" "Opens the scheduler view, for process and thread controls." "threads,processes,targets" }
{CallStack 0 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread" }
{Modules 0 Null Nil 0 0 0 0 0 0 Module "modules" "Modules" "Opens the modules view." "" }
@@ -454,12 +476,10 @@ DF_CoreCmdTable:// | | |
// rows, this stage offers the ability to build a ui
// stretching over all of the rows.
//
// whole ui build, "wu" -> sometimes, more sophisticated interfaces need to be
// provided for a view rule, that stretch beyond the
// limits of what could be offered inside a watch
// window block. in such cases, the eval/view-rule
// combo will be granted its own tab for example, and
// this stage is used to fill such a ui.
// tab ui build, "tu" -> when a view rule also wants to implement ui for a
// dedicated tab, it can supply hooks for that as well
// in which case an eval/view-rule can be opened in a
// fully fledged, dedicated ui
//
// A few other bits are included for various ways in which a view rule may be
// applied throughout the eval visualization pipeline. A list follows:
@@ -480,25 +500,26 @@ DF_CoreCmdTable:// | | |
// For any view rules in this layer which also have graphical features, they
// are specified in both tables under the same name.
@table(name name_lower string ih ex er vb display_name docs description)
@table(name name_lower string ih ex er vb display_name docs schema description)
DF_CoreViewRuleTable:
{
{Null null "" - - - - "" - "" }
{Array array "array" - - x - "Array" x "Specifies that a pointer points to N elements, rather than only 1." }
{List list "list" - - - x "List" x "Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list." }
{ByteSwap bswap "bswap" x - x - "Byte Swap" x "Specifies that all integer primitives should be byte-swapped, such that their endianness is reversed." }
{BaseDec base_dec "dec" x - - - "Decimal Base (Base 10)" x "Specifies that all integral evaluations should appear in base-10 form." }
{BaseBin base_bin "bin" x - - - "Binary Base (Base 2)" x "Specifies that all integral evaluations should appear in base-2 form." }
{BaseOct base_oct "oct" x - - - "Octal Base (Base 8)" x "Specifies that all integral evaluations should appear in base-8 form." }
{BaseHex base_hex "hex" x - - - "Hexadecimal Base (Base 16)" x "Specifies that all integral evaluations should appear in base-16 form." }
{Only only "only" x - - x "Only Specified Members" x "Specifies that only the specified members should appear in struct, union, or class evaluations." }
{Omit omit "omit" x - - x "Omit Specified Members" x "Omits a list of member names from appearing in struct, union, or class evaluations." }
{NoAddr no_addr "no_addr" x - - - "Disable Address Values" x "Displays only what pointers point to, if possible, without the pointer's address value." }
{RGBA rgba "rgba" - x - x "Color (RGBA)" x "Displays as a color, interpreting the data as encoding R, G, B, and A values." }
{Text text "text" - x - x "Text" x "Displays as text." }
{Disasm disasm "disasm" - x - x "Disassembly" x "Displays as disassembled instructions, interpreting the data as raw machine code." }
{Bitmap bitmap "bitmap" - x - x "Bitmap" x "Displays as a bitmap, interpreting the data as raw pixel data." }
{Geo geo "geo" - x - x "Geometry" x "Displays as geometry, interpreting the data as vertex data." }
{Null null "" - - - - "" - "" "" }
{Array array "array" - - x - "Array" x "x:{expr}" "Specifies that a pointer points to N elements, rather than only 1." }
{List list "list" - - - x "List" x "x:{member}" "Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list." }
{ByteSwap bswap "bswap" x - x - "Byte Swap" x "" "Specifies that all integer primitives should be byte-swapped, such that their endianness is reversed." }
{BaseDec base_dec "dec" x - - - "Decimal Base (Base 10)" x "" "Specifies that all integral evaluations should appear in base-10 form." }
{BaseBin base_bin "bin" x - - - "Binary Base (Base 2)" x "" "Specifies that all integral evaluations should appear in base-2 form." }
{BaseOct base_oct "oct" x - - - "Octal Base (Base 8)" x "" "Specifies that all integral evaluations should appear in base-8 form." }
{BaseHex base_hex "hex" x - - - "Hexadecimal Base (Base 16)" x "" "Specifies that all integral evaluations should appear in base-16 form." }
{Only only "only" x - - x "Only Specified Members" x "x:{member}" "Specifies that only the specified members should appear in struct, union, or class evaluations." }
{Omit omit "omit" x - - x "Omit Specified Members" x "x:{member}" "Omits a list of member names from appearing in struct, union, or class evaluations." }
{NoAddr no_addr "no_addr" x - - - "Disable Address Values" x "" "Displays only what pointers point to, if possible, without the pointer's address value." }
{RGBA rgba "rgba" - x - x "Color (RGBA)" x "" "Displays as a color, interpreting the data as encoding R, G, B, and A values." }
{Text text "text" - x - x "Text" x "x:{'lang':lang, 'size':expr}" "Displays as text." }
{Disasm disasm "disasm" - x - x "Disassembly" x "x:{'arch':arch, 'size':expr}" "Displays as disassembled instructions, interpreting the data as raw machine code." }
{Graph graph "graph" - x - x "Graph" x "" "Displays as a pointer graph, visualizing nodes and edges formed by pointers directly." }
{Bitmap bitmap "bitmap" - x - x "Bitmap" x "x:{'w':expr, 'h':expr, 'fmt':tex2dformat}" "Displays as a bitmap, interpreting the data as raw pixel data." }
{Geo geo "geo" - x - x "Geometry" x "x:{'count':expr, 'vertices_base':expr, 'vertices_size':expr}" "Displays as geometry, interpreting the data as vertex data." }
}
////////////////////////////////
@@ -1807,7 +1828,7 @@ DF_DevToggleTable:
@data(DF_CoreViewRuleSpecInfo) @c_file df_g_core_view_rule_spec_info_table:
{
@expand(DF_CoreViewRuleTable a)
```{str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.description)"), (DF_CoreViewRuleSpecInfoFlag_Inherited*$(a.ih == "x"))|(DF_CoreViewRuleSpecInfoFlag_Expandable*$(a.ex == "x"))|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*$(a.er == "x"))|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*$(a.vb == "x")), $(a.er == "x" -> "DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME("..a.name_lower..")") $(a.er != "x" -> 0), $(a.vb == "x" -> "DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vb != "x" -> 0), }```;
```{str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.schema)"), str8_lit_comp("$(a.description)"), (DF_CoreViewRuleSpecInfoFlag_Inherited*$(a.ih == "x"))|(DF_CoreViewRuleSpecInfoFlag_Expandable*$(a.ex == "x"))|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*$(a.er == "x"))|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*$(a.vb == "x")), $(a.er == "x" -> "DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME("..a.name_lower..")") $(a.er != "x" -> 0), $(a.vb == "x" -> "DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vb != "x" -> 0), }```;
}
//- rjf: icon kinds
+51 -38
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
Rng1U64 df_g_cmd_param_slot_range_table[19] =
Rng1U64 df_g_cmd_param_slot_range_table[22] =
{
{0},
{OffsetOf(DF_CmdParams, window), OffsetOf(DF_CmdParams, window) + sizeof(DF_Handle)},
@@ -19,23 +19,25 @@ Rng1U64 df_g_cmd_param_slot_range_table[19] =
{OffsetOf(DF_CmdParams, text_point), OffsetOf(DF_CmdParams, text_point) + sizeof(TxtPt)},
{OffsetOf(DF_CmdParams, cmd_spec), OffsetOf(DF_CmdParams, cmd_spec) + sizeof(struct DF_CmdSpec *)},
{OffsetOf(DF_CmdParams, view_spec), OffsetOf(DF_CmdParams, view_spec) + sizeof(struct DF_ViewSpec *)},
{OffsetOf(DF_CmdParams, cfg_node), OffsetOf(DF_CmdParams, cfg_node) + sizeof(struct DF_CfgNode *)},
{OffsetOf(DF_CmdParams, os_event), OffsetOf(DF_CmdParams, os_event) + sizeof(struct OS_Event *)},
{OffsetOf(DF_CmdParams, vaddr), OffsetOf(DF_CmdParams, vaddr) + sizeof(U64)},
{OffsetOf(DF_CmdParams, voff), OffsetOf(DF_CmdParams, voff) + sizeof(U64)},
{OffsetOf(DF_CmdParams, index), OffsetOf(DF_CmdParams, index) + sizeof(U64)},
{OffsetOf(DF_CmdParams, id), OffsetOf(DF_CmdParams, id) + sizeof(U64)},
{OffsetOf(DF_CmdParams, prefer_dasm), OffsetOf(DF_CmdParams, prefer_dasm) + sizeof(B32)},
{OffsetOf(DF_CmdParams, force_confirm), OffsetOf(DF_CmdParams, force_confirm) + sizeof(B32)},
{OffsetOf(DF_CmdParams, dir2), OffsetOf(DF_CmdParams, dir2) + sizeof(Dir2)},
};
DF_IconKind df_g_entity_kind_icon_kind_table[26] =
DF_IconKind df_g_entity_kind_icon_kind_table[25] =
{
DF_IconKind_Null,
DF_IconKind_Null,
DF_IconKind_Machine,
DF_IconKind_FileOutline,
DF_IconKind_FileOutline,
DF_IconKind_FileOutline,
DF_IconKind_FileOutline,
DF_IconKind_Binoculars,
DF_IconKind_Null,
DF_IconKind_Pin,
DF_IconKind_CircleFilled,
@@ -50,22 +52,21 @@ DF_IconKind_Null,
DF_IconKind_Threads,
DF_IconKind_Thread,
DF_IconKind_Module,
DF_IconKind_Null,
DF_IconKind_Threads,
DF_IconKind_Module,
DF_IconKind_Null,
DF_IconKind_Null,
DF_IconKind_Null,
};
String8 df_g_entity_kind_display_string_table[26] =
String8 df_g_entity_kind_display_string_table[25] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Root"),
str8_lit_comp("Machine"),
str8_lit_comp("File"),
str8_lit_comp("Override File Link"),
str8_lit_comp("Pending File Change"),
str8_lit_comp("Diagnostics Log"),
str8_lit_comp("Auto View Rule"),
str8_lit_comp("Flash Marker"),
str8_lit_comp("Watch Pin"),
str8_lit_comp("Breakpoint"),
@@ -80,14 +81,14 @@ str8_lit_comp("Destination"),
str8_lit_comp("Process"),
str8_lit_comp("Thread"),
str8_lit_comp("Module"),
str8_lit_comp("Debug Info Override"),
str8_lit_comp("Pending Thread Name"),
str8_lit_comp("Debug Info Path"),
str8_lit_comp("Conversion Task"),
str8_lit_comp("Conversion Failure"),
str8_lit_comp("EndedProcess"),
};
String8 df_g_entity_kind_name_label_table[26] =
String8 df_g_entity_kind_name_label_table[25] =
{
str8_lit_comp("Label"),
str8_lit_comp("Label"),
@@ -96,7 +97,6 @@ str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
@@ -117,15 +117,14 @@ str8_lit_comp("Label"),
str8_lit_comp("Label"),
};
DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
DF_EntityKindFlags df_g_entity_kind_flags_table[25] =
{
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProfileConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
@@ -140,14 +139,14 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 1*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 1*DF_EntityKindFlag_TreeMutationSoftHalt | 1*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
};
DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
DF_EntityOpFlags df_g_entity_kind_op_flags_table[25] =
{
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
@@ -156,7 +155,6 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (1*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
@@ -209,12 +207,13 @@ DF_CoreCmdKind_Null,
DF_CoreCmdKind_Null,
};
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[220] =
{
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
{ str8_lit_comp("run_command"), str8_lit_comp("Runs a command from the command palette."), str8_lit_comp("help,cmd"), str8_lit_comp("Run Command"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_CmdSpec, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("error"), str8_lit_comp("Notifies of an error."), str8_lit_comp(""), str8_lit_comp("Error"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("os_event"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("OS Event"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), str8_lit_comp("Launch and Run"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Target, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Play},
{ str8_lit_comp("launch_and_init"), str8_lit_comp("Starts debugging a new instance of a target, then stops at the program's entry point."), str8_lit_comp("launch,start,entry,point"), str8_lit_comp("Launch and Initialize"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Target, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_PlayStepForward},
{ str8_lit_comp("kill"), str8_lit_comp("Kills the specified existing debugged process(es)."), str8_lit_comp("stop,kill"), str8_lit_comp("Kill"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_EntityList, DF_EntityKind_Process, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Stop},
@@ -263,8 +262,12 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("confirm_accept"), str8_lit_comp("Accepts the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Accept"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("confirm_cancel"), str8_lit_comp("Cancels the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Cancel"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("reset_to_default_panels"), str8_lit_comp("Resets the window to the default panel layout."), str8_lit_comp("panel"), str8_lit_comp("Reset To Default Panel Layout"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Window},
{ str8_lit_comp("new_panel_right"), str8_lit_comp("Creates a new panel to the right of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Vertically"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
{ str8_lit_comp("new_panel_down"), str8_lit_comp("Creates a new panel at the bottom of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Horizontally"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
{ str8_lit_comp("reset_to_compact_panels"), str8_lit_comp("Resets the window to the compact panel layout."), str8_lit_comp("panel"), str8_lit_comp("Reset To Compact Panel Layout"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Window},
{ str8_lit_comp("new_panel_left"), str8_lit_comp("Creates a new panel to the left of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Left"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
{ str8_lit_comp("new_panel_up"), str8_lit_comp("Creates a new panel at the top of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Up"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
{ str8_lit_comp("new_panel_right"), str8_lit_comp("Creates a new panel to the right of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Right"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
{ str8_lit_comp("new_panel_down"), str8_lit_comp("Creates a new panel at the bottom of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Down"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
{ str8_lit_comp("split_panel"), str8_lit_comp("Creates a new panel in a given direction, and moves a tab to it, if specified."), str8_lit_comp(""), str8_lit_comp("Split Panel"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("rotate_panel_columns"), str8_lit_comp("Rotates all panels at the closest column level of the panel hierarchy."), str8_lit_comp(""), str8_lit_comp("Rotate Panel Columns"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("next_panel"), str8_lit_comp("Cycles the active panel forward."), str8_lit_comp(""), str8_lit_comp("Focus Next Panel"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_RightArrow},
{ str8_lit_comp("prev_panel"), str8_lit_comp("Cycles the active panel backwards."), str8_lit_comp(""), str8_lit_comp("Focus Previous Panel"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_LeftArrow},
@@ -296,12 +299,17 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("set_file_override_link_src"), str8_lit_comp("Sets the source path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Source"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("set_file_override_link_dst"), str8_lit_comp("Sets the destination path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Destination"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("set_file_replacement_path"), str8_lit_comp("Sets the path which should be used as the replacement for the passed file."), str8_lit_comp(""), str8_lit_comp("Set File Replacement Path"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("set_auto_view_rule_type"), str8_lit_comp("Sets the type for an auto view rule."), str8_lit_comp(""), str8_lit_comp("Set Auto View Rule Type"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("set_auto_view_rule_view_rule"), str8_lit_comp("Sets the view rule string for an auto view rule."), str8_lit_comp(""), str8_lit_comp("Set Auto View Rule View Rule"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("open_user"), str8_lit_comp("Opens a user file path, immediately loading it, and begins autosaving to it."), str8_lit_comp("load,user,profile,layout"), str8_lit_comp("Open User"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Person},
{ str8_lit_comp("open_profile"), str8_lit_comp("Opens a profile file path, immediately loading it, and begins autosaving to it."), str8_lit_comp("profile,project,session"), str8_lit_comp("Open Profile"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Briefcase},
{ str8_lit_comp("apply_user_data"), str8_lit_comp("Applies user data from the active user file."), str8_lit_comp(""), str8_lit_comp("Apply User Data"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("apply_profile_data"), str8_lit_comp("Applies profile data from the active profile file."), str8_lit_comp(""), str8_lit_comp("Apply Profile Data"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("write_user_data"), str8_lit_comp("Writes user data to the active user file."), str8_lit_comp(""), str8_lit_comp("Write User Data"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("write_profile_data"), str8_lit_comp("Writes profile data to the active profile file."), str8_lit_comp(""), str8_lit_comp("Write Profile Data"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("edit"), str8_lit_comp("Edits the current selection."), str8_lit_comp(""), str8_lit_comp("Edit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Pencil},
{ str8_lit_comp("accept"), str8_lit_comp("Accepts current changes, or answers prompts in the affirmative."), str8_lit_comp(""), str8_lit_comp("Accept"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CheckFilled},
{ str8_lit_comp("cancel"), str8_lit_comp("Rejects current changes, exits temporary menus, or answers prompts in the negative."), str8_lit_comp(""), str8_lit_comp("Cancel"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
{ str8_lit_comp("move_left"), str8_lit_comp("Moves the cursor or selection left."), str8_lit_comp(""), str8_lit_comp("Move Left"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_right"), str8_lit_comp("Moves the cursor or selection right."), str8_lit_comp(""), str8_lit_comp("Move Right"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_up"), str8_lit_comp("Moves the cursor or selection up."), str8_lit_comp(""), str8_lit_comp("Move Up"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
@@ -326,6 +334,8 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("move_down_page_select"), str8_lit_comp("Moves the cursor or selection down one page, while selecting."), str8_lit_comp(""), str8_lit_comp("Move Down Page Select"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_up_whole_select"), str8_lit_comp("Moves the cursor or selection to the beginning of the relevant content, while selecting."), str8_lit_comp(""), str8_lit_comp("Move Up Whole Select"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_down_whole_select"), str8_lit_comp("Moves the cursor or selection to the end of the relevant content, while selecting."), str8_lit_comp(""), str8_lit_comp("Move Down Whole Select"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_up_reorder"), str8_lit_comp("Moves the cursor or selection up, while swapping the currently selected element with that upward."), str8_lit_comp(""), str8_lit_comp("Move Up Reorder"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_down_reorder"), str8_lit_comp("Moves the cursor or selection down, while swapping the currently selected element with that downward."), str8_lit_comp(""), str8_lit_comp("Move Down Reorder"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_home"), str8_lit_comp("Moves the cursor to the beginning of the line."), str8_lit_comp(""), str8_lit_comp("Move Home"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_end"), str8_lit_comp("Moves the cursor to the end of the line."), str8_lit_comp(""), str8_lit_comp("Move End"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("move_home_select"), str8_lit_comp("Moves the cursor to the beginning of the line, while selecting."), str8_lit_comp(""), str8_lit_comp("Move Home Select"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
@@ -364,7 +374,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("name_entity"), str8_lit_comp("Equips an entity with a name."), str8_lit_comp(""), str8_lit_comp("Name Entity"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("edit_entity"), str8_lit_comp("Opens the editor for an entity."), str8_lit_comp(""), str8_lit_comp("Edit Entity"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("duplicate_entity"), str8_lit_comp("Duplicates an entity."), str8_lit_comp(""), str8_lit_comp("Duplicate Entity"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
{ str8_lit_comp("text_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the specified line of source code."), str8_lit_comp(""), str8_lit_comp("Text Breakpoint"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("text_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the specified line of source code."), str8_lit_comp(""), str8_lit_comp("Text Breakpoint"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("address_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the specified address."), str8_lit_comp(""), str8_lit_comp("Address Breakpoint"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_VirtualAddr, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*1)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("function_breakpoint"), str8_lit_comp("Places or removes a breakpoint on the first address(es) of the specified function."), str8_lit_comp(""), str8_lit_comp("Function Breakpoint"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_String, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*1)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_CircleFilled},
{ str8_lit_comp("toggle_breakpoint_cursor"), str8_lit_comp("Places or removes a breakpoint on the line on which the active cursor sits."), str8_lit_comp(""), str8_lit_comp("Toggle Breakpoint At Cursor"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_CircleFilled},
@@ -388,10 +398,12 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("filter"), str8_lit_comp("Begins filtering the active view."), str8_lit_comp("sort,search,filter,find"), str8_lit_comp("Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
{ str8_lit_comp("apply_filter"), str8_lit_comp("Applies the typed filter to the active view."), str8_lit_comp("sort,search,filter,find,apply"), str8_lit_comp("Apply Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
{ str8_lit_comp("clear_filter"), str8_lit_comp("Clears the filter applied to the active view."), str8_lit_comp("sort,search,filter,find,clear"), str8_lit_comp("Clear Filter"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Find},
{ str8_lit_comp("getting_started"), str8_lit_comp("Opens the menu for information on getting started."), str8_lit_comp("tutorial,help"), str8_lit_comp("Getting Started"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_QuestionMark},
{ str8_lit_comp("commands"), str8_lit_comp("Opens the list of all commands."), str8_lit_comp(""), str8_lit_comp("Commands"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_List},
{ str8_lit_comp("target"), str8_lit_comp("Opens the editor for a target."), str8_lit_comp(""), str8_lit_comp("Target"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Target},
{ str8_lit_comp("targets"), str8_lit_comp("Opens the list of all targets."), str8_lit_comp(""), str8_lit_comp("Targets"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Target},
{ str8_lit_comp("file_path_map"), str8_lit_comp("Opens the file path mapping editor."), str8_lit_comp(""), str8_lit_comp("File Path Map"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
{ str8_lit_comp("auto_view_rules"), str8_lit_comp("Opens the auto view rule editor."), str8_lit_comp(""), str8_lit_comp("Auto View Rules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Binoculars},
{ str8_lit_comp("scheduler"), str8_lit_comp("Opens the scheduler view, for process and thread controls."), str8_lit_comp("threads,processes,targets"), str8_lit_comp("Scheduler"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Scheduler},
{ str8_lit_comp("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread"), str8_lit_comp("Call Stack"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
{ str8_lit_comp("modules"), str8_lit_comp("Opens the modules view."), str8_lit_comp(""), str8_lit_comp("Modules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Module},
@@ -419,24 +431,25 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
{ str8_lit_comp("toggle_dev_menu"), str8_lit_comp("Opens and closes the developer menu."), str8_lit_comp(""), str8_lit_comp("Toggle Developer Menu"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
};
DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[16] =
DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[17] =
{
{str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(array) , 0, },
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(list) , },
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp("Specifies that all integer primitives should be byte-swapped, such that their endianness is reversed."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(bswap) , 0, },
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("bin"), str8_lit_comp("Binary Base (Base 2)"), str8_lit_comp("Specifies that all integral evaluations should appear in base-2 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("oct"), str8_lit_comp("Octal Base (Base 8)"), str8_lit_comp("Specifies that all integral evaluations should appear in base-8 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("hex"), str8_lit_comp("Hexadecimal Base (Base 16)"), str8_lit_comp("Specifies that all integral evaluations should appear in base-16 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("only"), str8_lit_comp("Only Specified Members"), str8_lit_comp("Specifies that only the specified members should appear in struct, union, or class evaluations."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(only) , },
{str8_lit_comp("omit"), str8_lit_comp("Omit Specified Members"), str8_lit_comp("Omits a list of member names from appearing in struct, union, or class evaluations."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(omit) , },
{str8_lit_comp("no_addr"), str8_lit_comp("Disable Address Values"), str8_lit_comp("Displays only what pointers point to, if possible, without the pointer's address value."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(rgba) , },
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("Displays as text."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(text) , },
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , },
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , },
{str8_lit_comp("geo"), str8_lit_comp("Geometry"), str8_lit_comp("Displays as geometry, interpreting the data as vertex data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo) , },
{str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("x:{expr}"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(array) , 0, },
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(list) , },
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp(""), str8_lit_comp("Specifies that all integer primitives should be byte-swapped, such that their endianness is reversed."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(bswap) , 0, },
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("bin"), str8_lit_comp("Binary Base (Base 2)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-2 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("oct"), str8_lit_comp("Octal Base (Base 8)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-8 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("hex"), str8_lit_comp("Hexadecimal Base (Base 16)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-16 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("only"), str8_lit_comp("Only Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that only the specified members should appear in struct, union, or class evaluations."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(only) , },
{str8_lit_comp("omit"), str8_lit_comp("Omit Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Omits a list of member names from appearing in struct, union, or class evaluations."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(omit) , },
{str8_lit_comp("no_addr"), str8_lit_comp("Disable Address Values"), str8_lit_comp(""), str8_lit_comp("Displays only what pointers point to, if possible, without the pointer's address value."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
{str8_lit_comp("rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(rgba) , },
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), str8_lit_comp("Displays as text."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(text) , },
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr}"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , },
{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp(""), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(graph) , },
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , },
{str8_lit_comp("geo"), str8_lit_comp("Geometry"), str8_lit_comp("x:{'count':expr, 'vertices_base':expr, 'vertices_size':expr}"), str8_lit_comp("Displays as geometry, interpreting the data as vertex data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo) , },
};
String8 df_g_icon_kind_text_table[69] =
+30 -9
View File
@@ -22,8 +22,7 @@ DF_EntityKind_Root,
DF_EntityKind_Machine,
DF_EntityKind_File,
DF_EntityKind_OverrideFileLink,
DF_EntityKind_PendingFileChange,
DF_EntityKind_DiagLog,
DF_EntityKind_AutoViewRule,
DF_EntityKind_FlashMarker,
DF_EntityKind_WatchPin,
DF_EntityKind_Breakpoint,
@@ -38,8 +37,8 @@ DF_EntityKind_Dest,
DF_EntityKind_Process,
DF_EntityKind_Thread,
DF_EntityKind_Module,
DF_EntityKind_DebugInfoOverride,
DF_EntityKind_PendingThreadName,
DF_EntityKind_DebugInfoPath,
DF_EntityKind_ConversionTask,
DF_EntityKind_ConversionFail,
DF_EntityKind_EndedProcess,
@@ -52,6 +51,7 @@ DF_CoreCmdKind_Null,
DF_CoreCmdKind_Exit,
DF_CoreCmdKind_RunCommand,
DF_CoreCmdKind_Error,
DF_CoreCmdKind_OSEvent,
DF_CoreCmdKind_LaunchAndRun,
DF_CoreCmdKind_LaunchAndInit,
DF_CoreCmdKind_Kill,
@@ -100,8 +100,12 @@ DF_CoreCmdKind_ToggleFullscreen,
DF_CoreCmdKind_ConfirmAccept,
DF_CoreCmdKind_ConfirmCancel,
DF_CoreCmdKind_ResetToDefaultPanels,
DF_CoreCmdKind_ResetToCompactPanels,
DF_CoreCmdKind_NewPanelLeft,
DF_CoreCmdKind_NewPanelUp,
DF_CoreCmdKind_NewPanelRight,
DF_CoreCmdKind_NewPanelDown,
DF_CoreCmdKind_SplitPanel,
DF_CoreCmdKind_RotatePanelColumns,
DF_CoreCmdKind_NextPanel,
DF_CoreCmdKind_PrevPanel,
@@ -133,12 +137,17 @@ DF_CoreCmdKind_SwitchToPartnerFile,
DF_CoreCmdKind_SetFileOverrideLinkSrc,
DF_CoreCmdKind_SetFileOverrideLinkDst,
DF_CoreCmdKind_SetFileReplacementPath,
DF_CoreCmdKind_SetAutoViewRuleType,
DF_CoreCmdKind_SetAutoViewRuleViewRule,
DF_CoreCmdKind_OpenUser,
DF_CoreCmdKind_OpenProfile,
DF_CoreCmdKind_ApplyUserData,
DF_CoreCmdKind_ApplyProfileData,
DF_CoreCmdKind_WriteUserData,
DF_CoreCmdKind_WriteProfileData,
DF_CoreCmdKind_Edit,
DF_CoreCmdKind_Accept,
DF_CoreCmdKind_Cancel,
DF_CoreCmdKind_MoveLeft,
DF_CoreCmdKind_MoveRight,
DF_CoreCmdKind_MoveUp,
@@ -163,6 +172,8 @@ DF_CoreCmdKind_MoveUpPageSelect,
DF_CoreCmdKind_MoveDownPageSelect,
DF_CoreCmdKind_MoveUpWholeSelect,
DF_CoreCmdKind_MoveDownWholeSelect,
DF_CoreCmdKind_MoveUpReorder,
DF_CoreCmdKind_MoveDownReorder,
DF_CoreCmdKind_MoveHome,
DF_CoreCmdKind_MoveEnd,
DF_CoreCmdKind_MoveHomeSelect,
@@ -225,10 +236,12 @@ DF_CoreCmdKind_FindCodeLocation,
DF_CoreCmdKind_Filter,
DF_CoreCmdKind_ApplyFilter,
DF_CoreCmdKind_ClearFilter,
DF_CoreCmdKind_GettingStarted,
DF_CoreCmdKind_Commands,
DF_CoreCmdKind_Target,
DF_CoreCmdKind_Targets,
DF_CoreCmdKind_FilePathMap,
DF_CoreCmdKind_AutoViewRules,
DF_CoreCmdKind_Scheduler,
DF_CoreCmdKind_CallStack,
DF_CoreCmdKind_Modules,
@@ -347,6 +360,7 @@ DF_CoreViewRuleKind_NoAddr,
DF_CoreViewRuleKind_RGBA,
DF_CoreViewRuleKind_Text,
DF_CoreViewRuleKind_Disasm,
DF_CoreViewRuleKind_Graph,
DF_CoreViewRuleKind_Bitmap,
DF_CoreViewRuleKind_Geo,
DF_CoreViewRuleKind_COUNT,
@@ -367,12 +381,15 @@ DF_CmdParamSlot_FilePath,
DF_CmdParamSlot_TextPoint,
DF_CmdParamSlot_CmdSpec,
DF_CmdParamSlot_ViewSpec,
DF_CmdParamSlot_CfgNode,
DF_CmdParamSlot_OSEvent,
DF_CmdParamSlot_VirtualAddr,
DF_CmdParamSlot_VirtualOff,
DF_CmdParamSlot_Index,
DF_CmdParamSlot_ID,
DF_CmdParamSlot_PreferDisassembly,
DF_CmdParamSlot_ForceConfirm,
DF_CmdParamSlot_Dir2,
DF_CmdParamSlot_COUNT,
} DF_CmdParamSlot;
@@ -392,12 +409,15 @@ String8 file_path;
TxtPt text_point;
struct DF_CmdSpec * cmd_spec;
struct DF_ViewSpec * view_spec;
struct DF_CfgNode * cfg_node;
struct OS_Event * os_event;
U64 vaddr;
U64 voff;
U64 index;
U64 id;
B32 prefer_dasm;
B32 force_confirm;
Dir2 dir2;
};
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array);
@@ -408,6 +428,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo);
@@ -1507,12 +1528,12 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
{&DEV_updating_indicator, str8_lit_comp("updating_indicator")},
};
C_LINKAGE_BEGIN
extern Rng1U64 df_g_cmd_param_slot_range_table[19];
extern DF_IconKind df_g_entity_kind_icon_kind_table[26];
extern String8 df_g_entity_kind_display_string_table[26];
extern String8 df_g_entity_kind_name_label_table[26];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[26];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[26];
extern Rng1U64 df_g_cmd_param_slot_range_table[22];
extern DF_IconKind df_g_entity_kind_icon_kind_table[25];
extern String8 df_g_entity_kind_display_string_table[25];
extern String8 df_g_entity_kind_name_label_table[25];
extern DF_EntityKindFlags df_g_entity_kind_flags_table[25];
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[25];
extern String8 df_g_cfg_src_string_table[4];
extern DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4];
extern DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4];
+1 -1
View File
@@ -4,4 +4,4 @@
#include "df/core/df_core.c"
#include "df/gfx/df_gfx.c"
#include "df/gfx/df_views.c"
#include "df/gfx/df_view_rule_hooks.c"
#include "df/gfx/df_view_rules.c"
+1 -1
View File
@@ -7,6 +7,6 @@
#include "df/core/df_core.h"
#include "df/gfx/df_gfx.h"
#include "df/gfx/df_views.h"
#include "df/gfx/df_view_rule_hooks.h"
#include "df/gfx/df_view_rules.h"
#endif // DEBUG_FRONTEND_INC_H
+2719 -1065
View File
File diff suppressed because it is too large Load Diff
+61 -32
View File
@@ -73,7 +73,7 @@ struct DF_View;
struct DF_Panel;
struct DF_Window;
#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(struct DF_View *view, DF_CfgNode *cfg_root)
#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(DF_Window *ws, struct DF_View *view, DF_CfgNode *cfg_root)
#define DF_VIEW_SETUP_FUNCTION_NAME(name) df_view_setup_##name
#define DF_VIEW_SETUP_FUNCTION_DEF(name) internal DF_VIEW_SETUP_FUNCTION_SIG(DF_VIEW_SETUP_FUNCTION_NAME(name))
typedef DF_VIEW_SETUP_FUNCTION_SIG(DF_ViewSetupFunctionType);
@@ -102,18 +102,27 @@ enum
DF_ViewSpecFlag_ParameterizedByEntity = (1<<0),
DF_ViewSpecFlag_CanSerialize = (1<<1),
DF_ViewSpecFlag_CanSerializeEntityPath = (1<<2),
DF_ViewSpecFlag_CanFilter = (1<<3),
DF_ViewSpecFlag_FilterIsCode = (1<<4),
DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<5),
DF_ViewSpecFlag_CanSerializeQuery = (1<<3),
DF_ViewSpecFlag_CanFilter = (1<<4),
DF_ViewSpecFlag_FilterIsCode = (1<<5),
DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<6),
};
typedef enum DF_NameKind
{
DF_NameKind_Null,
DF_NameKind_EntityName,
DF_NameKind_COUNT
}
DF_NameKind;
typedef struct DF_ViewSpecInfo DF_ViewSpecInfo;
struct DF_ViewSpecInfo
{
DF_ViewSpecFlags flags;
String8 name;
String8 display_string;
enum DF_NameKind name_kind;
DF_NameKind name_kind;
DF_IconKind icon_kind;
DF_ViewSetupFunctionType *setup_hook;
DF_ViewStringFromStateFunctionType *string_from_state_hook;
@@ -226,10 +235,10 @@ struct DF_Panel
// rjf: split data
Axis2 split_axis;
Vec2F32 off_pct_of_parent;
Vec2F32 off_pct_of_parent_target;
Vec2F32 size_pct_of_parent;
Vec2F32 size_pct_of_parent_target;
F32 pct_of_parent;
// rjf: animated rectangle data
Rng2F32 animated_rect_pct;
// rjf: tab params
Side tab_side;
@@ -281,7 +290,6 @@ enum
DF_GfxViewRuleSpecInfoFlag_LineStringize = (1<<1),
DF_GfxViewRuleSpecInfoFlag_RowUI = (1<<2),
DF_GfxViewRuleSpecInfoFlag_BlockUI = (1<<3),
DF_GfxViewRuleSpecInfoFlag_WholeUI = (1<<4),
};
#define DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(name) void name(void)
@@ -292,23 +300,18 @@ enum
#define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name) df_gfx_view_rule_line_stringize__##name
#define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(name) internal DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name))
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(DF_ExpandKey key, DF_Eval eval, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg)
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(DF_ExpandKey key, DF_Eval eval, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg)
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_gfx_view_rule_row_ui__##name
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name))
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, String8 string, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name) df_gfx_view_rule_block_ui__##name
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name))
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, struct DF_Panel *panel, struct DF_View *view, Rng2F32 rect, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg)
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name) df_gfx_view_rule_whole_ui__##name
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name))
typedef DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(DF_GfxViewRuleVizRowProdHookFunctionType);
typedef DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GfxViewRuleLineStringizeHookFunctionType);
typedef DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GfxViewRuleRowUIFunctionType);
typedef DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GfxViewRuleBlockUIFunctionType);
typedef DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GfxViewRuleWholeUIFunctionType);
typedef struct DF_GfxViewRuleSpecInfo DF_GfxViewRuleSpecInfo;
struct DF_GfxViewRuleSpecInfo
@@ -319,7 +322,7 @@ struct DF_GfxViewRuleSpecInfo
DF_GfxViewRuleLineStringizeHookFunctionType *line_stringize;
DF_GfxViewRuleRowUIFunctionType *row_ui;
DF_GfxViewRuleBlockUIFunctionType *block_ui;
DF_GfxViewRuleWholeUIFunctionType *whole_ui;
String8 tab_view_spec_name;
};
typedef struct DF_GfxViewRuleSpecInfoArray DF_GfxViewRuleSpecInfoArray;
@@ -402,7 +405,7 @@ struct DF_CodeSliceParams
DF_EntityList *line_pins;
DF_TextLineDasm2SrcInfoList *line_dasm2src;
DF_TextLineSrc2DasmInfoList *line_src2dasm;
DF_EntityList relevant_binaries;
DI_KeyList relevant_dbgi_keys;
// rjf: visual parameters
F_Tag font;
@@ -413,6 +416,7 @@ struct DF_CodeSliceParams
F32 line_num_width_px;
F32 line_text_max_width_px;
DF_EntityList flash_ranges;
F32 margin_float_off_px;
};
typedef struct DF_CodeSliceSignal DF_CodeSliceSignal;
@@ -439,9 +443,14 @@ struct DF_CodeSliceSignal
typedef U32 DF_AutoCompListerFlags;
enum
{
DF_AutoCompListerFlag_Locals = (1<<0),
DF_AutoCompListerFlag_Registers = (1<<1),
DF_AutoCompListerFlag_ViewRules = (1<<2),
DF_AutoCompListerFlag_Locals = (1<<0),
DF_AutoCompListerFlag_Registers = (1<<1),
DF_AutoCompListerFlag_ViewRules = (1<<2),
DF_AutoCompListerFlag_ViewRuleParams= (1<<3),
DF_AutoCompListerFlag_Members = (1<<4),
DF_AutoCompListerFlag_Languages = (1<<5),
DF_AutoCompListerFlag_Architectures = (1<<6),
DF_AutoCompListerFlag_Tex2DFormats = (1<<7),
};
typedef struct DF_AutoCompListerItem DF_AutoCompListerItem;
@@ -477,6 +486,13 @@ struct DF_AutoCompListerItemArray
U64 count;
};
typedef struct DF_AutoCompListerParams DF_AutoCompListerParams;
struct DF_AutoCompListerParams
{
DF_AutoCompListerFlags flags;
String8List strings;
};
////////////////////////////////
//~ rjf: Per-Window State
@@ -497,6 +513,7 @@ struct DF_Window
UI_State *ui;
F32 code_font_size_delta;
F32 main_font_size_delta;
B32 window_temporarily_focused_ipc;
// rjf: view state delta history
DF_StateDeltaHistory *view_state_hist;
@@ -522,9 +539,12 @@ struct DF_Window
// rjf: autocomplete lister state
U64 autocomp_last_frame_idx;
B32 autocomp_force_closed;
B32 autocomp_query_dirty;
UI_Key autocomp_root_key;
DF_CtrlCtx autocomp_ctrl_ctx;
DF_AutoCompListerFlags autocomp_lister_flags;
Arena *autocomp_lister_params_arena;
DF_AutoCompListerParams autocomp_lister_params;
U64 autocomp_cursor_off;
U8 autocomp_lister_query_buffer[1024];
U64 autocomp_lister_query_size;
F32 autocomp_open_t;
@@ -695,7 +715,8 @@ struct DF_GfxState
DF_DragDropState drag_drop_state;
// rjf: hover line info correllation state
DF_Handle hover_line_binary;
Arena *hover_line_arena;
DI_Key hover_line_dbgi_key;
U64 hover_line_voff;
B32 hover_line_set_this_frame;
@@ -707,6 +728,9 @@ struct DF_GfxState
String8 cfg_main_font_path;
String8 cfg_code_font_path;
F_Tag cfg_font_tags[DF_FontSlot_COUNT];
// rjf: icon texture
R_Handle icon_texture;
};
////////////////////////////////
@@ -765,6 +789,8 @@ read_only global DF_Panel df_g_nil_panel =
global DF_GfxState *df_gfx_state = 0;
global DF_DragDropPayload df_g_drag_drop_payload = {0};
global DF_Handle df_g_last_drag_drop_panel = {0};
global DF_Handle df_g_last_drag_drop_prev_tab = {0};
////////////////////////////////
//~ rjf: Basic Helpers
@@ -805,8 +831,8 @@ internal DF_PanelRec df_panel_rec_df(DF_Panel *panel, U64 sib_off, U64 child_off
#define df_panel_rec_df_post(panel) df_panel_rec_df(panel, OffsetOf(DF_Panel, prev), OffsetOf(DF_Panel, last))
//- rjf: panel -> rect calculations
internal Rng2F32 df_rect_from_panel_child(Rng2F32 parent_rect, DF_Panel *parent, DF_Panel *panel);
internal Rng2F32 df_rect_from_panel(Rng2F32 root_rect, DF_Panel *root, DF_Panel *panel);
internal Rng2F32 df_target_rect_from_panel_child(Rng2F32 parent_rect, DF_Panel *parent, DF_Panel *panel);
internal Rng2F32 df_target_rect_from_panel(Rng2F32 root_rect, DF_Panel *root, DF_Panel *panel);
//- rjf: view ownership insertion/removal
internal void df_panel_insert_tab_view(DF_Panel *panel, DF_View *prev_view, DF_View *view);
@@ -847,8 +873,8 @@ internal B32 df_drag_drop(DF_DragDropPayload *out_payload);
internal void df_drag_kill(void);
internal void df_queue_drag_drop(void);
internal void df_set_hovered_line_info(DF_Entity *binary, U64 voff);
internal DF_Entity *df_get_hovered_line_info_binary(void);
internal void df_set_hovered_line_info(DI_Key *dbgi_key, U64 voff);
internal DI_Key df_get_hovered_line_info_dbgi_key(void);
internal U64 df_get_hovered_line_info_voff(void);
////////////////////////////////
@@ -864,13 +890,14 @@ internal DF_ViewSpec *df_view_spec_from_cmd_param_slot_spec(DF_CmdParamSlot slot
internal void df_register_gfx_view_rule_specs(DF_GfxViewRuleSpecInfoArray specs);
internal DF_GfxViewRuleSpec *df_gfx_view_rule_spec_from_string(String8 string);
internal DF_ViewSpec *df_tab_view_spec_from_gfx_view_rule_spec(DF_GfxViewRuleSpec *spec);
////////////////////////////////
//~ rjf: View State Functions
internal DF_View *df_view_alloc(void);
internal void df_view_release(DF_View *view);
internal void df_view_equip_spec(DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root);
internal void df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root);
internal void df_view_equip_loading_info(DF_View *view, B32 is_loading, U64 progress_v, U64 progress_target);
internal void df_view_clear_user_state(DF_View *view);
internal void *df_view_get_or_push_user_state(DF_View *view, U64 size);
@@ -898,14 +925,14 @@ internal DF_Window *df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF
internal DF_Window *df_window_from_os_handle(OS_Handle os);
internal void df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, DF_CmdList *cmds);
internal void df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds);
////////////////////////////////
//~ rjf: Eval Viz
internal String8 df_eval_escaped_from_raw_string(Arena *arena, String8 raw);
internal String8List df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags flags, TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table);
internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
////////////////////////////////
//~ rjf: Hover Eval
@@ -920,7 +947,9 @@ internal DF_AutoCompListerItemArray df_autocomp_lister_item_array_from_chunk_lis
internal int df_autocomp_lister_item_qsort_compare(DF_AutoCompListerItem *a, DF_AutoCompListerItem *b);
internal void df_autocomp_lister_item_array_sort__in_place(DF_AutoCompListerItemArray *array);
internal void df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_CtrlCtx ctrl_ctx, DF_AutoCompListerFlags flags, String8 query);
internal String8 df_autocomp_query_word_from_input_string_off(String8 input, U64 cursor_off);
internal DF_AutoCompListerParams df_view_rule_autocomp_lister_params_from_input_cursor(Arena *arena, String8 string, U64 cursor_off);
internal void df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_CtrlCtx ctrl_ctx, DF_AutoCompListerParams *params, String8 input, U64 cursor_off);
////////////////////////////////
//~ rjf: Search Strings
+42 -33
View File
@@ -8,6 +8,7 @@
@embed_file df_g_default_main_font_bytes: "../data/Roboto-Regular.ttf"
@embed_file df_g_default_code_font_bytes: "../data/liberation-mono.ttf"
//@embed_file df_g_default_code_font_bytes: "../data/Inconsolata-Regular.ttf"
@embed_file df_g_icon_file_bytes: "../data/logo.ico"
////////////////////////////////
//~ rjf: Default Bindings
@@ -89,6 +90,11 @@ DF_DefaultBindingTable:
{ "load_user" O ctrl shift alt }
{ "load_profile" O ctrl 0 alt }
//- rjf: meta controls
{ "edit" F2 0 0 0 }
{ "accept" Return 0 0 0 }
{ "cancel" Esc 0 0 0 }
//- rjf: directional movement & text controls
{ "move_left" Left 0 0 0 }
{ "move_right" Right 0 0 0 }
@@ -114,6 +120,8 @@ DF_DefaultBindingTable:
{ "move_down_page_select" PageDown 0 shift 0 }
{ "move_up_whole_select" Home ctrl shift 0 }
{ "move_down_whole_select" End ctrl shift 0 }
{ "move_up_reorder" Up 0 0 alt }
{ "move_down_reorder" Down 0 0 alt }
{ "move_home" Home 0 0 0 }
{ "move_end" End 0 0 0 }
{ "move_home_select" Home 0 shift 0 }
@@ -124,8 +132,10 @@ DF_DefaultBindingTable:
{ "backspace_single" Backspace 0 0 0 }
{ "backspace_chunk" Backspace ctrl 0 0 }
{ "copy" C ctrl 0 0 }
{ "copy" Insert ctrl 0 0 }
{ "cut" X ctrl 0 0 }
{ "paste" V ctrl 0 0 }
{ "paste" Insert 0 shift 0 }
{ "insert_text" Null 0 0 0 }
//- rjf: code navigation
@@ -177,34 +187,27 @@ DF_BindingVersionRemapTable:
////////////////////////////////
//~ rjf: Gfx Layer View Kinds
@table(name)
DF_NameKindTable:
{
{Null}
{EntityName}
{EntityKindName}
}
@table(name, name_lower, display_string, name_kind, icon, parameterized_by_entity, can_serialize, can_serialize_entity_path, can_filter, filter_is_code, typing_automatically_filters, inc_in_docs, docs_desc)
DF_GfxViewTable:
{
{ Null "null" "" Null Null 0 0 0 0 0 0 0 "" }
{ Empty "empty" "" Null Null 0 0 0 0 0 0 0 "" }
{ GettingStarted "getting_started" "Getting Started" Null QuestionMark 0 1 0 0 0 0 0 "" }
{ Commands "commands" "Commands" Null List 0 0 0 0 0 0 0 "" }
{ FileSystem "file_system" "File System" Null FileOutline 0 0 0 0 0 0 0 "" }
{ SystemProcesses "system_processes" "System Processes" Null Null 0 0 0 0 0 0 0 "" }
{ EntityLister "entity_lister" "Entity List" EntityKindName Null 0 0 0 0 0 0 0 "" }
{ EntityLister "entity_lister" "Entity List" Null Null 0 0 0 0 0 0 0 "" }
{ SymbolLister "symbol_lister" "Symbols" Null Null 0 0 0 0 0 0 0 "" }
{ Target "target" "Target" EntityName Target 1 0 0 0 0 0 0 "" }
{ Targets "targets" "Targets" Null Target 0 1 0 1 0 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." }
{ FilePathMap "file_path_map" "File Path Map" Null FileOutline 0 1 0 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." }
{ AutoViewRules "auto_view_rules" "Auto View Rules" Null Binoculars 0 1 0 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." }
{ Scheduler "scheduler" "Scheduler" Null Scheduler 0 1 0 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." }
{ CallStack "call_stack" "Call Stack" Null Thread 0 1 0 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." }
{ Modules "modules" "Modules" Null Module 0 1 0 1 0 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." }
{ PendingEntity "pending_entity" "Pending Entity" EntityName FileOutline 1 0 0 0 0 0 0 "" }
{ Code "code" "Code" EntityName FileOutline 1 1 1 0 0 0 0 "" }
{ Disassembly "disassembly" "Disassembly" Null Glasses 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." }
{ EvalViewer "eval_viewer" "Evaluation Viewer" Null Binoculars 0 1 0 0 0 0 0 "." }
{ Watch "watch" "Watch" Null Binoculars 0 1 0 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." }
{ Locals "locals" "Locals" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
{ Registers "registers" "Registers" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
@@ -240,23 +243,23 @@ DF_CmdParamSlot2ViewSpecMap:
//
// NOTE(rjf): see @view_rule_info
@table(string vr ls ru bu wu)
@table(string vr ls ru bu tu tab_display_string)
DF_GfxViewRuleTable:
{
{"array" - - - - - }
{"list" x - - - - }
{"dec" - x - - - }
{"bin" - x - - - }
{"oct" - x - - - }
{"hex" - x - - - }
{"only" x x - - - }
{"omit" x x - - - }
{"no_addr" - x - - - }
{"rgba" - - x x - }
{"text" - - - x - }
{"disasm" - - - x - }
{"bitmap" - - x x x }
{"geo" - - x x - }
{"array" - - - - - "" }
{"list" x - - - - "" }
{"dec" - x - - - "" }
{"bin" - x - - - "" }
{"oct" - x - - - "" }
{"hex" - x - - - "" }
{"only" x x - - - "" }
{"omit" x x - - - "" }
{"no_addr" - x - - - "" }
{"rgba" - - x x - "" }
{"text" - - - x x "Text" }
{"disasm" - - - x x "Disassembly" }
{"bitmap" - - x x x "Bitmap" }
{"geo" - - x x x "Geometry" }
}
////////////////////////////////
@@ -411,12 +414,6 @@ DF_ThemePresetColorTable:
//- rjf: enums
@enum DF_NameKind:
{
@expand(DF_NameKindTable, a) `$(a.name)`,
COUNT,
}
@enum DF_GfxViewKind:
{
@expand(DF_GfxViewTable a) `$(a.name)`,
@@ -557,7 +554,13 @@ DF_ThemePresetColorTable:
@expand(DF_GfxViewRuleTable a)
`$(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
@expand(DF_GfxViewRuleTable a)
`$(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
`$(a.tu == "x" -> "DF_VIEW_SETUP_FUNCTION_DEF(" .. a.name_lower .. ");")`;
@expand(DF_GfxViewRuleTable a)
`$(a.tu == "x" -> "DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(" .. a.name_lower .. ");")`;
@expand(DF_GfxViewRuleTable a)
`$(a.tu == "x" -> "DF_VIEW_CMD_FUNCTION_DEF(" .. a.name_lower .. ");")`;
@expand(DF_GfxViewRuleTable a)
`$(a.tu == "x" -> "DF_VIEW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
}
//- rjf: gfx view rule tables
@@ -565,7 +568,13 @@ DF_ThemePresetColorTable:
@data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table:
{
@expand(DF_GfxViewRuleTable a)
```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), $(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME("..a.name_lower..")") $(a.wu != "x" -> 0) }```;
```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), str8_lit_comp("$(a.tu == 'x' -> a.string..'_view_rule')") }```;
}
@data(DF_ViewSpecInfo) @c_file df_g_gfx_view_rule_tab_view_spec_info_table:
{
@expand(DF_GfxViewRuleTable a)
```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_NameKind_Null, DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```;
}
//- rjf: default view spec info table
-49
View File
@@ -1,49 +0,0 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef DF_VIEW_RULE_HOOKS_H
#define DF_VIEW_RULE_HOOKS_H
////////////////////////////////
//~ rjf: Helper Types
typedef struct DF_BitmapTopologyInfo DF_BitmapTopologyInfo;
struct DF_BitmapTopologyInfo
{
U64 width;
U64 height;
R_Tex2DFormat fmt;
};
typedef struct DF_GeoTopologyInfo DF_GeoTopologyInfo;
struct DF_GeoTopologyInfo
{
U64 index_count;
Rng1U64 vertices_vaddr_range;
};
typedef struct DF_TxtTopologyInfo DF_TxtTopologyInfo;
struct DF_TxtTopologyInfo
{
TXT_LangKind lang;
U64 size_cap;
};
typedef struct DF_DisasmTopologyInfo DF_DisasmTopologyInfo;
struct DF_DisasmTopologyInfo
{
Architecture arch;
U64 size_cap;
};
////////////////////////////////
//~ rjf: Helpers
internal Vec4F32 df_view_rule_hooks__rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process);
internal void df_view_rule_hooks__eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba);
internal DF_BitmapTopologyInfo df_view_rule_hooks__bitmap_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
internal DF_GeoTopologyInfo df_view_rule_hooks__geo_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
internal DF_TxtTopologyInfo df_view_rule_hooks__txt_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
internal DF_DisasmTopologyInfo df_view_rule_hooks__disasm_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
#endif //DF_VIEW_RULE_HOOKS_H
File diff suppressed because it is too large Load Diff
+144
View File
@@ -0,0 +1,144 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef DF_VIEW_RULES_H
#define DF_VIEW_RULES_H
////////////////////////////////
//~ rjf: "rgba"
typedef struct DF_VR_RGBAState DF_VR_RGBAState;
struct DF_VR_RGBAState
{
Vec4F32 hsva;
U64 memgen_idx;
};
internal Vec4F32 df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process);
internal void df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba);
////////////////////////////////
//~ rjf: "text"
typedef struct DF_TxtTopologyInfo DF_TxtTopologyInfo;
struct DF_TxtTopologyInfo
{
TXT_LangKind lang;
U64 size_cap;
};
typedef struct DF_VR_TextState DF_VR_TextState;
struct DF_VR_TextState
{
B32 initialized;
TxtPt cursor;
TxtPt mark;
S64 preferred_column;
U64 last_open_frame_idx;
F32 loaded_t;
};
internal DF_TxtTopologyInfo df_vr_txt_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
////////////////////////////////
//~ rjf: "disasm"
typedef struct DF_DisasmTopologyInfo DF_DisasmTopologyInfo;
struct DF_DisasmTopologyInfo
{
Architecture arch;
U64 size_cap;
};
typedef struct DF_VR_DisasmState DF_VR_DisasmState;
struct DF_VR_DisasmState
{
B32 initialized;
TxtPt cursor;
TxtPt mark;
S64 preferred_column;
U64 last_open_frame_idx;
F32 loaded_t;
};
internal DF_DisasmTopologyInfo df_vr_disasm_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
////////////////////////////////
//~ rjf: "bitmap"
typedef struct DF_BitmapTopologyInfo DF_BitmapTopologyInfo;
struct DF_BitmapTopologyInfo
{
U64 width;
U64 height;
R_Tex2DFormat fmt;
};
typedef struct DF_BitmapViewState DF_BitmapViewState;
struct DF_BitmapViewState
{
Vec2F32 view_center_pos;
F32 zoom;
DF_BitmapTopologyInfo top;
};
typedef struct DF_VR_BitmapState DF_VR_BitmapState;
struct DF_VR_BitmapState
{
U64 last_open_frame_idx;
F32 loaded_t;
};
typedef struct DF_VR_BitmapBoxDrawData DF_VR_BitmapBoxDrawData;
struct DF_VR_BitmapBoxDrawData
{
Rng2F32 src;
R_Handle texture;
F32 loaded_t;
B32 hovered;
Vec2S32 mouse_px;
F32 ui_per_bmp_px;
};
internal Vec2F32 df_bitmap_view_state__screen_from_canvas_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 cvs);
internal Rng2F32 df_bitmap_view_state__screen_from_canvas_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 cvs);
internal Vec2F32 df_bitmap_view_state__canvas_from_screen_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 scr);
internal Rng2F32 df_bitmap_view_state__canvas_from_screen_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 scr);
internal DF_BitmapTopologyInfo df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
////////////////////////////////
//~ rjf: "geo"
typedef struct DF_GeoTopologyInfo DF_GeoTopologyInfo;
struct DF_GeoTopologyInfo
{
U64 index_count;
Rng1U64 vertices_vaddr_range;
};
typedef struct DF_VR_GeoState DF_VR_GeoState;
struct DF_VR_GeoState
{
B32 initialized;
U64 last_open_frame_idx;
F32 loaded_t;
F32 pitch;
F32 pitch_target;
F32 yaw;
F32 yaw_target;
F32 zoom;
F32 zoom_target;
};
typedef struct DF_VR_GeoBoxDrawData DF_VR_GeoBoxDrawData;
struct DF_VR_GeoBoxDrawData
{
DF_ExpandKey key;
R_Handle vertex_buffer;
R_Handle index_buffer;
F32 loaded_t;
};
internal DF_GeoTopologyInfo df_vr_geo_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
#endif // DF_VIEW_RULES_H
+1538 -658
View File
File diff suppressed because it is too large Load Diff
+83 -41
View File
@@ -101,7 +101,6 @@ struct DF_PendingEntityViewState
{
Arena *deferred_cmd_arena;
DF_CmdList deferred_cmds;
DF_Handle pick_file_override_target;
Arena *complete_cfg_arena;
DF_CfgNode *complete_cfg_root;
};
@@ -230,6 +229,23 @@ struct DF_FilePathMapViewState
F32 dst_column_pct;
};
////////////////////////////////
//~ rjf: AutoViewRules @view_types
typedef struct DF_AutoViewRulesViewState DF_AutoViewRulesViewState;
struct DF_AutoViewRulesViewState
{
B32 initialized;
Vec2S64 cursor;
TxtPt input_cursor;
TxtPt input_mark;
U8 input_buffer[1024];
U64 input_size;
B32 input_editing;
F32 src_column_pct;
F32 dst_column_pct;
};
////////////////////////////////
//~ rjf: Modules @view_types
@@ -264,55 +280,70 @@ struct DF_EvalRoot
U8 *expr_buffer;
};
typedef enum DF_EvalWatchViewColumnKind
typedef enum DF_WatchViewColumnKind
{
DF_EvalWatchViewColumnKind_Expr,
DF_EvalWatchViewColumnKind_Value,
DF_EvalWatchViewColumnKind_Type,
DF_EvalWatchViewColumnKind_ViewRule,
DF_EvalWatchViewColumnKind_COUNT
DF_WatchViewColumnKind_Expr,
DF_WatchViewColumnKind_Value,
DF_WatchViewColumnKind_Type,
DF_WatchViewColumnKind_ViewRule,
DF_WatchViewColumnKind_COUNT
}
DF_EvalWatchViewColumnKind;
DF_WatchViewColumnKind;
typedef enum DF_EvalWatchViewFillKind
typedef enum DF_WatchViewFillKind
{
DF_EvalWatchViewFillKind_Mutable,
DF_EvalWatchViewFillKind_Registers,
DF_EvalWatchViewFillKind_Locals,
DF_EvalWatchViewFillKind_Globals,
DF_EvalWatchViewFillKind_ThreadLocals,
DF_EvalWatchViewFillKind_Types,
DF_EvalWatchViewFillKind_Procedures,
DF_EvalWatchViewFillKind_COUNT
DF_WatchViewFillKind_Mutable,
DF_WatchViewFillKind_Registers,
DF_WatchViewFillKind_Locals,
DF_WatchViewFillKind_Globals,
DF_WatchViewFillKind_ThreadLocals,
DF_WatchViewFillKind_Types,
DF_WatchViewFillKind_Procedures,
DF_WatchViewFillKind_COUNT
}
DF_EvalWatchViewFillKind;
DF_WatchViewFillKind;
typedef struct DF_EvalWatchViewPoint DF_EvalWatchViewPoint;
struct DF_EvalWatchViewPoint
typedef struct DF_WatchViewPoint DF_WatchViewPoint;
struct DF_WatchViewPoint
{
DF_EvalWatchViewColumnKind column_kind;
DF_WatchViewColumnKind column_kind;
DF_ExpandKey parent_key;
DF_ExpandKey key;
};
typedef struct DF_EvalWatchViewState DF_EvalWatchViewState;
struct DF_EvalWatchViewState
typedef struct DF_WatchViewTextEditState DF_WatchViewTextEditState;
struct DF_WatchViewTextEditState
{
DF_WatchViewTextEditState *pt_hash_next;
DF_WatchViewPoint pt;
TxtPt cursor;
TxtPt mark;
U8 input_buffer[1024];
U64 input_size;
U8 initial_buffer[1024];
U64 initial_size;
};
typedef struct DF_WatchViewState DF_WatchViewState;
struct DF_WatchViewState
{
B32 initialized;
// rjf: fill kind (way that the contents of the watch view are computed)
DF_EvalWatchViewFillKind fill_kind;
DF_WatchViewFillKind fill_kind;
// rjf; table cursor state
DF_EvalWatchViewPoint cursor;
DF_EvalWatchViewPoint mark;
DF_WatchViewPoint cursor;
DF_WatchViewPoint mark;
DF_WatchViewPoint next_cursor;
DF_WatchViewPoint next_mark;
// rjf: text input state
TxtPt input_cursor;
TxtPt input_mark;
U8 input_buffer[1024];
U64 input_size;
B32 input_editing;
Arena *text_edit_arena;
U64 text_edit_state_slots_count;
DF_WatchViewTextEditState dummy_text_edit_state;
DF_WatchViewTextEditState **text_edit_state_slots;
B32 text_editing;
// rjf: table column width state
F32 expr_column_pct;
@@ -437,27 +468,38 @@ internal DF_EntityListerItemArray df_entity_lister_item_array_from_list(Arena *a
internal void df_entity_lister_item_array_sort_by_strength__in_place(DF_EntityListerItemArray array);
////////////////////////////////
//~ rjf: Eval/Watch Views
//~ rjf: Watch Views
//- rjf: eval watch view instance -> eval view key
internal DF_EvalViewKey df_eval_view_key_from_eval_watch_view(DF_EvalWatchViewState *ewv);
internal DF_EvalViewKey df_eval_view_key_from_eval_watch_view(DF_WatchViewState *ewv);
//- rjf: root allocation/deallocation/mutation
internal DF_EvalRoot * df_eval_root_alloc(DF_View *view, DF_EvalWatchViewState *ews);
internal void df_eval_root_release(DF_EvalWatchViewState *ews, DF_EvalRoot *root);
internal DF_EvalRoot * df_eval_root_alloc(DF_View *view, DF_WatchViewState *ews);
internal void df_eval_root_release(DF_WatchViewState *ews, DF_EvalRoot *root);
internal void df_eval_root_equip_string(DF_EvalRoot *root, String8 string);
internal DF_EvalRoot * df_eval_root_from_string(DF_EvalWatchViewState *ews, String8 string);
internal DF_EvalRoot * df_eval_root_from_expand_key(DF_EvalWatchViewState *ews, DF_EvalView *eval_view, DF_ExpandKey expand_key);
internal DF_EvalRoot * df_eval_root_from_string(DF_WatchViewState *ews, String8 string);
internal DF_EvalRoot * df_eval_root_from_expand_key(DF_WatchViewState *ews, DF_EvalView *eval_view, DF_ExpandKey expand_key);
internal String8 df_string_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_parent_expand_key_from_eval_root(DF_EvalRoot *root);
internal DF_ExpandKey df_expand_key_from_eval_root(DF_EvalRoot *root);
//- rjf: watch view points <-> table coordinates
internal B32 df_watch_view_point_match(DF_WatchViewPoint a, DF_WatchViewPoint b);
internal DF_WatchViewPoint df_watch_view_point_from_tbl(DF_EvalVizBlockList *blocks, Vec2S64 tbl);
internal Vec2S64 df_tbl_from_watch_view_point(DF_EvalVizBlockList *blocks, DF_WatchViewPoint pt);
//- rjf: table coordinates -> strings
internal String8 df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, TG_Graph *graph, RDI_Parsed *rdi, DF_EvalVizRow *row, DF_WatchViewColumnKind col_kind, B32 editable);
//- rjf: table coordinates -> text edit state
internal DF_WatchViewTextEditState *df_watch_view_text_edit_state_from_pt(DF_WatchViewState *wv, DF_WatchViewPoint pt);
//- rjf: windowed watch tree visualization
internal DF_EvalVizBlockList df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_View *view, DF_EvalWatchViewState *ews);
internal DF_EvalVizBlockList df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, FZY_Scope *fzy_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_View *view, DF_WatchViewState *ews);
//- rjf: eval/watch views main hooks
internal void df_eval_watch_view_init(DF_EvalWatchViewState *ewv, DF_View *view, DF_EvalWatchViewFillKind fill_kind);
internal void df_eval_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalWatchViewState *ewv, DF_CmdList *cmds);
internal void df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalWatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect);
internal void df_watch_view_init(DF_WatchViewState *ewv, DF_View *view, DF_WatchViewFillKind fill_kind);
internal void df_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, DF_CmdList *cmds);
internal void df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 default_radix, Rng2F32 rect);
#endif // DEBUG_FRONTEND_VIEWS_H
+34 -18
View File
@@ -598,7 +598,7 @@ str8_lit_comp("goto_name"),
str8_lit_comp("function_breakpoint"),
};
DF_StringBindingPair df_g_default_binding_table[97] =
DF_StringBindingPair df_g_default_binding_table[104] =
{
{str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_EventFlag_Shift }},
{str8_lit_comp("step_into_inst"), {OS_Key_F11, 0 |OS_EventFlag_Alt}},
@@ -644,6 +644,9 @@ DF_StringBindingPair df_g_default_binding_table[97] =
{str8_lit_comp("switch_to_partner_file"), {OS_Key_O, 0 |OS_EventFlag_Alt}},
{str8_lit_comp("load_user"), {OS_Key_O, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift |OS_EventFlag_Alt}},
{str8_lit_comp("load_profile"), {OS_Key_O, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}},
{str8_lit_comp("edit"), {OS_Key_F2, 0 }},
{str8_lit_comp("accept"), {OS_Key_Return, 0 }},
{str8_lit_comp("cancel"), {OS_Key_Esc, 0 }},
{str8_lit_comp("move_left"), {OS_Key_Left, 0 }},
{str8_lit_comp("move_right"), {OS_Key_Right, 0 }},
{str8_lit_comp("move_up"), {OS_Key_Up, 0 }},
@@ -668,6 +671,8 @@ DF_StringBindingPair df_g_default_binding_table[97] =
{str8_lit_comp("move_down_page_select"), {OS_Key_PageDown, 0 |OS_EventFlag_Shift }},
{str8_lit_comp("move_up_whole_select"), {OS_Key_Home, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }},
{str8_lit_comp("move_down_whole_select"), {OS_Key_End, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }},
{str8_lit_comp("move_up_reorder"), {OS_Key_Up, 0 |OS_EventFlag_Alt}},
{str8_lit_comp("move_down_reorder"), {OS_Key_Down, 0 |OS_EventFlag_Alt}},
{str8_lit_comp("move_home"), {OS_Key_Home, 0 }},
{str8_lit_comp("move_end"), {OS_Key_End, 0 }},
{str8_lit_comp("move_home_select"), {OS_Key_Home, 0 |OS_EventFlag_Shift }},
@@ -678,8 +683,10 @@ DF_StringBindingPair df_g_default_binding_table[97] =
{str8_lit_comp("backspace_single"), {OS_Key_Backspace, 0 }},
{str8_lit_comp("backspace_chunk"), {OS_Key_Backspace, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("copy"), {OS_Key_C, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("copy"), {OS_Key_Insert, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("cut"), {OS_Key_X, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("paste"), {OS_Key_V, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("paste"), {OS_Key_Insert, 0 |OS_EventFlag_Shift }},
{str8_lit_comp("insert_text"), {OS_Key_Null, 0 }},
{str8_lit_comp("goto_line"), {OS_Key_G, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("goto_address"), {OS_Key_G, 0 |OS_EventFlag_Alt}},
@@ -715,41 +722,50 @@ str8_lit_comp("open_profile"),
DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] =
{
{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 },
{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, 0 },
{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, 0 },
{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, 0 },
{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, 0 },
{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, 0 },
{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, 0 },
{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, 0 },
{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, 0 },
{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , 0 },
{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , 0 },
{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , 0 },
{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(bitmap) },
{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , 0 },
{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, str8_lit_comp("") },
{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, str8_lit_comp("") },
{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, str8_lit_comp("") },
{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , str8_lit_comp("") },
{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , str8_lit_comp("text_view_rule") },
{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , str8_lit_comp("disasm_view_rule") },
{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , str8_lit_comp("bitmap_view_rule") },
{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , str8_lit_comp("geo_view_rule") },
};
DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30] =
DF_ViewSpecInfo df_g_gfx_view_rule_tab_view_spec_info_table[4] =
{
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) },
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) },
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) },
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) },
};
DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31] =
{
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("null"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Null), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Null), DF_VIEW_CMD_FUNCTION_NAME(Null), DF_VIEW_UI_FUNCTION_NAME(Null)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("empty"), str8_lit_comp(""), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(Empty), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Empty), DF_VIEW_CMD_FUNCTION_NAME(Empty), DF_VIEW_UI_FUNCTION_NAME(Empty)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("getting_started"), str8_lit_comp("Getting Started"), DF_NameKind_Null, DF_IconKind_QuestionMark, DF_VIEW_SETUP_FUNCTION_NAME(GettingStarted), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(GettingStarted), DF_VIEW_CMD_FUNCTION_NAME(GettingStarted), DF_VIEW_UI_FUNCTION_NAME(GettingStarted)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("commands"), str8_lit_comp("Commands"), DF_NameKind_Null, DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Commands), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Commands), DF_VIEW_CMD_FUNCTION_NAME(Commands), DF_VIEW_UI_FUNCTION_NAME(Commands)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_system"), str8_lit_comp("File System"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FileSystem), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FileSystem), DF_VIEW_CMD_FUNCTION_NAME(FileSystem), DF_VIEW_UI_FUNCTION_NAME(FileSystem)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("system_processes"), str8_lit_comp("System Processes"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SystemProcesses), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SystemProcesses), DF_VIEW_CMD_FUNCTION_NAME(SystemProcesses), DF_VIEW_UI_FUNCTION_NAME(SystemProcesses)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_NameKind_EntityKindName, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("symbol_lister"), str8_lit_comp("Symbols"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SymbolLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SymbolLister), DF_VIEW_CMD_FUNCTION_NAME(SymbolLister), DF_VIEW_UI_FUNCTION_NAME(SymbolLister)},
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("target"), str8_lit_comp("Target"), DF_NameKind_EntityName, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Target), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Target), DF_VIEW_CMD_FUNCTION_NAME(Target), DF_VIEW_UI_FUNCTION_NAME(Target)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("targets"), str8_lit_comp("Targets"), DF_NameKind_Null, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Targets), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Targets), DF_VIEW_CMD_FUNCTION_NAME(Targets), DF_VIEW_UI_FUNCTION_NAME(Targets)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_path_map"), str8_lit_comp("File Path Map"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FilePathMap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FilePathMap), DF_VIEW_CMD_FUNCTION_NAME(FilePathMap), DF_VIEW_UI_FUNCTION_NAME(FilePathMap)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rules"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(AutoViewRules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(AutoViewRules), DF_VIEW_CMD_FUNCTION_NAME(AutoViewRules), DF_VIEW_UI_FUNCTION_NAME(AutoViewRules)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("scheduler"), str8_lit_comp("Scheduler"), DF_NameKind_Null, DF_IconKind_Scheduler, DF_VIEW_SETUP_FUNCTION_NAME(Scheduler), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Scheduler), DF_VIEW_CMD_FUNCTION_NAME(Scheduler), DF_VIEW_UI_FUNCTION_NAME(Scheduler)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("call_stack"), str8_lit_comp("Call Stack"), DF_NameKind_Null, DF_IconKind_Thread, DF_VIEW_SETUP_FUNCTION_NAME(CallStack), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(CallStack), DF_VIEW_CMD_FUNCTION_NAME(CallStack), DF_VIEW_UI_FUNCTION_NAME(CallStack)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("modules"), str8_lit_comp("Modules"), DF_NameKind_Null, DF_IconKind_Module, DF_VIEW_SETUP_FUNCTION_NAME(Modules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Modules), DF_VIEW_CMD_FUNCTION_NAME(Modules), DF_VIEW_UI_FUNCTION_NAME(Modules)},
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_entity"), str8_lit_comp("Pending Entity"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(PendingEntity), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(PendingEntity), DF_VIEW_CMD_FUNCTION_NAME(PendingEntity), DF_VIEW_UI_FUNCTION_NAME(PendingEntity)},
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("code"), str8_lit_comp("Code"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(Code), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Code), DF_VIEW_CMD_FUNCTION_NAME(Code), DF_VIEW_UI_FUNCTION_NAME(Code)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disassembly"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Glasses, DF_VIEW_SETUP_FUNCTION_NAME(Disassembly), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Disassembly), DF_VIEW_CMD_FUNCTION_NAME(Disassembly), DF_VIEW_UI_FUNCTION_NAME(Disassembly)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("eval_viewer"), str8_lit_comp("Evaluation Viewer"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(EvalViewer), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EvalViewer), DF_VIEW_CMD_FUNCTION_NAME(EvalViewer), DF_VIEW_UI_FUNCTION_NAME(EvalViewer)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Watch), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Watch), DF_VIEW_CMD_FUNCTION_NAME(Watch), DF_VIEW_UI_FUNCTION_NAME(Watch)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Locals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Locals), DF_VIEW_CMD_FUNCTION_NAME(Locals), DF_VIEW_UI_FUNCTION_NAME(Locals)},
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Registers), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Registers), DF_VIEW_CMD_FUNCTION_NAME(Registers), DF_VIEW_UI_FUNCTION_NAME(Registers)},
+154 -16
View File
@@ -6,18 +6,11 @@
#ifndef DF_GFX_META_H
#define DF_GFX_META_H
typedef enum DF_NameKind
{
DF_NameKind_Null,
DF_NameKind_EntityName,
DF_NameKind_EntityKindName,
DF_NameKind_COUNT,
} DF_NameKind;
typedef enum DF_GfxViewKind
{
DF_GfxViewKind_Null,
DF_GfxViewKind_Empty,
DF_GfxViewKind_GettingStarted,
DF_GfxViewKind_Commands,
DF_GfxViewKind_FileSystem,
DF_GfxViewKind_SystemProcesses,
@@ -26,13 +19,13 @@ DF_GfxViewKind_SymbolLister,
DF_GfxViewKind_Target,
DF_GfxViewKind_Targets,
DF_GfxViewKind_FilePathMap,
DF_GfxViewKind_AutoViewRules,
DF_GfxViewKind_Scheduler,
DF_GfxViewKind_CallStack,
DF_GfxViewKind_Modules,
DF_GfxViewKind_PendingEntity,
DF_GfxViewKind_Code,
DF_GfxViewKind_Disassembly,
DF_GfxViewKind_EvalViewer,
DF_GfxViewKind_Watch,
DF_GfxViewKind_Locals,
DF_GfxViewKind_Registers,
@@ -124,6 +117,7 @@ DF_ThemePreset_COUNT,
DF_VIEW_SETUP_FUNCTION_DEF(Null);
DF_VIEW_SETUP_FUNCTION_DEF(Empty);
DF_VIEW_SETUP_FUNCTION_DEF(GettingStarted);
DF_VIEW_SETUP_FUNCTION_DEF(Commands);
DF_VIEW_SETUP_FUNCTION_DEF(FileSystem);
DF_VIEW_SETUP_FUNCTION_DEF(SystemProcesses);
@@ -132,13 +126,13 @@ DF_VIEW_SETUP_FUNCTION_DEF(SymbolLister);
DF_VIEW_SETUP_FUNCTION_DEF(Target);
DF_VIEW_SETUP_FUNCTION_DEF(Targets);
DF_VIEW_SETUP_FUNCTION_DEF(FilePathMap);
DF_VIEW_SETUP_FUNCTION_DEF(AutoViewRules);
DF_VIEW_SETUP_FUNCTION_DEF(Scheduler);
DF_VIEW_SETUP_FUNCTION_DEF(CallStack);
DF_VIEW_SETUP_FUNCTION_DEF(Modules);
DF_VIEW_SETUP_FUNCTION_DEF(PendingEntity);
DF_VIEW_SETUP_FUNCTION_DEF(Code);
DF_VIEW_SETUP_FUNCTION_DEF(Disassembly);
DF_VIEW_SETUP_FUNCTION_DEF(EvalViewer);
DF_VIEW_SETUP_FUNCTION_DEF(Watch);
DF_VIEW_SETUP_FUNCTION_DEF(Locals);
DF_VIEW_SETUP_FUNCTION_DEF(Registers);
@@ -154,6 +148,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(ExceptionFilters);
DF_VIEW_SETUP_FUNCTION_DEF(Theme);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Null);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Empty);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(GettingStarted);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Commands);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(FileSystem);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(SystemProcesses);
@@ -162,13 +157,13 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(SymbolLister);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Target);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Targets);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(FilePathMap);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(AutoViewRules);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Scheduler);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(CallStack);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Modules);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingEntity);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Disassembly);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(EvalViewer);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Watch);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Locals);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Registers);
@@ -184,6 +179,7 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(ExceptionFilters);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Theme);
DF_VIEW_CMD_FUNCTION_DEF(Null);
DF_VIEW_CMD_FUNCTION_DEF(Empty);
DF_VIEW_CMD_FUNCTION_DEF(GettingStarted);
DF_VIEW_CMD_FUNCTION_DEF(Commands);
DF_VIEW_CMD_FUNCTION_DEF(FileSystem);
DF_VIEW_CMD_FUNCTION_DEF(SystemProcesses);
@@ -192,13 +188,13 @@ DF_VIEW_CMD_FUNCTION_DEF(SymbolLister);
DF_VIEW_CMD_FUNCTION_DEF(Target);
DF_VIEW_CMD_FUNCTION_DEF(Targets);
DF_VIEW_CMD_FUNCTION_DEF(FilePathMap);
DF_VIEW_CMD_FUNCTION_DEF(AutoViewRules);
DF_VIEW_CMD_FUNCTION_DEF(Scheduler);
DF_VIEW_CMD_FUNCTION_DEF(CallStack);
DF_VIEW_CMD_FUNCTION_DEF(Modules);
DF_VIEW_CMD_FUNCTION_DEF(PendingEntity);
DF_VIEW_CMD_FUNCTION_DEF(Code);
DF_VIEW_CMD_FUNCTION_DEF(Disassembly);
DF_VIEW_CMD_FUNCTION_DEF(EvalViewer);
DF_VIEW_CMD_FUNCTION_DEF(Watch);
DF_VIEW_CMD_FUNCTION_DEF(Locals);
DF_VIEW_CMD_FUNCTION_DEF(Registers);
@@ -214,6 +210,7 @@ DF_VIEW_CMD_FUNCTION_DEF(ExceptionFilters);
DF_VIEW_CMD_FUNCTION_DEF(Theme);
DF_VIEW_UI_FUNCTION_DEF(Null);
DF_VIEW_UI_FUNCTION_DEF(Empty);
DF_VIEW_UI_FUNCTION_DEF(GettingStarted);
DF_VIEW_UI_FUNCTION_DEF(Commands);
DF_VIEW_UI_FUNCTION_DEF(FileSystem);
DF_VIEW_UI_FUNCTION_DEF(SystemProcesses);
@@ -222,13 +219,13 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister);
DF_VIEW_UI_FUNCTION_DEF(Target);
DF_VIEW_UI_FUNCTION_DEF(Targets);
DF_VIEW_UI_FUNCTION_DEF(FilePathMap);
DF_VIEW_UI_FUNCTION_DEF(AutoViewRules);
DF_VIEW_UI_FUNCTION_DEF(Scheduler);
DF_VIEW_UI_FUNCTION_DEF(CallStack);
DF_VIEW_UI_FUNCTION_DEF(Modules);
DF_VIEW_UI_FUNCTION_DEF(PendingEntity);
DF_VIEW_UI_FUNCTION_DEF(Code);
DF_VIEW_UI_FUNCTION_DEF(Disassembly);
DF_VIEW_UI_FUNCTION_DEF(EvalViewer);
DF_VIEW_UI_FUNCTION_DEF(Watch);
DF_VIEW_UI_FUNCTION_DEF(Locals);
DF_VIEW_UI_FUNCTION_DEF(Registers);
@@ -261,7 +258,22 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo);
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap);
DF_VIEW_SETUP_FUNCTION_DEF(text);
DF_VIEW_SETUP_FUNCTION_DEF(disasm);
DF_VIEW_SETUP_FUNCTION_DEF(bitmap);
DF_VIEW_SETUP_FUNCTION_DEF(geo);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(text);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(disasm);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(bitmap);
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(geo);
DF_VIEW_CMD_FUNCTION_DEF(text);
DF_VIEW_CMD_FUNCTION_DEF(disasm);
DF_VIEW_CMD_FUNCTION_DEF(bitmap);
DF_VIEW_CMD_FUNCTION_DEF(geo);
DF_VIEW_UI_FUNCTION_DEF(text);
DF_VIEW_UI_FUNCTION_DEF(disasm);
DF_VIEW_UI_FUNCTION_DEF(bitmap);
DF_VIEW_UI_FUNCTION_DEF(geo);
C_LINKAGE_BEGIN
extern String8 df_g_theme_preset_display_string_table[9];
extern String8 df_g_theme_preset_code_string_table[9];
@@ -278,10 +290,10 @@ extern Vec4F32* df_g_theme_preset_colors_table[9];
extern DF_CmdParamSlot df_g_cmd_param_slot_2_view_spec_src_map[7];
extern String8 df_g_cmd_param_slot_2_view_spec_dst_map[7];
extern String8 df_g_cmd_param_slot_2_view_spec_cmd_map[7];
extern DF_StringBindingPair df_g_default_binding_table[97];
extern DF_StringBindingPair df_g_default_binding_table[104];
extern String8 df_g_binding_version_remap_old_name_table[3];
extern String8 df_g_binding_version_remap_new_name_table[3];
extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30];
extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31];
extern String8 df_g_theme_color_display_string_table[54];
extern String8 df_g_theme_color_cfg_string_table[54];
read_only global U8 df_g_icon_font_bytes__data[] =
@@ -4864,6 +4876,132 @@ read_only global U8 df_g_default_code_font_bytes__data[] =
};
read_only global String8 df_g_default_code_font_bytes = {df_g_default_code_font_bytes__data, sizeof(df_g_default_code_font_bytes__data)};
read_only global U8 df_g_icon_file_bytes__data[] =
{
0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x02,0x1e,0x00,0x00,0x16,0x00,0x00,0x00,0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x06,0x00,0x00,0x00,0x5c,0x72,0xa8,0x66,0x00,0x00,0x1d,0xc9,0x49,0x44,0x41,0x54,0x78,
0x9c,0xed,0xdd,0x7b,0x7c,0x14,0xe5,0xbd,0xc7,0xf1,0xcf,0x6e,0xb2,0x9b,0x04,0x12,0x20,0x10,0xae,0xe2,0x25,0x52,0x06,0x05,0xe5,0x12,0x14,0x6f,0xc7,0x56,0x99,0x5a,0xd4,0xaa,0xd5,0xda,0x8b,0xb7,0xa2,0x55,0x4f,0x6d,0x6b,0xab,0xb5,0xf6,0x72,0x7a,0xb1,0xb5,0x1e,0x41,0xce,0xd1,0xb6,0x5a,0x4f,0xeb,0xa9,0x56,0x8b,0x37,0xb4,0x5a,
0xfb,0xaa,0x56,0x5a,0xa4,0x1d,0xb5,0x20,0x2d,0x95,0x8a,0x8a,0xf5,0xa0,0x83,0x8a,0x37,0x10,0x08,0x90,0x70,0x0b,0xe4,0xb6,0x7b,0xfe,0x98,0x8d,0x44,0x48,0x42,0x36,0xf3,0xcc,0xfc,0x66,0x77,0x7e,0xef,0xd7,0x8b,0x57,0xbc,0x24,0xcf,0xf3,0xcb,0x32,0xcf,0x77,0x9f,0x99,0x9d,0x79,0x1e,0x50,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,
0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x54,0xe1,0x4a,0x48,0x17,0xa0,0x82,0xe5,0x58,0x54,0x01,0xd5,0xc0,0xa0,0x4e,0x5f,0x3b,0xff,0x33,0x40,0x23,0xd0,0x90,0xfb,0xda,0xf9,0x9f,0x1b,0x6c,0x97,0x6d,0x61,0xd7,0xac,0xc2,0xa3,0x01,0x50,0xa0,0x1c,0x8b,0xa1,0xc0,0x54,0x60,0x0a,0x70,0x30,0x7b,
0x0f,0xec,0x6a,0x60,0x20,0x50,0xe2,0xb3,0xab,0x76,0x60,0x0b,0x9d,0x42,0x81,0xdd,0x41,0xf1,0x06,0xf0,0x3c,0xf0,0x9c,0xed,0x52,0xef,0xb3,0x1f,0x25,0x40,0x03,0xa0,0x00,0x38,0x16,0xfb,0x03,0x75,0x78,0x83,0xbd,0x2e,0xf7,0x67,0x3f,0xd1,0xa2,0xf6,0xb6,0x06,0x58,0xde,0xf9,0x8f,0xed,0xf2,0xae,0x6c,0x49,0x6a,0x5f,0x34,0x00,0x22,
0xc4,0xb1,0x48,0xe0,0xbd,0x9b,0xd7,0x75,0xfa,0x33,0x05,0x18,0x2a,0x59,0x97,0x0f,0xf5,0x78,0x33,0x84,0xce,0xa1,0xf0,0xba,0x6c,0x49,0xaa,0x33,0x0d,0x80,0x88,0x70,0x2c,0x7e,0x0f,0x9c,0x80,0x37,0x6d,0x2f,0x66,0x5b,0x80,0xa7,0x6d,0x97,0x33,0xa5,0x0b,0x51,0x1a,0x00,0x91,0xe0,0x58,0xd4,0xe2,0x9d,0x4f,0xc7,0x49,0xad,0xed,0xf2,
0xa6,0x74,0x11,0x71,0x97,0x94,0x2e,0x40,0x01,0x30,0x5d,0xba,0x00,0x01,0x71,0xfc,0x9d,0x23,0x47,0x03,0x20,0x1a,0xe2,0x38,0x18,0xe2,0xf8,0x3b,0x47,0x8e,0x06,0x40,0x34,0x9c,0x28,0x5d,0x80,0x80,0x38,0xfe,0xce,0x91,0xa3,0x01,0x20,0xcc,0xb1,0x38,0x04,0x18,0x29,0x5d,0x87,0x80,0x51,0x8e,0xc5,0x38,0xe9,0x22,0xe2,0x4e,0x03,0x40,
0x5e,0x9c,0xa7,0xc2,0x71,0xfe,0xdd,0x23,0x41,0x03,0x40,0x5e,0x9c,0x07,0x41,0x9c,0x7f,0xf7,0x48,0xd0,0x8f,0x01,0x05,0xe5,0x6e,0xfc,0xa9,0x07,0x86,0x48,0xd7,0x22,0x64,0x23,0x30,0xcc,0x76,0xc9,0x4a,0x17,0x12,0x57,0x3a,0x03,0x90,0x35,0x91,0xf8,0x0e,0x7e,0x80,0x1a,0xe0,0x70,0xe9,0x22,0xe2,0x4c,0x03,0x40,0x96,0x4e,0x81,0xf5,
0x35,0x10,0xa5,0x01,0x20,0x4b,0x0f,0x7e,0x7d,0x0d,0x44,0xe9,0x35,0x00,0x21,0x8e,0x45,0x09,0xb0,0x19,0x18,0x20,0x5d,0x8b,0xb0,0x2d,0xc0,0x10,0xdb,0xa5,0x5d,0xba,0x90,0x38,0xd2,0x19,0x80,0x9c,0xa9,0xe8,0xe0,0x07,0xef,0xe1,0xa7,0x3a,0xe9,0x22,0xe2,0x4a,0x03,0x40,0x8e,0x4e,0x7d,0x77,0xd3,0xd7,0x42,0x88,0x06,0x80,0x1c,0x3d,
0xe8,0x77,0xd3,0xd7,0x42,0x88,0x5e,0x03,0x10,0xe0,0x58,0xa4,0xf1,0x96,0xd6,0xea,0x27,0x5d,0x4b,0x44,0x34,0x01,0x83,0x6c,0x97,0x56,0xe9,0x42,0xe2,0x46,0x67,0x00,0x32,0x8e,0x42,0x07,0x7f,0x67,0xfd,0xf0,0x5e,0x13,0x15,0x32,0x0d,0x00,0x19,0x3a,0xe5,0xdd,0x9b,0xbe,0x26,0x02,0x34,0x00,0x64,0xe8,0xc1,0xbe,0x37,0x7d,0x4d,0x04,
0xe8,0x35,0x80,0x90,0x39,0x16,0x15,0x78,0x4b,0x6a,0xa7,0xa5,0x6b,0x89,0x98,0x66,0xa0,0xda,0x76,0xd9,0x29,0x5d,0x48,0x9c,0xe8,0x0c,0x20,0x7c,0xc7,0xa1,0x83,0xbf,0x2b,0x65,0xc0,0xb1,0xd2,0x45,0xc4,0x8d,0x06,0x40,0xf8,0x74,0xaa,0xdb,0x3d,0x7d,0x6d,0x42,0xa6,0x01,0x10,0x3e,0x3d,0xc8,0xbb,0xa7,0xaf,0x4d,0xc8,0xf4,0x1a,0x40,
0x88,0x1c,0x8b,0x01,0x78,0xf7,0xff,0xfb,0xdd,0xae,0xab,0x58,0xb5,0x01,0x83,0x75,0x3f,0xc2,0xf0,0xe8,0x0c,0x20,0x5c,0xc7,0xa3,0x83,0xbf,0x27,0xa5,0x78,0xaf,0x91,0x0a,0x89,0xce,0x00,0x42,0xe0,0x58,0x94,0x03,0x5f,0x00,0xbe,0x0d,0x8c,0x12,0x2e,0x27,0xea,0xd6,0x02,0x73,0x80,0x3b,0x6c,0x97,0x5d,0xd2,0xc5,0x14,0x3b,0x0d,0x80,
0x00,0xe5,0x3e,0xf2,0xfb,0x22,0xf0,0x2d,0x60,0x84,0x70,0x39,0x85,0xe6,0x3d,0xe0,0x46,0xe0,0x7f,0xf5,0xa3,0xc1,0xe0,0x68,0x00,0x04,0xc0,0xb1,0xe8,0x0f,0x7c,0x19,0xb8,0x1a,0x18,0x2e,0x5c,0x4e,0xa1,0x5b,0x0f,0xdc,0x04,0xdc,0x66,0xbb,0xec,0x90,0x2e,0xa6,0xd8,0x68,0x00,0x18,0xe4,0x58,0x54,0x02,0x5f,0x01,0xbe,0x4e,0xe1,0xee,
0xe8,0x1b,0x55,0xf5,0xc0,0x4f,0x80,0xff,0xb1,0x5d,0xb6,0x4b,0x17,0x53,0x2c,0x34,0x00,0x0c,0xc8,0x5d,0xdd,0xbf,0x02,0xf8,0x1a,0xf1,0x5e,0xe4,0x33,0x0c,0x9b,0x80,0x9b,0x81,0x9f,0xd9,0x2e,0x5b,0xa5,0x8b,0x29,0x74,0x05,0x15,0x00,0x8e,0x45,0x12,0xf8,0x11,0xb0,0x1a,0x58,0x60,0xbb,0xac,0x15,0xae,0x27,0x0d,0x7c,0x13,0xf8,0x06,
0x30,0x48,0xb2,0x96,0x18,0x6a,0x00,0x7e,0x0c,0xdc,0x68,0xbb,0xb4,0x48,0x16,0xe2,0x58,0x8c,0x02,0x4e,0x06,0x0e,0x02,0xae,0xb5,0x5d,0x32,0x92,0xf5,0xe4,0xa3,0xd0,0x02,0xe0,0x66,0xe0,0xca,0x4e,0xff,0xe9,0x5f,0xc0,0x02,0xe0,0x09,0x60,0xb1,0xed,0xd2,0x1c,0x62,0x2d,0x75,0xc0,0x5c,0x74,0x59,0x6b,0x69,0x2f,0x01,0x17,0xda,0x2e,
0xcf,0x87,0xd5,0xa1,0x63,0x51,0x86,0xf7,0x71,0xe5,0x0c,0xbc,0x81,0x7f,0x58,0xa7,0xff,0x7d,0xb3,0xed,0x72,0x55,0x58,0xb5,0xf8,0x55,0x30,0x01,0xe0,0x58,0x5c,0x89,0x37,0xf5,0xeb,0x4e,0x13,0xf0,0x34,0xb9,0x40,0xb0,0x5d,0xdc,0x80,0xea,0x48,0x01,0xd7,0x00,0xdf,0xc1,0xfb,0xdc,0x5a,0xc9,0x6b,0x03,0x6e,0x00,0xfe,0x33,0xa8,0x45,
0x45,0x1c,0x0b,0x8b,0xdd,0x03,0xfe,0x04,0x7a,0x5e,0xcf,0xe1,0x4a,0xdb,0xe5,0x67,0x41,0xd4,0x61,0x5a,0x41,0x04,0x80,0x63,0x71,0x26,0xf0,0x08,0xf9,0xdd,0xb8,0xb4,0x1a,0x6f,0x66,0xb0,0x00,0x78,0xd2,0xc4,0xdd,0x65,0x8e,0xc5,0x14,0xbc,0x77,0xfd,0x89,0x7e,0xdb,0x52,0x81,0x58,0x01,0x5c,0x64,0x62,0x36,0xe0,0x58,0x54,0x01,0x36,
0xde,0xa0,0x9f,0x01,0xd4,0xe6,0xf1,0xe3,0x19,0xe0,0x93,0xb6,0xcb,0xa3,0x7e,0xeb,0x08,0x5a,0xe4,0x03,0xc0,0xb1,0x98,0x86,0xf7,0xce,0x5e,0xe1,0xa3,0x99,0x56,0xe0,0x6f,0xec,0x0e,0x84,0x17,0xf2,0xd9,0x8e,0x2a,0xf7,0xae,0xff,0x7d,0xe0,0xbb,0xe8,0xbb,0x7e,0xd4,0xb5,0x02,0xb3,0x81,0x59,0xf9,0xcc,0x06,0x72,0xdb,0xb4,0x4d,0x61,
0xf7,0xbb,0xfc,0x31,0x40,0xca,0x47,0x1d,0x4d,0xc0,0x09,0xb6,0xcb,0x32,0x1f,0x6d,0x04,0x2e,0xd2,0x01,0xe0,0x58,0xd4,0x02,0x4b,0x81,0x61,0x86,0x9b,0x5e,0x0f,0x2c,0xc4,0x0b,0x84,0x85,0xb6,0x4b,0x7d,0x0f,0x35,0x4c,0xc6,0x7b,0xd7,0x9f,0x64,0xb8,0x06,0x15,0xac,0x17,0xf1,0xae,0x0d,0xbc,0xd8,0xdd,0x37,0x38,0x16,0x43,0x81,0x8f,
0xe1,0x0d,0xf8,0x93,0x30,0x7f,0xcf,0xc6,0x06,0xe0,0x68,0xdb,0x65,0xb5,0xe1,0x76,0x8d,0x89,0x6c,0x00,0x38,0x16,0xd5,0x78,0xef,0xda,0x87,0x04,0xdc,0x55,0x16,0x58,0xce,0xee,0xd9,0xc1,0xdf,0x6d,0x97,0xb6,0xdc,0xbb,0xfe,0xf7,0xf0,0xde,0xf5,0xfd,0xbc,0x13,0x28,0x39,0xad,0xc0,0x2c,0x60,0xb6,0xed,0xd2,0xea,0x58,0x94,0xe2,0xbd,
0xb3,0x9f,0x8c,0xf7,0x4e,0x5f,0x47,0xf0,0x63,0xe0,0x15,0xe0,0x58,0xdb,0xa5,0x21,0xe0,0x7e,0xfa,0x24,0x92,0x01,0x90,0xbb,0xca,0xba,0x10,0xf8,0xb0,0x40,0xf7,0x5b,0x01,0x07,0xef,0x9c,0x6f,0xb2,0x40,0xff,0xca,0xbc,0x17,0xf0,0xae,0x09,0xd9,0xc8,0x6c,0xc6,0xb2,0x08,0x38,0x49,0xfa,0xe3,0xca,0xae,0x44,0x2e,0x00,0x72,0xe7,0x62,
0xf7,0x03,0xe7,0x4a,0xd7,0xa2,0x94,0x41,0xf3,0x80,0x0b,0xa2,0xb6,0x15,0x7a,0x14,0x1f,0x07,0xbe,0x1e,0x1d,0xfc,0xaa,0xf8,0x9c,0x07,0xfc,0xa7,0x74,0x11,0x7b,0x8a,0xd4,0x0c,0xc0,0xb1,0xb8,0x14,0xb8,0x43,0xba,0x0e,0xa5,0x02,0x74,0xa9,0xed,0x72,0xa7,0x74,0x11,0x1d,0x22,0x13,0x00,0x8e,0xc5,0x47,0x81,0x3f,0xa1,0x1f,0xb3,0xa9,
0xe2,0xd6,0x06,0x9c,0x62,0xbb,0xfc,0x45,0xba,0x10,0x88,0x48,0x00,0xe4,0xae,0xf8,0xbf,0x0c,0x8c,0x94,0xae,0x45,0xa9,0x10,0xbc,0x07,0x4c,0x88,0xc2,0x27,0x03,0x51,0xb9,0x06,0xf0,0x33,0x74,0xf0,0xab,0xf8,0x18,0x09,0xdc,0x22,0x5d,0x04,0x44,0x60,0x06,0xe0,0x58,0x9c,0x0e,0x3c,0x26,0x5d,0x87,0x52,0x02,0x4e,0xb7,0x5d,0x1e,0x97,
0x2c,0x40,0x34,0x00,0x74,0xea,0xaf,0x62,0x4e,0xfc,0x54,0x40,0xfa,0x14,0xe0,0x16,0x74,0xf0,0xab,0xf8,0x1a,0x49,0xcf,0x4f,0xb8,0x06,0x4e,0x6c,0x06,0xa0,0x53,0x7f,0xa5,0xde,0x27,0x76,0x2a,0x20,0x12,0x00,0x3a,0xf5,0x57,0xea,0x03,0xd6,0xe2,0x9d,0x0a,0x34,0x86,0xdd,0xb1,0xd4,0x29,0x80,0x4e,0xfd,0x95,0xda,0x6d,0x14,0x42,0x9f,
0x0a,0x84,0x3e,0x03,0xd0,0xa9,0xbf,0x52,0xdd,0x0a,0xfd,0x54,0x20,0xd4,0x00,0xd0,0xa9,0xbf,0x52,0x3d,0x0a,0xfd,0x54,0x20,0xec,0x53,0x00,0x9d,0xfa,0x2b,0xd5,0xbd,0xd0,0x4f,0x05,0x42,0x9b,0x01,0x38,0x16,0xa7,0x01,0x7f,0x08,0xab,0x3f,0xa5,0x0a,0x58,0x68,0xa7,0x02,0xa1,0x04,0x40,0x6e,0x81,0x8f,0x55,0xc0,0xfe,0x61,0xf4,0xa7,
0x54,0x81,0x7b,0x07,0xf8,0x50,0x18,0x0b,0x88,0x84,0x75,0x0a,0x70,0x09,0x3a,0xf8,0x95,0xea,0xad,0xfd,0xf1,0xc6,0x4c,0xe0,0x02,0x9f,0x01,0xe4,0x76,0xcf,0x79,0x0d,0x0d,0x00,0xa5,0xf2,0xf1,0x36,0x30,0x36,0xe8,0x59,0x40,0x18,0x33,0x80,0xcf,0xa3,0x83,0x5f,0xa9,0x7c,0x1d,0x00,0x5c,0x14,0x74,0x27,0x81,0xce,0x00,0x72,0x2b,0xeb,
0xae,0x02,0x0e,0x0c,0xb2,0x1f,0xa5,0x8a,0xd4,0x5b,0x78,0xb3,0x80,0x40,0x76,0x3b,0x82,0xe0,0x67,0x00,0x17,0xa2,0x83,0x5f,0xa9,0xbe,0x3a,0x10,0x98,0x19,0x64,0x07,0x81,0xcd,0x00,0x72,0x6b,0xb0,0xbb,0xe4,0xb7,0xa5,0x92,0x52,0xea,0x83,0x56,0x03,0x96,0xed,0xd2,0x16,0x44,0xe3,0x41,0xce,0x00,0x66,0xa2,0x83,0x5f,0x29,0xbf,0x6a,
0x81,0xcf,0x05,0xd5,0x78,0x20,0x33,0x80,0xdc,0xbb,0xff,0xab,0xc0,0xc1,0x41,0xb4,0xaf,0x54,0xcc,0xbc,0x0e,0x8c,0xb3,0x5d,0xda,0x4d,0x37,0x1c,0xd4,0x0c,0xe0,0x7c,0x74,0xf0,0x2b,0x65,0xca,0x18,0xbc,0x31,0x65,0x9c,0xf1,0x19,0x80,0x63,0x51,0x82,0xb7,0x1f,0xda,0x87,0x4c,0xb7,0xad,0x54,0x8c,0xad,0x02,0x0e,0x35,0x3d,0x0b,0x08,
0x62,0x0d,0xfe,0xf3,0xd0,0xc1,0xdf,0xa3,0x64,0x2a,0xcd,0x90,0xe9,0xa7,0x33,0xea,0xd3,0x97,0x52,0x7d,0xe4,0x47,0x00,0xc8,0x66,0xb3,0x40,0x16,0x32,0x19,0xef,0x9f,0x73,0x7f,0xb2,0xd9,0xcc,0xfb,0xff,0x4c,0x36,0x4b,0x36,0x93,0xf1,0xbe,0x2f,0x9b,0xf5,0xbe,0xaf,0xf3,0xf7,0x93,0xfb,0xff,0xdd,0xfc,0x7c,0xc7,0xf7,0x43,0x76,0xf7,
0xcf,0x7c,0xa0,0xbf,0x3d,0xfa,0xee,0xa2,0x2f,0xb2,0x59,0xb2,0x74,0xf5,0xb3,0xbd,0xab,0xb5,0xf3,0xcf,0xaf,0x7b,0xf4,0x3e,0x36,0x3e,0xa9,0x4f,0x86,0xf7,0xd2,0x58,0xbc,0x1d,0xb3,0xee,0x33,0xd9,0xa8,0xd1,0x19,0x80,0x63,0x91,0x04,0x56,0x02,0x96,0xc9,0x76,0x8b,0x59,0xbf,0x03,0xc7,0x32,0xf2,0x33,0x97,0x32,0xf2,0xac,0x8b,0x48,
0x0f,0x31,0xbd,0x0b,0x7a,0xb4,0x65,0xdb,0x5a,0x59,0xf1,0xc5,0x33,0xd8,0xb4,0x78,0x81,0x74,0x29,0x85,0xe2,0x55,0x60,0xbc,0xed,0x92,0x31,0xd5,0xa0,0xe9,0x00,0x38,0x07,0x78,0xc0,0x64,0x9b,0x71,0x91,0x4c,0xa5,0x19,0x72,0xe2,0x69,0x1c,0x70,0xf1,0x37,0x18,0x38,0xe5,0x18,0xe9,0x72,0x42,0x93,0x69,0xde,0xc5,0x8b,0x97,0x9e,0x42,
0xc3,0xb3,0x4f,0x4b,0x97,0x52,0x28,0xce,0xb5,0x5d,0x1e,0x34,0xd5,0x98,0xe9,0x8b,0x80,0xa1,0x3c,0xc0,0x50,0x8c,0x32,0xad,0x2d,0xd4,0x2f,0xfc,0x1d,0xcb,0xcf,0x3f,0x9e,0x55,0x37,0x7c,0x9d,0x4c,0xf3,0x2e,0xe9,0x92,0x42,0x91,0x2c,0x2b,0x67,0xe2,0xed,0x8f,0x33,0x60,0xf2,0xd1,0xd2,0xa5,0x14,0x8a,0x8b,0x4d,0x36,0x66,0x6c,0x06,
0xe0,0x58,0x0c,0xc3,0x5b,0xd1,0xa4,0xc4,0x54,0x9b,0x71,0xd6,0xef,0xe0,0x43,0x18,0x3f,0x67,0x2e,0x03,0x26,0x1d,0x25,0x5d,0x4a,0x28,0xda,0xb6,0x36,0xb2,0x7c,0xe6,0x89,0x6c,0x5f,0xf9,0x82,0x74,0x29,0x51,0xd7,0x0e,0x8c,0xb4,0x5d,0xea,0x4d,0x34,0x66,0x72,0x06,0xf0,0x69,0x74,0xf0,0x1b,0xd3,0xf4,0xc6,0x2b,0x3c,0x77,0xee,0xbf,
0xf1,0xfa,0x8f,0xbf,0x43,0xa6,0x35,0xf0,0xc7,0xc2,0xc5,0x95,0x0e,0x18,0xc4,0x94,0x5f,0xff,0x99,0xfe,0x1f,0x1a,0x2f,0x5d,0x4a,0xd4,0x95,0xe0,0x8d,0x35,0x23,0x4c,0x06,0xc0,0x39,0x06,0xdb,0x52,0x40,0xb6,0xbd,0x8d,0xb7,0x6e,0x9f,0xc3,0xb2,0xb3,0xa6,0xd2,0xb4,0xfa,0x55,0xe9,0x72,0x02,0x97,0xaa,0xae,0x61,0xca,0xdc,0xbf,0x50,
0x71,0xc0,0x18,0xe9,0x52,0xa2,0xce,0xd8,0x58,0x33,0x72,0x0a,0xe0,0x58,0x8c,0xc6,0x7b,0x7e,0x59,0x7c,0xaf,0xc1,0x62,0x55,0x36,0x7c,0x3f,0xea,0xe6,0x2d,0xa6,0x62,0x74,0xf1,0xdf,0x5d,0xbd,0x6b,0xed,0x5b,0x2c,0x3f,0xff,0xc3,0xec,0x5a,0xfb,0xb6,0x74,0x29,0x51,0x95,0x05,0xf6,0xb7,0x5d,0xd6,0xf8,0x6d,0xc8,0x54,0x00,0x5c,0x0d,
0xdc,0x64,0xa2,0xad,0x42,0x52,0x5a,0x99,0xa0,0xfa,0xb0,0x34,0xe5,0x43,0x4b,0x28,0xab,0x4e,0x92,0xae,0x4e,0x52,0x36,0x38,0x49,0x32,0x95,0xa0,0x79,0x73,0x86,0x96,0xcd,0x19,0x9a,0x1b,0xda,0x69,0xde,0x94,0xa1,0x71,0x65,0x2b,0xbb,0xea,0xfd,0xdd,0xc3,0x51,0x31,0xba,0x96,0xba,0x79,0x8b,0x29,0x1b,0xbe,0x9f,0xa1,0xdf,0x20,0xba,
0x9a,0xde,0x5a,0xc5,0xf2,0xf3,0x3e,0x4c,0xcb,0xc6,0x75,0xd2,0xa5,0x44,0xd5,0xd5,0xb6,0xcb,0x4f,0xfc,0x36,0x62,0x2a,0x00,0x96,0x01,0x47,0x98,0x68,0x2b,0xea,0xca,0x6b,0x4a,0xa8,0x99,0x96,0x66,0xe8,0xb4,0x32,0x06,0x8d,0x4f,0x93,0xc8,0xe3,0xaa,0xc7,0xf6,0xd5,0x6d,0xd4,0x3f,0xdb,0x4c,0xfd,0xb2,0x66,0xb6,0xbf,0xd9,0xe6,0xe5,
0x78,0x9e,0xfa,0xd5,0x8e,0xa3,0xee,0xfe,0x45,0xb1,0xb8,0x67,0x60,0xc7,0xaa,0x97,0x59,0xfe,0xb9,0x13,0x68,0x6d,0xd8,0x28,0x5d,0x4a,0x14,0x2d,0xb3,0x5d,0xa6,0xf9,0x6d,0xc4,0x77,0x00,0x38,0x16,0x63,0xf0,0x96,0xfc,0x2a,0x6a,0xfd,0x46,0x95,0x30,0xe6,0x82,0x4a,0x86,0x1e,0x55,0x66,0xa4,0xbd,0x6d,0xaf,0xb7,0xf1,0xda,0xbd,0xdb,
0x69,0x78,0x29,0xff,0x0b,0x7c,0x95,0xe3,0x26,0x52,0x77,0xdf,0xd3,0x94,0x0e,0xa8,0x36,0x52,0x4b,0x94,0x6d,0x7b,0x79,0x39,0xcf,0x5f,0x38,0x9d,0xb6,0x6d,0x5b,0xa4,0x4b,0x89,0xa2,0x31,0xb6,0xcb,0x1b,0x7e,0x1a,0x30,0x71,0x11,0xb0,0xa8,0x2f,0xfe,0xa5,0xab,0x93,0x8c,0xbb,0xac,0x8a,0xa3,0x6e,0x19,0x62,0x6c,0xf0,0x03,0x54,0x8d,
0x29,0x65,0xca,0xb5,0x83,0x98,0x7c,0xcd,0x20,0x2a,0x0f,0xca,0xef,0x8e,0xec,0xed,0xaf,0xae,0xe0,0x85,0x4b,0x4e,0x8e,0xc5,0xbd,0x02,0x55,0x13,0xea,0x98,0x74,0xc7,0x1f,0x29,0xe9,0x57,0x29,0x5d,0x4a,0x14,0xf9,0x1e,0x7b,0xbe,0x3f,0xb6,0xbb,0x70,0x08,0xbf,0x00,0x8a,0x72,0x3e,0x3a,0xfc,0xdf,0xca,0x99,0x72,0xed,0x20,0x06,0x8e,
0x4b,0x91,0x08,0xe8,0xf2,0x66,0xc5,0x88,0x12,0xf6,0xfb,0x58,0x05,0xc9,0x74,0x82,0xc6,0x7f,0xb5,0xf4,0xfa,0xb4,0xa0,0x79,0xfd,0x1a,0x48,0x24,0xa8,0x3e,0x7a,0x7a,0x30,0x85,0x45,0x48,0xf9,0xc8,0xfd,0x19,0x38,0xf9,0x68,0x36,0x2c,0x78,0x98,0x6c,0x5b,0x20,0xeb,0x62,0x14,0xaa,0x61,0xf7,0x6c,0xe2,0x36,0x3f,0x0d,0xf8,0x3a,0xac,
0x1d,0x8b,0x09,0xc0,0xbf,0xfc,0xb4,0x11,0x45,0x89,0x04,0xd4,0x9e,0xdb,0x9f,0x83,0xce,0xee,0x1f,0x6a,0xbf,0x9b,0x9e,0x6b,0xe1,0xe5,0x9f,0x6e,0xa1,0x6d,0x67,0xef,0x52,0x20,0x99,0x2e,0x63,0xda,0xe3,0x2f,0xd1,0xef,0xc0,0xb1,0x01,0x57,0x16,0x0d,0x9b,0xfe,0xfa,0x47,0x5e,0xba,0xfc,0xac,0x58,0xdc,0x17,0x91,0x87,0x09,0xb6,0xcb,
0xff,0xf5,0xf5,0x87,0xfd,0x9e,0x02,0x14,0xdd,0xf4,0xbf,0xa4,0x3c,0xc1,0x61,0xdf,0x1a,0x18,0xfa,0xe0,0x07,0x18,0x32,0x35,0xcd,0xd4,0x39,0xd5,0x54,0x0c,0xef,0xdd,0xc4,0x2c,0xd3,0xd2,0x8c,0x7b,0xdd,0x57,0x02,0xae,0x2a,0x3a,0x86,0x7c,0xe4,0x54,0xc6,0xff,0xf8,0x7e,0x12,0x25,0x41,0x3c,0xc4,0x5a,0xb0,0x7c,0x8d,0x41,0xbf,0x01,
0xf0,0x59,0x9f,0x3f,0x1f,0x29,0x89,0x12,0x98,0xf8,0x9d,0x81,0x0c,0x9d,0x66,0xee,0x5c,0x3f,0x5f,0xfd,0x47,0x97,0x52,0x77,0x7d,0x35,0x65,0x83,0x7b,0xf7,0x57,0xb3,0xf9,0x99,0x85,0x6c,0x58,0xf0,0x70,0xc0,0x55,0x45,0xc7,0xb0,0x19,0x9f,0xe2,0xd0,0x1b,0xee,0x22,0x91,0x94,0xda,0xd9,0x3e,0x72,0x7c,0x8d,0xc1,0x3e,0xbf,0x8a,0x8e,
0x45,0x1d,0xde,0x33,0xca,0x45,0xc3,0xba,0xa4,0x8a,0xea,0xc3,0xd2,0xd2,0x65,0x50,0x36,0x38,0xc9,0xe1,0xdf,0x1e,0x48,0x32,0xdd,0xbb,0x33,0xb4,0x55,0xb3,0xaf,0xa2,0xbd,0x69,0x7b,0xc0,0x55,0x45,0xc7,0x88,0x4f,0x7c,0x0e,0xeb,0x07,0x3f,0x27,0xb0,0x0b,0x33,0x85,0xc5,0xca,0x8d,0xc5,0x3e,0xe9,0xf3,0x45,0xc0,0x0b,0x87,0xd0,0x04,
0x9c,0x08,0x8c,0xee,0x6b,0x1b,0x51,0xb2,0xdf,0xc9,0x15,0xd4,0x7e,0x26,0xfc,0x69,0x7f,0x77,0xca,0x06,0x97,0x50,0x31,0xbc,0x84,0xfa,0x7f,0x34,0xef,0xf3,0x7b,0xdb,0x77,0x6c,0xa3,0x75,0xd3,0x06,0x4a,0xaa,0x06,0xd0,0xb2,0x61,0x2d,0xad,0x9b,0xd6,0xd3,0xda,0xb0,0x91,0xb6,0xad,0x0d,0xb4,0x6d,0xdf,0x4a,0x66,0xe7,0x0e,0x32,0xcd,
0xbb,0xc8,0xb6,0xb5,0x92,0xcd,0x64,0x48,0x24,0x13,0x05,0xff,0x0e,0x3a,0xe0,0xf0,0x23,0x28,0xe9,0x5f,0xc5,0xe6,0x25,0x7f,0x96,0x2e,0x45,0xda,0x52,0xe0,0xd6,0x7b,0x36,0xb1,0xef,0x03,0xa5,0x0b,0x7e,0x2f,0x02,0x0e,0x00,0xfe,0x04,0x1c,0xeb,0xa7,0x1d,0x69,0x03,0xac,0x14,0x53,0x67,0x55,0x93,0x88,0xe0,0x98,0x58,0x75,0xd7,0x76,
0xde,0x99,0xdf,0x64,0xbc,0xdd,0x44,0x32,0x49,0xa2,0x34,0x45,0x22,0x95,0x26,0x99,0x4a,0xbf,0xff,0x35,0x99,0x4a,0x93,0x48,0x7f,0xf0,0xbf,0x75,0xf7,0x3d,0x89,0xd2,0xd4,0xee,0x7f,0xcf,0x7d,0x4d,0x0d,0x1a,0xc2,0x7e,0xe7,0x5f,0x4e,0xa2,0x24,0x9c,0xe7,0xc2,0x56,0x7c,0xf1,0x74,0x36,0x3e,0x15,0xca,0x46,0xba,0x51,0xb4,0x04,0x38,
0xc5,0x76,0xd9,0xd6,0xd7,0x06,0x7c,0x5d,0x4d,0xb1,0x5d,0xb6,0x3a,0x16,0x33,0x80,0xf9,0xc0,0x87,0xfd,0xb4,0x25,0x26,0x01,0x63,0x2f,0xaa,0x8c,0xe4,0xe0,0x07,0xa8,0x3d,0xa7,0x3f,0xeb,0x16,0xed,0xa2,0x75,0x9b,0xb1,0x45,0x60,0x00,0xc8,0x66,0x32,0x64,0x5b,0x9a,0xa1,0xa5,0xd9,0xd8,0x22,0x73,0x65,0xc3,0x46,0x31,0xe9,0xf6,0xf9,
0xa1,0x0d,0xfe,0x77,0xef,0xbd,0x95,0x8d,0x4f,0xcf,0x0f,0xa5,0xaf,0x08,0xfa,0x2b,0x70,0x9a,0xed,0xe2,0xeb,0xdc,0xcf,0xf7,0x61,0x9f,0x2b,0xe0,0x14,0xe0,0x49,0xbf,0x6d,0x49,0x18,0x3a,0xad,0x8c,0x81,0xe3,0x52,0xd2,0x65,0x74,0xab,0xb4,0x5f,0x82,0x03,0xcf,0xee,0x27,0x5d,0xc6,0x3e,0xf5,0x1f,0x7b,0x18,0x53,0x1f,0x5a,0x4a,0xe5,
0xa1,0x93,0x43,0xe9,0xef,0xdd,0x7b,0x6f,0xc5,0x9d,0x75,0x65,0x6e,0x2d,0xc4,0xd8,0x71,0x80,0x53,0xfd,0x0e,0x7e,0x30,0xf4,0x38,0xb0,0xed,0xd2,0x04,0x9c,0x06,0x2c,0x34,0xd1,0x5e,0x58,0x12,0x25,0x30,0xe6,0x82,0xe8,0xdf,0x61,0x36,0xfa,0x94,0x0a,0xca,0x87,0x45,0x77,0xa9,0x85,0xea,0x63,0x6c,0xa6,0x3e,0xb8,0x84,0xf2,0x91,0xe1,
0xec,0x01,0x1b,0xf3,0xc1,0xff,0x04,0x70,0x7a,0x6e,0xcc,0xf9,0x66,0x6c,0xe2,0x6b,0xbb,0xec,0x04,0xce,0x00,0xfe,0x68,0xaa,0xcd,0xa0,0x0d,0x3f,0xbe,0x9c,0x7e,0xa3,0xa2,0x3b,0xb0,0x3a,0x24,0x4b,0x13,0x1c,0xf4,0xc9,0x68,0xce,0x02,0x46,0x9c,0x39,0x93,0xc9,0x77,0x2e,0xa0,0xb4,0x72,0x40,0x28,0xfd,0xc5,0x7c,0xf0,0xcf,0x07,0x3e,
0x91,0x1b,0x6b,0x46,0x18,0x3d,0xf3,0xb5,0x5d,0x9a,0x81,0xb3,0x80,0x82,0x58,0xeb,0x79,0xd8,0x31,0x72,0x9f,0xf7,0xe7,0x6b,0xe8,0xd1,0x65,0x79,0x3d,0x79,0x18,0xb8,0x44,0x82,0xda,0xcb,0x7f,0xc0,0xf8,0xff,0xba,0x3b,0xb4,0x1b,0x73,0x62,0x3e,0xf8,0x1f,0x05,0x3e,0x99,0x1b,0x63,0xc6,0x18,0xbf,0xf4,0x65,0xbb,0xb4,0x00,0x9f,0x02,
0x1e,0x31,0xdd,0xb6,0x49,0x25,0xe5,0x09,0x06,0x4f,0x92,0xff,0xcc,0xbf,0xb7,0x52,0x55,0xc9,0xc8,0x5c,0xab,0x48,0x94,0xa6,0x38,0x74,0xd6,0x9d,0xd4,0x5e,0xf1,0xa3,0xd0,0xfa,0x8c,0xf9,0xe0,0x7f,0x04,0xf8,0x74,0x6e,0x6c,0x19,0x15,0xc8,0xb5,0xef,0xdc,0x7e,0xe6,0xe7,0x00,0x0f,0x05,0xd1,0xbe,0x09,0x83,0x27,0xa7,0x49,0xa6,0x0a,
0xeb,0x46,0x12,0xc9,0x3b,0x14,0x3b,0x94,0x56,0x0e,0x60,0xd2,0xed,0xf3,0x19,0x79,0xf6,0xe7,0x43,0xeb,0x33,0xe6,0x83,0xff,0x37,0xc0,0x39,0xb9,0x31,0x65,0x5c,0x60,0x1f,0x7e,0xe5,0xb6,0x33,0x3e,0x0f,0xb8,0x3f,0xa8,0x3e,0xfc,0xa8,0x39,0x52,0x7e,0x30,0xe5,0xab,0x46,0x38,0x00,0xca,0x46,0x8c,0xa6,0x6e,0xde,0x62,0x06,0x1f,0x77,
0x52,0x68,0x7d,0xc6,0x7c,0xf0,0xdf,0x07,0x9c,0x1f,0xd4,0xd6,0xe0,0x10,0xec,0xf6,0xe0,0xe4,0xf6,0x31,0x9b,0x09,0xcc,0x0d,0xb2,0x9f,0xbe,0xa8,0xdc,0xbf,0xf0,0x1e,0x28,0xa9,0x18,0x5e,0xd2,0xeb,0xdb,0x83,0x4d,0xab,0x1c,0x37,0x91,0x23,0x1e,0x5a,0x4a,0xe5,0xb8,0x89,0xa1,0xf5,0x19,0xf3,0xc1,0xff,0x6b,0xe0,0xc2,0x20,0x76,0x04,
0xee,0x2c,0xf0,0xdb,0x5f,0x72,0xdb,0x18,0x5d,0x0c,0xdc,0x11,0x74,0x5f,0xf9,0xe8,0xed,0xc3,0x36,0x51,0x53,0x56,0x1d,0x7e,0xdd,0x83,0x8f,0x3b,0x89,0xa9,0x0f,0x3c,0x13,0xea,0x5a,0x84,0x31,0x1f,0xfc,0x77,0x00,0x97,0x98,0xdc,0x02,0xac,0x3b,0xa1,0x1c,0x4d,0xb6,0x4b,0x16,0xb8,0x0c,0xf8,0x45,0x18,0xfd,0xed,0x4b,0xa2,0x04,0x52,
0x83,0x0a,0x34,0x00,0x42,0x0e,0xae,0x91,0x67,0x7f,0xde,0x5b,0x91,0xa7,0x7f,0x55,0x68,0x7d,0xc6,0x7c,0xf0,0xff,0x02,0xb8,0x2c,0x37,0x66,0x02,0x17,0xda,0x3c,0x38,0xf7,0x0b,0x5d,0xee,0x58,0xb4,0x02,0x57,0x86,0xd5,0x6f,0x57,0xd2,0x03,0x93,0x05,0xfb,0x20,0x59,0x3a,0xac,0x19,0x40,0x22,0x41,0xed,0x57,0xaf,0xa5,0xf6,0xf2,0x1f,
0x84,0xd3,0x5f,0x4e,0xcc,0x07,0xff,0xcd,0xb6,0xcb,0x55,0x61,0x76,0x18,0xfa,0xdb,0xa0,0xed,0xf2,0x35,0x84,0x97,0x10,0x4f,0x55,0x15,0xe6,0xbb,0x3f,0x40,0x6a,0x40,0xf0,0xb5,0x27,0x53,0x69,0xc6,0xcf,0x99,0xab,0x83,0x3f,0x5c,0x37,0x86,0x3d,0xf8,0x41,0x20,0x00,0x00,0x6c,0x97,0x6f,0x02,0x37,0x48,0xf4,0x0d,0x18,0x7f,0xb0,0x26,
0x4c,0xad,0x5b,0x83,0xad,0xbd,0xb4,0x6a,0x20,0x93,0x7e,0xf5,0x27,0x46,0x9c,0x39,0x33,0xd0,0x7e,0xf6,0x14,0xf3,0xc1,0x3f,0xdb,0x76,0xf9,0x96,0x44,0xc7,0x62,0x6f,0x85,0xb6,0xcb,0x77,0x81,0xeb,0x24,0xfa,0x6e,0xd9,0x92,0xe9,0xd3,0x9a,0xfc,0x51,0xd0,0xd2,0x10,0x5c,0x00,0x94,0x8f,0xdc,0x9f,0xa9,0x0f,0x3c,0x13,0xfa,0x42,0xa3,
0x31,0x1f,0xfc,0x3f,0xb2,0x5d,0xbe,0x27,0xd5,0xb9,0xe8,0x5c,0xd8,0x76,0xf9,0x21,0x70,0x4d,0xd8,0xfd,0x66,0xdb,0x73,0x21,0x50,0x80,0x9a,0x03,0x0a,0x80,0xca,0x43,0x27,0x33,0xf5,0xa1,0xa5,0xf4,0x1f,0x7b,0x58,0x20,0xed,0x77,0x27,0xe6,0x83,0xff,0xfb,0xb6,0xcb,0xb5,0x92,0x05,0x88,0x9f,0x0c,0xdb,0x2e,0xd7,0x03,0xb7,0x84,0xdd,
0x6f,0xf3,0xe6,0xc2,0x0c,0x80,0x20,0x66,0x00,0x43,0x8e,0x3f,0x99,0xa9,0xf3,0x16,0x53,0x36,0x6c,0x94,0xf1,0xb6,0x7b,0x12,0xf3,0xc1,0x7f,0xb3,0xed,0x32,0x4b,0xba,0x08,0xf1,0x00,0xc8,0x79,0x27,0xec,0x0e,0x77,0xbc,0x5b,0x78,0xeb,0xcb,0xef,0xda,0xd0,0x4e,0x7b,0xb3,0xd9,0xc1,0x32,0xea,0xd3,0x97,0x32,0xf1,0x97,0x8f,0x87,0xbe,
0xf1,0x46,0xcc,0x07,0x3f,0x08,0x1c,0xf3,0x5d,0x89,0x4a,0x00,0x0c,0x0a,0xbb,0xc3,0x8d,0xcb,0x8c,0x3e,0x54,0x15,0x8a,0x8d,0xcb,0x0c,0x3e,0x0b,0x92,0x48,0x70,0xf0,0xd7,0xae,0xe7,0x90,0xeb,0xef,0x08,0x6d,0x05,0x9f,0x0e,0x3a,0xf8,0x01,0x81,0x63,0xbe,0x2b,0x51,0xb9,0x1f,0x36,0xf4,0x4d,0xee,0x36,0x3d,0xdf,0x42,0xa6,0x2d,0x4b,
0xb2,0xb4,0x70,0x6e,0x08,0xa8,0x7f,0xd6,0x4c,0x68,0x25,0x53,0x69,0x0e,0x99,0x7d,0x27,0x23,0xce,0xb8,0xc0,0x48,0x7b,0xf9,0xd0,0xc1,0xff,0xbe,0x48,0x6c,0xec,0x18,0x95,0x19,0x40,0xe8,0x2f,0x46,0xfb,0xce,0x2c,0x0d,0x2b,0x02,0x79,0xc0,0x2a,0x10,0x6d,0xdb,0xb3,0x34,0xae,0xf4,0x3f,0x03,0x28,0x1d,0x30,0x88,0x49,0x77,0x2e,0xd0,
0xc1,0x2f,0x4f,0x03,0xa0,0x13,0x91,0x17,0x63,0xc3,0xdf,0x0b,0x67,0x73,0xcd,0xfa,0x67,0x9b,0xc9,0xfa,0x7c,0x2c,0xa4,0x7c,0xd4,0x81,0x4c,0x7d,0x60,0x09,0xd5,0x47,0x9d,0x68,0xa6,0xa8,0x3c,0xe8,0xe0,0xdf,0x8b,0x06,0x40,0x27,0x22,0xe7,0x43,0xeb,0x17,0x35,0xb3,0x73,0x5d,0xa0,0x0f,0x5b,0x19,0x91,0x6d,0x87,0x37,0x7f,0xbb,0xc3,
0x57,0x1b,0x55,0x13,0xea,0x38,0xe2,0xe1,0xa5,0xf4,0xff,0xd0,0x78,0x43,0x55,0xf5,0x9e,0x0e,0xfe,0x2e,0x45,0xe2,0x1a,0x40,0x54,0x02,0x40,0x24,0x0d,0x33,0x6d,0x59,0x5e,0xbf,0x3f,0xfa,0x3b,0xea,0xac,0x59,0xb0,0x93,0x9d,0xeb,0xfb,0x1e,0x54,0x43,0x3e,0x72,0x2a,0x75,0xf7,0x2f,0x22,0x5d,0x33,0xc2,0x60,0x55,0xbd,0xa3,0x83,0xbf,
0x5b,0x3a,0x03,0xe8,0x44,0xec,0xc5,0xd8,0xf0,0xf7,0x66,0xb6,0xbe,0x16,0xdd,0x6b,0x01,0xed,0x3b,0xb3,0xac,0xf6,0xf1,0xee,0x3f,0xea,0xb3,0x5f,0x60,0xe2,0x6d,0x8f,0x51,0x52,0x11,0xfe,0xae,0x47,0x3a,0xf8,0x7b,0xa4,0x01,0xd0,0x89,0xdc,0x74,0x28,0x0b,0xaf,0xcd,0xdd,0x1e,0xd9,0x63,0x74,0xf5,0xc3,0x3b,0xfa,0x74,0xff,0x7f,0x22,
0x99,0x64,0xcc,0xd7,0x67,0x73,0xc8,0x75,0xbf,0x0c,0xfd,0x63,0x3e,0xd0,0xc1,0xdf,0x0b,0x1a,0x00,0x00,0x8e,0x45,0x05,0x20,0xba,0xd6,0x55,0xe3,0xca,0x56,0x5e,0x9b,0x1b,0xbd,0x53,0x81,0x0d,0x7f,0x6f,0xe6,0x9d,0xc7,0xf2,0x5f,0xfe,0x3d,0x99,0x2e,0x63,0xfc,0x8d,0xf7,0x71,0xe0,0x65,0xdf,0x09,0xa0,0xaa,0x7d,0xd3,0xc1,0xdf,0x2b,
0x65,0x8e,0x45,0xb9,0x74,0x11,0xe2,0x01,0x40,0x44,0x92,0xf0,0x9d,0xf9,0x4d,0xbc,0xf7,0x64,0x74,0x3e,0x15,0xd8,0xb6,0xba,0x8d,0x95,0xb7,0x6e,0xcd,0x7b,0x0c,0xa5,0x06,0x0e,0x66,0xf2,0x5d,0x0b,0x19,0x7e,0xda,0xb9,0xc1,0x14,0xb6,0x0f,0x3a,0xf8,0xf3,0x22,0x7e,0xec,0x6b,0x00,0x74,0xc8,0xc2,0xab,0xb7,0x6f,0xa3,0x71,0xa5,0xfc,
0xf5,0x80,0x96,0xc6,0x0c,0x2f,0xcd,0xd9,0x92,0xf7,0x6d,0xbf,0x15,0xa3,0x6b,0x99,0xfa,0xe0,0x12,0x06,0x1d,0x29,0xb3,0x4d,0xa3,0x0e,0xfe,0xbc,0x89,0x1f,0xfb,0x51,0x08,0x80,0xc8,0xc8,0xb4,0x66,0x59,0x31,0xbb,0x91,0x4d,0xcb,0x8d,0x2f,0xbf,0xde,0x6b,0x4d,0xef,0xb5,0xb3,0xfc,0x07,0x0d,0xec,0xda,0x98,0xdf,0x55,0xff,0xaa,0xc3,
0x8e,0x60,0xea,0x43,0x4b,0xe9,0x77,0xf0,0x21,0x01,0x55,0xd6,0x33,0x1d,0xfc,0x85,0x29,0x0a,0x01,0xd0,0x20,0x5d,0x40,0x67,0x6d,0x4d,0x59,0x56,0xdc,0xd0,0xc8,0xdb,0x7d,0x38,0xf7,0xf6,0x6b,0xf3,0x8b,0x2d,0xfc,0xf3,0x3f,0x36,0xd3,0xb4,0x26,0xbf,0xc1,0x5f,0x33,0xfd,0x74,0xea,0xee,0xfb,0x2b,0xe9,0x21,0xc3,0x02,0xaa,0xac,0x67,
0x3a,0xf8,0xfb,0x4c,0xfc,0xd8,0xd7,0x00,0xe8,0x42,0x36,0x03,0xaf,0xdd,0xbd,0x9d,0x95,0xff,0xb3,0x95,0x4c,0x6b,0x38,0x07,0xf5,0x3b,0xf3,0x9b,0x78,0x71,0x56,0x23,0x6d,0xdb,0xf3,0xeb,0x6f,0xbf,0xf3,0xbe,0xcc,0xe1,0x3f,0xff,0x3d,0x25,0x15,0x32,0x7b,0x07,0xae,0xfb,0xfd,0x3d,0x3a,0xf8,0xfb,0x4e,0xfc,0xd8,0x8f,0xc4,0x93,0x30,
0x8e,0xc5,0x2e,0x84,0x3f,0x09,0xe8,0x4e,0x79,0x4d,0x09,0xb5,0xe7,0xf4,0x67,0xe4,0x09,0xe5,0x81,0xbc,0x5a,0x8d,0x2f,0xb7,0xf2,0xda,0xbd,0xdb,0xd9,0xba,0x2a,0xbf,0x6b,0x0f,0x89,0x64,0x92,0x31,0x57,0xcf,0xe1,0x80,0x4b,0xbf,0x69,0xbe,0xa8,0x3c,0xb4,0x6c,0x5c,0xc7,0xf2,0xcf,0x9d,0x48,0xd3,0x1b,0xaf,0x88,0xd6,0x51,0x80,0x9a,
0x6d,0x57,0xfe,0x53,0x80,0xa8,0x04,0xc0,0x3a,0x60,0xb8,0x74,0x1d,0x3d,0xa9,0x3c,0xb0,0x94,0x31,0x17,0x54,0x32,0xa4,0xce,0xcc,0x7e,0x82,0x3b,0xde,0x6e,0xe3,0xb5,0x7b,0xb7,0xb3,0xe9,0xf9,0x96,0xbc,0x97,0x27,0x4b,0x96,0x95,0x33,0xfe,0xbf,0xee,0x66,0xd8,0x29,0x9f,0x31,0x52,0x8b,0x5f,0x1a,0x02,0x7d,0xb2,0xce,0x76,0x19,0x29,
0x5d,0x44,0x54,0x02,0x60,0x25,0x20,0x73,0xf5,0x2a,0x4f,0xfd,0x46,0x95,0x50,0x73,0x64,0x19,0x43,0xa7,0x95,0x79,0x9b,0x75,0xe6,0xf1,0x0a,0x36,0xad,0x69,0xa7,0xfe,0xd9,0x66,0xea,0x9f,0x6d,0x66,0xdb,0xaa,0xd6,0x3e,0xcd,0x9a,0x4b,0xab,0x06,0x32,0xf1,0xb6,0xc7,0xc4,0xae,0xf4,0x77,0x47,0x43,0x20,0x6f,0x2b,0x6d,0x97,0xf0,0x1f,
0xcc,0xd8,0x43,0x54,0x02,0xe0,0x6f,0xc0,0x31,0xd2,0x75,0xe4,0x2b,0x3d,0x28,0xc9,0xe0,0x89,0x69,0xca,0x6a,0x92,0x94,0x0d,0x2e,0xa1,0xac,0x3a,0x49,0xba,0x3a,0x49,0x32,0x95,0xa0,0x79,0x73,0x3b,0x2d,0x0d,0x19,0x9a,0x37,0x67,0x68,0x6e,0xc8,0xd0,0xf8,0x72,0x0b,0x4d,0x6b,0xfd,0x3d,0x78,0x94,0xaa,0xae,0x61,0xf2,0x9d,0x4f,0x50,
0x35,0xa1,0xce,0xd0,0x6f,0x60,0x96,0x86,0x40,0x5e,0xfe,0x66,0xbb,0x1c,0x27,0x5d,0x44,0x54,0x16,0x04,0x69,0x94,0x2e,0xa0,0x2f,0x5a,0x1a,0x33,0xac,0x5b,0x14,0xce,0xcd,0x43,0x65,0xc3,0x46,0x31,0xf9,0xd7,0x7f,0x16,0x79,0x9a,0xaf,0xb7,0xd2,0x35,0x23,0xa8,0xbb,0xf7,0x29,0x0d,0x81,0xde,0x89,0xc4,0x31,0x1f,0x85,0x4f,0x01,0x20,
0x02,0x57,0x43,0xa3,0xac,0x62,0x74,0x2d,0x75,0xf3,0x16,0x47,0x7a,0xf0,0x77,0xe8,0x08,0x01,0xa9,0xfb,0x11,0x0a,0x48,0x24,0x8e,0x79,0x0d,0x80,0x28,0x4b,0x24,0x18,0x7e,0xea,0x67,0x39,0xe2,0x91,0x65,0x54,0xec,0x7f,0xb0,0x74,0x35,0xbd,0xa6,0x21,0xd0,0x2b,0x91,0x38,0xe6,0x35,0x00,0x22,0x2a,0x35,0x78,0x28,0x87,0xdd,0xf2,0x10,
0x13,0x7e,0xfa,0x20,0xa9,0x41,0x43,0xa4,0xcb,0xc9,0x9b,0x86,0xc0,0x3e,0x45,0xe2,0x98,0x8f,0x4a,0x00,0x44,0xe2,0x7c,0x28,0x2a,0x86,0xce,0x38,0x9b,0xa3,0xe7,0xbf,0xcc,0xb0,0x19,0x9f,0x92,0x2e,0xc5,0x17,0x0d,0x81,0x1e,0x45,0xe2,0x98,0x8f,0x4a,0x00,0xec,0x2f,0x5d,0x80,0xb4,0x44,0x32,0x49,0xcd,0xf4,0x33,0xa8,0x9b,0xb7,0x98,
0xc3,0x7f,0xf6,0x5b,0x52,0x83,0x87,0x4a,0x97,0x64,0x84,0x86,0x40,0xb7,0x22,0x71,0xcc,0x8b,0x7f,0x0c,0xe8,0x58,0x5c,0x83,0xd0,0x1e,0x81,0x51,0x90,0x2c,0x2b,0x67,0xc4,0x99,0x33,0x39,0xe0,0xe2,0xab,0xe9,0x77,0x90,0x25,0x5d,0x4e,0x60,0xf4,0x23,0xc2,0x2e,0x5d,0x93,0xdb,0x19,0x4b,0x8c,0x68,0x00,0x38,0x16,0xd7,0x21,0xb0,0x37,
0xa0,0xb4,0x54,0x75,0x0d,0xd5,0x47,0x9d,0xc8,0xe0,0x63,0x3f,0x4a,0xcd,0x47,0xcf,0x14,0x7b,0x88,0x27,0x6c,0x1a,0x02,0x5d,0xba,0x2e,0xb7,0x47,0xa6,0x08,0xb1,0x00,0x70,0x2c,0x66,0x03,0x32,0x4b,0xd6,0x98,0x92,0x48,0xf4,0xfa,0x21,0x98,0x44,0x49,0x09,0x55,0xe3,0xeb,0xa8,0x3e,0xf6,0xa3,0x54,0x1d,0x3a,0xd9,0xfb,0xd9,0x8e,0x36,
0xf6,0xfc,0xde,0xae,0xfe,0x5a,0xba,0xf8,0x3e,0x12,0x09,0x12,0x25,0x25,0x24,0x52,0x69,0x92,0xa5,0x29,0xef,0x6b,0x2a,0x9d,0xfb,0xba,0xc7,0xbf,0xef,0xf1,0xff,0x25,0x96,0x09,0x03,0x0d,0x81,0x6e,0xcc,0x96,0xda,0x21,0x58,0x24,0x00,0x1c,0x8b,0x9b,0x80,0xab,0x25,0xfa,0x56,0x9e,0x44,0x32,0x49,0xa2,0x53,0x28,0x54,0x1f,0x3d,0x9d,
0x09,0x3f,0x99,0x47,0xa2,0x24,0xf8,0x7b,0xc3,0x34,0x04,0xba,0x74,0x93,0xed,0x12,0xfa,0x93,0x5d,0xa1,0x07,0x80,0x63,0x71,0x0b,0x70,0x45,0xd8,0xfd,0xaa,0x7d,0xab,0xb1,0x3f,0xc1,0xe1,0xb7,0xfe,0x56,0x43,0x40,0xce,0x2d,0xb6,0xcb,0xd7,0xc2,0xec,0x30,0xb4,0x00,0x70,0x2c,0x12,0xc0,0xcf,0x81,0x2f,0x85,0xd5,0xa7,0xca,0x9f,0x86,
0x80,0xb8,0x5f,0x00,0x5f,0xb1,0xdd,0x7c,0x9f,0x11,0xed,0x9b,0x50,0x02,0xc0,0xb1,0x48,0x02,0xbf,0x04,0x2e,0x0d,0xa3,0x3f,0xe5,0x8f,0x86,0x80,0xb8,0x3b,0x80,0xcb,0xc2,0x08,0x81,0xc0,0x03,0x20,0x37,0xf8,0xef,0x02,0x2e,0x0c,0xba,0x2f,0x65,0x8e,0x86,0x80,0xb8,0xb9,0xc0,0x25,0xb6,0x4b,0xfe,0x9b,0x42,0xe4,0x21,0xd0,0x00,0x70,
0x2c,0x4a,0x80,0xbb,0x81,0xf3,0x83,0xec,0x47,0x05,0x43,0x43,0x40,0xdc,0xfd,0xc0,0x85,0xb6,0x4b,0x60,0x1b,0x58,0x06,0x16,0x00,0x8e,0x45,0x29,0xde,0x2f,0x10,0x8d,0x65,0x6b,0x54,0x9f,0x68,0x08,0x88,0xfb,0x0d,0x70,0x81,0xed,0xd2,0x16,0x44,0xe3,0x81,0x04,0x80,0x63,0x91,0x02,0x1e,0x04,0x3e,0x19,0x44,0xfb,0x2a,0x5c,0x1a,0x02,
0xe2,0x1e,0x01,0xce,0xb5,0x5d,0x8c,0x6f,0x5a,0x61,0x3c,0x00,0x1c,0x8b,0x34,0xf0,0x30,0x70,0x86,0xe9,0xb6,0x95,0x1c,0x0d,0x01,0x71,0x8f,0x02,0x9f,0xb1,0x5d,0x8c,0x6e,0x5a,0x61,0x34,0x00,0x1c,0x8b,0x32,0xe0,0x77,0xc0,0xa9,0x26,0xdb,0x55,0xd1,0xa0,0x21,0x20,0x6e,0x3e,0x70,0xb6,0xed,0xd2,0x6c,0xaa,0x41,0x63,0x01,0x90,0xdb,
0xe4,0xf3,0xf7,0xc0,0xc7,0x4c,0xb5,0xa9,0xa2,0x47,0x43,0x40,0xdc,0x42,0xe0,0x4c,0xdb,0x65,0xa7,0x89,0xc6,0x8c,0x04,0x80,0x63,0xd1,0x0f,0xf8,0x03,0x30,0xdd,0x44,0x7b,0x2a,0xda,0x34,0x04,0xc4,0x3d,0x09,0x9c,0x6e,0xbb,0xf8,0xde,0xbe,0xca,0x77,0x00,0x38,0x16,0x95,0x78,0x53,0x93,0x68,0xad,0x53,0xad,0x02,0xa5,0x21,0x20,0x6e,
0x11,0xf0,0x71,0xdb,0xc5,0xd7,0xbe,0xf6,0xbe,0x02,0xc0,0xb1,0x18,0x00,0xfc,0x09,0x38,0xd6,0x4f,0x3b,0xaa,0x30,0x69,0x08,0x88,0x5b,0x02,0x9c,0x62,0xbb,0x6c,0xeb,0x6b,0x03,0x7d,0x0e,0x00,0xc7,0x62,0x20,0xf0,0x04,0x70,0x54,0x5f,0xdb,0x50,0x85,0x4f,0x43,0x40,0xdc,0x3f,0x80,0x19,0xb6,0xcb,0x96,0xbe,0xfc,0xb0,0x9f,0x25,0xc1,
0xc6,0xa0,0x83,0x3f,0xf6,0x36,0x3a,0x8f,0xf2,0xd2,0x57,0x3f,0x45,0xb6,0x3d,0x90,0xfb,0x54,0x3e,0x40,0x97,0x17,0xeb,0xd2,0x51,0x78,0x63,0xb1,0x4f,0xfc,0x9e,0x02,0xb8,0xc0,0x58,0x3f,0x6d,0xa8,0xe2,0xa0,0x33,0x01,0x31,0xae,0xed,0x32,0xae,0xaf,0x3f,0xec,0x77,0x51,0xd0,0xdf,0xf8,0xfc,0x79,0x55,0x24,0x74,0x26,0x20,0xc6,0xd7,
0x18,0xf4,0x1b,0x00,0x0f,0xf8,0xfc,0x79,0x55,0x44,0x34,0x04,0x44,0xf8,0x1a,0x83,0xbe,0x02,0xc0,0x76,0xf9,0x3f,0xe0,0x5f,0x7e,0xda,0x50,0xc5,0x25,0xec,0x10,0x18,0x79,0x56,0xac,0x9f,0x32,0x7f,0xc9,0x76,0x59,0xe9,0xa7,0x01,0x13,0xfb,0x02,0x3c,0x68,0xa0,0x0d,0x55,0x44,0xc2,0x0c,0x81,0x4c,0xab,0xd1,0x5b,0xe3,0x0b,0x8d,0xef,
0xb1,0xa7,0x01,0xa0,0x02,0x11,0x56,0x08,0x64,0x35,0x00,0x7c,0xf1,0x1d,0x00,0xb6,0xcb,0xeb,0xc0,0x3f,0xfd,0xb6,0xa3,0x8a,0x4f,0x18,0x21,0x10,0xe3,0x19,0xc0,0x32,0xdb,0xe5,0x0d,0xbf,0x8d,0x98,0xda,0x1a,0x4c,0x67,0x01,0xaa,0x4b,0x41,0x87,0x40,0xb6,0xd5,0xf8,0x23,0xf2,0x85,0xc2,0xc8,0x98,0x33,0x15,0x00,0xbf,0x81,0x70,0x56,
0x31,0x55,0x85,0x27,0xc8,0x10,0x88,0xe9,0x0c,0x20,0x8b,0xa1,0x8f,0xe0,0x8d,0x04,0x80,0xed,0xf2,0x2e,0xde,0x7d,0xc9,0x4a,0x75,0x29,0xa8,0x10,0x88,0xe9,0x35,0x80,0x67,0x6c,0x97,0x35,0x26,0x1a,0x32,0xb9,0x3b,0xb0,0x9e,0x06,0xa8,0x1e,0x05,0x11,0x02,0x31,0x9d,0x01,0x18,0x1b,0x6b,0x26,0x03,0xe0,0x61,0x08,0x6e,0xf5,0x52,0x55,
0x1c,0x4c,0x87,0x40,0xb6,0x2d,0x76,0xd7,0x00,0xda,0xf1,0xc6,0x9a,0x11,0xc6,0x02,0xc0,0x76,0xd9,0x00,0x3c,0x65,0xaa,0x3d,0x55,0xbc,0x4c,0x86,0x40,0x0c,0x67,0x00,0x4f,0xda,0x2e,0xf5,0xa6,0x1a,0x33,0x39,0x03,0x00,0xb8,0xd3,0x70,0x7b,0xaa,0x48,0x99,0x0a,0x81,0x18,0x5e,0x03,0xb8,0xcb,0x64,0x63,0xa6,0x03,0xe0,0x21,0xe0,0x55,
0xc3,0x6d,0xaa,0x22,0x65,0x22,0x04,0x32,0x2d,0xb1,0x0a,0x80,0x57,0xf1,0xc6,0x98,0x31,0x46,0x03,0x20,0xb7,0x8d,0xd1,0x2c,0x93,0x6d,0xaa,0xe2,0xe6,0x37,0x04,0x62,0x76,0x0d,0xe0,0x7a,0xd3,0x5b,0x85,0x99,0x9e,0x01,0x00,0xcc,0x03,0x56,0x05,0xd0,0xae,0x2a,0x52,0x7e,0x42,0x20,0x46,0xa7,0x00,0xab,0x08,0xe0,0xe9,0x5b,0xe3,0x01,
0x90,0xdb,0xc7,0x4c,0x67,0x01,0x2a,0x2f,0x7d,0x0d,0x81,0x18,0x5d,0x04,0xbc,0x3e,0x88,0x3d,0x02,0x83,0x98,0x01,0x80,0xb7,0x27,0xe0,0xeb,0x01,0xb5,0xad,0x8a,0x54,0x5f,0x42,0x20,0x26,0x01,0xf0,0x3a,0xde,0x98,0x32,0x2e,0x90,0x00,0xc8,0x6d,0x64,0x38,0x3b,0x88,0xb6,0x55,0x71,0xcb,0x37,0x04,0x62,0x72,0x0a,0x30,0x2b,0xa8,0x1d,
0x82,0x83,0x9a,0x01,0x00,0xdc,0x03,0xac,0x0e,0xb0,0x7d,0x55,0xa4,0xf2,0x09,0x81,0x18,0x3c,0x0c,0xf4,0x06,0x70,0x6f,0x50,0x8d,0x07,0x16,0x00,0x3a,0x0b,0x50,0x7e,0xf4,0x36,0x04,0x62,0x70,0x0a,0x30,0x3b,0xa8,0xad,0xc1,0x21,0xd8,0x19,0x00,0xc0,0xdd,0xc0,0x5b,0x01,0xf7,0xa1,0x8a,0x54,0x6f,0x42,0xa0,0xc8,0x03,0xe0,0x4d,0xbc,
0x99,0x74,0x60,0x02,0x0d,0x80,0xdc,0x7e,0xe6,0x37,0x04,0xd9,0x87,0x2a,0x6e,0xfb,0x0a,0x81,0x22,0xbf,0x06,0x70,0x43,0x6e,0x0c,0x05,0x26,0xe8,0x19,0x00,0xc0,0xaf,0x81,0x77,0x42,0xe8,0x47,0x15,0xa9,0x9e,0x42,0xa0,0x88,0x6f,0x04,0x7a,0x1b,0x6f,0xec,0x04,0x2a,0xf0,0x00,0xb0,0x5d,0x5a,0x80,0x39,0x41,0xf7,0xa3,0x8a,0x5b,0x77,
0x21,0x50,0xc4,0xa7,0x00,0x73,0x82,0x7e,0xf7,0x87,0x70,0x66,0x00,0xe0,0x3d,0x24,0xa4,0xb3,0x00,0xe5,0x4b,0x57,0x21,0x50,0xa4,0x33,0x80,0x77,0x08,0xe9,0xc1,0xba,0x50,0x02,0xc0,0x76,0x69,0x06,0xbe,0x1c,0x46,0x5f,0xaa,0xb8,0x75,0x0e,0x81,0x6c,0x7b,0x3b,0xd9,0xf6,0xa2,0x5c,0x82,0xe2,0x4b,0xb9,0x99,0x73,0xe0,0xc2,0x9a,0x01,
0x60,0xbb,0x3c,0x4e,0x80,0x9f,0x67,0xaa,0xf8,0xe8,0x08,0x81,0xf6,0x9d,0x3b,0xa4,0x4b,0x09,0xc2,0x3d,0xb6,0xcb,0xfc,0xb0,0x3a,0xf3,0xb5,0x39,0x68,0xbe,0x1c,0x8b,0x6a,0xe0,0x65,0x60,0x64,0x98,0xfd,0xaa,0xe2,0x34,0xf8,0xb8,0x93,0xd8,0xbc,0xe4,0xcf,0xd2,0x65,0x98,0xb4,0x16,0x98,0x60,0xbb,0x34,0x86,0xd5,0x61,0xa8,0x01,0x00,
0xe0,0x58,0x9c,0x06,0xfc,0x21,0xec,0x7e,0x95,0x2a,0x00,0xa7,0xe7,0x66,0xca,0xa1,0x09,0xed,0x14,0xa0,0x83,0x9e,0x0a,0x28,0xd5,0xa5,0x7b,0xc2,0x1e,0xfc,0x20,0x10,0x00,0x39,0x57,0x02,0xef,0x09,0xf5,0xad,0x54,0xd4,0xac,0xc5,0x1b,0x13,0xa1,0x13,0x09,0x00,0xdb,0xa5,0x01,0xf8,0x82,0x44,0xdf,0x4a,0x45,0xd0,0x65,0x61,0x9e,0xf7,
0x77,0x26,0x35,0x03,0xd0,0x53,0x01,0xa5,0x3c,0x22,0x53,0xff,0x0e,0x62,0x01,0x90,0xa3,0xa7,0x02,0x2a,0xce,0xc4,0xa6,0xfe,0x1d,0x44,0x03,0x20,0x77,0x2a,0x70,0x99,0x64,0x0d,0x4a,0x09,0x12,0x9b,0xfa,0x77,0x90,0x9e,0x01,0x60,0xbb,0xfc,0x01,0xb8,0x4f,0xba,0x0e,0xa5,0x42,0x76,0xaf,0xe4,0xd4,0xbf,0x83,0x78,0x00,0xe4,0x5c,0x81,
0x9e,0x0a,0xa8,0xf8,0x78,0x0f,0xe1,0xa9,0x7f,0x87,0x48,0x04,0x40,0xee,0x54,0x60,0x26,0x04,0xb7,0xf2,0x89,0x52,0x11,0xd1,0x06,0xcc,0xcc,0x1d,0xf3,0xe2,0x22,0x11,0x00,0x00,0xb6,0xcb,0x5f,0x80,0x2f,0x49,0xd7,0xa1,0x54,0xc0,0xbe,0x98,0x3b,0xd6,0x23,0x21,0x32,0x01,0x00,0x60,0xbb,0xfc,0x0a,0x5d,0x47,0x50,0x15,0xaf,0x59,0xb6,
0x1b,0xad,0xfd,0x33,0x23,0x15,0x00,0x39,0xdf,0xc7,0xdb,0x5d,0x48,0xa9,0x62,0x72,0xbf,0xed,0xf2,0x7d,0xe9,0x22,0xf6,0x14,0xb9,0x00,0xb0,0x5d,0xb2,0xc0,0xc5,0xc0,0x22,0xa1,0x12,0xb6,0x00,0xbf,0x03,0x5e,0x10,0xea,0x5f,0x99,0xf7,0x02,0xde,0xdf,0xe9,0x16,0xa1,0xfe,0xff,0x8a,0x77,0x4c,0x47,0x4e,0xe4,0x02,0x00,0xde,0x5f,0x40,
0xe4,0x4c,0xe0,0x95,0x10,0xba,0xcb,0x02,0xff,0xc4,0xdb,0xce,0xec,0x78,0xa0,0xc6,0x76,0x39,0x1b,0x98,0x06,0x5c,0x0b,0xc1,0x2f,0xcb,0xa4,0x02,0xd3,0x0a,0xfc,0x10,0x38,0x32,0xf7,0x77,0x5a,0x83,0xf7,0x77,0x3c,0x0b,0xef,0xef,0x3c,0x1b,0x42,0x0d,0xaf,0x00,0x67,0x85,0xb5,0xc0,0x47,0xbe,0x42,0x7f,0x1c,0x38,0x1f,0x8e,0x45,0x2d,
0xb0,0x14,0x18,0x66,0xb8,0xe9,0xf5,0xc0,0x13,0xb9,0x3f,0x0b,0x6d,0x97,0x8d,0x3d,0xd4,0x30,0x19,0x98,0x0b,0x4c,0x32,0x5c,0x83,0x0a,0xd6,0x0b,0xc0,0x45,0xb6,0xcb,0x8b,0xdd,0x7d,0x83,0x63,0x31,0x14,0x38,0x09,0x38,0x19,0xf8,0x18,0x30,0xdc,0x70,0x0d,0xeb,0x81,0xa3,0x6d,0x97,0x37,0x0d,0xb7,0x6b,0x4c,0xa4,0x03,0x00,0xc0,0xb1,
0x98,0x06,0x3c,0x05,0xf4,0xf3,0xd1,0x4c,0x2b,0xb0,0x04,0x6f,0xc0,0x2f,0x00,0x5e,0xcc,0x9d,0x6a,0xf4,0xb6,0x86,0x14,0xf0,0x3d,0xe0,0xbb,0x40,0xca,0x47,0x1d,0x2a,0x78,0xad,0x78,0xef,0xf0,0xb3,0xf3,0x59,0x54,0xd3,0xb1,0x48,0x00,0x93,0x81,0x19,0x78,0x81,0x70,0x2c,0xfe,0xfe,0xae,0x9b,0x80,0x13,0x6c,0x97,0x65,0x3e,0xda,0x08,
0x5c,0xe4,0x03,0x00,0xc0,0xb1,0xf8,0x04,0xde,0x39,0x5c,0x3e,0xa7,0x2c,0x6f,0xb0,0x7b,0xc0,0x3f,0x65,0xbb,0x6c,0x33,0x50,0xc7,0x64,0xbc,0xcd,0x4e,0x26,0xfa,0x6d,0x4b,0x05,0xe2,0x45,0xbc,0x77,0x7d,0xdf,0xd7,0x6f,0x1c,0x8b,0x2a,0x60,0x3a,0x5e,0x20,0xcc,0x00,0x0e,0xce,0xe3,0xc7,0x33,0x78,0xd3,0xfe,0xc7,0xfc,0xd6,0x11,0xb4,
0x82,0x08,0x00,0x00,0xc7,0xe2,0x4a,0xe0,0xe6,0x1e,0xbe,0x65,0x07,0xf0,0x34,0xde,0x80,0x7f,0xc2,0x76,0x59,0x15,0x50,0x1d,0x29,0xbc,0x4f,0x2a,0xbe,0x0b,0x94,0x06,0xd1,0x87,0xca,0x5b,0xc7,0x36,0x74,0xd7,0x07,0xb5,0x94,0xb6,0x63,0x31,0x96,0xdd,0xb3,0x83,0x13,0x80,0xfe,0x3d,0x7c,0xfb,0x15,0xb6,0xcb,0xad,0x41,0xd4,0x61,0x5a,
0xc1,0x04,0x00,0x80,0x63,0x71,0x33,0x1f,0xbc,0x85,0xf2,0x25,0x72,0x03,0x1e,0x58,0x1c,0xe6,0x85,0x16,0xc7,0xa2,0x0e,0xef,0xda,0xc0,0xe1,0x61,0xf5,0xa9,0xba,0xb4,0x02,0xef,0x5d,0xff,0xf9,0xb0,0x3a,0x74,0x2c,0xd2,0x78,0x17,0x13,0x3b,0x02,0xa1,0xf3,0x31,0x70,0xb3,0xed,0x72,0x55,0x58,0xb5,0xf8,0x55,0x68,0x01,0x90,0xc4,0xbb,
0x32,0xbf,0x1a,0xef,0x5d,0x7e,0xad,0x70,0x3d,0x69,0xe0,0x9b,0xc0,0xd5,0x40,0xb5,0x64,0x2d,0x31,0xd4,0x00,0xdc,0x04,0xdc,0x18,0xc6,0x06,0x1a,0x3d,0x71,0x2c,0x46,0xe1,0x85,0x41,0x2d,0x70,0xad,0xed,0x92,0x91,0xac,0x27,0x1f,0x05,0x15,0x00,0x51,0xe5,0x58,0x0c,0x00,0xbe,0x0a,0x5c,0x05,0x0c,0x11,0x2e,0xa7,0xd8,0x6d,0x02,0x7e,
0x0a,0xdc,0x6a,0xbb,0x6c,0x95,0x2e,0xa6,0xd0,0x69,0x00,0x18,0xe4,0x58,0x54,0x02,0x97,0xe3,0xcd,0x08,0x86,0x0a,0x97,0x53,0x6c,0xea,0x81,0x1f,0x03,0x3f,0xb7,0x5d,0xb6,0x4b,0x17,0x53,0x2c,0x34,0x00,0x02,0xe0,0x58,0xf4,0xc7,0x7b,0xb0,0xe9,0x1b,0x98,0xff,0x6c,0x39,0x6e,0xd6,0x03,0x37,0x02,0xb7,0xd9,0x2e,0x4d,0xd2,0xc5,0x14,
0x1b,0x0d,0x80,0x00,0x39,0x16,0x15,0x78,0x2b,0x1e,0x7d,0x0b,0xdd,0x0c,0x25,0x5f,0xef,0x01,0xff,0x0d,0xfc,0xd2,0x76,0xd9,0x29,0x5d,0x4c,0xb1,0xd2,0x00,0x08,0x81,0x63,0x51,0x0e,0xfc,0x3b,0xf0,0x6d,0x60,0x3f,0xe1,0x72,0xa2,0x6e,0x0d,0xde,0x6e,0xd2,0xbf,0xb2,0x5d,0x76,0x49,0x17,0x53,0xec,0x34,0x00,0x42,0xe4,0x58,0x7c,0x1c,
0xe4,0x97,0x81,0x8a,0xb8,0x8f,0xdb,0x2e,0x7f,0x94,0x2e,0x22,0x2e,0x22,0xf9,0x30,0x50,0x11,0x5b,0x84,0xae,0x7a,0xd4,0x93,0x36,0x60,0xb1,0x74,0x11,0x71,0xa2,0x01,0x10,0xa2,0xdc,0xed,0xc8,0xcf,0x49,0xd7,0x11,0x61,0xff,0x34,0x71,0xcb,0xb6,0xea,0x3d,0x0d,0x80,0xf0,0x3d,0x29,0x5d,0x40,0x84,0xe9,0x6b,0x13,0x32,0x0d,0x80,0xf0,
0xe9,0x41,0xde,0x3d,0x7d,0x6d,0x42,0xa6,0x01,0x10,0xbe,0x25,0x10,0xcd,0xc5,0x21,0x84,0x35,0x03,0x7f,0x93,0x2e,0x22,0x6e,0x34,0x00,0x42,0x96,0xfb,0x4c,0x7b,0xa9,0x74,0x1d,0x11,0xb4,0x54,0x3f,0xef,0x0f,0x9f,0x06,0x80,0x0c,0x9d,0xea,0xee,0x4d,0x5f,0x13,0x01,0x1a,0x00,0x32,0xf4,0x60,0xdf,0x9b,0xbe,0x26,0x02,0x34,0x00,0x64,
0xfc,0x03,0xf4,0xbe,0xf6,0x4e,0x9a,0xf0,0x5e,0x13,0x15,0x32,0x0d,0x00,0x01,0xb9,0x85,0x4b,0x96,0x48,0xd7,0x11,0x21,0xcf,0x48,0x3f,0xd3,0x1f,0x57,0x1a,0x00,0x72,0x74,0xca,0xbb,0x9b,0xbe,0x16,0x42,0x34,0x00,0xe4,0xe8,0x41,0xbf,0x9b,0xbe,0x16,0x42,0x34,0x00,0xe4,0x3c,0x07,0xba,0xa2,0x0d,0xde,0x6e,0x3d,0xcb,0xa5,0x8b,0x88,
0x2b,0x0d,0x00,0x21,0xb6,0x4b,0x3b,0x72,0xdb,0x9f,0x45,0xc9,0xa2,0xdc,0x6b,0xa1,0x04,0x68,0x00,0xc8,0xd2,0xa9,0xaf,0xbe,0x06,0xa2,0x34,0x00,0x64,0xe9,0xc1,0xaf,0xaf,0x81,0x28,0x0d,0x00,0x59,0x2b,0xf0,0x56,0xb9,0x8d,0xab,0x8d,0x78,0x7b,0x3b,0x28,0x21,0x1a,0x00,0x82,0x72,0xfb,0x13,0x3e,0x2d,0x5d,0x87,0xa0,0xa7,0xf3,0xd9,
0xa3,0x51,0x99,0xa7,0x01,0x20,0x2f,0xce,0x53,0xe0,0x38,0xff,0xee,0x91,0xa0,0x01,0x20,0x2f,0xce,0x83,0x20,0xce,0xbf,0x7b,0x24,0xe8,0xa2,0xa0,0x11,0xe0,0x58,0xac,0x25,0x7e,0xcb,0x86,0xaf,0xb5,0x5d,0x5d,0x21,0x59,0x9a,0xce,0x00,0xa2,0xe1,0x29,0xe9,0x02,0x04,0xc4,0xf1,0x77,0x8e,0x1c,0x0d,0x80,0x68,0x88,0xe3,0x54,0x38,0x8e,
0xbf,0x73,0xe4,0x68,0x00,0x44,0x43,0x1c,0x07,0x83,0x23,0x5d,0x80,0xd2,0x00,0x88,0x04,0xdb,0x65,0x35,0xf0,0x28,0xde,0x7d,0xf1,0xc5,0xae,0x11,0x78,0xd4,0x76,0x79,0x4b,0xba,0x10,0xa5,0x17,0x01,0x23,0xc5,0xb1,0x48,0xe0,0xed,0x31,0x5f,0xb7,0xc7,0x9f,0x42,0xdd,0x69,0x78,0x03,0xf0,0x3c,0xde,0xc3,0x3e,0xcb,0x81,0xe5,0xb6,0xcb,
0x1b,0xb2,0x25,0xa9,0xce,0x34,0x00,0x0a,0x80,0x63,0x31,0x1a,0x2f,0x08,0xa6,0xb0,0x3b,0x14,0x46,0x8b,0x16,0xb5,0xb7,0x77,0xe9,0x34,0xd0,0xf1,0x06,0xfb,0x1a,0xd9,0x92,0xd4,0xbe,0x68,0x00,0x14,0x28,0xc7,0x62,0x28,0xbb,0xc3,0xa0,0x16,0x18,0x94,0xfb,0x53,0xdd,0xe9,0xeb,0x40,0xa0,0xd4,0x67,0x57,0x6d,0x78,0xa7,0x26,0x0d,0x78,
0xd3,0xf7,0x8e,0xaf,0x8d,0xc0,0x6a,0x76,0x0f,0xf6,0x7a,0x9f,0xfd,0x28,0x01,0x1a,0x00,0x45,0xce,0xb1,0xa8,0xe4,0x83,0xa1,0xb0,0x67,0x50,0xc0,0xde,0x03,0xfb,0xfd,0xc1,0x6e,0xbb,0x6c,0x0f,0xbb,0x66,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,
0xd5,0x1b,0xff,0x0f,0x5c,0x56,0xd9,0x0b,0x64,0x90,0x3b,0x82,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
};
read_only global String8 df_g_icon_file_bytes = {df_g_icon_file_bytes__data, sizeof(df_g_icon_file_bytes__data)};
C_LINKAGE_END
#endif // DF_GFX_META_H
+3 -1
View File
@@ -952,8 +952,10 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
// generate ir tree
if (can_generate){
EVAL_IRTree *new_tree = l.tree;
EVAL_EvalMode mode = l.mode;
if (l_resolve){
new_tree = eval_irtree_resolve_to_value(arena, graph, rdi, l.mode, new_tree, l_restype);
mode = EVAL_EvalMode_Addr;
}
if (r_off != 0){
EVAL_IRTree *const_tree = eval_irtree_const_u(arena, r_off);
@@ -963,7 +965,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
// fill result
result.tree = new_tree;
result.type_key = r_type;
result.mode = l.mode;
result.mode = mode;
}
}break;
}
+8
View File
@@ -414,6 +414,14 @@ eval_token_array_from_text(Arena *arena, String8 text)
eval_token_chunk_list_push(scratch.arena, &tokens, 256, &token);
}
// rjf: symbolic strings matching `--` mean the remainder of the string
// is reserved for external usage. the rest of the stream should not
// be tokenized.
else if(idx == active_token_start_idx+2 && text.str[active_token_start_idx] == '-' && text.str[active_token_start_idx+1] == '-')
{
break;
}
// rjf: if we got a symbol string of N>1 characters, then we need to
// apply the maximum-munch rule, and produce M<=N tokens, where each
// formed token is the maximum size possible, given the legal
+14
View File
@@ -10,6 +10,7 @@ fs_init(void)
Arena *arena = arena_alloc();
fs_shared = push_array(arena, FS_Shared, 1);
fs_shared->arena = arena;
fs_shared->change_gen = 1;
fs_shared->slots_count = 1024;
fs_shared->stripes_count = os_logical_core_count();
fs_shared->slots = push_array(arena, FS_Slot, fs_shared->slots_count);
@@ -33,6 +34,15 @@ fs_init(void)
fs_shared->detector_thread = os_launch_thread(fs_detector_thread__entry_point, 0, 0);
}
////////////////////////////////
//~ rjf: Change Generation
internal U64
fs_change_gen(void)
{
return ins_atomic_u64_eval(&fs_shared->change_gen);
}
////////////////////////////////
//~ rjf: Cache Interaction
@@ -220,6 +230,10 @@ fs_streamer_thread__entry_point(void *p)
}
if(node != 0)
{
if(node->timestamp != 0)
{
ins_atomic_u64_inc_eval(&fs_shared->change_gen);
}
if(post_props.modified == pre_props.modified)
{
node->timestamp = post_props.modified;
+6
View File
@@ -38,6 +38,7 @@ typedef struct FS_Shared FS_Shared;
struct FS_Shared
{
Arena *arena;
U64 change_gen;
// rjf: path info cache
U64 slots_count;
@@ -71,6 +72,11 @@ global FS_Shared *fs_shared = 0;
internal void fs_init(void);
////////////////////////////////
//~ rjf: Change Generation
internal U64 fs_change_gen(void);
////////////////////////////////
//~ rjf: Cache Interaction
+562
View File
@@ -0,0 +1,562 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Helpers
internal U64
fzy_hash_from_string(U64 seed, String8 string)
{
U64 result = seed;
for(U64 i = 0; i < string.size; i += 1)
{
result = ((result << 5) + result) + string.str[i];
}
return result;
}
internal U64
fzy_hash_from_params(FZY_Params *params)
{
U64 hash = 5381;
hash = fzy_hash_from_string(hash, str8_struct(&params->target));
for(U64 idx = 0; idx < params->dbgi_keys.count; idx += 1)
{
hash = fzy_hash_from_string(hash, str8_struct(&params->dbgi_keys.v[idx].min_timestamp));
hash = fzy_hash_from_string(hash, params->dbgi_keys.v[idx].path);
}
return hash;
}
internal U64
fzy_item_num_from_array_element_idx__linear_search(FZY_ItemArray *array, U64 element_idx)
{
U64 fuzzy_item_num = 0;
for(U64 idx = 0; idx < array->count; idx += 1)
{
if(array->v[idx].idx == element_idx)
{
fuzzy_item_num = idx+1;
break;
}
}
return fuzzy_item_num;
}
internal String8
fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target, U64 element_idx)
{
String8 result = {0};
switch(target)
{
// NOTE(rjf): no default - warn if we miss a case
case FZY_Target_Procedures:
{
RDI_Procedure *proc = rdi_element_from_idx(rdi, procedures, element_idx);
U64 name_size = 0;
U8 *name_base = rdi_string_from_idx(rdi, proc->name_string_idx, &name_size);
result = str8(name_base, name_size);
}break;
case FZY_Target_GlobalVariables:
{
RDI_GlobalVariable *gvar = rdi_element_from_idx(rdi, global_variables, element_idx);
U64 name_size = 0;
U8 *name_base = rdi_string_from_idx(rdi, gvar->name_string_idx, &name_size);
result = str8(name_base, name_size);
}break;
case FZY_Target_ThreadVariables:
{
RDI_ThreadVariable *tvar = rdi_element_from_idx(rdi, thread_variables, element_idx);
U64 name_size = 0;
U8 *name_base = rdi_string_from_idx(rdi, tvar->name_string_idx, &name_size);
result = str8(name_base, name_size);
}break;
case FZY_Target_UDTs:
{
RDI_UDT *udt = rdi_element_from_idx(rdi, udts, element_idx);
RDI_TypeNode *type_node = rdi_element_from_idx(rdi, type_nodes, udt->self_type_idx);
U64 name_size = 0;
U8 *name_base = rdi_string_from_idx(rdi, type_node->user_defined.name_string_idx, &name_size);
result = str8(name_base, name_size);
}break;
case FZY_Target_COUNT:{}break;
}
return result;
}
internal FZY_Params
fzy_params_copy(Arena *arena, FZY_Params *src)
{
FZY_Params dst = zero_struct;
MemoryCopyStruct(&dst, src);
dst.dbgi_keys.v = push_array(arena, DI_Key, dst.dbgi_keys.count);
MemoryCopy(dst.dbgi_keys.v, src->dbgi_keys.v, sizeof(DI_Key)*src->dbgi_keys.count);
for(U64 idx = 0; idx < dst.dbgi_keys.count; idx += 1)
{
dst.dbgi_keys.v[idx].path = push_str8_copy(arena, dst.dbgi_keys.v[idx].path);
}
return dst;
}
////////////////////////////////
//~ rjf: Main Layer Initialization
internal void
fzy_init(void)
{
Arena *arena = arena_alloc();
fzy_shared = push_array(arena, FZY_Shared, 1);
fzy_shared->arena = arena;
fzy_shared->slots_count = 256;
fzy_shared->stripes_count = os_logical_core_count();
fzy_shared->slots = push_array(arena, FZY_Slot, fzy_shared->slots_count);
fzy_shared->stripes = push_array(arena, FZY_Stripe, fzy_shared->stripes_count);
for(U64 idx = 0; idx < fzy_shared->stripes_count; idx += 1)
{
fzy_shared->stripes[idx].arena = arena_alloc();
fzy_shared->stripes[idx].rw_mutex = os_rw_mutex_alloc();
fzy_shared->stripes[idx].cv = os_condition_variable_alloc();
}
fzy_shared->thread_count = Min(os_logical_core_count(), 2);
fzy_shared->threads = push_array(arena, FZY_Thread, fzy_shared->thread_count);
for(U64 idx = 0; idx < fzy_shared->thread_count; idx += 1)
{
fzy_shared->threads[idx].u2f_ring_mutex = os_mutex_alloc();
fzy_shared->threads[idx].u2f_ring_cv = os_condition_variable_alloc();
fzy_shared->threads[idx].u2f_ring_size = KB(64);
fzy_shared->threads[idx].u2f_ring_base = push_array_no_zero(arena, U8, fzy_shared->threads[idx].u2f_ring_size);
fzy_shared->threads[idx].thread = os_launch_thread(fzy_search_thread__entry_point, (void *)idx, 0);
}
}
////////////////////////////////
//~ rjf: Scope Functions
internal FZY_Scope *
fzy_scope_open(void)
{
if(fzy_tctx == 0)
{
Arena *arena = arena_alloc();
fzy_tctx = push_array(arena, FZY_TCTX, 1);
fzy_tctx->arena = arena;
}
FZY_Scope *scope = fzy_tctx->free_scope;
if(scope != 0)
{
SLLStackPop(fzy_tctx->free_scope);
}
else
{
scope = push_array_no_zero(fzy_tctx->arena, FZY_Scope, 1);
}
MemoryZeroStruct(scope);
return scope;
}
internal void
fzy_scope_close(FZY_Scope *scope)
{
for(FZY_Touch *t = scope->first_touch, *next = 0; t != 0; t = next)
{
next = t->next;
SLLStackPush(fzy_tctx->free_touch, t);
if(t->node != 0)
{
ins_atomic_u64_dec_eval(&t->node->touch_count);
}
}
SLLStackPush(fzy_tctx->free_scope, scope);
}
internal void
fzy_scope_touch_node__stripe_mutex_r_guarded(FZY_Scope *scope, FZY_Node *node)
{
if(node != 0)
{
ins_atomic_u64_inc_eval(&node->touch_count);
}
FZY_Touch *touch = fzy_tctx->free_touch;
if(touch != 0)
{
SLLStackPop(fzy_tctx->free_touch);
}
else
{
touch = push_array_no_zero(fzy_tctx->arena, FZY_Touch, 1);
}
MemoryZeroStruct(touch);
SLLQueuePush(scope->first_touch, scope->last_touch, touch);
touch->node = node;
}
////////////////////////////////
//~ rjf: Cache Lookup Functions
internal FZY_ItemArray
fzy_items_from_key_params_query(FZY_Scope *scope, U128 key, FZY_Params *params, String8 query, U64 endt_us, B32 *stale_out)
{
Temp scratch = scratch_begin(0, 0);
FZY_ItemArray items = {0};
//- rjf: hash parameters
U64 params_hash = fzy_hash_from_params(params);
//- rjf: unpack key
U64 slot_idx = key.u64[1]%fzy_shared->slots_count;
U64 stripe_idx = slot_idx%fzy_shared->stripes_count;
FZY_Slot *slot = &fzy_shared->slots[slot_idx];
FZY_Stripe *stripe = &fzy_shared->stripes[stripe_idx];
//- rjf: query and/or request
OS_MutexScopeR(stripe->rw_mutex) for(;;)
{
// rjf: map key -> node
FZY_Node *node = 0;
for(FZY_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->key, key))
{
node = n;
break;
}
}
// rjf: no node? -> allocate
if(node == 0) OS_MutexScopeRWPromote(stripe->rw_mutex)
{
node = push_array(stripe->arena, FZY_Node, 1);
SLLQueuePush(slot->first, slot->last, node);
node->key = key;
for(U64 idx = 0; idx < ArrayCount(node->buckets); idx += 1)
{
node->buckets[idx].arena = arena_alloc();
}
}
// rjf: try to grab last valid results for this key/query; determine if stale
B32 stale = 1;
if(params_hash == node->buckets[node->gen%ArrayCount(node->buckets)].params_hash &&
node->gen != 0)
{
fzy_scope_touch_node__stripe_mutex_r_guarded(scope, node);
items = node->gen_items;
stale = !str8_match(query, node->buckets[node->gen%ArrayCount(node->buckets)].query, 0);
if(stale_out != 0)
{
*stale_out = stale;
}
}
// rjf: if stale -> request again
if(stale) OS_MutexScopeRWPromote(stripe->rw_mutex)
{
if(node->gen <= node->submit_gen && node->submit_gen < node->gen + ArrayCount(node->buckets)-1)
{
node->submit_gen += 1;
arena_clear(node->buckets[node->submit_gen%ArrayCount(node->buckets)].arena);
node->buckets[node->submit_gen%ArrayCount(node->buckets)].query = push_str8_copy(node->buckets[node->submit_gen%ArrayCount(node->buckets)].arena, query);
node->buckets[node->submit_gen%ArrayCount(node->buckets)].params = fzy_params_copy(node->buckets[node->submit_gen%ArrayCount(node->buckets)].arena, params);
node->buckets[node->submit_gen%ArrayCount(node->buckets)].params_hash = params_hash;
}
if((node->submit_gen > node->gen+1 || os_now_microseconds() >= node->last_time_submitted_us+100000) &&
fzy_u2s_enqueue_req(key, endt_us))
{
node->last_time_submitted_us = os_now_microseconds();
}
}
// rjf: not stale, or timeout -> break
if(!stale || os_now_microseconds() >= endt_us)
{
break;
}
// rjf: no results, but have time to wait -> wait
os_condition_variable_wait_rw_r(stripe->cv, stripe->rw_mutex, endt_us);
}
scratch_end(scratch);
return items;
}
////////////////////////////////
//~ rjf: Searcher Threads
internal B32
fzy_u2s_enqueue_req(U128 key, U64 endt_us)
{
B32 sent = 0;
FZY_Thread *thread = &fzy_shared->threads[key.u64[1]%fzy_shared->thread_count];
OS_MutexScope(thread->u2f_ring_mutex) for(;;)
{
U64 unconsumed_size = thread->u2f_ring_write_pos - thread->u2f_ring_read_pos;
U64 available_size = thread->u2f_ring_size - unconsumed_size;
if(available_size >= sizeof(U128))
{
sent = 1;
thread->u2f_ring_write_pos += ring_write_struct(thread->u2f_ring_base, thread->u2f_ring_size, thread->u2f_ring_write_pos, &key);
break;
}
os_condition_variable_wait(thread->u2f_ring_cv, thread->u2f_ring_mutex, endt_us);
}
if(sent)
{
os_condition_variable_broadcast(thread->u2f_ring_cv);
}
return sent;
}
internal void
fzy_u2s_dequeue_req(Arena *arena, FZY_Thread *thread, U128 *key_out)
{
OS_MutexScope(thread->u2f_ring_mutex) for(;;)
{
U64 unconsumed_size = thread->u2f_ring_write_pos - thread->u2f_ring_read_pos;
if(unconsumed_size >= sizeof(U128))
{
thread->u2f_ring_read_pos += ring_read_struct(thread->u2f_ring_base, thread->u2f_ring_size, thread->u2f_ring_read_pos, key_out);
break;
}
os_condition_variable_wait(thread->u2f_ring_cv, thread->u2f_ring_mutex, max_U64);
}
os_condition_variable_broadcast(thread->u2f_ring_cv);
}
internal int
fzy_qsort_compare_items(FZY_Item *a, FZY_Item *b)
{
int result = 0;
if(a->match_ranges.count > b->match_ranges.count)
{
result = -1;
}
else if(a->match_ranges.count < b->match_ranges.count)
{
result = +1;
}
else if(a->missed_size < b->missed_size)
{
result = -1;
}
else if(a->missed_size > b->missed_size)
{
result = +1;
}
return result;
}
internal void
fzy_search_thread__entry_point(void *p)
{
ThreadNameF("[fzy] searcher #%I64u", (U64)p);
FZY_Thread *thread = &fzy_shared->threads[(U64)p];
for(;;)
{
Temp scratch = scratch_begin(0, 0);
DI_Scope *di_scope = di_scope_open();
////////////////////////////
//- rjf: dequeue next request
//
U128 key = {0};
fzy_u2s_dequeue_req(scratch.arena, thread, &key);
U64 slot_idx = key.u64[1]%fzy_shared->slots_count;
U64 stripe_idx = slot_idx%fzy_shared->stripes_count;
FZY_Slot *slot = &fzy_shared->slots[slot_idx];
FZY_Stripe *stripe = &fzy_shared->stripes[stripe_idx];
////////////////////////////
//- rjf: grab next exe_path/query for this key
//
B32 task_is_good = 0;
Arena *task_arena = 0;
String8 query = {0};
FZY_Params params = {FZY_Target_Procedures};
U64 initial_submit_gen = 0;
OS_MutexScopeW(stripe->rw_mutex)
{
for(FZY_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->key, key))
{
FZY_Bucket *bucket = &n->buckets[n->submit_gen%ArrayCount(n->buckets)];
task_is_good = 1;
initial_submit_gen = n->submit_gen;
task_arena = bucket->arena;
query = bucket->query;
params = bucket->params;
break;
}
}
}
////////////////////////////
//- rjf: params -> look up all rdis
//
U64 rdis_count = params.dbgi_keys.count;
RDI_Parsed **rdis = push_array(scratch.arena, RDI_Parsed *, rdis_count);
if(task_is_good)
{
for(U64 idx = 0; idx < rdis_count; idx += 1)
{
rdis[idx] = di_rdi_from_key(di_scope, &params.dbgi_keys.v[idx], max_U64);
}
}
////////////////////////////
//- rjf: search target -> info about search space
//
U64 table_ptr_off = 0;
U64 table_count_off = 0;
U64 element_name_idx_off = 0;
U64 element_size = 0;
if(task_is_good)
{
switch(params.target)
{
// NOTE(rjf): no default!
case FZY_Target_COUNT:{}break;
case FZY_Target_Procedures:
{
table_ptr_off = OffsetOf(RDI_Parsed, procedures);
table_count_off = OffsetOf(RDI_Parsed, procedures_count);
element_name_idx_off = OffsetOf(RDI_Procedure, name_string_idx);
element_size = sizeof(RDI_Procedure);
}break;
case FZY_Target_GlobalVariables:
{
table_ptr_off = OffsetOf(RDI_Parsed, global_variables);
table_count_off = OffsetOf(RDI_Parsed, global_variables_count);
element_name_idx_off = OffsetOf(RDI_GlobalVariable, name_string_idx);
element_size = sizeof(RDI_GlobalVariable);
}break;
case FZY_Target_ThreadVariables:
{
table_ptr_off = OffsetOf(RDI_Parsed, thread_variables);
table_count_off = OffsetOf(RDI_Parsed, thread_variables_count);
element_name_idx_off = OffsetOf(RDI_ThreadVariable, name_string_idx);
element_size = sizeof(RDI_ThreadVariable);
}break;
case FZY_Target_UDTs:
{
table_ptr_off = OffsetOf(RDI_Parsed, udts);
table_count_off = OffsetOf(RDI_Parsed, udts_count);
element_size = sizeof(RDI_UDT);
}break;
}
}
////////////////////////////
//- rjf: rdis * query * params -> item list
//
FZY_ItemChunkList items_list = {0};
if(task_is_good)
{
U64 base_idx = 0;
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
{
RDI_Parsed *rdi = rdis[rdi_idx];
void *table_base = (U8*)rdi + table_ptr_off;
U64 element_count = *MemberFromOffset(U64 *, rdi, table_count_off);
for(U64 idx = 1; task_is_good && idx < element_count; idx += 1)
{
void *element = (U8 *)(*(void **)table_base) + element_size*idx;
U32 *name_idx_ptr = (U32 *)((U8 *)element + element_name_idx_off);
if(params.target == FZY_Target_UDTs)
{
RDI_UDT *udt = (RDI_UDT *)element;
RDI_TypeNode *type_node = rdi_element_from_idx(rdi, type_nodes, udt->self_type_idx);
name_idx_ptr = &type_node->user_defined.name_string_idx;
}
U32 name_idx = *name_idx_ptr;
U64 name_size = 0;
U8 *name_base = rdi_string_from_idx(rdi, name_idx, &name_size);
String8 name = str8(name_base, name_size);
if(name.size == 0) { continue; }
FuzzyMatchRangeList matches = fuzzy_match_find(task_arena, query, name);
if(matches.count == matches.needle_part_count)
{
FZY_ItemChunk *chunk = items_list.last;
if(chunk == 0 || chunk->count >= chunk->cap)
{
chunk = push_array(scratch.arena, FZY_ItemChunk, 1);
chunk->cap = 1024;
chunk->count = 0;
chunk->v = push_array_no_zero(scratch.arena, FZY_Item, chunk->cap);
SLLQueuePush(items_list.first, items_list.last, chunk);
items_list.chunk_count += 1;
}
chunk->v[chunk->count].idx = base_idx + idx;
chunk->v[chunk->count].match_ranges = matches;
chunk->v[chunk->count].missed_size = (name_size > matches.total_dim) ? (name_size-matches.total_dim) : 0;
chunk->count += 1;
items_list.total_count += 1;
}
if(idx%100 == 99) OS_MutexScopeR(stripe->rw_mutex)
{
for(FZY_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->key, key) && n->submit_gen > initial_submit_gen)
{
task_is_good = 0;
break;
}
}
}
}
base_idx += element_count;
}
}
//- rjf: item list -> item array
FZY_ItemArray items = {0};
if(task_is_good)
{
items.count = items_list.total_count;
items.v = push_array_no_zero(task_arena, FZY_Item, items.count);
U64 idx = 0;
for(FZY_ItemChunk *chunk = items_list.first; chunk != 0; chunk = chunk->next)
{
MemoryCopy(items.v+idx, chunk->v, sizeof(FZY_Item)*chunk->count);
idx += chunk->count;
}
}
//- rjf: sort item array
if(items.count != 0 && query.size != 0)
{
qsort(items.v, items.count, sizeof(FZY_Item), (int (*)(const void *, const void *))fzy_qsort_compare_items);
}
//- rjf: commit to cache - busyloop on scope touches
if(task_is_good)
{
for(B32 done = 0; !done;)
{
B32 found = 0;
OS_MutexScopeW(stripe->rw_mutex) for(FZY_Node *n = slot->first; n != 0; n = n->next)
{
if(u128_match(n->key, key))
{
if(n->touch_count == 0)
{
n->gen = initial_submit_gen;
n->gen_items = items;
done = 1;
}
found = 1;
break;
}
}
if(!found)
{
break;
}
}
}
di_scope_close(di_scope);
scratch_end(scratch);
}
}
+202
View File
@@ -0,0 +1,202 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef FUZZY_SEARCH_H
#define FUZZY_SEARCH_H
////////////////////////////////
//~ rjf: Result Types
typedef struct FZY_Item FZY_Item;
struct FZY_Item
{
U64 idx; // indexes into whole space of parameter tables. [rdis[0] element count) [rdis[1] element count) ... [rdis[n] element count)
U64 missed_size;
FuzzyMatchRangeList match_ranges;
};
typedef struct FZY_ItemChunk FZY_ItemChunk;
struct FZY_ItemChunk
{
FZY_ItemChunk *next;
FZY_Item *v;
U64 count;
U64 cap;
};
typedef struct FZY_ItemChunkList FZY_ItemChunkList;
struct FZY_ItemChunkList
{
FZY_ItemChunk *first;
FZY_ItemChunk *last;
U64 chunk_count;
U64 total_count;
};
typedef struct FZY_ItemArray FZY_ItemArray;
struct FZY_ItemArray
{
FZY_Item *v;
U64 count;
};
////////////////////////////////
//~ rjf: Search Parameter Types
typedef enum FZY_Target
{
FZY_Target_Procedures,
FZY_Target_GlobalVariables,
FZY_Target_ThreadVariables,
FZY_Target_UDTs,
FZY_Target_COUNT
}
FZY_Target;
typedef struct FZY_Params FZY_Params;
struct FZY_Params
{
FZY_Target target;
DI_KeyArray dbgi_keys;
};
////////////////////////////////
//~ rjf: Cache Types
typedef struct FZY_Bucket FZY_Bucket;
struct FZY_Bucket
{
Arena *arena;
String8 query;
FZY_Params params;
U64 params_hash;
};
typedef struct FZY_Node FZY_Node;
struct FZY_Node
{
FZY_Node *next;
U128 key;
U64 touch_count;
U64 last_time_submitted_us;
FZY_Bucket buckets[3];
U64 gen;
U64 submit_gen;
FZY_ItemArray gen_items;
};
typedef struct FZY_Slot FZY_Slot;
struct FZY_Slot
{
FZY_Node *first;
FZY_Node *last;
};
typedef struct FZY_Stripe FZY_Stripe;
struct FZY_Stripe
{
Arena *arena;
OS_Handle rw_mutex;
OS_Handle cv;
};
////////////////////////////////
//~ rjf: Scoped Access Types
typedef struct FZY_Touch FZY_Touch;
struct FZY_Touch
{
FZY_Touch *next;
FZY_Node *node;
};
typedef struct FZY_Scope FZY_Scope;
struct FZY_Scope
{
FZY_Scope *next;
FZY_Touch *first_touch;
FZY_Touch *last_touch;
};
typedef struct FZY_TCTX FZY_TCTX;
struct FZY_TCTX
{
Arena *arena;
FZY_Scope *free_scope;
FZY_Touch *free_touch;
};
////////////////////////////////
//~ rjf: Shared State Types
typedef struct FZY_Thread FZY_Thread;
struct FZY_Thread
{
OS_Handle thread;
OS_Handle u2f_ring_mutex;
OS_Handle u2f_ring_cv;
U64 u2f_ring_size;
U8 *u2f_ring_base;
U64 u2f_ring_write_pos;
U64 u2f_ring_read_pos;
};
typedef struct FZY_Shared FZY_Shared;
struct FZY_Shared
{
Arena *arena;
// rjf: search artifact cache table
U64 slots_count;
U64 stripes_count;
FZY_Slot *slots;
FZY_Stripe *stripes;
// rjf: threads
U64 thread_count;
FZY_Thread *threads;
};
////////////////////////////////
//~ rjf: Globals
global FZY_Shared *fzy_shared = 0;
thread_static FZY_TCTX *fzy_tctx = 0;
////////////////////////////////
//~ rjf: Helpers
internal U64 fzy_hash_from_string(U64 seed, String8 string);
internal U64 fzy_hash_from_params(FZY_Params *params);
internal U64 fzy_item_num_from_array_element_idx__linear_search(FZY_ItemArray *array, U64 element_idx);
internal String8 fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target, U64 element_idx);
internal FZY_Params fzy_params_copy(Arena *arena, FZY_Params *src);
////////////////////////////////
//~ rjf: Main Layer Initialization
internal void fzy_init(void);
////////////////////////////////
//~ rjf: Scope Functions
internal FZY_Scope *fzy_scope_open(void);
internal void fzy_scope_close(FZY_Scope *scope);
internal void fzy_scope_touch_node__stripe_mutex_r_guarded(FZY_Scope *scope, FZY_Node *node);
////////////////////////////////
//~ rjf: Cache Lookup Functions
internal FZY_ItemArray fzy_items_from_key_params_query(FZY_Scope *scope, U128 key, FZY_Params *params, String8 query, U64 endt_us, B32 *stale_out);
////////////////////////////////
//~ rjf: Searcher Threads
internal B32 fzy_u2s_enqueue_req(U128 key, U64 endt_us);
internal void fzy_u2s_dequeue_req(Arena *arena, FZY_Thread *thread, U128 *key_out);
internal int fzy_qsort_compare_items(FZY_Item *a, FZY_Item *b);
internal void fzy_search_thread__entry_point(void *p);
#endif // FUZZY_SEARCH_H
+2
View File
@@ -0,0 +1,2 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
+43
View File
@@ -0,0 +1,43 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef ICO_H
#define ICO_H
////////////////////////////////
//~ rjf: ICO File Format Types
#pragma pack(push, 1)
typedef struct ICO_Header ICO_Header;
struct ICO_Header
{
U16 reserved_padding; // must be 0
U16 image_type; // if 1 -> ICO, if 2 -> CUR
U16 num_images;
};
typedef struct ICO_Entry ICO_Entry;
struct ICO_Entry
{
U8 image_width_px;
U8 image_height_px;
U8 num_colors;
U8 reserved_padding; // should be 0
union
{
U16 ico_color_planes; // in ICO
U16 cur_hotspot_x_px; // in CUR
};
union
{
U16 ico_bits_per_pixel; // in ICO
U16 cur_hotspot_y_px; // in CUR
};
U32 image_data_size;
U32 image_data_off;
};
#pragma pack(pop)
#endif // ICO_H
+3 -3
View File
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RDI_MARKUP_H
#define RDI_MARKUP_H
#ifndef RADDBG_MARKUP_H
#define RADDBG_MARKUP_H
////////////////////////////////
//~ Usage Macros
@@ -75,4 +75,4 @@ raddbg_log__impl(char *fmt, ...)
#endif // defined(_WIN32)
#endif // RDI_MARKUP_H
#endif // RADDBG_MARKUP_H
@@ -4,11 +4,11 @@
////////////////////////////////////////////////////////////////
// RAD Debug Info, (R)AD(D)BG(I) Format Library
//
// Defines standard RADDBGI debug information format types and
// Defines standard RDI debug information format types and
// functions.
#ifndef RADDBGI_FORMAT_H
#define RADDBGI_FORMAT_H
#ifndef RDI_FORMAT_H
#define RDI_FORMAT_H
////////////////////////////////////////////////////////////////
// Overridable procedure decoration
@@ -300,7 +300,8 @@ typedef enum RDI_DataSectionTagEnum{
#define RDI_DataSectionEncodingXList(X) \
X(Unpacked, 0)
X(Unpacked, 0)\
X(LZB, 1)
typedef RDI_U32 RDI_DataSectionEncoding;
typedef enum RDI_DataSectionEncodingEnum{
@@ -923,4 +924,4 @@ RDI_PROC RDI_EvalConversionKind rdi_eval_conversion_rule(RDI_EvalTypeGroup in, R
RDI_PROC RDI_U8* rdi_eval_conversion_message(RDI_EvalConversionKind conversion_kind, RDI_U64 *lennout);
RDI_PROC RDI_S32 rdi_eval_opcode_type_compatible(RDI_EvalOp op, RDI_EvalTypeGroup group);
#endif // RADDBGI_FORMAT_H
#endif // RDI_FORMAT_H
@@ -537,23 +537,23 @@ rdi_first_voff_from_proc(RDI_Parsed *p, RDI_U32 proc_id){
RDI_PROC void*
rdi_data_from_dsec(RDI_Parsed *parsed, RDI_U32 idx, RDI_U32 item_size,
RDI_DataSectionTag expected_tag,
RDI_U64 *count_out){
RDI_U64 *count_out)
{
void *result = 0;
RDI_U32 count_result = 0;
// TODO(allen): need a version of this that works with encodings other than "Unpacked"
if (0 < idx && idx < parsed->dsec_count){
if(0 < idx && idx < parsed->dsec_count)
{
RDI_DataSection *ds = parsed->dsecs + idx;
if (ds->tag == expected_tag){
RDI_U64 opl = ds->off + ds->encoded_size;
if (opl <= parsed->raw_data_size){
count_result = ds->encoded_size/item_size;
if(ds->tag == expected_tag)
{
RDI_U64 encoded_opl = ds->off + ds->encoded_size;
if(encoded_opl <= parsed->raw_data_size)
{
count_result = ds->unpacked_size/item_size;
result = (parsed->raw_data + ds->off);
}
}
}
*count_out = count_result;
return(result);
}
@@ -1744,11 +1744,13 @@ rdim_bake_section_list_push(RDIM_Arena *arena, RDIM_BakeSectionList *list)
}
RDI_PROC RDIM_BakeSection *
rdim_bake_section_list_push_new(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx)
rdim_bake_section_list_push_new_unpacked(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx)
{
RDIM_BakeSection *section = rdim_bake_section_list_push(arena, list);
section->data = data;
section->size = size;
section->encoding = RDI_DataSectionEncoding_Unpacked;
section->encoded_size = size;
section->unpacked_size = size;
section->tag = tag;
section->tag_idx = tag_idx;
return section;
@@ -2142,7 +2144,7 @@ rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
dst_tli->exe_name_string_idx = rdim_bake_idx_from_string(strings, src_tli->exe_name);
dst_tli->exe_hash = src_tli->exe_hash;
dst_tli->voff_max = src_tli->voff_max;
rdim_bake_section_list_push_new(arena, &sections, dst_tli, sizeof(*dst_tli), RDI_DataSectionTag_TopLevelInfo, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_tli, sizeof(*dst_tli), RDI_DataSectionTag_TopLevelInfo, 0);
return sections;
}
@@ -2166,7 +2168,7 @@ rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
dst->foff_first = src->foff_first;
dst->foff_opl = src->foff_opl;
}
rdim_bake_section_list_push_new(arena, &sections, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_BinarySections, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_BinarySections, 0);
return sections;
}
@@ -2286,11 +2288,11 @@ rdim_bake_section_list_from_unit(RDIM_Arena *arena, RDIM_Unit *unit)
//- rjf: build line info sections
//
U64 unit_idx = rdim_idx_from_unit(unit);
rdim_bake_section_list_push_new(arena, &sections, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, unit_idx);
rdim_bake_section_list_push_new(arena, &sections, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, unit_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, unit_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, unit_idx);
if(unit_cols != 0)
{
rdim_bake_section_list_push_new(arena, &sections, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, unit_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, unit_idx);
}
return sections;
@@ -2417,11 +2419,11 @@ rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
////////////////////////
//- rjf: build line info sections
//
rdim_bake_section_list_push_new(arena, &sections, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, dst_idx);
rdim_bake_section_list_push_new(arena, &sections, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, dst_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, dst_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, dst_idx);
if(unit_cols != 0)
{
rdim_bake_section_list_push_new(arena, &sections, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, dst_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, dst_idx);
}
////////////////////////
@@ -2439,7 +2441,7 @@ rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
dst->line_info_col_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineInfoColumns, dst_idx); // TODO(rjf): @u64_to_u32
}
}
rdim_bake_section_list_push_new(arena, &sections, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_Units, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_Units, 0);
return sections;
}
@@ -2514,7 +2516,7 @@ rdim_bake_unit_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
//- rjf: build section
RDIM_BakeSectionList sections = {0};
RDI_U64 unit_vmap_size = sizeof(unit_vmap.vmap[0])*(unit_vmap.count+1);
rdim_bake_section_list_push_new(arena, &sections, unit_vmap.vmap, unit_vmap_size, RDI_DataSectionTag_UnitVmap, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, unit_vmap.vmap, unit_vmap_size, RDI_DataSectionTag_UnitVmap, 0);
return sections;
}
@@ -2689,9 +2691,9 @@ rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMa
dst_file->line_map_nums_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapNumbers, dst_file_idx); // TODO(rjf): @u64_to_u32
dst_file->line_map_range_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapRanges, dst_file_idx); // TODO(rjf): @u64_to_u32
dst_file->line_map_voff_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapVoffs, dst_file_idx); // TODO(rjf): @u64_to_u32
rdim_bake_section_list_push_new(arena, &sections, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers, dst_file_idx);
rdim_bake_section_list_push_new(arena, &sections, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges, dst_file_idx);
rdim_bake_section_list_push_new(arena, &sections, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs, dst_file_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers, dst_file_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges, dst_file_idx);
rdim_bake_section_list_push_new_unpacked(arena, &sections, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs, dst_file_idx);
}
}
}
@@ -2699,7 +2701,7 @@ rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMa
////////////////////////////
//- rjf: build section for all source files
//
rdim_bake_section_list_push_new(arena, &sections, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles, 0);
return sections;
}
@@ -2723,6 +2725,7 @@ rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
//- rjf: fill shared type node info
dst->kind = src->kind;
dst->flags = (RDI_U16)src->flags; // TODO(rjf): @u32_to_u16
dst->byte_size = src->byte_size;
//- rjf: fill built-in-only type node info
@@ -2774,7 +2777,7 @@ rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, type_nodes, sizeof(RDI_TypeNode)*(params->types.total_count+1), RDI_DataSectionTag_TypeNodes, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, type_nodes, sizeof(RDI_TypeNode)*(params->types.total_count+1), RDI_DataSectionTag_TypeNodes, 0);
return sections;
}
@@ -2842,9 +2845,9 @@ rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTigh
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, udts, sizeof(RDI_UDT) * (params->udts.total_count+1), RDI_DataSectionTag_UDTs, 0);
rdim_bake_section_list_push_new(arena, &sections, members , sizeof(RDI_Member) * (params->udts.total_member_count+1), RDI_DataSectionTag_Members, 0);
rdim_bake_section_list_push_new(arena, &sections, enum_members, sizeof(RDI_EnumMember) * (params->udts.total_enum_val_count+1), RDI_DataSectionTag_EnumMembers, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, udts, sizeof(RDI_UDT) * (params->udts.total_count+1), RDI_DataSectionTag_UDTs, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, members , sizeof(RDI_Member) * (params->udts.total_member_count+1), RDI_DataSectionTag_Members, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, enum_members, sizeof(RDI_EnumMember) * (params->udts.total_enum_val_count+1), RDI_DataSectionTag_EnumMembers, 0);
return sections;
}
@@ -2886,7 +2889,7 @@ rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeS
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, global_variables, sizeof(RDI_GlobalVariable)*(params->global_variables.total_count+1), RDI_DataSectionTag_GlobalVariables, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, global_variables, sizeof(RDI_GlobalVariable)*(params->global_variables.total_count+1), RDI_DataSectionTag_GlobalVariables, 0);
return sections;
}
@@ -2917,9 +2920,10 @@ rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParam
{
RDIM_Symbol *global_var = &n->v[chunk_idx];
RDI_U32 global_var_idx = (RDI_U32)rdim_idx_from_symbol(global_var); // TODO(rjf): @u64_to_u32
RDI_U64 global_var_size = global_var->type ? global_var->type->byte_size : 1;
RDI_U64 first = global_var->offset;
RDI_U64 opl = first + global_var->type->byte_size;
RDI_U64 opl = first + global_var_size;
key_ptr->key = first;
key_ptr->val = marker_ptr;
@@ -2965,7 +2969,7 @@ rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParam
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, global_vmap.vmap, sizeof(RDI_VMapEntry)*(global_vmap.count+1), RDI_DataSectionTag_GlobalVmap, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, global_vmap.vmap, sizeof(RDI_VMapEntry)*(global_vmap.count+1), RDI_DataSectionTag_GlobalVmap, 0);
return sections;
}
@@ -3007,7 +3011,7 @@ rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeS
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, thread_variables, sizeof(RDI_ThreadVariable)*(params->thread_variables.total_count+1), RDI_DataSectionTag_ThreadVariables, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, thread_variables, sizeof(RDI_ThreadVariable)*(params->thread_variables.total_count+1), RDI_DataSectionTag_ThreadVariables, 0);
return sections;
}
@@ -3050,7 +3054,7 @@ rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, procedures, sizeof(RDI_Procedure)*(params->procedures.total_count+1), RDI_DataSectionTag_Procedures, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, procedures, sizeof(RDI_Procedure)*(params->procedures.total_count+1), RDI_DataSectionTag_Procedures, 0);
return sections;
}
@@ -3217,11 +3221,11 @@ rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTi
RDIM_BakeSectionList sections = {0};
RDIM_ProfScope("push all symbol info sections")
{
rdim_bake_section_list_push_new(arena, &sections, scopes, sizeof(RDI_Scope) * (params->scopes.total_count+1), RDI_DataSectionTag_Scopes, 0);
rdim_bake_section_list_push_new(arena, &sections, scope_voffs, sizeof(RDI_U64) * (params->scopes.scope_voff_count+1), RDI_DataSectionTag_ScopeVoffData, 0);
rdim_bake_section_list_push_new(arena, &sections, locals, sizeof(RDI_Local) * (params->scopes.local_count+1), RDI_DataSectionTag_Locals, 0);
rdim_bake_section_list_push_new(arena, &sections, location_blocks, sizeof(RDI_LocationBlock) * (params->scopes.location_count+1), RDI_DataSectionTag_LocationBlocks, 0);
rdim_bake_section_list_push_new(arena, &sections, location_data_blob.str, location_data_blob.size, RDI_DataSectionTag_LocationData, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, scopes, sizeof(RDI_Scope) * (params->scopes.total_count+1), RDI_DataSectionTag_Scopes, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, scope_voffs, sizeof(RDI_U64) * (params->scopes.scope_voff_count+1), RDI_DataSectionTag_ScopeVoffData, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, locals, sizeof(RDI_Local) * (params->scopes.local_count+1), RDI_DataSectionTag_Locals, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, location_blocks, sizeof(RDI_LocationBlock) * (params->scopes.location_count+1), RDI_DataSectionTag_LocationBlocks, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, location_data_blob.str, location_data_blob.size, RDI_DataSectionTag_LocationData, 0);
}
rdim_scratch_end(scratch);
return sections;
@@ -3279,7 +3283,7 @@ rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
//- rjf: build sections
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, scope_vmap.vmap, sizeof(RDI_VMapEntry)*(scope_vmap.count+1), RDI_DataSectionTag_ScopeVmap, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, scope_vmap.vmap, sizeof(RDI_VMapEntry)*(scope_vmap.count+1), RDI_DataSectionTag_ScopeVmap, 0);
return sections;
}
@@ -3321,7 +3325,7 @@ rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RD
}
// rjf: push section for all name maps
rdim_bake_section_list_push_new(arena, &sections, dst_maps, sizeof(RDI_NameMap)*name_map_count, RDI_DataSectionTag_NameMaps, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_maps, sizeof(RDI_NameMap)*name_map_count, RDI_DataSectionTag_NameMaps, 0);
return sections;
}
@@ -3423,8 +3427,8 @@ rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_Bak
}
// rjf: sections for buckets/nodes
rdim_bake_section_list_push_new(arena, &sections, baked_buckets, sizeof(RDI_NameMapBucket)* baked_buckets_count, RDI_DataSectionTag_NameMapBuckets, (RDI_U64)k);
rdim_bake_section_list_push_new(arena, &sections, baked_nodes, sizeof(RDI_NameMapNode) * baked_nodes_count, RDI_DataSectionTag_NameMapNodes, (RDI_U64)k);
rdim_bake_section_list_push_new_unpacked(arena, &sections, baked_buckets, sizeof(RDI_NameMapBucket)* baked_buckets_count, RDI_DataSectionTag_NameMapBuckets, (RDI_U64)k);
rdim_bake_section_list_push_new_unpacked(arena, &sections, baked_nodes, sizeof(RDI_NameMapNode) * baked_nodes_count, RDI_DataSectionTag_NameMapNodes, (RDI_U64)k);
}
return sections;
}
@@ -3460,7 +3464,7 @@ rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStri
}
}
RDIM_BakeSectionList sections = {0};
rdim_bake_section_list_push_new(arena, &sections, dst_nodes, sizeof(RDI_FilePathNode)*dst_nodes_count, RDI_DataSectionTag_FilePathNodes, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, dst_nodes, sizeof(RDI_FilePathNode)*dst_nodes_count, RDI_DataSectionTag_FilePathNodes, 0);
return sections;
}
@@ -3506,8 +3510,8 @@ rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeString
}
}
}
rdim_bake_section_list_push_new(arena, &sections, str_offs, sizeof(RDI_U32)*(strings->total_count+1), RDI_DataSectionTag_StringTable, 0);
rdim_bake_section_list_push_new(arena, &sections, buf, off_cursor, RDI_DataSectionTag_StringData, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, str_offs, sizeof(RDI_U32)*(strings->total_count+1), RDI_DataSectionTag_StringTable, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, buf, off_cursor, RDI_DataSectionTag_StringData, 0);
return sections;
}
@@ -3529,7 +3533,7 @@ rdim_bake_idx_run_section_list_from_idx_run_map(RDIM_Arena *arena, RDIM_BakeIdxR
out_ptr += node->count;
}
}
rdim_bake_section_list_push_new(arena, &sections, idx_data, sizeof(RDI_U32)*idx_runs->idx_count, RDI_DataSectionTag_IndexRuns, 0);
rdim_bake_section_list_push_new_unpacked(arena, &sections, idx_data, sizeof(RDI_U32)*idx_runs->idx_count, RDI_DataSectionTag_IndexRuns, 0);
return sections;
}
@@ -3590,17 +3594,17 @@ rdim_serialized_strings_from_params_bake_section_list(RDIM_Arena *arena, RDIM_Ba
if(src == 0) { continue; }
RDI_DataSection *dst = rdi_sections+dst_idx;
U64 data_section_off = 0;
if(src->size != 0)
if(src->encoded_size != 0)
{
rdim_str8_list_push_align(arena, &strings, 8);
data_section_off = strings.total_size;
rdim_str8_list_push(arena, &strings, rdim_str8((RDI_U8 *)src->data, src->size));
rdim_str8_list_push(arena, &strings, rdim_str8((RDI_U8 *)src->data, src->encoded_size));
}
dst->tag = src->tag;
dst->encoding = RDI_DataSectionEncoding_Unpacked;
dst->encoding = src->encoding;
dst->off = data_section_off;
dst->encoded_size = src->size;
dst->unpacked_size = src->size;
dst->encoded_size = src->encoded_size;
dst->unpacked_size = src->unpacked_size;
}
rdim_scratch_end(scratch);
@@ -5,14 +5,14 @@
// RAD Debug Info Make, (R)AD(D)BG(I) (M)ake Library
//
// Library for building loose data structures which contain
// RADDBGI debug information, and baking that down into the
// proper flattened RADDBGI format.
// RDI debug information, and baking that down into the
// proper flattened RDI format.
//
// Requires prior inclusion of the RAD Debug Info, (R)AD(D)BG(I)
// Format Library, in raddbgi_format.h.
// Format Library, in rdi_format.h.
#ifndef RADDBGI_MAKE_H
#define RADDBGI_MAKE_H
#ifndef RDI_MAKE_H
#define RDI_MAKE_H
////////////////////////////////
//~ rjf: Overrideable Memory Operations
@@ -811,7 +811,9 @@ typedef struct RDIM_BakeSection RDIM_BakeSection;
struct RDIM_BakeSection
{
void *data;
RDI_U64 size;
RDI_DataSectionEncoding encoding;
RDI_U64 encoded_size;
RDI_U64 unpacked_size;
RDI_DataSectionTag tag;
RDI_U64 tag_idx;
};
@@ -1153,7 +1155,7 @@ RDI_PROC void rdim_bake_name_map_push(RDIM_Arena *arena, RDIM_BakeNameMap *map,
//~ rjf: [Baking Helpers] Data Section List Building Helpers
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push(RDIM_Arena *arena, RDIM_BakeSectionList *list);
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push_new(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx);
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push_new_unpacked(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx);
RDI_PROC void rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst, RDIM_BakeSectionList *to_push);
////////////////////////////////
@@ -1250,4 +1252,4 @@ RDI_PROC RDIM_BakeSectionList rdim_bake_idx_run_section_list_from_idx_run_map(RD
RDI_PROC RDIM_String8List rdim_serialized_strings_from_params_bake_section_list(RDIM_Arena *arena, RDIM_BakeParams *params, RDIM_BakeSectionList *sections);
#endif // RADDBGI_MAKE_H
#endif // RDI_MAKE_H
@@ -141,4 +141,14 @@
# error Endianness of this architecture not understood by context cracker
#endif
////////////////////////////////
//~ rjf: Unsupported Errors
#if ARCH_X86
# error You tried to build in x86 (32 bit) mode, but currently, only building in x64 (64 bit) mode is supported.
#endif
#if !ARCH_X64
# error You tried to build with an unsupported architecture. Currently, only building in x64 mode is supported.
#endif
#endif // BASE_CONTEXT_CRACKING_H
+3
View File
@@ -326,6 +326,9 @@ type_coverage_eval_tests(void){
swea.z = 'z';
}
Struct_With_Embedded_Arrays *swea_ptr = &swea;
int access_via_ptr_member = swea_ptr->x;
Custom_Index_Type custom_index = 42;
Custom_Index_Type more_custom_indices[] = {
04,13,22,31,40
+1
View File
@@ -39,4 +39,5 @@ dll_type_eval_tests(void)
Basics basics2 = {4, 5, 6, 7};
int x = 0;
(void)x;
*(int *)0 = 0;
}
+61
View File
@@ -0,0 +1,61 @@
#include <windows.h>
#include <winternl.h>
#include "mule_peb_trample_reload.c"
static void
HideModuleFromWindowsReload(HMODULE ModuleToFlush)
{
/* NOTE(casey): Normally you cannot "reload" an executable module with the same name,
because Windows checks a linked list of loaded modules and assumes that if
it's already loaded, it doesn't need to reload it, even though it may have to because
it has changed on disk.
This solution to that problem comes from some excellent spelunking by Martins Mozeiko,
who figured out that you could overwrite the filenames Windows stores in your process's
loaded module table, thus thwarting the Windows filename check against loaded modules,
allowing you to reload an existing module that has changed without requiring it to
have a different filename!
*/
PEB *Peb = (PEB *)__readgsqword(offsetof(TEB, ProcessEnvironmentBlock));
LIST_ENTRY *Head = &Peb->Ldr->InMemoryOrderModuleList;
for(LIST_ENTRY *Entry = Head->Flink;
Entry != Head;
Entry = Entry->Flink)
{
LDR_DATA_TABLE_ENTRY *Mod = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks);
if(Mod->DllBase == ModuleToFlush)
{
ZeroMemory(Mod->FullDllName.Buffer, Mod->FullDllName.Length);
Mod->DllBase = 0;
break;
}
}
}
int main(int argument_count, char **arguments)
{
char *exe_name = arguments[0];
HANDLE last_module = GetModuleHandle(0);
int (*loop_iteration_function)(int it) = (int (*)(int))GetProcAddress(last_module, "loop_iteration");
FILETIME last_filetime = {0};
int should_exit = 0;
for(int it = 0; !should_exit; it += 1)
{
int result = loop_iteration_function(it);
printf("%i\n", result);
Sleep(50);
FILETIME current_filetime = {0};
HANDLE current_exe_file = CreateFile(exe_name, 0, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
GetFileTime(current_exe_file, 0, 0, &current_filetime);
CloseHandle(current_exe_file);
if(it != 0 && CompareFileTime(&last_filetime, &current_filetime) < 0)
{
HideModuleFromWindowsReload(last_module);
last_module = LoadLibrary(arguments[0]);
loop_iteration_function = (int (*)(int))GetProcAddress(last_module, "loop_iteration");
}
last_filetime = current_filetime;
}
return 0;
}
+13
View File
@@ -0,0 +1,13 @@
__declspec(dllexport) int
loop_iteration(int it)
{
return 111;
#if 0
int sum = 0;
for(int i = 0; i < 1000; i += 1)
{
sum += it*i;
}
return sum;
#endif
}
+1 -1
View File
@@ -1607,7 +1607,7 @@ os_semaphore_close(OS_Handle semaphore)
}
internal B32
os_semaphore_take(OS_Handle semaphore)
os_semaphore_take(OS_Handle semaphore, U64 endt_us)
{
NotImplemented;
return 0;
+18
View File
@@ -113,6 +113,24 @@ os_write_data_list_to_file_path(String8 path, String8List list)
return good;
}
internal B32
os_append_data_to_file_path(String8 path, String8 data)
{
B32 good = 0;
if(data.size != 0)
{
OS_Handle file = os_file_open(OS_AccessFlag_Write|OS_AccessFlag_Append, path);
if(!os_handle_match(file, os_handle_zero()))
{
good = 1;
U64 pos = os_properties_from_file(file).size;
os_file_write(file, r1u64(pos, pos+data.size), data.str);
os_file_close(file);
}
}
return good;
}
internal OS_FileID
os_id_from_file_path(String8 path)
{
+4 -2
View File
@@ -13,8 +13,9 @@ enum
OS_AccessFlag_Read = (1<<0),
OS_AccessFlag_Write = (1<<1),
OS_AccessFlag_Execute = (1<<2),
OS_AccessFlag_ShareRead = (1<<3),
OS_AccessFlag_ShareWrite = (1<<4),
OS_AccessFlag_Append = (1<<3),
OS_AccessFlag_ShareRead = (1<<4),
OS_AccessFlag_ShareWrite = (1<<5),
};
////////////////////////////////
@@ -171,6 +172,7 @@ internal String8List os_string_list_from_argcv(Arena *arena, int argc, char **ar
internal String8 os_data_from_file_path(Arena *arena, String8 path);
internal B32 os_write_data_to_file_path(String8 path, String8 data);
internal B32 os_write_data_list_to_file_path(String8 path, String8List list);
internal B32 os_append_data_to_file_path(String8 path, String8 data);
internal OS_FileID os_id_from_file_path(String8 path);
internal S64 os_file_id_compare(OS_FileID a, OS_FileID b);
internal String8 os_string_from_file_range(Arena *arena, OS_Handle file, Rng1U64 range);
+1
View File
@@ -664,6 +664,7 @@ os_file_open(OS_AccessFlags flags, String8 path)
if(flags & OS_AccessFlag_ShareRead) {share_mode |= FILE_SHARE_READ;}
if(flags & OS_AccessFlag_ShareWrite) {share_mode |= FILE_SHARE_WRITE|FILE_SHARE_DELETE;}
if(flags & OS_AccessFlag_Write) {creation_disposition = CREATE_ALWAYS;}
if(flags & OS_AccessFlag_Append) {creation_disposition = OPEN_ALWAYS;}
HANDLE file = CreateFileW((WCHAR *)path16.str, access_flags, share_mode, 0, creation_disposition, FILE_ATTRIBUTE_NORMAL, 0);
if(file != INVALID_HANDLE_VALUE)
{
+5 -15
View File
@@ -7,22 +7,12 @@
////////////////////////////////
//~ NOTE(allen): Negotiate the windows header include order
#if OS_FEATURE_SOCKET
#include <WinSock2.h>
#endif
#include <Windows.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <timeapi.h>
#include <tlhelp32.h>
#include <Shlobj.h>
#if OS_FEATURE_GRAPHICAL
#include <shellscalingapi.h>
#endif
#if OS_FEATURE_SOCKET
#include <WS2tcpip.h>
#include <Mswsock.h>
#endif
#include <processthreadsapi.h>
////////////////////////////////
+12 -1
View File
@@ -7,6 +7,12 @@
////////////////////////////////
//~ rjf: Window Types
typedef U32 OS_WindowFlags;
enum
{
OS_WindowFlag_CustomBorder = (1<<0),
};
typedef void OS_WindowRepaintFunctionType(OS_Handle window, void *user_data);
////////////////////////////////
@@ -112,7 +118,7 @@ internal String8 os_get_clipboard_text(Arena *arena);
////////////////////////////////
//~ rjf: @os_hooks Windows (Implemented Per-OS)
internal OS_Handle os_window_open(Vec2F32 resolution, String8 title);
internal OS_Handle os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title);
internal void os_window_close(OS_Handle window);
internal void os_window_first_paint(OS_Handle window);
internal void os_window_equip_repaint(OS_Handle window, OS_WindowRepaintFunctionType *repaint, void *user_data);
@@ -122,8 +128,13 @@ internal B32 os_window_is_fullscreen(OS_Handle window);
internal void os_window_set_fullscreen(OS_Handle window, B32 fullscreen);
internal B32 os_window_is_maximized(OS_Handle window);
internal void os_window_set_maximized(OS_Handle window, B32 maximized);
internal void os_window_minimize(OS_Handle window);
internal void os_window_bring_to_front(OS_Handle window);
internal void os_window_set_monitor(OS_Handle window, OS_Handle monitor);
internal void os_window_clear_custom_border_data(OS_Handle handle);
internal void os_window_push_custom_title_bar(OS_Handle handle, F32 thickness);
internal void os_window_push_custom_edges(OS_Handle handle, F32 thickness);
internal void os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect);
internal Rng2F32 os_rect_from_window(OS_Handle window);
internal Rng2F32 os_client_rect_from_window(OS_Handle window);
internal F32 os_dpi_from_window(OS_Handle window);
+26 -1
View File
@@ -24,7 +24,7 @@ os_get_clipboard_text(Arena *arena)
//~ rjf: @os_hooks Windows (Implemented Per-OS)
internal OS_Handle
os_window_open(Vec2F32 resolution, String8 title)
os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title)
{
OS_Handle handle = {1};
return handle;
@@ -78,6 +78,11 @@ os_window_set_maximized(OS_Handle window, B32 maximized)
{
}
internal void
os_window_minimize(OS_Handle window)
{
}
internal void
os_window_bring_to_front(OS_Handle window)
{
@@ -88,6 +93,26 @@ os_window_set_monitor(OS_Handle window, OS_Handle monitor)
{
}
internal void
os_window_clear_custom_border_data(OS_Handle handle)
{
}
internal void
os_window_push_custom_title_bar(OS_Handle handle, F32 thickness)
{
}
internal void
os_window_push_custom_edges(OS_Handle handle, F32 thickness)
{
}
internal void
os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect)
{
}
internal Rng2F32
os_rect_from_window(OS_Handle window)
{
+321 -8
View File
@@ -1,6 +1,17 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Includes
#include <uxtheme.h>
#include <dwmapi.h>
#include <shellscalingapi.h>
#pragma comment(lib, "gdi32")
#pragma comment(lib, "dwmapi")
#pragma comment(lib, "UxTheme")
#pragma comment(lib, "ole32")
////////////////////////////////
//~ rjf: Globals
@@ -100,6 +111,10 @@ w32_allocate_window(void)
internal void
w32_free_window(W32_Window *window)
{
if(window->paint_arena != 0)
{
arena_release(window->paint_arena);
}
DestroyWindow(window->hwnd);
DLLRemove(w32_first_window, w32_last_window, window);
window->next = w32_first_free_window;
@@ -530,8 +545,19 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETCURSOR:
{
if(!w32_resizing &&
contains_2f32(os_client_rect_from_window(window_handle), os_mouse_from_window(window_handle)))
Rng2F32 window_rect = os_client_rect_from_window(window_handle);
Vec2F32 mouse = os_mouse_from_window(window_handle);
B32 on_border = 0;
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
if(window != 0 && window->custom_border && !is_fullscreen)
{
B32 on_border_x = (mouse.x <= window->custom_border_edge_thickness || window_rect.x1-window->custom_border_edge_thickness <= mouse.x);
B32 on_border_y = (mouse.y <= window->custom_border_edge_thickness || window_rect.y1-window->custom_border_edge_thickness <= mouse.y);
on_border = on_border_x || on_border_y;
}
if(!w32_resizing && !on_border &&
contains_2f32(window_rect, mouse))
{
SetCursor(w32_hcursor);
}
@@ -546,6 +572,225 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
F32 new_dpi = (F32)(wParam & 0xffff);
window->dpi = new_dpi;
}break;
//- rjf: [custom border]
case WM_NCPAINT:
{
if(window != 0 && window->custom_border && !window->custom_border_composition_enabled)
{
result = 0;
}
else
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}break;
case WM_DWMCOMPOSITIONCHANGED:
{
if(window != 0 && window->custom_border)
{
BOOL enabled = 0;
DwmIsCompositionEnabled(&enabled);
window->custom_border_composition_enabled = enabled;
if(enabled)
{
MARGINS m = { 0, 0, 1, 0 };
DwmExtendFrameIntoClientArea(hwnd, &m);
DWORD dwmncrp_enabled = DWMNCRP_ENABLED;
DwmSetWindowAttribute(hwnd, DWMWA_NCRENDERING_POLICY, &enabled, sizeof(dwmncrp_enabled));
}
}
else
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}break;
case WM_WINDOWPOSCHANGED:
{
result = 0;
}break;
case WM_NCUAHDRAWCAPTION:
case WM_NCUAHDRAWFRAME:
{
// NOTE(rjf): undocumented messages for drawing themed window borders.
if(window != 0 && window->custom_border)
{
result = 0;
}
else
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}break;
case WM_SETICON:
case WM_SETTEXT:
{
if(window && window->custom_border && !window->custom_border_composition_enabled)
{
// NOTE(rjf):
// https://blogs.msdn.microsoft.com/wpfsdk/2008/09/08/custom-window-chrome-in-wpf/
LONG_PTR old_style = GetWindowLongPtrW(hwnd, GWL_STYLE);
SetWindowLongPtrW(hwnd, GWL_STYLE, old_style & ~WS_VISIBLE);
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
SetWindowLongPtrW(hwnd, GWL_STYLE, old_style);
}
else
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}break;
//- rjf: [custom border] activation - without this `result`, stuff flickers.
case WM_NCACTIVATE:
{
if(window == 0 || window->custom_border == 0)
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
else
{
result = DefWindowProcW(hwnd, uMsg, wParam, -1);
}
}break;
//- rjf: [custom border] client/window size calculation
case WM_NCCALCSIZE:
if(window != 0)
{
if(window->custom_border == 0)
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
else
{
MARGINS m = {0, 0, 0, 0};
RECT *r = (RECT *)lParam;
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
if(IsZoomed(hwnd) && !is_fullscreen)
{
int x_push_in = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
int y_push_in = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
r->left += x_push_in;
r->top += y_push_in;
r->bottom -= x_push_in;
r->right -= y_push_in;
m.cxLeftWidth = m.cxRightWidth = x_push_in;
m.cyTopHeight = m.cyBottomHeight = y_push_in;
}
DwmExtendFrameIntoClientArea(hwnd, &m);
}
}break;
//- rjf: [custom border] client/window hit testing (mapping mouse -> action)
case WM_NCHITTEST:
{
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
if(window == 0 || window->custom_border == 0 || is_fullscreen)
{
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
else
{
POINT pos_monitor;
pos_monitor.x = GET_X_LPARAM(lParam);
pos_monitor.y = GET_Y_LPARAM(lParam);
POINT pos_client = pos_monitor;
ScreenToClient(hwnd, &pos_client);
//- rjf: check against window boundaries
RECT frame_rect;
GetWindowRect(hwnd, &frame_rect);
B32 is_over_window = (frame_rect.left <= pos_monitor.x && pos_monitor.x < frame_rect.right &&
frame_rect.top <= pos_monitor.y && pos_monitor.y < frame_rect.bottom);
//- rjf: check against borders
B32 is_over_left = 0;
B32 is_over_right = 0;
B32 is_over_top = 0;
B32 is_over_bottom = 0;
{
RECT rect;
GetClientRect(hwnd, &rect);
if(!IsZoomed(hwnd))
{
if(rect.left <= pos_client.x && pos_client.x < rect.left + window->custom_border_edge_thickness)
{
is_over_left = 1;
}
if(rect.right - window->custom_border_edge_thickness <= pos_client.x && pos_client.x < rect.right)
{
is_over_right = 1;
}
if(rect.bottom - window->custom_border_edge_thickness <= pos_client.y && pos_client.y < rect.bottom)
{
is_over_bottom = 1;
}
if(rect.top <= pos_client.y && pos_client.y < rect.top + window->custom_border_edge_thickness)
{
is_over_top = 1;
}
}
}
//- rjf: check against title bar
B32 is_over_title_bar = 0;
{
RECT rect;
GetClientRect(hwnd, &rect);
is_over_title_bar = (rect.left <= pos_client.x && pos_client.x < rect.right &&
rect.top <= pos_client.y && pos_client.y < rect.top + window->custom_border_title_thickness);
}
//- rjf: check against title bar client areas
B32 is_over_title_bar_client_area = 0;
for(W32_TitleBarClientArea *area = window->first_title_bar_client_area;
area != 0;
area = area->next)
{
Rng2F32 rect = area->rect;
if(rect.x0 <= pos_client.x && pos_client.x < rect.x1 &&
rect.y0 <= pos_client.y && pos_client.y < rect.y1)
{
is_over_title_bar_client_area = 1;
break;
}
}
//- rjf: resolve hovering to result
result = HTNOWHERE;
if(is_over_window)
{
// rjf: default to client area
result = HTCLIENT;
// rjf: title bar
if(is_over_title_bar)
{
result = HTCAPTION;
}
// rjf: normal edges
if(is_over_left) { result = HTLEFT; }
if(is_over_right) { result = HTRIGHT; }
if(is_over_top) { result = HTTOP; }
if(is_over_bottom) { result = HTBOTTOM; }
// rjf: corners
if(is_over_left && is_over_top) { result = HTTOPLEFT; }
if(is_over_left && is_over_bottom) { result = HTBOTTOMLEFT; }
if(is_over_right && is_over_top) { result = HTTOPRIGHT; }
if(is_over_right && is_over_bottom) { result = HTBOTTOMRIGHT; }
// rjf: title bar client area
if(is_over_title_bar_client_area)
{
result = HTCLIENT;
}
}
}
}break;
}
}
@@ -580,7 +825,7 @@ os_graphical_init(void)
//- rjf: set dpi awareness
w32_SetProcessDpiAwarenessContext_Type *SetProcessDpiAwarenessContext_func = 0;
HMODULE module = LoadLibraryA("user32.dll");
if (module != 0)
if(module != 0)
{
SetProcessDpiAwarenessContext_func =
(w32_SetProcessDpiAwarenessContext_Type*)GetProcAddress(module, "SetProcessDpiAwarenessContext");
@@ -588,7 +833,7 @@ os_graphical_init(void)
(w32_GetDpiForWindow_Type*)GetProcAddress(module, "GetDpiForWindow");
FreeLibrary(module);
}
if (SetProcessDpiAwarenessContext_func != 0)
if(SetProcessDpiAwarenessContext_func != 0)
{
SetProcessDpiAwarenessContext_func(w32_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}
@@ -601,6 +846,7 @@ os_graphical_init(void)
wndclass.lpszClassName = L"graphical-window";
wndclass.hCursor = LoadCursorA(0, IDC_ARROW);
wndclass.hIcon = LoadIcon(w32_h_instance, MAKEINTRESOURCE(1));
wndclass.style = CS_VREDRAW|CS_HREDRAW;
ATOM wndatom = RegisterClassExW(&wndclass);
(void)wndatom;
}
@@ -667,17 +913,17 @@ os_get_clipboard_text(Arena *arena)
//~ rjf: @os_hooks Windows (Implemented Per-OS)
internal OS_Handle
os_window_open(Vec2F32 resolution, String8 title)
os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title)
{
//- rjf: make hwnd
HWND hwnd = 0;
{
Temp scratch = scratch_begin(0, 0);
String16 title16 = str16_from_8(scratch.arena, title);
hwnd = CreateWindowExW(0,
hwnd = CreateWindowExW(WS_EX_APPWINDOW,
L"graphical-window",
(WCHAR*)title16.str,
WS_OVERLAPPEDWINDOW,
WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT,
(int)resolution.x,
(int)resolution.y,
@@ -699,8 +945,23 @@ os_window_open(Vec2F32 resolution, String8 title)
}
}
//- rjf: early detection of composition
{
BOOL enabled = 0;
DwmIsCompositionEnabled(&enabled);
window->custom_border_composition_enabled = enabled;
}
//- rjf: custom border
if(flags & OS_WindowFlag_CustomBorder)
{
window->custom_border = 1;
window->paint_arena = arena_alloc();
}
//- rjf: convert to handle + return
return os_window_from_w32_window(window);
OS_Handle result = os_window_from_w32_window(window);
return result;
}
internal void
@@ -825,6 +1086,16 @@ os_window_set_maximized(OS_Handle handle, B32 maximized)
}
}
internal void
os_window_minimize(OS_Handle handle)
{
W32_Window *window = w32_window_from_os_window(handle);
if(window != 0)
{
ShowWindow(window->hwnd, SW_MINIMIZE);
}
}
internal void
os_window_bring_to_front(OS_Handle handle)
{
@@ -856,6 +1127,48 @@ os_window_set_monitor(OS_Handle window_handle, OS_Handle monitor)
}
}
internal void
os_window_clear_custom_border_data(OS_Handle handle)
{
W32_Window *window = w32_window_from_os_window(handle);
if(window->custom_border)
{
arena_clear(window->paint_arena);
window->first_title_bar_client_area = window->last_title_bar_client_area = 0;
window->custom_border_title_thickness = 0;
window->custom_border_edge_thickness = 0;
}
}
internal void
os_window_push_custom_title_bar(OS_Handle handle, F32 thickness)
{
W32_Window *window = w32_window_from_os_window(handle);
window->custom_border_title_thickness = thickness;
}
internal void
os_window_push_custom_edges(OS_Handle handle, F32 thickness)
{
W32_Window *window = w32_window_from_os_window(handle);
window->custom_border_edge_thickness = thickness;
}
internal void
os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect)
{
W32_Window *window = w32_window_from_os_window(handle);
if(window->custom_border)
{
W32_TitleBarClientArea *area = push_array(window->paint_arena, W32_TitleBarClientArea, 1);
if(area != 0)
{
area->rect = rect;
SLLQueuePush(window->first_title_bar_client_area, window->last_title_bar_client_area, area);
}
}
}
internal Rng2F32
os_rect_from_window(OS_Handle handle)
{
+21
View File
@@ -7,9 +7,23 @@
#pragma comment(lib, "user32")
#pragma comment(lib, "gdi32")
#ifndef WM_NCUAHDRAWCAPTION
#define WM_NCUAHDRAWCAPTION (0x00AE)
#endif
#ifndef WM_NCUAHDRAWFRAME
#define WM_NCUAHDRAWFRAME (0x00AF)
#endif
////////////////////////////////
//~ rjf: Windows
typedef struct W32_TitleBarClientArea W32_TitleBarClientArea;
struct W32_TitleBarClientArea
{
W32_TitleBarClientArea *next;
Rng2F32 rect;
};
typedef struct W32_Window W32_Window;
struct W32_Window
{
@@ -22,6 +36,13 @@ struct W32_Window
F32 dpi;
B32 first_paint_done;
B32 maximized;
B32 custom_border;
F32 custom_border_title_thickness;
F32 custom_border_edge_thickness;
B32 custom_border_composition_enabled;
Arena *paint_arena;
W32_TitleBarClientArea *first_title_bar_client_area;
W32_TitleBarClientArea *last_title_bar_client_area;
};
////////////////////////////////
+2 -3
View File
@@ -69,11 +69,10 @@ pe_bin_info_from_data(Arena *arena, String8 data)
}
// rjf: read pe magic
U32 coff_off = dos_header.coff_file_offset;
U32 pe_magic = 0;
if(valid)
{
str8_deserial_read_struct(data, coff_off, &pe_magic);
str8_deserial_read_struct(data, dos_header.coff_file_offset, &pe_magic);
}
// rjf: bad pe magic -> abort
@@ -83,7 +82,7 @@ pe_bin_info_from_data(Arena *arena, String8 data)
}
// rjf: read coff header
U32 coff_header_off = coff_off + sizeof(pe_magic);
U32 coff_header_off = dos_header.coff_file_offset + sizeof(pe_magic);
COFF_Header coff_header = {0};
if(valid)
{
+144 -79
View File
@@ -11,12 +11,32 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
//////////////////////////////
//- rjf: begin logging
//
if(main_thread_log == 0)
{
main_thread_log = log_alloc();
String8 user_program_data_path = os_string_from_system_path(scratch.arena, OS_SystemPath_UserProgramData);
String8 user_data_folder = push_str8f(scratch.arena, "%S/raddbg/logs", user_program_data_path);
main_thread_log_path = push_str8f(df_state->arena, "%S/ui_thread.raddbg_log", user_data_folder);
os_make_directory(user_data_folder);
os_write_data_to_file_path(main_thread_log_path, str8_zero());
}
log_select(main_thread_log);
log_scope_begin();
//////////////////////////////
//- rjf: tick cache layers
//
txt_user_clock_tick();
dasm_user_clock_tick();
geo_user_clock_tick();
tex_user_clock_tick();
//////////////////////////////
//- rjf: pick target hz
//
// TODO(rjf): maximize target, given all windows and their monitors
F32 target_hz = os_default_refresh_rate();
if(frame_time_us_history_idx > 32)
@@ -52,29 +72,41 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
target_hz = best_target_hz;
}
//////////////////////////////
//- rjf: target Hz -> delta time
//
F32 dt = 1.f/target_hz;
//////////////////////////////
//- rjf: last frame before sleep -> disable txti change detection
//
if(df_gfx_state->num_frames_requested == 0)
{
txti_set_external_change_detection_enabled(0);
}
//////////////////////////////
//- rjf: get events from the OS
//
OS_EventList events = {0};
if(os_handle_match(repaint_window_handle, os_handle_zero()))
{
events = os_get_events(scratch.arena, df_gfx_state->num_frames_requested == 0);
}
//////////////////////////////
//- rjf: enable txti change detection
//
txti_set_external_change_detection_enabled(1);
//////////////////////////////
//- rjf: begin measuring actual per-frame work
//
U64 begin_time_us = os_now_microseconds();
//////////////////////////////
//- rjf: bind change
//
if(!df_gfx_state->confirm_active && df_gfx_state->bind_change_active)
{
if(os_key_press(&events, os_handle_zero(), 0, OS_Key_Esc))
@@ -99,6 +131,7 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
event->key != OS_Key_Delete &&
event->key != OS_Key_LeftMouseButton &&
event->key != OS_Key_RightMouseButton &&
event->key != OS_Key_MiddleMouseButton &&
event->key != OS_Key_Ctrl &&
event->key != OS_Key_Alt &&
event->key != OS_Key_Shift)
@@ -122,7 +155,10 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
}
}
//- rjf: take hotkeys
//////////////////////////////
//- rjf: consume events
//
B32 queue_drag_drop = 0;
{
for(OS_Event *event = events.first, *next = 0;
event != 0;
@@ -131,7 +167,63 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
next = event->next;
DF_Window *window = df_window_from_os_handle(event->window);
DF_CmdParams params = window ? df_cmd_params_from_window(window) : df_cmd_params_from_gfx();
if(event->kind == OS_EventKind_Press)
B32 take = 0;
B32 skip = 0;
//- rjf: try drag-drop
if(df_drag_is_active() && event->kind == OS_EventKind_Release && event->key == OS_Key_LeftMouseButton)
{
skip = 1;
queue_drag_drop = 1;
}
//- rjf: try window close
if(!take && event->kind == OS_EventKind_WindowClose && window != 0)
{
take = 1;
DF_CmdParams params = df_cmd_params_from_window(window);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CloseWindow));
}
//- rjf: try menu bar operations
{
if(!take && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
window->menu_bar_focused_on_press = window->menu_bar_focused;
window->menu_bar_key_held = 1;
window->menu_bar_focus_press_started = 1;
}
if(!take && event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
window->menu_bar_key_held = 0;
}
if(window->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
window->menu_bar_focused = 0;
}
else if(window->menu_bar_focus_press_started && !window->menu_bar_focused && event->kind == OS_EventKind_Release && event->flags == 0 && event->key == OS_Key_Alt && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
window->menu_bar_focused = !window->menu_bar_focused_on_press;
window->menu_bar_focus_press_started = 0;
}
else if(event->kind == OS_EventKind_Press && event->key == OS_Key_Esc && window->menu_bar_focused && !ui_any_ctx_menu_is_open())
{
take = 1;
df_gfx_request_frame();
window->menu_bar_focused = 0;
}
}
//- rjf: try hotkey presses
if(!take && event->kind == OS_EventKind_Press)
{
DF_Binding binding = {event->key, event->flags};
DF_CmdSpecList spec_candidates = df_cmd_spec_list_from_binding(scratch.arena, binding);
@@ -145,16 +237,22 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
df_cmd_params_mark_slot(&params, DF_CmdParamSlot_CmdSpec);
}
U32 hit_char = os_codepoint_from_event_flags_and_key(event->flags, event->key);
os_eat_event(&events, event);
take = 1;
df_push_cmd__root(&params, run_spec);
if(event->flags & OS_EventFlag_Alt)
{
window->menu_bar_focus_press_started = 0;
}
}
else if(OS_Key_F1 <= event->key && event->key <= OS_Key_F19)
{
window->menu_bar_focus_press_started = 0;
}
df_gfx_request_frame();
}
else if(event->kind == OS_EventKind_Text)
//- rjf: try text events
if(!take && event->kind == OS_EventKind_Text)
{
String32 insertion32 = str32(&event->character, 1);
String8 insertion8 = str8_from_32(scratch.arena, insertion32);
@@ -163,87 +261,51 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
df_cmd_params_mark_slot(&params, DF_CmdParamSlot_String);
df_push_cmd__root(&params, spec);
df_gfx_request_frame();
os_eat_event(&events, event);
take = 1;
if(event->flags & OS_EventFlag_Alt)
{
window->menu_bar_focus_press_started = 0;
}
}
}
}
//- rjf: menu bar focus
{
for(OS_Event *event = events.first, *next = 0; event != 0; event = next)
{
next = event->next;
DF_Window *ws = df_window_from_os_handle(event->window);
if(ws == 0)
{
continue;
}
B32 take = 0;
if(event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
//- rjf: do fall-through
if(!take)
{
take = 1;
df_gfx_request_frame();
ws->menu_bar_focused_on_press = ws->menu_bar_focused;
ws->menu_bar_key_held = 1;
ws->menu_bar_focus_press_started = 1;
params.os_event = event;
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OSEvent));
}
if(event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
ws->menu_bar_key_held = 0;
}
if(ws->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
ws->menu_bar_focused = 0;
}
else if(ws->menu_bar_focus_press_started && !ws->menu_bar_focused && event->kind == OS_EventKind_Release && event->flags == 0 && event->key == OS_Key_Alt && event->is_repeat == 0)
{
take = 1;
df_gfx_request_frame();
ws->menu_bar_focused = !ws->menu_bar_focused_on_press;
ws->menu_bar_focus_press_started = 0;
}
else if(event->kind == OS_EventKind_Press && event->key == OS_Key_Esc && ws->menu_bar_focused && !ui_any_ctx_menu_is_open())
{
take = 1;
df_gfx_request_frame();
ws->menu_bar_focused = 0;
}
if(take)
//- rjf: take
if(take && !skip)
{
os_eat_event(&events, event);
}
}
}
//////////////////////////////
//- rjf: gather root-level commands
//
DF_CmdList cmds = df_core_gather_root_cmds(scratch.arena);
//////////////////////////////
//- rjf: begin frame
//
df_core_begin_frame(scratch.arena, &cmds, dt);
df_gfx_begin_frame(scratch.arena, &cmds);
//////////////////////////////
//- rjf: queue drop for drag/drop
if(df_drag_is_active())
//
if(queue_drag_drop)
{
for(OS_Event *event = events.first; event != 0; event = event->next)
{
if(event->kind == OS_EventKind_Release && event->key == OS_Key_LeftMouseButton)
{
df_queue_drag_drop();
break;
}
}
df_queue_drag_drop();
}
//////////////////////////////
//- rjf: auto-focus moused-over windows while dragging
//
if(df_drag_is_active())
{
B32 over_focused_window = 0;
@@ -274,20 +336,26 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
}
}
//////////////////////////////
//- rjf: update & render
//
{
d_begin_frame();
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
{
df_window_update_and_render(scratch.arena, &events, w, &cmds);
df_window_update_and_render(scratch.arena, w, &cmds);
}
}
//////////////////////////////
//- rjf: end frontend frame, send signals, etc.
//
df_gfx_end_frame();
df_core_end_frame();
//////////////////////////////
//- rjf: submit rendering to all windows
//
{
r_begin_frame();
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
@@ -299,36 +367,33 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
r_end_frame();
}
//- rjf: take window closing events
for(OS_Event *e = events.first, *next = 0; e; e = next)
{
next = e->next;
if(e->kind == OS_EventKind_WindowClose)
{
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
{
if(os_handle_match(w->os, e->window))
{
DF_CmdParams params = df_cmd_params_from_window(w);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CloseWindow));
break;
}
}
os_eat_event(&events, e);
}
}
//////////////////////////////
//- rjf: determine frame time, record into history
//
U64 end_time_us = os_now_microseconds();
U64 frame_time_us = end_time_us-begin_time_us;
frame_time_us_history[frame_time_us_history_idx%ArrayCount(frame_time_us_history)] = frame_time_us;
frame_time_us_history_idx += 1;
//////////////////////////////
//- rjf: end logging
//
{
LogScopeResult log = log_scope_end(scratch.arena);
os_append_data_to_file_path(main_thread_log_path, log.strings[LogMsgKind_Info]);
if(log.strings[LogMsgKind_UserError].size != 0)
{
DF_CmdParams p = df_cmd_params_from_gfx();
p.string = log.strings[LogMsgKind_UserError];
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error));
}
}
scratch_end(scratch);
ProfEnd();
}
internal CTRL_WAKEUP_FUNCTION_DEF(wakeup_hook)
internal CTRL_WAKEUP_FUNCTION_DEF(wakeup_hook_ctrl)
{
os_send_wakeup_event();
}
+75 -97
View File
@@ -1,31 +1,16 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Demon/Cleanup Pass Tasks
//
// [ ] TLS eval -> in-process-memory EXE info
// [ ] unwinding -> in-process-memory EXE info
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
// jettison a collection of keys in retained mode fashion
////////////////////////////////
//~ rjf: Frontend/UI Pass Tasks
//
// [ ] editing multiple bindings for commands
// [ ] n-row table selection, in watch window & other UIs, multi-selection
// ctrl+C
// [ ] UI_NavActions, OS_Event -> UI_Event (single event stream)
//
// [ ] better discoverability for view rules - have better help hover tooltip,
// info on arguments, and better autocomplete lister
//
// [ ] source view -> floating margin/line-nums
// [ ] theme colors -> more explicit about e.g. opaque backgrounds vs. floating
// & scrollbars etc.
// [ ] drag/drop tab cleanup
// [ ] target/breakpoint/watch-pin reordering
// [ ] watch window reordering
// [ ] standard way to filter
// [ ] visualize remapped files (via path map)
// [ ] theme lister -> fonts & font sizes
// [ ] font lister
@@ -41,9 +26,6 @@
// that you use to tag them. Just some way that would make it easier to
// focus on your own threads.
//
// [ ] autocomplete lister should respect position in edited expression,
// tabbing through should autocomplete but not exit, etc.
//
// [ ] it would be nice to have "show in explorer" for right click on source
// file tab (opens explorer & selects the file)
//
@@ -51,43 +33,41 @@
// different color? can I turn it off? And why sometimes digits in number
// start with brighter color, but sometimes with darker - shouldn't it
// always have the same color ordering?
//
// [ ] pipe failure-to-launch errors back to frontend
////////////////////////////////
//~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy)
//
// [ ] raddbg jai.exe my_file.jai -- foobar -> raddbg consumes `--` incorrectly
// [ ] PDB files distributed with the build are not found by DbgHelp!!!
// [ ] Jai compiler debugging crash
// [ ] raddbgi file regeneration too strict
//
// [ ] Jump table thunks, on code w/o /INCREMENTAL:NO
//
// [ ] ** Thread/process control bullet-proofing, including solo-step mode
//
// [ ] ** In solo-stepping mode, if I step over something like CreateFileA, it
// pseudo-hangs the debugger. I can't seem to do anything else, including
// "Kill All". I have to close the debugger and restart it, AFAICT?
//
// [ ] ** I tried to debug a console program, and "step into" didn't seem to
// work. Instead, it just started running the program, but the program
// seemed to hang, and then the debugger pseudo-hung with a continual
// progress bar in the disassembly window. I had to close and restart. Is
// console app debugging not working yet, perhaps?
//
// [ ] Setting the code_font/main_font values to a font name doesn't work.
// Should probably make note that you have to set it to a path to a TTF,
// since that's not normally how Windows fonts work.
//
// [ ] ** Converter performance & heuristics for asynchronously doing it early
////////////////////////////////
//~ rjf: Hot, Medium Priority Tasks (Low-Hanging-Fruit Features, UI Jank, Cleanup)
//
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
// jettison a collection of keys in retained mode fashion
//
// [ ] Jeff Notes
// [ ] highlighted text & ctrl+f -> auto-fill search query
// [ ] double-click any part of frame in callstack view -> snap to function
// [ ] sort locals by appearance in source code (or maybe just debug info)
// [ ] sum view rule
// [ ] plot view rule
// [ ] histogram view rule
// [ ] max view rule
// [ ] min view rule
// [ ] double click on procedure in procedures tab to jump to source
//
// [ ] investigate /DEBUG:FASTLINK - can we somehow alert that we do not
// support it?
//
// [ ] ** Converter performance & heuristics for asynchronously doing it early
//
// [ ] visualize conversion failures
//
// [ ] I was a little confused about what a profile file was. I understood
@@ -139,24 +119,11 @@
// have alternating bright/dim letters to show sections of a number. Is
// this in the theme colors somewhere?
//
// [ ] ** I couldn't figure out how to really view threads in the debugger.
// The only place I found a thread list was in "The Scheduler", but it
// only lists threads by ID, which is hard to use. I can hover over them
// to get the stack, which helps, but it would be much nicer if the top
// function was displayed in the window by default next to the thread.
// [ ] ** It would be nice if thread listings displayed the name of the
// thread, instead of just the ID.
//
// [ ] ** Scrollbars are barely visible for me, for some reason. I could not
// find anything in the theme that would fill them with a solid, bright
// color. Instead they are just a thin outline and the same color as the
// scroll bar background.
//
// [ ] Dragging a window tab (like Locals or Registers or whatnot) and
// canceling with ESC should revert the window tab to where it was.
// Currently, it leaves the window tab reordered if you dragged over its
// window and shuffled its position.
//
// [ ] Many of the UI elements, like the menus, would like better if they had
// a little bit of margin. Having the text right next to the edges, and
// with no line spacing, makes it harder to read things quickly.
@@ -182,11 +149,6 @@
// item, then releasing, does not trigger that item as expected. Instead,
// it is a nop, and it waits for you to click again on the item.
//
// [ ] Working with panels felt cumbersome. I couldn't figure out any way to
// quickly arrange the display without manually selecting "split panel"
// and "close panel" and stuff from the menu, which took a long time.
// - @polish @feature ui for dragging tab -> bundling panel split options
//
// [ ] I found the "context menu" convention to be confusing. For example, if
// I left-click on a tab, it selects the tab. If I right-click on a tab,
// it opens the context menu. However, if I left-click on a module, it
@@ -198,7 +160,6 @@
// the files myself in the shell, but it seemed weird that there was no
// "save" option in the menus.
//
// [ ] @cleanup @feature double & triple click select in source views
// [ ] @feature debug info overrides (both path-based AND module-based)
// [ ] configure tab size
// [ ] auto-scroll output window
@@ -221,11 +182,6 @@
// be fine with them, but they would have to be much more light (like
// alpha 0.1 or something)
//
// [ ] It's confusing that ENTER is the way you expand and collapse things in
// the watch window, but then also how you edit them if they are not
// expandable? It seems like this should be consistent (one way to edit,
// one way to expand/collapse, that are distinct)
//
// [ ] The hex format for color values in the config file was a real
// mindbender. It's prefixed with "0x", so I was assuming it was either
// Windows Big Endian (0xAARRGGBB) or Mac Little Endian (0xAABBGGRR). To
@@ -250,16 +206,10 @@
// [ ] can it ignore stepping into _RTC_CheckStackVars generated functions?
// [ ] mouse back button should make view to go back after I double clicked
// on function to open it
// [ ] pressing random keyboard keys in source code advances text cursor like
// you were inputting text, very strange.
// [ ] Alt+8 to switch to disassembly would be nice (regardless on which
// panel was previous, don't want to use ctrl+, multiple times)
// Alt+8 for disasm and Alt+6 for memory view are shortcuts I often use
// in VS
// [ ] in watch window when I enter some new expression and then click mouse
// away from cell, then it should behave the same as if I pressed enter.
// Currently it does the same as if I have pressed esc and I have lost my
// expression
// [ ] default font size is too small for me - not only source code, but
// menus/tab/watch names (which don't resize). Maybe you could query
// Windows for initial font size?
@@ -315,8 +265,6 @@
// [ ] @bug view-snapping in scroll-lists, accounting for mapping between
// visual positions & logical positions (variably sized rows in watch,
// table headers, etc.)
// [ ] @bug selected frame should be keyed by run_idx or something so that it
// can gracefully reset to the top frame when running
// [ ] @cleanup collapse DF_CfgNodes into just being MD trees, find another way
// to encode config source - don't need it at every node
// [ ] @cleanup straighten out index/number space & types & terminology for
@@ -335,11 +283,8 @@
// when editing)
// [ ] @feature eval system -> somehow evaluate breakpoint hit counts? "meta"
// variables?
// [ ] @feature watch window labels
// [ ] @feature scheduler -> thread grid view?
//
// [ ] @feature disasm view improvement features
// [ ] interleaved src/dasm view
// [ ] visualize jump destinations in disasm
//
// [ ] @feature eval ui improvement features
@@ -375,14 +320,6 @@
// [ ] fancy string runs can include "weakness" information for text truncation
// ... can prioritize certain parts of strings to be truncated before
// others. would be good for e.g. the middle of a path
// [ ] ui code maintenance, simplification, design, & robustness pass
// [ ] page-up & page-down correct handling in keyboard nav
// [ ] collapse context menus & command lister into same codepaths. filter by
// context. parameterize by context.
// [ ] collapse text cells & command lister & etc. into same codepath (?)
// [ ] nested context menus
// [ ] unified top-level cursor/typing/lister helper
// [ ] font selection lister
// [ ] font cache eviction (both for font tags, closing fp handles, and
// rasterizations)
// [ ] frontend speedup opportunities
@@ -397,20 +334,48 @@
////////////////////////////////
//~ rjf: Recently Completed Task Log
//
// [x] solidify synchronization mechanisms for usage of demon layer
// [x] TLS eval correctness
// [x] freezing thread while running -> soft-halt
// [x] Watch Window Filtering
// [x] @feature disasm keyboard navigation & copy/paste
// [x] run-to-line needs to work if no processes are running
// - place temp bp, attach "die on hit" flag or something like that?
// [x] disasm animation & go-to-address
// [x] middle mouse button on tab should close it
// [x] I didn't understand the terminology "Equip With Color". Does that just
// mean specify the color used to display it? Is "Apply Color" perhaps a
// bit more user-friendly?
//
// [x] The cursor feels a bit too huge vertically.
// [x] UI_NavActions, OS_Event -> UI_Event (single event stream)
// [x] better discoverability for view rules - have better help hover tooltip,
// info on arguments, and better autocomplete lister
// [x] source view -> floating margin/line-nums
// [x] watch window reordering
// [x] standard way to filter
// [x] autocomplete lister should respect position in edited expression,
// tabbing through should autocomplete but not exit, etc.
// [x] pipe failure-to-launch errors back to frontend
// [x] bit more padding on the tabs
// [x] unified top-level cursor/typing/lister helper
// [x] collapse text cells & command lister & etc. into same codepath (?)
// [x] page-up & page-down correct handling in keyboard nav
// [x] interleaved src/dasm view
// [x] in watch window when I enter some new expression and then click mouse
// away from cell, then it should behave the same as if I pressed enter.
// Currently it does the same as if I have pressed esc and I have lost my
// expression
// [x] pressing random keyboard keys in source code advances text cursor like
// you were inputting text, very strange.
// [x] It's confusing that ENTER is the way you expand and collapse things in
// the watch window, but then also how you edit them if they are not
// expandable? It seems like this should be consistent (one way to edit,
// one way to expand/collapse, that are distinct)
// [x] Dragging a window tab (like Locals or Registers or whatnot) and
// canceling with ESC should revert the window tab to where it was.
// Currently, it leaves the window tab reordered if you dragged over its
// window and shuffled its position.
// [x] ** I couldn't figure out how to really view threads in the debugger.
// The only place I found a thread list was in "The Scheduler", but it
// only lists threads by ID, which is hard to use. I can hover over them
// to get the stack, which helps, but it would be much nicer if the top
// function was displayed in the window by default next to the thread.
// [x] ** It would be nice if thread listings displayed the name of the
// thread, instead of just the ID.
// [x] TLS eval -> in-process-memory EXE info
// [x] unwinding -> in-process-memory EXE info
// [x] new fuzzy searching layer
// [x] robustify dbgi layer to renames (cache should not be based only on
// path - must invalidate naturally when new filetime occurs)
// [x] rdi file regeneration too strict
// [x] raddbg jai.exe my_file.jai -- foobar -> raddbg consumes `--` incorrectly
#ifndef RADDBG_H
#define RADDBG_H
@@ -436,13 +401,26 @@ struct IPCInfo
////////////////////////////////
//~ rjf: Globals
#define IPC_SHARED_MEMORY_BUFFER_SIZE MB(16)
//- rjf: IPC resources
#define IPC_SHARED_MEMORY_BUFFER_SIZE MB(4)
StaticAssert(IPC_SHARED_MEMORY_BUFFER_SIZE > sizeof(IPCInfo), ipc_buffer_size_requirement);
read_only global String8 ipc_shared_memory_name = str8_lit_comp("_raddbg_ipc_shared_memory_");
read_only global String8 ipc_semaphore_name = str8_lit_comp("_raddbg_ipc_semaphore_");
global OS_Handle ipc_signal_semaphore = {0};
global OS_Handle ipc_lock_semaphore = {0};
global U8 *ipc_shared_memory_base = 0;
global U8 ipc_s2m_ring_buffer[MB(4)] = {0};
global U64 ipc_s2m_ring_write_pos = 0;
global U64 ipc_s2m_ring_read_pos = 0;
global OS_Handle ipc_s2m_ring_mutex = {0};
global OS_Handle ipc_s2m_ring_cv = {0};
//- rjf: frame time history
global U64 frame_time_us_history[64] = {0};
global U64 frame_time_us_history_idx = 0;
//- rjf: main thread log
global Log *main_thread_log = 0;
global String8 main_thread_log_path = {0};
////////////////////////////////
//~ rjf: Frontend Entry Points
+207 -72
View File
@@ -6,30 +6,39 @@
#define BUILD_VERSION_MAJOR 0
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "The RAD Debugger"
#define OS_FEATURE_GRAPHICAL 1
#define R_INIT_MANUAL 1
#define TEX_INIT_MANUAL 1
#define GEO_INIT_MANUAL 1
#define F_INIT_MANUAL 1
#define DF_INIT_MANUAL 1
#define DF_GFX_INIT_MANUAL 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format_parse.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "ico/ico.h"
#include "rdi_make_local/rdi_make_local.h"
#include "mdesk/mdesk.h"
#include "hash_store/hash_store.h"
#include "file_stream/file_stream.h"
#include "text_cache/text_cache.h"
#include "dasm_cache/dasm_cache.h"
#include "path/path.h"
#include "txti/txti.h"
#include "coff/coff.h"
@@ -39,14 +48,15 @@
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
#include "regs/regs.h"
#include "regs/raddbgi/regs_raddbgi.h"
#include "regs/rdi/regs_rdi.h"
#include "type_graph/type_graph.h"
#include "dbgi/dbgi.h"
#include "dasm_cache/dasm_cache.h"
#include "fuzzy_search/fuzzy_search.h"
#include "demon/demon_inc.h"
#include "eval/eval_inc.h"
#include "unwind/unwind.h"
#include "ctrl/ctrl_inc.h"
#include "font_provider/font_provider_inc.h"
#include "render/render_inc.h"
@@ -62,12 +72,12 @@
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "ico/ico.c"
#include "rdi_make_local/rdi_make_local.c"
#include "mdesk/mdesk.c"
#include "hash_store/hash_store.c"
#include "file_stream/file_stream.c"
#include "text_cache/text_cache.c"
#include "dasm_cache/dasm_cache.c"
#include "path/path.c"
#include "txti/txti.c"
#include "coff/coff.c"
@@ -77,14 +87,15 @@
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
#include "regs/regs.c"
#include "regs/raddbgi/regs_raddbgi.c"
#include "regs/rdi/regs_rdi.c"
#include "type_graph/type_graph.c"
#include "dbgi/dbgi.c"
#include "dasm_cache/dasm_cache.c"
#include "fuzzy_search/fuzzy_search.c"
#include "demon/demon_inc.c"
#include "eval/eval_inc.c"
#include "unwind/unwind.c"
#include "ctrl/ctrl_inc.c"
#include "font_provider/font_provider_inc.c"
#include "render/render_inc.c"
@@ -96,6 +107,42 @@
#include "df/df_inc.c"
#include "raddbg.c"
////////////////////////////////
//~ rjf: IPC Signaler Thread
internal void
ipc_signaler_thread__entry_point(void *p)
{
for(;;)
{
if(os_semaphore_take(ipc_signal_semaphore, max_U64))
{
if(os_semaphore_take(ipc_lock_semaphore, max_U64))
{
IPCInfo *ipc_info = (IPCInfo *)ipc_shared_memory_base;
String8 msg = str8((U8 *)(ipc_info+1), ipc_info->msg_size);
msg.size = Min(msg.size, IPC_SHARED_MEMORY_BUFFER_SIZE - sizeof(IPCInfo));
OS_MutexScope(ipc_s2m_ring_mutex) for(;;)
{
U64 unconsumed_size = ipc_s2m_ring_write_pos - ipc_s2m_ring_read_pos;
U64 available_size = (sizeof(ipc_s2m_ring_buffer) - unconsumed_size);
if(available_size >= sizeof(U64)+sizeof(msg.size))
{
ipc_s2m_ring_write_pos += ring_write_struct(ipc_s2m_ring_buffer, sizeof(ipc_s2m_ring_buffer), ipc_s2m_ring_write_pos, &msg.size);
ipc_s2m_ring_write_pos += ring_write(ipc_s2m_ring_buffer, sizeof(ipc_s2m_ring_buffer), ipc_s2m_ring_write_pos, msg.str, msg.size);
break;
}
os_condition_variable_wait(ipc_s2m_ring_cv, ipc_s2m_ring_mutex, max_U64);
}
os_condition_variable_broadcast(ipc_s2m_ring_cv);
os_send_wakeup_event();
ipc_info->msg_size = 0;
os_semaphore_drop(ipc_lock_semaphore);
}
}
}
}
////////////////////////////////
//~ rjf: Entry Point
@@ -174,7 +221,7 @@ entry_point(CmdLine *cmd_line)
}
//- rjf: set up layers
ctrl_set_wakeup_hook(wakeup_hook);
ctrl_set_wakeup_hook(wakeup_hook_ctrl);
//- rjf: dispatch to top-level codepath based on execution mode
switch(exec_mode)
@@ -183,12 +230,16 @@ entry_point(CmdLine *cmd_line)
default:
case ExecMode_Normal:
{
//- rjf: set up shared memory for ipc
OS_Handle ipc_shared_memory = os_shared_memory_alloc(IPC_SHARED_MEMORY_BUFFER_SIZE, ipc_shared_memory_name);
void *ipc_shared_memory_base = os_shared_memory_view_open(ipc_shared_memory, r1u64(0, IPC_SHARED_MEMORY_BUFFER_SIZE));
OS_Handle ipc_semaphore = os_semaphore_alloc(1, 1, ipc_semaphore_name);
IPCInfo *ipc_info = (IPCInfo *)ipc_shared_memory_base;
ipc_info->msg_size = 0;
//- rjf: manual layer initialization
{
r_init(cmd_line);
tex_init();
geo_init();
f_init();
DF_StateDeltaHistory *hist = df_state_delta_history_alloc();
df_core_init(cmd_line, hist);
df_gfx_init(update_and_render, df_state_delta_history());
}
//- rjf: setup initial target from command line args
{
@@ -243,56 +294,97 @@ entry_point(CmdLine *cmd_line)
}
}
//- rjf: set up shared resources for ipc to this instance; launch IPC signaler thread
{
Temp scratch = scratch_begin(0, 0);
U32 instance_pid = os_get_pid();
String8 ipc_shared_memory_name = push_str8f(scratch.arena, "_raddbg_ipc_shared_memory_%i_", instance_pid);
String8 ipc_signal_semaphore_name = push_str8f(scratch.arena, "_raddbg_ipc_signal_semaphore_%i_", instance_pid);
String8 ipc_lock_semaphore_name = push_str8f(scratch.arena, "_raddbg_ipc_lock_semaphore_%i_", instance_pid);
OS_Handle ipc_shared_memory = os_shared_memory_alloc(IPC_SHARED_MEMORY_BUFFER_SIZE, ipc_shared_memory_name);
ipc_shared_memory_base = (U8 *)os_shared_memory_view_open(ipc_shared_memory, r1u64(0, IPC_SHARED_MEMORY_BUFFER_SIZE));
ipc_signal_semaphore = os_semaphore_alloc(0, 1, ipc_signal_semaphore_name);
ipc_lock_semaphore = os_semaphore_alloc(1, 1, ipc_lock_semaphore_name);
ipc_s2m_ring_mutex = os_mutex_alloc();
ipc_s2m_ring_cv = os_condition_variable_alloc();
IPCInfo *ipc_info = (IPCInfo *)ipc_shared_memory_base;
MemoryZeroStruct(ipc_info);
os_launch_thread(ipc_signaler_thread__entry_point, 0, 0);
scratch_end(scratch);
}
//- rjf: main application loop
{
for(;;)
{
//- rjf: get IPC messages & dispatch ui commands from them
//- rjf: consume IPC messages, dispatch UI commands
{
if(os_semaphore_take(ipc_semaphore, max_U64))
Temp scratch = scratch_begin(0, 0);
B32 consumed = 0;
String8 msg = {0};
OS_MutexScope(ipc_s2m_ring_mutex)
{
if(ipc_info->msg_size != 0)
U64 unconsumed_size = ipc_s2m_ring_write_pos - ipc_s2m_ring_read_pos;
if(unconsumed_size >= sizeof(U64))
{
U8 *buffer = (U8 *)(ipc_info+1);
U64 msg_size = ipc_info->msg_size;
String8 cmd_string = str8(buffer, msg_size);
ipc_info->msg_size = 0;
DF_Window *dst_window = df_gfx_state->first_window;
for(DF_Window *window = dst_window; window != 0; window = window->next)
consumed = 1;
ipc_s2m_ring_read_pos += ring_read_struct(ipc_s2m_ring_buffer, sizeof(ipc_s2m_ring_buffer), ipc_s2m_ring_read_pos, &msg.size);
msg.size = Min(msg.size, unconsumed_size);
msg.str = push_array(scratch.arena, U8, msg.size);
ipc_s2m_ring_read_pos += ring_read(ipc_s2m_ring_buffer, sizeof(ipc_s2m_ring_buffer), ipc_s2m_ring_read_pos, msg.str, msg.size);
}
}
if(consumed)
{
os_condition_variable_broadcast(ipc_s2m_ring_cv);
}
if(msg.size != 0)
{
log_infof("IPC message received: \"%S\"", msg);
DF_Window *dst_window = df_gfx_state->first_window;
for(DF_Window *window = dst_window; window != 0; window = window->next)
{
if(os_window_is_focused(window->os))
{
if(os_window_is_focused(window->os))
dst_window = window;
break;
}
}
if(dst_window != 0)
{
dst_window->window_temporarily_focused_ipc = 1;
String8 cmd_spec_string = df_cmd_name_part_from_string(msg);
DF_CmdSpec *cmd_spec = df_cmd_spec_from_string(cmd_spec_string);
if(!df_cmd_spec_is_nil(cmd_spec))
{
DF_CmdParams params = df_cmd_params_from_window(dst_window);
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(dst_window);
String8 error = df_cmd_params_apply_spec_query(scratch.arena, &ctrl_ctx, &params, cmd_spec, df_cmd_arg_part_from_string(msg));
if(error.size == 0)
{
df_push_cmd__root(&params, cmd_spec);
df_gfx_request_frame();
}
else
{
dst_window = window;
break;
DF_CmdParams params = df_cmd_params_from_window(dst_window);
params.string = error;
df_cmd_params_mark_slot(&params, DF_CmdParamSlot_String);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error));
df_gfx_request_frame();
}
}
if(dst_window != 0)
else
{
Temp scratch = scratch_begin(0, 0);
String8 cmd_spec_string = df_cmd_name_part_from_string(cmd_string);
DF_CmdSpec *cmd_spec = df_cmd_spec_from_string(cmd_spec_string);
if(!df_cmd_spec_is_nil(cmd_spec))
{
DF_CmdParams params = df_cmd_params_from_gfx();
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(dst_window);
String8 error = df_cmd_params_apply_spec_query(scratch.arena, &ctrl_ctx, &params, cmd_spec, df_cmd_arg_part_from_string(cmd_string));
if(error.size == 0)
{
df_push_cmd__root(&params, cmd_spec);
}
else
{
DF_CmdParams params = df_cmd_params_from_window(dst_window);
params.string = error;
df_cmd_params_mark_slot(&params, DF_CmdParamSlot_String);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error));
}
}
scratch_end(scratch);
DF_CmdParams params = df_cmd_params_from_window(dst_window);
params.string = push_str8f(scratch.arena, "\"%S\" is not a command.", cmd_spec_string);
df_cmd_params_mark_slot(&params, DF_CmdParamSlot_String);
df_push_cmd__root(&params, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Error));
df_gfx_request_frame();
}
}
os_semaphore_drop(ipc_semaphore);
}
scratch_end(scratch);
}
//- rjf: update & render frame
@@ -340,25 +432,61 @@ entry_point(CmdLine *cmd_line)
{
Temp scratch = scratch_begin(0, 0);
//- rjf: grab ipc shared memory
OS_Handle ipc_shared_memory = os_shared_memory_open(ipc_shared_memory_name);
void *ipc_shared_memory_base = os_shared_memory_view_open(ipc_shared_memory, r1u64(0, MB(16)));
if(ipc_shared_memory_base != 0)
//- rjf: grab explicit PID argument
U32 dst_pid = 0;
if(cmd_line_has_argument(cmd_line, str8_lit("pid")))
{
OS_Handle ipc_semaphore = os_semaphore_open(ipc_semaphore_name);
IPCInfo *ipc_info = (IPCInfo *)ipc_shared_memory_base;
if(os_semaphore_take(ipc_semaphore, os_now_microseconds() + Million(6)))
String8 dst_pid_string = cmd_line_string(cmd_line, str8_lit("pid"));
U64 dst_pid_u64 = 0;
if(dst_pid_string.size != 0 &&
try_u64_from_str8_c_rules(dst_pid_string, &dst_pid_u64))
{
U8 *buffer = (U8 *)(ipc_info+1);
U64 buffer_max = IPC_SHARED_MEMORY_BUFFER_SIZE - sizeof(IPCInfo);
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
String8 msg = str8_list_join(scratch.arena, &cmd_line->inputs, &join);
ipc_info->msg_size = Min(buffer_max, msg.size);
MemoryCopy(buffer, msg.str, ipc_info->msg_size);
os_semaphore_drop(ipc_semaphore);
dst_pid = (U32)dst_pid_u64;
}
}
//- rjf: no explicit PID? -> find PID to send message to, by looking for other raddbg instances
if(dst_pid == 0)
{
U32 this_pid = os_get_pid();
DMN_ProcessIter it = {0};
dmn_process_iter_begin(&it);
for(DMN_ProcessInfo info = {0}; dmn_process_iter_next(scratch.arena, &it, &info);)
{
if(str8_match(str8_skip_last_slash(str8_chop_last_dot(cmd_line->exe_name)), str8_skip_last_slash(str8_chop_last_dot(info.name)), StringMatchFlag_CaseInsensitive) &&
this_pid != info.pid)
{
dst_pid = info.pid;
break;
}
}
dmn_process_iter_end(&it);
}
//- rjf: grab destination instance's shared memory resources
String8 ipc_shared_memory_name = push_str8f(scratch.arena, "_raddbg_ipc_shared_memory_%i_", dst_pid);
String8 ipc_signal_semaphore_name = push_str8f(scratch.arena, "_raddbg_ipc_signal_semaphore_%i_", dst_pid);
String8 ipc_lock_semaphore_name = push_str8f(scratch.arena, "_raddbg_ipc_lock_semaphore_%i_", dst_pid);
OS_Handle ipc_shared_memory = os_shared_memory_alloc(IPC_SHARED_MEMORY_BUFFER_SIZE, ipc_shared_memory_name);
ipc_shared_memory_base = (U8 *)os_shared_memory_view_open(ipc_shared_memory, r1u64(0, IPC_SHARED_MEMORY_BUFFER_SIZE));
ipc_signal_semaphore = os_semaphore_alloc(0, 1, ipc_signal_semaphore_name);
ipc_lock_semaphore = os_semaphore_alloc(1, 1, ipc_lock_semaphore_name);
//- rjf: got resources -> write message
if(ipc_shared_memory_base != 0 &&
os_semaphore_take(ipc_lock_semaphore, max_U64))
{
IPCInfo *ipc_info = (IPCInfo *)ipc_shared_memory_base;
U8 *buffer = (U8 *)(ipc_info+1);
U64 buffer_max = IPC_SHARED_MEMORY_BUFFER_SIZE - sizeof(IPCInfo);
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
String8 msg = str8_list_join(scratch.arena, &cmd_line->inputs, &join);
ipc_info->msg_size = Min(buffer_max, msg.size);
MemoryCopy(buffer, msg.str, ipc_info->msg_size);
os_semaphore_drop(ipc_signal_semaphore);
os_semaphore_drop(ipc_lock_semaphore);
}
scratch_end(scratch);
}break;
@@ -389,8 +517,15 @@ entry_point(CmdLine *cmd_line)
bake2srlz = p2r_bake(scratch.arena, convert2bake);
}
//- rjf: compress
P2R_Bake2Serialize *bake2srlz_compressed = bake2srlz;
if(cmd_line_has_flag(cmd_line, str8_lit("compress"))) ProfScope("compress")
{
bake2srlz_compressed = p2r_compress(scratch.arena, bake2srlz);
}
//- rjf: serialize
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(scratch.arena, &convert2bake->bake_params, &bake2srlz->sections);
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(scratch.arena, &convert2bake->bake_params, &bake2srlz_compressed->sections);
//- rjf: write
if(out_file_is_good)
@@ -3,45 +3,48 @@
#define BUILD_VERSION_MAJOR 0
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 8
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_breakpad_from_pdb"
#define BUILD_TITLE "rdi_breakpad_from_pdb"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "coff/coff.h"
#include "codeview/codeview.h"
#include "codeview/codeview_stringize.h"
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "coff/coff.c"
#include "codeview/codeview.c"
#include "codeview/codeview_stringize.c"
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
////////////////////////////////
//~ rjf: Baking Tasks
@@ -78,7 +81,7 @@ internal TS_TASK_FUNCTION_DEF(p2b_bake_unit_vmap_task__entry_point)
if(vmap_section != 0)
{
out->vmap_entries = (RDI_VMapEntry *)vmap_section->data;
out->vmap_entries_count = vmap_section->size/sizeof(RDI_VMapEntry);
out->vmap_entries_count = vmap_section->unpacked_size/sizeof(RDI_VMapEntry);
}
return out;
}
@@ -117,7 +120,7 @@ internal TS_TASK_FUNCTION_DEF(p2b_bake_unit_task__entry_point)
}
if(voffs_section != 0 && lines_section != 0)
{
out->unit_line_count = lines_section->size/sizeof(RDI_Line);
out->unit_line_count = lines_section->unpacked_size/sizeof(RDI_Line);
out->unit_line_voffs = (U64 *)voffs_section->data;
out->unit_lines = (RDI_Line *)lines_section->data;
}
@@ -167,11 +170,14 @@ internal TS_TASK_FUNCTION_DEF(p2b_dump_proc_chunk_task__entry_point)
RDI_Line *line = &line_info.lines[line_info_idx];
U64 line_voff_min = line_info.voffs[line_info_idx];
U64 line_voff_opl = line_info.voffs[line_info_idx+1];
str8_list_pushf(arena, out, "%I64x %I64x %I64u %I64u\n",
line_voff_min,
line_voff_opl-line_voff_min,
(U64)line->line_num,
(U64)line->file_idx);
if(line->file_idx != 0)
{
str8_list_pushf(arena, out, "%I64x %I64x %I64u %I64u\n",
line_voff_min,
line_voff_opl-line_voff_min,
(U64)line->line_num,
(U64)line->file_idx);
}
last_voff = voff;
voff = line_voff_opl;
}
@@ -203,7 +209,7 @@ entry_point(CmdLine *cmdline)
//- rjf: display help
if(do_help || user2convert->errors.node_count != 0)
{
fprintf(stderr, "--- raddbgi_breakpad_from_pdb -------------------------------------------------\n\n");
fprintf(stderr, "--- rdi_breakpad_from_pdb -----------------------------------------------------\n\n");
fprintf(stderr, "This utility converts debug information from PDBs into the textual Breakpad\n");
fprintf(stderr, "symbol information format, used for various external utilities, using the RAD\n");
@@ -2,7 +2,7 @@
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: RADDBGI Enum -> String Functions
//~ rjf: RDI Enum -> String Functions
internal String8
rdi_string_from_data_section_tag(RDI_DataSectionTag tag){
@@ -79,7 +79,7 @@ rdi_string_from_local_kind(RDI_LocalKind local_kind){
}
////////////////////////////////
//~ rjf: RADDBGI Flags -> String Functions
//~ rjf: RDI Flags -> String Functions
internal void
rdi_stringize_binary_section_flags(Arena *arena, String8List *out,
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DUMP_H
#define RADDBGI_DUMP_H
#ifndef RDI_DUMP_H
#define RDI_DUMP_H
////////////////////////////////
//~ rjf: RADDBG Stringize Helper Types
@@ -39,7 +39,7 @@ struct RDI_ScopeBundle
};
////////////////////////////////
//~ rjf: RADDBGI Enum -> String Functions
//~ rjf: RDI Enum -> String Functions
internal String8 rdi_string_from_data_section_tag(RDI_DataSectionTag tag);
internal String8 rdi_string_from_arch(RDI_Arch arch);
@@ -49,7 +49,7 @@ internal String8 rdi_string_from_member_kind(RDI_MemberKind member_kind);
internal String8 rdi_string_from_local_kind(RDI_LocalKind local_kind);
////////////////////////////////
//~ rjf: RADDBGI Flags -> String Functions
//~ rjf: RDI Flags -> String Functions
internal void rdi_stringize_binary_section_flags(Arena *arena, String8List *out, RDI_BinarySectionFlags flags);
internal void rdi_stringize_type_modifier_flags(Arena *arena, String8List *out, RDI_TypeModifierFlags flags);
@@ -57,7 +57,7 @@ internal void rdi_stringize_user_defined_type_flags(Arena *arena, String8List *o
internal void rdi_stringize_link_flags(Arena *arena, String8List *out, RDI_LinkFlags flags);
////////////////////////////////
//~ rjf: RADDBG Compound Stringize Functions
//~ rjf: RDI Compound Stringize Functions
internal void rdi_stringize_data_sections(Arena *arena, String8List *out, RDI_Parsed *parsed, U32 indent_level);
internal void rdi_stringize_top_level_info(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_TopLevelInfo *tli, U32 indent_level);
@@ -72,4 +72,4 @@ internal void rdi_stringize_thread_variable(Arena *arena, String8List *out, RDI_
internal void rdi_stringize_procedure(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_Procedure *proc, U32 indent_level);
internal void rdi_stringize_scope(Arena *arena, String8List *out, RDI_Parsed *parsed, RDI_ScopeBundle *bundle, RDI_Scope *scope, U32 indent_level);
#endif // RADDBGI_DUMP_H
#endif // RDI_DUMP_H
@@ -6,29 +6,35 @@
#define BUILD_VERSION_MAJOR 0
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_dump"
#define BUILD_TITLE "rdi_dump"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "raddbgi_dump.h"
#include "path/path.h"
#include "dbgi/dbgi.h"
#include "rdi_dump.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "raddbgi_dump.c"
#include "path/path.c"
#include "dbgi/dbgi.c"
#include "rdi_dump.c"
////////////////////////////////
//~ rjf: Entry Point
@@ -40,6 +46,7 @@ entry_point(CmdLine *cmd_line)
//- rjf: set up
//
Arena *arena = arena_alloc();
DI_Scope *di_scope = di_scope_open();
String8List errors = {0};
//////////////////////////////
@@ -70,11 +77,8 @@ entry_point(CmdLine *cmd_line)
String8 input_data = {0};
DumpFlags dump_flags = (U32)0xffffffff;
{
// rjf: extract input file path & load data
// rjf: extract input file path
input_name = str8_list_first(&cmd_line->inputs);
if(input_name.size > 0) { input_data = os_data_from_file_path(arena, input_name); }
else {str8_list_pushf(arena, &errors, "error (input): No input RADDBGI file specified.");}
if(input_name.size != 0 && input_data.size == 0) { str8_list_pushf(arena, &errors, "error (input): No input RADDBGI file successfully loaded; either the path or file contents are invalid."); }
// rjf: extract dump options
{
@@ -107,17 +111,22 @@ entry_point(CmdLine *cmd_line)
}
//////////////////////////////
//- rjf: parse raddbg from input data
//- rjf: obtain rdi parse
//
RDI_ParseStatus parse_status = RDI_ParseStatus_Good;
RDI_Parsed raddbg_ = {0};
RDI_Parsed *raddbg = &raddbg_;
RDI_Parsed *rdi = &di_rdi_parsed_nil;
if(input_name.size == 0)
{
parse_status = rdi_parse(input_data.str, input_data.size, &raddbg_);
if(parse_status != RDI_ParseStatus_Good)
{
str8_list_pushf(arena, &errors, "error (parse): RADDBGI file wasn't parsed successfully. (0x%x)", parse_status);
}
str8_list_pushf(arena, &errors, "error (input): No input RDI file specified.");
}
else
{
DI_Key key = {input_name};
di_open(&key);
rdi = di_rdi_from_key(di_scope, &key, max_U64);
}
if(rdi == &di_rdi_parsed_nil)
{
str8_list_pushf(arena, &errors, "error (input): No input RDI file successfully loaded; either the path or file contents are invalid.");
}
//////////////////////////////
@@ -133,13 +142,13 @@ entry_point(CmdLine *cmd_line)
//- rjf: build dump strings
//
String8List dump = {0};
if(parse_status == RDI_ParseStatus_Good)
if(rdi != &di_rdi_parsed_nil)
{
//- rjf: DATA SECTIONS
if(dump_flags & DumpFlag_DataSections)
{
str8_list_pushf(arena, &dump, "# DATA SECTIONS:\n");
rdi_stringize_data_sections(arena, &dump, raddbg, 1);
rdi_stringize_data_sections(arena, &dump, rdi, 1);
str8_list_push(arena, &dump, str8_lit("\n"));
}
@@ -147,7 +156,7 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_TopLevelInfo)
{
str8_list_pushf(arena, &dump, "# TOP LEVEL INFO:\n");
rdi_stringize_top_level_info(arena, &dump, raddbg, raddbg->top_level_info, 1);
rdi_stringize_top_level_info(arena, &dump, rdi, rdi->top_level_info, 1);
str8_list_push(arena, &dump, str8_lit("\n"));
}
@@ -155,11 +164,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_BinarySections)
{
str8_list_pushf(arena, &dump, "# BINARY SECTIONS:\n");
RDI_BinarySection *ptr = raddbg->binary_sections;
for(U32 i = 0; i < raddbg->binary_sections_count; i += 1, ptr += 1)
RDI_BinarySection *ptr = rdi->binary_sections;
for(U32 i = 0; i < rdi->binary_sections_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " section[%u]:\n", i);
rdi_stringize_binary_section(arena, &dump, raddbg, ptr, 2);
rdi_stringize_binary_section(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -170,16 +179,16 @@ entry_point(CmdLine *cmd_line)
{
RDI_FilePathBundle file_path_bundle = {0};
{
file_path_bundle.file_paths = raddbg->file_paths;
file_path_bundle.file_path_count = raddbg->file_paths_count;
file_path_bundle.file_paths = rdi->file_paths;
file_path_bundle.file_path_count = rdi->file_paths_count;
}
str8_list_pushf(arena, &dump, "# FILE PATHS\n");
RDI_FilePathNode *ptr = raddbg->file_paths;
for(U32 i = 0; i < raddbg->file_paths_count; i += 1, ptr += 1)
RDI_FilePathNode *ptr = rdi->file_paths;
for(U32 i = 0; i < rdi->file_paths_count; i += 1, ptr += 1)
{
if(ptr->parent_path_node == 0)
{
rdi_stringize_file_path(arena, &dump, raddbg, &file_path_bundle, ptr, 1);
rdi_stringize_file_path(arena, &dump, rdi, &file_path_bundle, ptr, 1);
}
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -189,11 +198,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_SourceFiles)
{
str8_list_pushf(arena, &dump, "# SOURCE FILES\n");
RDI_SourceFile *ptr = raddbg->source_files;
for(U32 i = 0; i < raddbg->source_files_count; i += 1, ptr += 1)
RDI_SourceFile *ptr = rdi->source_files;
for(U32 i = 0; i < rdi->source_files_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " source_file[%u]:\n", i);
rdi_stringize_source_file(arena, &dump, raddbg, ptr, 2);
rdi_stringize_source_file(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -203,11 +212,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_Units)
{
str8_list_pushf(arena, &dump, "# UNITS\n");
RDI_Unit *ptr = raddbg->units;
for (U32 i = 0; i < raddbg->units_count; i += 1, ptr += 1)
RDI_Unit *ptr = rdi->units;
for (U32 i = 0; i < rdi->units_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " unit[%u]:\n", i);
rdi_stringize_unit(arena, &dump, raddbg, ptr, 2);
rdi_stringize_unit(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -217,8 +226,8 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_UnitVMap)
{
str8_list_pushf(arena, &dump, "# UNIT VMAP\n");
RDI_VMapEntry *ptr = raddbg->unit_vmap;
for(U32 i = 0; i < raddbg->unit_vmap_count; i += 1, ptr += 1)
RDI_VMapEntry *ptr = rdi->unit_vmap;
for(U32 i = 0; i < rdi->unit_vmap_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " 0x%08x: %llu\n", ptr->voff, ptr->idx);
}
@@ -229,11 +238,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_TypeNodes)
{
str8_list_pushf(arena, &dump, "# TYPE NODES:\n");
RDI_TypeNode *ptr = raddbg->type_nodes;
for(U32 i = 0; i < raddbg->type_nodes_count; i += 1, ptr += 1)
RDI_TypeNode *ptr = rdi->type_nodes;
for(U32 i = 0; i < rdi->type_nodes_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " type[%u]:\n", i);
rdi_stringize_type_node(arena, &dump, raddbg, ptr, 2);
rdi_stringize_type_node(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -244,17 +253,17 @@ entry_point(CmdLine *cmd_line)
{
RDI_UDTMemberBundle member_bundle = {0};
{
member_bundle.members = raddbg->members;
member_bundle.enum_members = raddbg->enum_members;
member_bundle.member_count = raddbg->members_count;
member_bundle.enum_member_count = raddbg->enum_members_count;
member_bundle.members = rdi->members;
member_bundle.enum_members = rdi->enum_members;
member_bundle.member_count = rdi->members_count;
member_bundle.enum_member_count = rdi->enum_members_count;
}
str8_list_pushf(arena, &dump, "# UDTS:\n");
RDI_UDT *ptr = raddbg->udts;
for(U32 i = 0; i < raddbg->udts_count; i += 1, ptr += 1)
RDI_UDT *ptr = rdi->udts;
for(U32 i = 0; i < rdi->udts_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " udt[%u]:\n", i);
rdi_stringize_udt(arena, &dump, raddbg, &member_bundle, ptr, 2);
rdi_stringize_udt(arena, &dump, rdi, &member_bundle, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -264,11 +273,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_GlobalVariables)
{
str8_list_pushf(arena, &dump, "# GLOBAL VARIABLES:\n");
RDI_GlobalVariable *ptr = raddbg->global_variables;
for(U32 i = 0; i < raddbg->global_variables_count; i += 1, ptr += 1)
RDI_GlobalVariable *ptr = rdi->global_variables;
for(U32 i = 0; i < rdi->global_variables_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " global_variable[%u]:\n", i);
rdi_stringize_global_variable(arena, &dump, raddbg, ptr, 2);
rdi_stringize_global_variable(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -278,8 +287,8 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_GlobalVMap)
{
str8_list_pushf(arena, &dump, "# GLOBAL VMAP:\n");
RDI_VMapEntry *ptr = raddbg->global_vmap;
for(U32 i = 0; i < raddbg->global_vmap_count; i += 1, ptr += 1)
RDI_VMapEntry *ptr = rdi->global_vmap;
for(U32 i = 0; i < rdi->global_vmap_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " 0x%08x: %llu\n", ptr->voff, ptr->idx);
}
@@ -290,11 +299,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_ThreadVariables)
{
str8_list_pushf(arena, &dump, "# THREAD VARIABLES:\n");
RDI_ThreadVariable *ptr = raddbg->thread_variables;
for(U32 i = 0; i < raddbg->thread_variables_count; i += 1, ptr += 1)
RDI_ThreadVariable *ptr = rdi->thread_variables;
for(U32 i = 0; i < rdi->thread_variables_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " thread_variable[%u]:\n", i);
rdi_stringize_thread_variable(arena, &dump, raddbg, ptr, 2);
rdi_stringize_thread_variable(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -304,11 +313,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_Procedures)
{
str8_list_pushf(arena, &dump, "# PROCEDURES:\n");
RDI_Procedure *ptr = raddbg->procedures;
for(U32 i = 0; i < raddbg->procedures_count; i += 1, ptr += 1)
RDI_Procedure *ptr = rdi->procedures;
for(U32 i = 0; i < rdi->procedures_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " procedure[%u]:\n", i);
rdi_stringize_procedure(arena, &dump, raddbg, ptr, 2);
rdi_stringize_procedure(arena, &dump, rdi, ptr, 2);
str8_list_push(arena, &dump, str8_lit("\n"));
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -319,24 +328,24 @@ entry_point(CmdLine *cmd_line)
{
RDI_ScopeBundle scope_bundle = {0};
{
scope_bundle.scopes = raddbg->scopes;
scope_bundle.scope_count = raddbg->scopes_count;
scope_bundle.scope_voffs = raddbg->scope_voffs;
scope_bundle.scope_voff_count = raddbg->scope_voffs_count;
scope_bundle.locals = raddbg->locals;
scope_bundle.local_count = raddbg->locals_count;
scope_bundle.location_blocks = raddbg->location_blocks;
scope_bundle.location_block_count = raddbg->location_blocks_count;
scope_bundle.location_data = raddbg->location_data;
scope_bundle.location_data_size = raddbg->location_data_size;
scope_bundle.scopes = rdi->scopes;
scope_bundle.scope_count = rdi->scopes_count;
scope_bundle.scope_voffs = rdi->scope_voffs;
scope_bundle.scope_voff_count = rdi->scope_voffs_count;
scope_bundle.locals = rdi->locals;
scope_bundle.local_count = rdi->locals_count;
scope_bundle.location_blocks = rdi->location_blocks;
scope_bundle.location_block_count = rdi->location_blocks_count;
scope_bundle.location_data = rdi->location_data;
scope_bundle.location_data_size = rdi->location_data_size;
}
str8_list_pushf(arena, &dump, "# SCOPES:\n");
RDI_Scope *ptr = raddbg->scopes;
for(U32 i = 0; i < raddbg->scopes_count; i += 1, ptr += 1)
RDI_Scope *ptr = rdi->scopes;
for(U32 i = 0; i < rdi->scopes_count; i += 1, ptr += 1)
{
if(ptr->parent_scope_idx == 0)
{
rdi_stringize_scope(arena, &dump, raddbg, &scope_bundle, ptr, 1);
rdi_stringize_scope(arena, &dump, rdi, &scope_bundle, ptr, 1);
str8_list_push(arena, &dump, str8_lit("\n"));
}
}
@@ -347,8 +356,8 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_ScopeVMap)
{
str8_list_pushf(arena, &dump, "# SCOPE VMAP:\n");
RDI_VMapEntry *ptr = raddbg->scope_vmap;
for(U32 i = 0; i < raddbg->scope_vmap_count; i += 1, ptr += 1)
RDI_VMapEntry *ptr = rdi->scope_vmap;
for(U32 i = 0; i < rdi->scope_vmap_count; i += 1, ptr += 1)
{
str8_list_pushf(arena, &dump, " 0x%08x: %llu\n", ptr->voff, ptr->idx);
}
@@ -359,11 +368,11 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_NameMaps)
{
str8_list_pushf(arena, &dump, "# NAME MAP:\n");
RDI_NameMap *ptr = raddbg->name_maps;
for(U32 i = 0; i < raddbg->name_maps_count; i += 1, ptr += 1)
RDI_NameMap *ptr = rdi->name_maps;
for(U32 i = 0; i < rdi->name_maps_count; i += 1, ptr += 1)
{
RDI_ParsedNameMap name_map = {0};
rdi_name_map_parse(raddbg, ptr, &name_map);
rdi_name_map_parse(rdi, ptr, &name_map);
str8_list_pushf(arena, &dump, " name_map[%u]:\n", i);
RDI_NameMapBucket *bucket = name_map.buckets;
for(U32 j = 0; j < name_map.bucket_count; j += 1, bucket += 1)
@@ -376,7 +385,7 @@ entry_point(CmdLine *cmd_line)
for(;node < node_opl; node += 1)
{
String8 string = {0};
string.str = rdi_string_from_idx(raddbg, node->string_idx, &string.size);
string.str = rdi_string_from_idx(rdi, node->string_idx, &string.size);
str8_list_pushf(arena, &dump, " match \"%.*s\": ", str8_varg(string));
if(node->match_count == 1)
{
@@ -386,7 +395,7 @@ entry_point(CmdLine *cmd_line)
{
RDI_U32 idx_count = 0;
RDI_U32 *idx_run =
rdi_idx_run_from_first_count(raddbg, node->match_idx_or_idx_run_first,
rdi_idx_run_from_first_count(rdi, node->match_idx_or_idx_run_first,
node->match_count, &idx_count);
if(idx_count > 0)
{
@@ -411,10 +420,10 @@ entry_point(CmdLine *cmd_line)
if(dump_flags & DumpFlag_Strings)
{
str8_list_pushf(arena, &dump, "# STRINGS:\n");
for(U64 string_idx = 0; string_idx < raddbg->string_count; string_idx += 1)
for(U64 string_idx = 0; string_idx < rdi->string_count; string_idx += 1)
{
String8 string = {0};
string.str = rdi_string_from_idx(raddbg, string_idx, &string.size);
string.str = rdi_string_from_idx(rdi, string_idx, &string.size);
str8_list_pushf(arena, &dump, " string[%I64u]: \"%S\"\n", string_idx, string);
}
str8_list_push(arena, &dump, str8_lit("\n"));
@@ -428,4 +437,6 @@ entry_point(CmdLine *cmd_line)
{
fwrite(n->string.str, 1, n->string.size, stdout);
}
di_scope_close(di_scope);
}
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DWARF_H
#define RADDBGI_DWARF_H
#ifndef RDI_DWARF_H
#define RDI_DWARF_H
// https://dwarfstd.org/doc/DWARF4.pdf
// https://dwarfstd.org/doc/DWARF5.pdf
@@ -1489,5 +1489,5 @@ static String8 dwarf_string_from_line_ext_op(DWARF_LineExtOp op);
static String8 dwarf_string_from_line_entry_format(DWARF_LineEntryFormat format);
static String8 dwarf_string_from_section_code(DWARF_SectionCode sec_code);
#endif //RADDBGI_DWARF_H
#endif //RDI_DWARF_H
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_DWARF_STRINGIZE_H
#define RADDBGI_DWARF_STRINGIZE_H
#ifndef RDI_DWARF_STRINGIZE_H
#define RDI_DWARF_STRINGIZE_H
////////////////////////////////
//~ DWARF Stringize Functions
@@ -25,4 +25,4 @@ dwarf_stringize_addr(Arena *arena, String8List *out, DWARF_AddrUnit *unit, U32 i
#endif //RADDBGI_DWARF_STRINGIZE_H
#endif //RDI_DWARF_STRINGIZE_H
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_ELF_H
#define RADDBGI_ELF_H
#ifndef RDI_ELF_H
#define RDI_ELF_H
// https://refspecs.linuxfoundation.org/elf/elf.pdf
@@ -514,4 +514,4 @@ static String8 elf_string_from_symbol_binding(ELF_SymbolBinding binding);
static String8 elf_string_from_symbol_type(ELF_SymbolType type);
static String8 elf_string_from_symbol_visibility(ELF_SymbolVisibility visibility);
#endif //RADDBGI_ELF_H
#endif //RDI_ELF_H
@@ -1,27 +1,27 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_rdi_format/rdi_format.h"
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "raddbgi_elf.h"
#include "raddbgi_dwarf.h"
#include "rdi_elf.h"
#include "rdi_dwarf.h"
#include "raddbgi_dwarf_stringize.h"
#include "rdi_dwarf_stringize.h"
#include "raddbgi_from_dwarf.h"
#include "rdi_from_dwarf.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_rdi_format/rdi_format.c"
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "raddbgi_elf.c"
#include "raddbgi_dwarf.c"
#include "rdi_elf.c"
#include "rdi_dwarf.c"
#include "raddbgi_dwarf_stringize.c"
#include "rdi_dwarf_stringize.c"
// TODO(allen):
// [ ] need sample data for .debug_names
@@ -1,8 +1,8 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_FROM_DWARF_H
#define RADDBGI_FROM_DWARF_H
#ifndef RDI_FROM_DWARF_H
#define RDI_FROM_DWARF_H
////////////////////////////////
//~ Program Parameters Type
@@ -47,4 +47,4 @@ static DWARFCONV_Params *dwarf_convert_params_from_cmd_line(Arena *arena, CmdLin
#endif //RADDBGI_FROM_DWARF_H
#endif //RDI_FROM_DWARF_H
@@ -95,16 +95,59 @@ p2r_user2convert_from_cmdln(Arena *arena, CmdLine *cmdline)
}
}
//- rjf: define string -> flag bits
#define FlagNameMapXList \
Case("sections", BinarySections)\
Case("units", Units)\
Case("procedures", Procedures)\
Case("globals", GlobalVariables)\
Case("threadvars", ThreadVariables)\
Case("scopes", Scopes)\
Case("locals", Locals)\
Case("types", Types)\
Case("udts", UDTs)\
Case("lines", LineInfo)\
Case("globals_name_map", GlobalVariableNameMap)\
Case("threadvars_name_map", ThreadVariableNameMap)\
Case("procedure_name_map", ProcedureNameMap)\
Case("type_name_map", TypeNameMap)\
Case("link_name_map", LinkNameProcedureNameMap)\
Case("source_path_name_map",NormalSourcePathNameMap)\
//- rjf: get flags
{
result->flags = P2R_ConvertFlag_All;
String8List only_names = cmd_line_strings(cmdline, str8_lit("only"));
String8List omit_names = cmd_line_strings(cmdline, str8_lit("only"));
if(only_names.node_count != 0)
{
result->flags = 0;
for(String8Node *n = only_names.first; n != 0; n = n->next)
{
String8 string = n->string;
#define Case(str, flag) if(str8_match(string, str8_lit(str), StringMatchFlag_CaseInsensitive)) {result->flags |= P2R_ConvertFlag_##flag;}
FlagNameMapXList;
#undef Case
}
}
if(omit_names.node_count != 0)
{
for(String8Node *n = omit_names.first; n != 0; n = n->next)
{
String8 string = n->string;
#define Case(str, flag) if(str8_match(string, str8_lit(str), StringMatchFlag_CaseInsensitive)) {result->flags &= ~P2R_ConvertFlag_##flag;}
FlagNameMapXList;
#undef Case
}
}
}
#undef FlagNameMapXList
return result;
}
////////////////////////////////
//~ rjf: COFF <-> RADDBGI Canonical Conversions
//~ rjf: COFF <-> RDI Canonical Conversions
internal RDI_BinarySectionFlags
p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
@@ -126,7 +169,7 @@ p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
}
////////////////////////////////
//~ rjf: CodeView <-> RADDBGI Canonical Conversions
//~ rjf: CodeView <-> RDI Canonical Conversions
internal RDI_Arch
p2r_rdi_arch_from_cv_arch(CV_Arch cv_arch)
@@ -1257,7 +1300,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
CV_LeafKind field_kind = *(CV_LeafKind *)read_ptr;
U64 field_leaf_header_size = cv_header_struct_size_from_leaf_kind(field_kind);
U8 *field_leaf_first = read_ptr+2;
U8 *field_leaf_opl = field_leaf_first+range->hdr.size-2;
U8 *field_leaf_opl = field_list_opl;
next_read_ptr = field_leaf_opl;
// rjf: skip out-of-bounds fields
@@ -1282,6 +1325,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
CV_LeafIndex *lf = (CV_LeafIndex *)field_leaf_first;
CV_TypeId new_itype = lf->itype;
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// rjf: determine if index itype is new
B32 is_new = 1;
for(FieldListTask *t = fl_done_stack; t != 0; t = t->next)
@@ -1573,6 +1619,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
U8 *num2_ptr = num1_ptr + num1.encoded_size;
CV_NumericParsed num2 = cv_numeric_from_data_range(num2_ptr, field_leaf_opl);
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// rjf: emit member
RDIM_UDTMember *mem = rdim_udt_push_member(arena, udts, dst_udt);
mem->kind = RDI_MemberKind_VirtualBase;
@@ -1583,6 +1632,10 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
case CV_LeafKind_VFUNCTAB:
{
CV_LeafVFuncTab *lf = (CV_LeafVFuncTab *)field_leaf_first;
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// NOTE(rjf): currently no-op this case
(void)lf;
}break;
@@ -1970,7 +2023,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
if(container_name_opl > 2)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -2004,10 +2057,10 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
// rjf: unpack proc's container type
RDIM_Type *container_type = 0;
U64 container_name_opl = p2r_end_of_cplusplus_container_name(name);
if(container_name_opl > 2)
if(container_name_opl > 2 && in->tpi_hash != 0 && in->tpi_leaf != 0)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -2182,7 +2235,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
if(container_name_opl > 2)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -2745,7 +2798,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
RDIM_TopLevelInfo top_level_info = {0};
{
top_level_info.arch = arch;
top_level_info.exe_name = in->input_exe_name;
top_level_info.exe_name = str8_skip_last_slash(in->input_exe_name);
top_level_info.exe_hash = exe_hash;
top_level_info.voff_max = exe_voff_max;
}
@@ -2882,7 +2935,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
//- rjf: types pass 2: produce per-itype itype chain
//
// this pass is to ensure that subsequent passes always produce types for
// dependent itypes first - guaranteeing raddbgi's "only reference backward"
// dependent itypes first - guaranteeing rdi's "only reference backward"
// rule (which eliminates cycles). each itype slot gets a list of itypes,
// starting with the deepest dependency - when types are produced per-itype,
// this chain is walked, so that deeper dependencies are built first, and
@@ -2921,7 +2974,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
//- rjf: types pass 3: construct all types from TPI
//
// this doesn't gather struct/class/union/enum members, which is done by
// subsequent passes, to build RADDBGI "UDT" information, which is distinct
// subsequent passes, to build RDI "UDT" information, which is distinct
// from regular type info.
//
RDIM_Type **itype_type_ptrs = 0;
@@ -3026,11 +3079,18 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
if(lf->flags & CV_ModifierFlag_Volatile) {flags |= RDI_TypeModifierFlag_Volatile;}
// rjf: fill type
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = flags;
dst_type->direct_type = p2r_type_ptr_from_itype(lf->itype);
dst_type->byte_size = dst_type->direct_type ? dst_type->direct_type->byte_size : 0;
if(flags == 0)
{
dst_type = p2r_type_ptr_from_itype(lf->itype);
}
else
{
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = flags;
dst_type->direct_type = p2r_type_ptr_from_itype(lf->itype);
dst_type->byte_size = dst_type->direct_type ? dst_type->direct_type->byte_size : 0;
}
}break;
//- rjf: POINTER
@@ -3072,10 +3132,10 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
}
// rjf: fill type
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
if(modifier_flags != 0)
{
RDIM_Type *pointer_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = modifier_flags;
dst_type->direct_type = pointer_type;
@@ -3086,6 +3146,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
}
else
{
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = type_kind;
dst_type->byte_size = arch_addr_size;
dst_type->direct_type = direct_type;
@@ -4220,3 +4281,58 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
scratch_end(scratch);
return out;
}
////////////////////////////////
//~ rjf: Top-Level Compression Entry Point
internal P2R_Bake2Serialize *
p2r_compress(Arena *arena, P2R_Bake2Serialize *in)
{
RDIM_BakeSectionList prepack_sections = in->sections;
RDIM_BakeSectionList postpack_sections = {0};
{
//- rjf: set up compression context
rr_lzb_simple_context ctx = {0};
ctx.m_tableSizeBits = 14;
ctx.m_hashTable = push_array(arena, U16, 1<<ctx.m_tableSizeBits);
//- rjf: compress, or just copy, all sections
for(RDIM_BakeSectionNode *src_n = prepack_sections.first; src_n != 0; src_n = src_n->next)
{
RDIM_BakeSection *src = &src_n->v;
// rjf: push new section
RDIM_BakeSection *dst = rdim_bake_section_list_push(arena, &postpack_sections);
// rjf: unpack uncompressed section info
void *data = src->data;
RDI_DataSectionEncoding encoding = src->encoding;
RDI_U64 encoded_size = src->encoded_size;
RDI_U64 unpacked_size = src->unpacked_size;
// rjf: determine if this section should be compressed
B32 should_compress = 1;
// rjf: compress if needed
if(should_compress)
{
MemoryZero(ctx.m_hashTable, sizeof(U16)*(1<<ctx.m_tableSizeBits));
void *raw_data = data;
data = push_array_no_zero(arena, U8, unpacked_size);
encoded_size = rr_lzb_simple_encode_veryfast(&ctx, raw_data, unpacked_size, data);
encoding = RDI_DataSectionEncoding_LZB;
}
// rjf: fill
dst->data = data;
dst->encoding = encoding;
dst->encoded_size = encoded_size;
dst->unpacked_size = unpacked_size;
dst->tag = src->tag;
dst->tag_idx = src->tag_idx;
}
}
P2R_Bake2Serialize *out = push_array(arena, P2R_Bake2Serialize, 1);
out->sections = postpack_sections;
return out;
}
@@ -1,20 +1,39 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RADDBGI_FROM_PDB_H
#define RADDBGI_FROM_PDB_H
#ifndef RDI_FROM_PDB_H
#define RDI_FROM_PDB_H
////////////////////////////////
//~ rjf: Conversion Stage Inputs/Outputs
//~ rjf: Export Artifact Flags
typedef U32 P2R_ConvertFlags;
enum
{
P2R_ConvertFlag_Types = (1<<0),
P2R_ConvertFlag_UDTs = (1<<1),
P2R_ConvertFlag_Strings = (1<<0),
P2R_ConvertFlag_IndexRuns = (1<<1),
P2R_ConvertFlag_BinarySections = (1<<2),
P2R_ConvertFlag_Units = (1<<3),
P2R_ConvertFlag_Procedures = (1<<4),
P2R_ConvertFlag_GlobalVariables = (1<<5),
P2R_ConvertFlag_ThreadVariables = (1<<6),
P2R_ConvertFlag_Scopes = (1<<7),
P2R_ConvertFlag_Locals = (1<<8),
P2R_ConvertFlag_Types = (1<<9),
P2R_ConvertFlag_UDTs = (1<<10),
P2R_ConvertFlag_LineInfo = (1<<11),
P2R_ConvertFlag_GlobalVariableNameMap = (1<<12),
P2R_ConvertFlag_ThreadVariableNameMap = (1<<13),
P2R_ConvertFlag_ProcedureNameMap = (1<<14),
P2R_ConvertFlag_TypeNameMap = (1<<15),
P2R_ConvertFlag_LinkNameProcedureNameMap= (1<<16),
P2R_ConvertFlag_NormalSourcePathNameMap = (1<<17),
P2R_ConvertFlag_All = 0xffffffff,
};
////////////////////////////////
//~ rjf: Conversion Stage Inputs/Outputs
typedef struct P2R_User2Convert P2R_User2Convert;
struct P2R_User2Convert
{
@@ -495,12 +514,12 @@ internal U64 p2r_hash_from_voff(U64 voff);
internal P2R_User2Convert *p2r_user2convert_from_cmdln(Arena *arena, CmdLine *cmdline);
////////////////////////////////
//~ rjf: COFF => RADDBGI Canonical Conversions
//~ rjf: COFF => RDI Canonical Conversions
internal RDI_BinarySectionFlags p2r_rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags);
////////////////////////////////
//~ rjf: CodeView => RADDBGI Canonical Conversions
//~ rjf: CodeView => RDI Canonical Conversions
internal RDI_Arch p2r_rdi_arch_from_cv_arch(CV_Arch arch);
internal RDI_RegisterCode p2r_rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code);
@@ -602,4 +621,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_bake_idx_runs_task__entry_point);
internal P2R_Bake2Serialize *p2r_bake(Arena *arena, P2R_Convert2Bake *in);
#endif // RADDBGI_FROM_PDB_H
////////////////////////////////
//~ rjf: Top-Level Compression Entry Point
internal P2R_Bake2Serialize *p2r_compress(Arena *arena, P2R_Bake2Serialize *in);
#endif // RDI_FROM_PDB_H
@@ -6,43 +6,45 @@
#define BUILD_VERSION_MAJOR 0
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "raddbgi_from_pdb"
#define BUILD_TITLE "rdi_from_pdb"
#define BUILD_CONSOLE_INTERFACE 1
////////////////////////////////
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format.c"
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "coff/coff.h"
#include "codeview/codeview.h"
#include "codeview/codeview_stringize.h"
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb.h"
#include "rdi_from_pdb.h"
//- rjf: [c]
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "coff/coff.c"
#include "codeview/codeview.c"
#include "codeview/codeview_stringize.c"
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb.c"
#include "rdi_from_pdb.c"
////////////////////////////////
//~ rjf: Entry Point
@@ -60,7 +62,7 @@ entry_point(CmdLine *cmdline)
//- rjf: display help
if(do_help || user2convert->errors.node_count != 0)
{
fprintf(stderr, "--- raddbgi_from_pdb ----------------------------------------------------------\n\n");
fprintf(stderr, "--- rdi_from_pdb --------------------------------------------------------------\n\n");
fprintf(stderr, "This utility converts debug information from PDBs into the RAD Debug Info.\n");
fprintf(stderr, "format. The following arguments are accepted:\n\n");
@@ -96,8 +98,15 @@ entry_point(CmdLine *cmdline)
bake2srlz = p2r_bake(arena, convert2bake);
}
//- rjf: compress
P2R_Bake2Serialize *bake2srlz_compressed = bake2srlz;
if(cmd_line_has_flag(cmdline, str8_lit("compress"))) ProfScope("compress")
{
bake2srlz_compressed = p2r_compress(arena, bake2srlz);
}
//- rjf: serialize
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(arena, &convert2bake->bake_params, &bake2srlz->sections);
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(arena, &convert2bake->bake_params, &bake2srlz_compressed->sections);
//- rjf: write
ProfScope("write")
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "lib_raddbgi_make/raddbgi_make.c"
#include "lib_rdi_make/rdi_make.c"
@@ -45,6 +45,6 @@
#define RDIM_ProfBegin(...) ProfBeginDynamic(__VA_ARGS__)
#define RDIM_ProfEnd(...) ProfEnd()
#include "lib_raddbgi_make/raddbgi_make.h"
#include "lib_rdi_make/rdi_make.h"
#endif // RDI_CONS_LOCAL_H
@@ -3,10 +3,10 @@
//- GENERATED CODE
#ifndef REGS_RADDBGI_META_H
#define REGS_RADDBGI_META_H
#ifndef REGS_RDI_META_H
#define REGS_RDI_META_H
C_LINKAGE_BEGIN
C_LINKAGE_END
#endif // REGS_RADDBGI_META_H
#endif // REGS_RDI_META_H
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#include "regs/raddbgi/generated/regs_raddbgi.meta.c"
#include "regs/rdi/generated/regs_rdi.meta.c"
@@ -1,10 +1,10 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef REGS_RADDBGI_H
#define REGS_RADDBGI_H
#ifndef REGS_RDI_H
#define REGS_RDI_H
internal RDI_RegisterCode regs_rdi_code_from_arch_reg_code(Architecture arch, REGS_RegCode code);
internal REGS_RegCode regs_reg_code_from_arch_rdi_code(Architecture arch, RDI_RegisterCode reg);
#endif //REGS_RADDBGI_H
#endif //REGS_RDI_H
+4 -4
View File
@@ -13,7 +13,7 @@ internal U64
regs_rip_from_arch_block(Architecture arch, void *block)
{
U64 result = 0;
switch(arch)
if(block != 0) switch(arch)
{
default:{}break;
case Architecture_x64:{result = ((REGS_RegBlockX64 *)block)->rip.u64;}break;
@@ -26,7 +26,7 @@ internal U64
regs_rsp_from_arch_block(Architecture arch, void *block)
{
U64 result = 0;
switch(arch)
if(block != 0) switch(arch)
{
default:{}break;
case Architecture_x64:{result = ((REGS_RegBlockX64 *)block)->rsp.u64;}break;
@@ -38,7 +38,7 @@ regs_rsp_from_arch_block(Architecture arch, void *block)
internal void
regs_arch_block_write_rip(Architecture arch, void *block, U64 rip)
{
switch(arch)
if(block != 0) switch(arch)
{
default:{}break;
case Architecture_x64:{((REGS_RegBlockX64 *)block)->rip.u64 = rip;}break;
@@ -49,7 +49,7 @@ regs_arch_block_write_rip(Architecture arch, void *block, U64 rip)
internal void
regs_arch_block_write_rsp(Architecture arch, void *block, U64 rsp)
{
switch(arch)
if(block != 0) switch(arch)
{
default:{}break;
case Architecture_x64:{((REGS_RegBlockX64 *)block)->rsp.u64 = rsp;}break;
+13 -7
View File
@@ -841,18 +841,13 @@ r_window_begin_frame(OS_Handle window, R_Handle window_equip)
Vec2S32 resolution = {(S32)(client_rect.x1 - client_rect.x0), (S32)(client_rect.y1 - client_rect.y0)};
//- rjf: resolution change
B32 resize_done = 0;
if(wnd->last_resolution.x != resolution.x ||
wnd->last_resolution.y != resolution.y)
{
resize_done = 1;
wnd->last_resolution = resolution;
// rjf: resize swapchain & main framebuffer
wnd->framebuffer_rtv->Release();
wnd->framebuffer->Release();
wnd->swapchain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);
wnd->swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void **)(&wnd->framebuffer));
r_d3d11_state->device->CreateRenderTargetView(wnd->framebuffer, 0, &wnd->framebuffer_rtv);
// rjf: release screen-sized render target resources, if there
if(wnd->stage_scratch_color_srv){wnd->stage_scratch_color_srv->Release();}
if(wnd->stage_scratch_color_rtv){wnd->stage_scratch_color_rtv->Release();}
@@ -867,6 +862,13 @@ r_window_begin_frame(OS_Handle window, R_Handle window_equip)
if(wnd->geo3d_depth_dsv) {wnd->geo3d_depth_dsv->Release();}
if(wnd->geo3d_depth) {wnd->geo3d_depth->Release();}
// rjf: resize swapchain & main framebuffer
wnd->framebuffer_rtv->Release();
wnd->framebuffer->Release();
wnd->swapchain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);
wnd->swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void **)(&wnd->framebuffer));
r_d3d11_state->device->CreateRenderTargetView(wnd->framebuffer, 0, &wnd->framebuffer_rtv);
// rjf: create stage color targets
{
D3D11_TEXTURE2D_DESC color_desc = {};
@@ -946,6 +948,10 @@ r_window_begin_frame(OS_Handle window, R_Handle window_equip)
Vec4F32 clear_color = {0, 0, 0, 0};
d_ctx->ClearRenderTargetView(wnd->framebuffer_rtv, clear_color.v);
d_ctx->ClearRenderTargetView(wnd->stage_color_rtv, clear_color.v);
if(resize_done)
{
d_ctx->Flush();
}
}
ProfEnd();
}
+46 -16
View File
@@ -1,30 +1,60 @@
struct Bar
static int Static = 5;
namespace NS
{
int x;
int y;
int z;
static int staticDataInNS = 99;
struct A
{
static int staticData;
int a = 20;
int b = 30;
void Foo()
{
Static += 1;
staticDataInNS += 1;
staticData++;
a++;
b++;
}
};
int A::staticData = 123;
}
struct Resource
{
int resourceType;
};
struct BarContainer
struct Stack
{
Bar *bar;
int bar_count;
int bar_cap;
Resource *resource;
};
struct Foo
struct StackNode
{
BarContainer bar;
int a;
int b;
int c;
StackNode *next;
Stack v;
};
struct Context
{
StackNode *entry_stack_first;
};
int main(void)
{
Bar bar[100] = {0};
Foo foo_ = {bar, 50, sizeof(bar)/sizeof(Bar)};
Foo &foo = foo_;
Resource r_ = {0};
Resource *r = &r_;
Stack s = {r};
StackNode n_ = {0, s};
StackNode *n = &n_;
Context c_ = {n};
Context *context = &c_;
// evaluate `context.entry_stack_first.v.resource.resourceType == 0xd8`
int x = 0;
NS::A a = {0};
a.Foo();
return 0;
}
+11 -11
View File
@@ -6,7 +6,7 @@
#define BUILD_VERSION_MAJOR 0
#define BUILD_VERSION_MINOR 9
#define BUILD_VERSION_PATCH 9
#define BUILD_VERSION_PATCH 10
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
#define BUILD_TITLE "ryan_scratch"
#define BUILD_CONSOLE_INTERFACE 1
@@ -15,16 +15,16 @@
//~ rjf: Includes
//- rjf: [lib]
#include "lib_raddbgi_format/raddbgi_format.h"
#include "lib_raddbgi_format/raddbgi_format_parse.h"
#include "lib_raddbgi_format/raddbgi_format.c"
#include "lib_raddbgi_format/raddbgi_format_parse.c"
#include "lib_rdi_format/rdi_format.h"
#include "lib_rdi_format/rdi_format_parse.h"
#include "lib_rdi_format/rdi_format.c"
#include "lib_rdi_format/rdi_format_parse.c"
//- rjf: [h]
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "raddbgi_make_local/raddbgi_make_local.h"
#include "rdi_make_local/rdi_make_local.h"
#include "mdesk/mdesk.h"
#include "hash_store/hash_store.h"
#include "file_stream/file_stream.h"
@@ -38,9 +38,9 @@
#include "msf/msf.h"
#include "pdb/pdb.h"
#include "pdb/pdb_stringize.h"
#include "raddbgi_from_pdb/raddbgi_from_pdb.h"
#include "rdi_from_pdb/rdi_from_pdb.h"
#include "regs/regs.h"
#include "regs/raddbgi/regs_raddbgi.h"
#include "regs/rdi/regs_rdi.h"
#include "type_graph/type_graph.h"
#include "dbgi/dbgi.h"
#include "demon/demon_inc.h"
@@ -52,7 +52,7 @@
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "raddbgi_make_local/raddbgi_make_local.c"
#include "rdi_make_local/rdi_make_local.c"
#include "mdesk/mdesk.c"
#include "hash_store/hash_store.c"
#include "file_stream/file_stream.c"
@@ -66,9 +66,9 @@
#include "msf/msf.c"
#include "pdb/pdb.c"
#include "pdb/pdb_stringize.c"
#include "raddbgi_from_pdb/raddbgi_from_pdb.c"
#include "rdi_from_pdb/rdi_from_pdb.c"
#include "regs/regs.c"
#include "regs/raddbgi/regs_raddbgi.c"
#include "regs/rdi/regs_rdi.c"
#include "type_graph/type_graph.c"
#include "dbgi/dbgi.c"
#include "demon/demon_inc.c"
+526
View File
@@ -17,6 +17,12 @@ txt_lang_kind_from_extension(String8 extension)
str8_match(extension, str8_lit("cxx"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("cc"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("c++"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("ixx"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("cxxm"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("c++m"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("ccm"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("cppm"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("mpp"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("C"), 0) ||
str8_match(extension, str8_lit("hpp"), StringMatchFlag_CaseInsensitive) ||
str8_match(extension, str8_lit("hxx"), StringMatchFlag_CaseInsensitive) ||
@@ -30,9 +36,36 @@ txt_lang_kind_from_extension(String8 extension)
{
kind = TXT_LangKind_Odin;
}
else if(str8_match(extension, str8_lit("jai"), StringMatchFlag_CaseInsensitive))
{
kind = TXT_LangKind_Jai;
}
else if(str8_match(extension, str8_lit("zig"), StringMatchFlag_CaseInsensitive))
{
kind = TXT_LangKind_Zig;
}
return kind;
}
internal String8
txt_extension_from_lang_kind(TXT_LangKind kind)
{
String8 result = {0};
switch(kind)
{
case TXT_LangKind_Null:
case TXT_LangKind_COUNT:
case TXT_LangKind_DisasmX64Intel:
{}break;
case TXT_LangKind_C: {result = str8_lit("c");}break;
case TXT_LangKind_CPlusPlus: {result = str8_lit("cpp");}break;
case TXT_LangKind_Odin: {result = str8_lit("odin");}break;
case TXT_LangKind_Jai: {result = str8_lit("jai");}break;
case TXT_LangKind_Zig: {result = str8_lit("zig");}break;
}
return result;
}
internal TXT_LangKind
txt_lang_kind_from_architecture(Architecture arch)
{
@@ -55,6 +88,8 @@ txt_lex_function_from_lang_kind(TXT_LangKind kind)
case TXT_LangKind_C: {fn = txt_token_array_from_string__c_cpp;}break;
case TXT_LangKind_CPlusPlus: {fn = txt_token_array_from_string__c_cpp;}break;
case TXT_LangKind_Odin: {fn = txt_token_array_from_string__odin;}break;
case TXT_LangKind_Jai: {fn = txt_token_array_from_string__jai;}break;
case TXT_LangKind_Zig: {fn = txt_token_array_from_string__zig;}break;
case TXT_LangKind_DisasmX64Intel:{fn = txt_token_array_from_string__disasm_x64_intel;}break;
}
return fn;
@@ -565,6 +600,7 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
{
read_only local_persist String8 odin_keywords[] =
{
str8_lit_comp("align_of"),
str8_lit_comp("asm"),
str8_lit_comp("auto_cast"),
str8_lit_comp("bit_set"),
@@ -594,6 +630,7 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
str8_lit_comp("package"),
str8_lit_comp("proc"),
str8_lit_comp("return"),
str8_lit_comp("size_of"),
str8_lit_comp("struct"),
str8_lit_comp("switch"),
str8_lit_comp("transmute"),
@@ -637,6 +674,470 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
return result;
}
internal TXT_TokenArray
txt_token_array_from_string__jai(Arena *arena, U64 *bytes_processed_counter, String8 string)
{
Temp scratch = scratch_begin(&arena, 1);
//- rjf: generate token list
TXT_TokenChunkList tokens = {0};
{
B32 comment_is_single_line = 0;
B32 string_is_char = 0;
TXT_TokenKind active_token_kind = TXT_TokenKind_Null;
U64 active_token_start_idx = 0;
B32 escaped = 0;
B32 next_escaped = 0;
U64 byte_process_start_idx = 0;
for(U64 idx = 0; idx <= string.size;)
{
U8 byte = (idx+0 < string.size) ? (string.str[idx+0]) : 0;
U8 next_byte = (idx+1 < string.size) ? (string.str[idx+1]) : 0;
// rjf: update counter
if(bytes_processed_counter != 0 && ((idx-byte_process_start_idx) >= 1000 || idx == string.size))
{
ins_atomic_u64_add_eval(bytes_processed_counter, (idx-byte_process_start_idx));
byte_process_start_idx = idx;
}
// rjf: escaping
if(escaped && (byte != '\r' && byte != '\n'))
{
next_escaped = 0;
}
else if(!escaped && byte == '\\')
{
next_escaped = 1;
}
// rjf: take starter, determine active token kind
if(active_token_kind == TXT_TokenKind_Null)
{
// rjf: use next bytes to start a new token
if(0){}
else if(char_is_space(byte)) { active_token_kind = TXT_TokenKind_Whitespace; }
else if(byte == '_' ||
byte == '$' ||
char_is_alpha(byte)) { active_token_kind = TXT_TokenKind_Identifier; }
else if(char_is_digit(byte, 10) ||
(byte == '.' &&
char_is_digit(next_byte, 10))) { active_token_kind = TXT_TokenKind_Numeric; }
else if(byte == '"') { active_token_kind = TXT_TokenKind_String; string_is_char = 0; }
else if(byte == '\'') { active_token_kind = TXT_TokenKind_String; string_is_char = 1; }
else if(byte == '/' && next_byte == '/') { active_token_kind = TXT_TokenKind_Comment; comment_is_single_line = 1; }
else if(byte == '/' && next_byte == '*') { active_token_kind = TXT_TokenKind_Comment; comment_is_single_line = 0; }
else if(byte == '~' || byte == '!' ||
byte == '%' || byte == '^' ||
byte == '&' || byte == '*' ||
byte == '(' || byte == ')' ||
byte == '-' || byte == '=' ||
byte == '+' || byte == '[' ||
byte == ']' || byte == '{' ||
byte == '}' || byte == ':' ||
byte == ';' || byte == ',' ||
byte == '.' || byte == '<' ||
byte == '>' || byte == '/' ||
byte == '?' || byte == '|') { active_token_kind = TXT_TokenKind_Symbol; }
else if(byte == '#') { active_token_kind = TXT_TokenKind_Meta; }
// rjf: start new token
if(active_token_kind != TXT_TokenKind_Null)
{
active_token_start_idx = idx;
}
// rjf: invalid token kind -> emit error
else
{
TXT_Token token = {TXT_TokenKind_Error, r1u64(idx, idx+1)};
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
}
}
// rjf: look for ender
U64 ender_pad = 0;
B32 ender_found = 0;
if(active_token_kind != TXT_TokenKind_Null && idx>active_token_start_idx)
{
if(idx == string.size)
{
ender_pad = 0;
ender_found = 1;
}
else switch(active_token_kind)
{
default:break;
case TXT_TokenKind_Whitespace:
{
ender_found = !char_is_space(byte);
}break;
case TXT_TokenKind_Identifier:
{
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
}break;
case TXT_TokenKind_Numeric:
{
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '.' && byte != '\'');
}break;
case TXT_TokenKind_String:
{
ender_found = (!escaped && ((!string_is_char && byte == '"') || (string_is_char && byte == '\'')));
ender_pad += 1;
}break;
case TXT_TokenKind_Symbol:
{
ender_found = (byte != '~' && byte != '!' &&
byte != '%' && byte != '^' &&
byte != '&' && byte != '*' &&
byte != '(' && byte != ')' &&
byte != '-' && byte != '=' &&
byte != '+' && byte != '[' &&
byte != ']' && byte != '{' &&
byte != '}' && byte != ':' &&
byte != ';' && byte != ',' &&
byte != '.' && byte != '<' &&
byte != '>' && byte != '/' &&
byte != '?' && byte != '|');
}break;
case TXT_TokenKind_Comment:
{
if(comment_is_single_line)
{
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
}
else
{
ender_found = (active_token_start_idx+1 < idx && byte == '*' && next_byte == '/');
ender_pad += 2;
}
}break;
case TXT_TokenKind_Meta:
{
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
}break;
}
}
// rjf: next byte is ender => emit token
if(ender_found)
{
TXT_Token token = {active_token_kind, r1u64(active_token_start_idx, idx+ender_pad)};
active_token_kind = TXT_TokenKind_Null;
// rjf: identifier -> keyword in special cases
if(token.kind == TXT_TokenKind_Identifier)
{
read_only local_persist String8 jai_keywords[] =
{
str8_lit_comp("bool"),
str8_lit_comp("true"),
str8_lit_comp("false"),
str8_lit_comp("int"),
str8_lit_comp("s8"),
str8_lit_comp("u8"),
str8_lit_comp("s16"),
str8_lit_comp("u16"),
str8_lit_comp("s32"),
str8_lit_comp("u32"),
str8_lit_comp("s64"),
str8_lit_comp("u64"),
str8_lit_comp("s128"),
str8_lit_comp("u128"),
str8_lit_comp("float"),
str8_lit_comp("float32"),
str8_lit_comp("float64"),
str8_lit_comp("void"),
str8_lit_comp("enum"),
str8_lit_comp("enum_flags"),
str8_lit_comp("size_of"),
str8_lit_comp("string"),
str8_lit_comp("type_of"),
str8_lit_comp("cast"),
str8_lit_comp("if"),
str8_lit_comp("ifs"),
str8_lit_comp("then"),
str8_lit_comp("else"),
str8_lit_comp("case"),
str8_lit_comp("for"),
str8_lit_comp("while"),
str8_lit_comp("break"),
str8_lit_comp("continue"),
str8_lit_comp("remove"),
str8_lit_comp("return"),
str8_lit_comp("inline"),
str8_lit_comp("null"),
str8_lit_comp("defer"),
str8_lit_comp("xx"),
};
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
for(U64 keyword_idx = 0; keyword_idx < ArrayCount(jai_keywords); keyword_idx += 1)
{
if(str8_match(jai_keywords[keyword_idx], token_string, 0))
{
token.kind = TXT_TokenKind_Keyword;
break;
}
}
}
// rjf: push
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
// rjf: increment by ender padding
idx += ender_pad;
}
// rjf: advance by 1 byte if we haven't found an ender
if(!ender_found)
{
idx += 1;
}
escaped = next_escaped;
}
}
//- rjf: token list -> token array
TXT_TokenArray result = txt_token_array_from_chunk_list(arena, &tokens);
scratch_end(scratch);
return result;
}
internal TXT_TokenArray
txt_token_array_from_string__zig(Arena *arena, U64 *bytes_processed_counter, String8 string)
{
Temp scratch = scratch_begin(&arena, 1);
//- rjf: generate token list
TXT_TokenChunkList tokens = {0};
{
B32 string_is_char = 0;
B32 string_is_line = 0;
TXT_TokenKind active_token_kind = TXT_TokenKind_Null;
U64 active_token_start_idx = 0;
B32 escaped = 0;
B32 next_escaped = 0;
U64 byte_process_start_idx = 0;
for(U64 idx = 0; idx <= string.size;)
{
U8 byte = (idx+0 < string.size) ? (string.str[idx+0]) : 0;
U8 next_byte = (idx+1 < string.size) ? (string.str[idx+1]) : 0;
// rjf: update counter
if(bytes_processed_counter != 0 && ((idx-byte_process_start_idx) >= 1000 || idx == string.size))
{
ins_atomic_u64_add_eval(bytes_processed_counter, (idx-byte_process_start_idx));
byte_process_start_idx = idx;
}
// rjf: escaping
if(escaped && (byte != '\r' && byte != '\n'))
{
next_escaped = 0;
}
else if(!escaped && byte == '\\')
{
next_escaped = 1;
}
// rjf: take starter, determine active token kind
if(active_token_kind == TXT_TokenKind_Null)
{
// rjf: use next bytes to start a new token
if(0){}
else if(char_is_space(byte)) { active_token_kind = TXT_TokenKind_Whitespace; }
else if(byte == '_' ||
char_is_alpha(byte)) { active_token_kind = TXT_TokenKind_Identifier; }
else if(char_is_digit(byte, 10) ||
(byte == '.' &&
char_is_digit(next_byte, 10))) { active_token_kind = TXT_TokenKind_Numeric; }
else if(byte == '"') { active_token_kind = TXT_TokenKind_String; string_is_char = 0; }
else if(byte == '\'') { active_token_kind = TXT_TokenKind_String; string_is_char = 1; }
else if(byte == '\\' &&
next_byte == '\\') { active_token_kind = TXT_TokenKind_String; string_is_line = 1; }
else if(byte == '/' && next_byte == '/') { active_token_kind = TXT_TokenKind_Comment; }
else if(byte == '~' || byte == '!' ||
byte == '%' || byte == '^' ||
byte == '&' || byte == '*' ||
byte == '(' || byte == ')' ||
byte == '-' || byte == '=' ||
byte == '+' || byte == '[' ||
byte == ']' || byte == '{' ||
byte == '}' || byte == ':' ||
byte == ';' || byte == ',' ||
byte == '.' || byte == '<' ||
byte == '>' || byte == '/' ||
byte == '?' || byte == '|' ||
byte == 'c') { active_token_kind = TXT_TokenKind_Symbol; }
// rjf: start new token
if(active_token_kind != TXT_TokenKind_Null)
{
active_token_start_idx = idx;
}
// rjf: invalid token kind -> emit error
else
{
TXT_Token token = {TXT_TokenKind_Error, r1u64(idx, idx+1)};
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
}
}
// rjf: look for ender
U64 ender_pad = 0;
B32 ender_found = 0;
if(active_token_kind != TXT_TokenKind_Null && idx>active_token_start_idx)
{
if(idx == string.size)
{
ender_pad = 0;
ender_found = 1;
}
else switch(active_token_kind)
{
default:break;
case TXT_TokenKind_Whitespace:
{
ender_found = !char_is_space(byte);
}break;
case TXT_TokenKind_Identifier:
{
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
}break;
case TXT_TokenKind_Numeric:
{
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '.' && byte != '\'');
}break;
case TXT_TokenKind_String:
{
if (string_is_line)
{
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
}
else
{
ender_found = (!escaped && ((!string_is_char && byte == '"') || (string_is_char && byte == '\'')));
ender_pad += 1;
}
}break;
case TXT_TokenKind_Symbol:
{
ender_found = (byte != '~' && byte != '!' &&
byte != '%' && byte != '^' &&
byte != '&' && byte != '*' &&
byte != '(' && byte != ')' &&
byte != '-' && byte != '=' &&
byte != '+' && byte != '[' &&
byte != ']' && byte != '{' &&
byte != '}' && byte != ':' &&
byte != ';' && byte != ',' &&
byte != '.' && byte != '<' &&
byte != '>' && byte != '/' &&
byte != '?' && byte != '|' &&
byte != 'c');
}break;
case TXT_TokenKind_Comment:
{
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
}break;
}
}
// rjf: next byte is ender => emit token
if(ender_found)
{
TXT_Token token = {active_token_kind, r1u64(active_token_start_idx, idx+ender_pad)};
active_token_kind = TXT_TokenKind_Null;
// rjf: identifier -> keyword in special cases
if(token.kind == TXT_TokenKind_Identifier)
{
read_only local_persist String8 zig_keywords[] =
{
str8_lit_comp("addrspace"),
str8_lit_comp("align"),
str8_lit_comp("allowzero"),
str8_lit_comp("and"),
str8_lit_comp("anyframe"),
str8_lit_comp("anytype"),
str8_lit_comp("asm"),
str8_lit_comp("async"),
str8_lit_comp("await"),
str8_lit_comp("break"),
str8_lit_comp("callconv"),
str8_lit_comp("catch"),
str8_lit_comp("comptime"),
str8_lit_comp("const"),
str8_lit_comp("continue"),
str8_lit_comp("defer"),
str8_lit_comp("else"),
str8_lit_comp("enum"),
str8_lit_comp("errdefer"),
str8_lit_comp("error"),
str8_lit_comp("export"),
str8_lit_comp("extern"),
str8_lit_comp("fn"),
str8_lit_comp("for"),
str8_lit_comp("if"),
str8_lit_comp("inline"),
str8_lit_comp("noalias"),
str8_lit_comp("nosuspend"),
str8_lit_comp("noinline"),
str8_lit_comp("opaque"),
str8_lit_comp("or"),
str8_lit_comp("orelse"),
str8_lit_comp("packed"),
str8_lit_comp("pub"),
str8_lit_comp("resume"),
str8_lit_comp("return"),
str8_lit_comp("linksection"),
str8_lit_comp("struct"),
str8_lit_comp("suspend"),
str8_lit_comp("switch"),
str8_lit_comp("test"),
str8_lit_comp("threadlocal"),
str8_lit_comp("try"),
str8_lit_comp("union"),
str8_lit_comp("unreachable"),
str8_lit_comp("usingnamespace"),
str8_lit_comp("var"),
str8_lit_comp("volatile"),
str8_lit_comp("while"),
};
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
for(U64 keyword_idx = 0; keyword_idx < ArrayCount(zig_keywords); keyword_idx += 1)
{
if(str8_match(zig_keywords[keyword_idx], token_string, 0))
{
token.kind = TXT_TokenKind_Keyword;
break;
}
}
}
// rjf: push
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
// rjf: increment by ender padding
idx += ender_pad;
}
// rjf: advance by 1 byte if we haven't found an ender
if(!ender_found)
{
idx += 1;
}
escaped = next_escaped;
}
}
//- rjf: token list -> token array
TXT_TokenArray result = txt_token_array_from_chunk_list(arena, &tokens);
scratch_end(scratch);
return result;
}
internal TXT_TokenArray
txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed_counter, String8 string)
{
@@ -651,6 +1152,7 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
B32 escaped = 0;
B32 string_is_char = 0;
S32 brace_nest = 0;
S32 paren_nest = 0;
for(U64 advance = 0; off <= string.size; off += advance)
{
U8 byte = (off+0 < string.size) ? string.str[off+0] : 0;
@@ -673,6 +1175,12 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
active_token_kind = TXT_TokenKind_Whitespace;
advance = 1;
}
else if(byte == '>' && brace_nest == 0 && paren_nest == 0)
{
active_token_start_off = off;
active_token_kind = TXT_TokenKind_Comment;
advance = 1;
}
else if(('a' <= byte && byte <= 'z') || ('A' <= byte && byte <= 'Z') || byte == '_')
{
active_token_start_off = off;
@@ -717,6 +1225,14 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
{
brace_nest -= 1;
}
if(byte == '(')
{
paren_nest += 1;
}
else if(byte == ')')
{
paren_nest -= 1;
}
}
else
{
@@ -792,6 +1308,12 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
ender_found = 1;
advance = 0;
}break;
case TXT_TokenKind_Comment:
if(byte == '\n')
{
ender_found = 1;
advance = 1;
}break;
}
if(ender_found != 0)
{
@@ -799,6 +1321,10 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
{
active_token_kind = TXT_TokenKind_Numeric;
}
if(paren_nest != 0 && active_token_kind == TXT_TokenKind_Keyword)
{
active_token_kind = TXT_TokenKind_Identifier;
}
TXT_Token token = {active_token_kind, r1u64(active_token_start_off, off+advance)};
txt_token_chunk_list_push(arena, &tokens, 1024, &token);
active_token_kind = TXT_TokenKind_Null;

Some files were not shown because too many files have changed in this diff Show More