mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-09-22 17:20:05 +00:00
Compare commits
393
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05ceedfcb | ||
|
|
5e093a9b4c | ||
|
|
08bc2b0a79 | ||
|
|
4ebc38d9f9 | ||
|
|
5e2c6b5107 | ||
|
|
7584890edd | ||
|
|
4bbf64de7e | ||
|
|
e10bef9d2b | ||
|
|
1229a50c68 | ||
|
|
6e2353d302 | ||
|
|
3d272a598b | ||
|
|
dbdf6e7c02 | ||
|
|
0904de74de | ||
|
|
e3077cf6f5 | ||
|
|
9ad52d25b5 | ||
|
|
c2ddffd424 | ||
|
|
7d351d03c5 | ||
|
|
2e12b1485a | ||
|
|
653eb08d43 | ||
|
|
9be3c2affc | ||
|
|
6fa8af5e1a | ||
|
|
010d5609c6 | ||
|
|
d12c5ec2e8 | ||
|
|
c10ac170a8 | ||
|
|
7a185f9560 | ||
|
|
0d581694e6 | ||
|
|
b4b8f5f0ab | ||
|
|
15d42027e7 | ||
|
|
883aa2d1de | ||
|
|
586b3e3072 | ||
|
|
2588bbcd12 | ||
|
|
0a5cc5df6f | ||
|
|
ff32449ba2 | ||
|
|
614954b7ef | ||
|
|
31c671e3f5 | ||
|
|
6d75d6b63b | ||
|
|
4d2b524400 | ||
|
|
16863b1f5a | ||
|
|
f9abb397f3 | ||
|
|
db5a7d4be2 | ||
|
|
6ac870dac0 | ||
|
|
5f23820f9d | ||
|
|
fc77844452 | ||
|
|
3b27abd5c7 | ||
|
|
ce1f54a931 | ||
|
|
c60d3aab22 | ||
|
|
b76c605eba | ||
|
|
6eef8c3e16 | ||
|
|
b5b5aca691 | ||
|
|
435877824a | ||
|
|
3327d73373 | ||
|
|
376a7c48a5 | ||
|
|
f6eec680bc | ||
|
|
41fd224956 | ||
|
|
c794d896c9 | ||
|
|
1a8b39ad9d | ||
|
|
a8891b3ca4 | ||
|
|
ada1b8dfe2 | ||
|
|
9461e79268 | ||
|
|
4fc5b61676 | ||
|
|
6cc1dfb39a | ||
|
|
d44f098e84 | ||
|
|
749821dd27 | ||
|
|
6ad94978ce | ||
|
|
bc5d0b1888 | ||
|
|
3c2c98b08a | ||
|
|
31d7be8f8a | ||
|
|
0b3e3228d1 | ||
|
|
794f212501 | ||
|
|
723c7c5d4d | ||
|
|
fb9824dc24 | ||
|
|
933b4c90de | ||
|
|
5349838633 | ||
|
|
f655758060 | ||
|
|
fa4d0bc262 | ||
|
|
3c39a88abf | ||
|
|
fb6689a74d | ||
|
|
a5e29f65f6 | ||
|
|
b6f50cc4be | ||
|
|
b47b22bdce | ||
|
|
41e99bd2f6 | ||
|
|
2c7d15de59 | ||
|
|
bf2d5640fa | ||
|
|
1880eca295 | ||
|
|
59a20a5574 | ||
|
|
852ff5f054 | ||
|
|
ac3d7be4de | ||
|
|
07b56a920c | ||
|
|
1cc829512f | ||
|
|
dafbe32e85 | ||
|
|
2419a00b11 | ||
|
|
6e9b2bd107 | ||
|
|
123232ab32 | ||
|
|
1dbc37fe1f | ||
|
|
4c10967cec | ||
|
|
e543abd478 | ||
|
|
3b94fa55fb | ||
|
|
3b6d8cb761 | ||
|
|
a73cde2864 | ||
|
|
fe12f2fdf9 | ||
|
|
c80555c49d | ||
|
|
a3f411ddd4 | ||
|
|
084cabad39 | ||
|
|
64d7bae845 | ||
|
|
93d5bab41c | ||
|
|
772bc37504 | ||
|
|
2ff0abb91e | ||
|
|
b05cfa4b24 | ||
|
|
379885421e | ||
|
|
809a888ce7 | ||
|
|
9dadd3ed3c | ||
|
|
d0d1e7d7e6 | ||
|
|
10ead2f999 | ||
|
|
550e8a0451 | ||
|
|
7495096e05 | ||
|
|
7e85335f3b | ||
|
|
3ad6197b88 | ||
|
|
81b45f1a2f | ||
|
|
44868c0e85 | ||
|
|
f7ce1b73bc | ||
|
|
a4a0452d0c | ||
|
|
45090de3fb | ||
|
|
6824ffddc0 | ||
|
|
dc34cdb59a | ||
|
|
98290ff29b | ||
|
|
5a24649a31 | ||
|
|
97a96cfdd4 | ||
|
|
e25c3044b0 | ||
|
|
af80e1bfc8 | ||
|
|
6488e2d5e2 | ||
|
|
649932cce0 | ||
|
|
dd5cc89483 | ||
|
|
8a6837c553 | ||
|
|
a009473557 | ||
|
|
c18c02a37e | ||
|
|
c61f820aef | ||
|
|
5c8c1a89e3 | ||
|
|
61630f4cf9 | ||
|
|
21b439e7e5 | ||
|
|
4888f90f7f | ||
|
|
6f92fe971a | ||
|
|
cfd2380caa | ||
|
|
07d56ee27c | ||
|
|
334bd3b06f | ||
|
|
a14a2f34f5 | ||
|
|
9dcb5a209a | ||
|
|
300b14ffb4 | ||
|
|
8c63478d9b | ||
|
|
8f03fb0cc5 | ||
|
|
b48fcea28a | ||
|
|
431884dce8 | ||
|
|
d931aed462 | ||
|
|
2c4c9e9d75 | ||
|
|
11978904e1 | ||
|
|
8d99f4859b | ||
|
|
6e84c078a8 | ||
|
|
14034c8bea | ||
|
|
0a88e08dee | ||
|
|
c04a97f991 | ||
|
|
0b35224cf8 | ||
|
|
3f50169fee | ||
|
|
ebd5cf9e47 | ||
|
|
f7e67a80c9 | ||
|
|
063975693d | ||
|
|
44fbbc24ee | ||
|
|
fcb839b788 | ||
|
|
139d00e660 | ||
|
|
41afe1af64 | ||
|
|
3927d333ae | ||
|
|
8438faca06 | ||
|
|
061abb4545 | ||
|
|
011c980646 | ||
|
|
26626c3946 | ||
|
|
281849b4e8 | ||
|
|
d3f7bef2b7 | ||
|
|
ab5259a3d3 | ||
|
|
57da328c2a | ||
|
|
ebc19ded62 | ||
|
|
aff3da8256 | ||
|
|
c1764cee07 | ||
|
|
cc58703185 | ||
|
|
6a57555882 | ||
|
|
cdf0b67354 | ||
|
|
45f69b6f98 | ||
|
|
47df50b6dc | ||
|
|
f50b54cff7 | ||
|
|
8492693df2 | ||
|
|
652a9b5cee | ||
|
|
7f87f89aa8 | ||
|
|
92b3356526 | ||
|
|
98486f0795 | ||
|
|
729a5a9392 | ||
|
|
ffa802f583 | ||
|
|
b192e38d12 | ||
|
|
3c0831ec09 | ||
|
|
02e1b8cf00 | ||
|
|
448baf68a8 | ||
|
|
82c1badcdc | ||
|
|
01a21af955 | ||
|
|
a8b02f9791 | ||
|
|
2c9a6f996d | ||
|
|
d66bbdc6a7 | ||
|
|
de56231f4a | ||
|
|
35c1c463c8 | ||
|
|
59e71eb5cc | ||
|
|
d3adfdeced | ||
|
|
ed8731c093 | ||
|
|
6d4b4b1526 | ||
|
|
9fbcd1ec36 | ||
|
|
da54fd1217 | ||
|
|
34bba95839 | ||
|
|
89fd718a8c | ||
|
|
89c8f84498 | ||
|
|
c426818364 | ||
|
|
62fa397e29 | ||
|
|
0e179f3844 | ||
|
|
f808e8ae29 | ||
|
|
8f446d1f9a | ||
|
|
e073ff3218 | ||
|
|
2512d07c72 | ||
|
|
f65cf5436e | ||
|
|
5778e75d66 | ||
|
|
08750c2318 | ||
|
|
9a5a3b9296 | ||
|
|
cab8bdaf38 | ||
|
|
afb7aba039 | ||
|
|
0750570081 | ||
|
|
86a9934016 | ||
|
|
f14686c6fb | ||
|
|
e80008cb7e | ||
|
|
68d3f17ecb | ||
|
|
e541fce2bc | ||
|
|
6a32c197fa | ||
|
|
eea3c6b53c | ||
|
|
d2f9bdeefb | ||
|
|
c767f03f32 | ||
|
|
db737941d8 | ||
|
|
8319850666 | ||
|
|
d04ee598b2 | ||
|
|
15f5894c60 | ||
|
|
05c751a61a | ||
|
|
dd7cce2c3a | ||
|
|
b1e1752229 | ||
|
|
bddc9c97d9 | ||
|
|
325474fc49 | ||
|
|
50d401e4ce | ||
|
|
1dbbd351d7 | ||
|
|
1161c4adbb | ||
|
|
320a307e90 | ||
|
|
f835158071 | ||
|
|
f214b7d5f2 | ||
|
|
d716159faf | ||
|
|
5074b7f62e | ||
|
|
fd982d38fc | ||
|
|
7e0611e7f1 | ||
|
|
fd7085b690 | ||
|
|
5f76fcfb6b | ||
|
|
9e778b30b6 | ||
|
|
15a1f81545 | ||
|
|
f7ad44a0d7 | ||
|
|
9349ac9e72 | ||
|
|
489ae56223 | ||
|
|
35b97d9c20 | ||
|
|
bafc2170ca | ||
|
|
6837d8d71a | ||
|
|
35c599dea3 | ||
|
|
dc5dda3f71 | ||
|
|
fdfee37228 | ||
|
|
ece414c575 | ||
|
|
f431ac7f80 | ||
|
|
e850f6fc93 | ||
|
|
68a9802357 | ||
|
|
905d04ab0b | ||
|
|
bc40d1c0b0 | ||
|
|
f26b4c3b06 | ||
|
|
68a92e910a | ||
|
|
1621dc0637 | ||
|
|
21fcfd28a4 | ||
|
|
4a3d439c44 | ||
|
|
30f8e1675e | ||
|
|
c17072053b | ||
|
|
a5e2235fc6 | ||
|
|
0160d05e8a | ||
|
|
7a4e939886 | ||
|
|
b33559b081 | ||
|
|
b74db17375 | ||
|
|
a019115b95 | ||
|
|
b9ac104276 | ||
|
|
6e41bdf11b | ||
|
|
49eb834e2b | ||
|
|
fd6befecc3 | ||
|
|
5342fab86b | ||
|
|
9919ac59bb | ||
|
|
2d1fcd7475 | ||
|
|
393fb9e5f2 | ||
|
|
301cf6b7ac | ||
|
|
578a56d231 | ||
|
|
33ab26dfb3 | ||
|
|
8901dd30ec | ||
|
|
e1a5d131c8 | ||
|
|
55c1674ec6 | ||
|
|
364a2160af | ||
|
|
56afe8ca60 | ||
|
|
6e039430a5 | ||
|
|
f1af166fd4 | ||
|
|
03844d81d2 | ||
|
|
aa73e62240 | ||
|
|
16de33245c | ||
|
|
f8b688096a | ||
|
|
4dd1f6f579 | ||
|
|
58b8ed8974 | ||
|
|
ac9a908464 | ||
|
|
5d459d9b7a | ||
|
|
3085482e34 | ||
|
|
6c200a59cd | ||
|
|
362bcbcda5 | ||
|
|
897949d33a | ||
|
|
70479e0399 | ||
|
|
90fc289ef0 | ||
|
|
7c0f92ab3d | ||
|
|
036d94fff0 | ||
|
|
37dd5cea2d | ||
|
|
05f2cde2ee | ||
|
|
e59d71893b | ||
|
|
e41eb9430f | ||
|
|
58192b8356 | ||
|
|
38e38eaf3b | ||
|
|
9f89735b01 | ||
|
|
4cb0073909 | ||
|
|
6fb8db4d3d | ||
|
|
123276a1c6 | ||
|
|
6e8753f1e1 | ||
|
|
dda0e012bf | ||
|
|
6660446bdd | ||
|
|
ef175baae4 | ||
|
|
f45ea18f24 | ||
|
|
4aeb6d7d03 | ||
|
|
ed0ec4b34d | ||
|
|
2e971f9e39 | ||
|
|
d65c263266 | ||
|
|
cd9437534c | ||
|
|
3b2656675e | ||
|
|
b4dab84235 | ||
|
|
2fc34ffb3d | ||
|
|
d419c6e15c | ||
|
|
15a2e708a0 | ||
|
|
5a84fe4949 | ||
|
|
9177299488 | ||
|
|
b6eb13761f | ||
|
|
67eede7513 | ||
|
|
f4ea9e66b0 | ||
|
|
0dbde584bd | ||
|
|
579e3e9637 | ||
|
|
425626a275 | ||
|
|
5b87c2b64a | ||
|
|
879e649d0e | ||
|
|
15e9dec60a | ||
|
|
ec13092a35 | ||
|
|
757cd9b9d2 | ||
|
|
856c59a949 | ||
|
|
62d1c6b130 | ||
|
|
b995909997 | ||
|
|
a954317500 | ||
|
|
b307d3bbed | ||
|
|
8890284f97 | ||
|
|
b41e762393 | ||
|
|
72e8ae6e30 | ||
|
|
9f4aade2e1 | ||
|
|
27fef06b6c | ||
|
|
572fad1f03 | ||
|
|
c31847f785 | ||
|
|
9719688bb3 | ||
|
|
a6bed27dff | ||
|
|
b7a14aa41c | ||
|
|
56bc399fd5 | ||
|
|
d560f8c734 | ||
|
|
36b50981ff | ||
|
|
32114c3215 | ||
|
|
a8ece647c1 | ||
|
|
e0879ac569 | ||
|
|
0eb8216ea0 | ||
|
|
cd1a0a4cb5 | ||
|
|
1b95eacd08 | ||
|
|
546c544ae0 | ||
|
|
3ea67dd7cf | ||
|
|
52295e5e06 | ||
|
|
63123d69d1 | ||
|
|
835eae208a | ||
|
|
cfb34ec560 | ||
|
|
c45b12cfac | ||
|
|
7c0ce2ab54 | ||
|
|
693d20ec1a | ||
|
|
a6db711f2d |
@@ -21,10 +21,10 @@ jobs:
|
||||
run: |
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
call build raddbg msvc debug || exit /b 1
|
||||
call build raddbgi_from_pdb msvc debug || exit /b 1
|
||||
call build raddbgi_from_dwarf msvc debug || exit /b 1
|
||||
call build raddbgi_dump msvc debug || exit /b 1
|
||||
call build rdi_from_pdb msvc debug || exit /b 1
|
||||
call build rdi_from_dwarf msvc debug || exit /b 1
|
||||
call build rdi_dump msvc debug || exit /b 1
|
||||
call build raddbg clang debug || exit /b 1
|
||||
call build raddbgi_from_pdb clang debug || exit /b 1
|
||||
call build raddbgi_from_dwarf clang debug || exit /b 1
|
||||
call build raddbgi_dump clang debug || exit /b 1
|
||||
call build rdi_from_pdb clang debug || exit /b 1
|
||||
call build rdi_from_dwarf clang debug || exit /b 1
|
||||
call build rdi_dump clang debug || exit /b 1
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
@@ -33,7 +33,8 @@ if "%debug%"=="1" set release=0 && echo [debug mode]
|
||||
if "%release%"=="1" set debug=0 && echo [release mode]
|
||||
if "%msvc%"=="1" set clang=0 && echo [msvc compile]
|
||||
if "%clang%"=="1" set msvc=0 && echo [clang compile]
|
||||
if "%~1"=="" echo [default mode, assuming `raddbg` build] && set raddbg=1
|
||||
if "%~1"=="" echo [default mode, assuming `raddbg` build] && set raddbg=1
|
||||
if "%~1"=="release" if "%~2"=="" echo [default mode, assuming `raddbg` build] && set raddbg=1
|
||||
|
||||
:: --- Unpack Command Line Build Arguments ------------------------------------
|
||||
set auto_compile_flags=
|
||||
@@ -42,8 +43,8 @@ if "%asan%"=="1" set auto_compile_flags=%auto_compile_flags% -fsanitize=add
|
||||
|
||||
:: --- Compile/Link Line Definitions ------------------------------------------
|
||||
set cl_common= /I..\src\ /I..\local\ /nologo /FC /Z7
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf
|
||||
set cl_debug= call cl /Od /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags%
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf
|
||||
set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags%
|
||||
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
||||
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
||||
set clang_release= call clang -g -O2 -DBUILD_DEBUG=0 %clang_common% %auto_compile_flags%
|
||||
@@ -54,12 +55,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=-Wl,/DYNAMICBASE:NO
|
||||
if "%msvc%"=="1" set rc=call rc
|
||||
if "%clang%"=="1" set rc=call llvm-rc
|
||||
|
||||
:: --- Choose Compile/Link Lines ----------------------------------------------
|
||||
if "%msvc%"=="1" set compile_debug=%cl_debug%
|
||||
@@ -96,17 +99,25 @@ 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 "%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_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 "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %out%raddbg.exe || exit /b 1
|
||||
if "%rdi_from_pdb%"=="1" set didbuild=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" set didbuild=1 && %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
|
||||
if "%rdi_dump%"=="1" set didbuild=1 && %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
||||
if "%rdi_breakpad_from_pdb%"=="1" set didbuild=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" set didbuild=1 && %compile% ..\src\scratch\ryan_scratch.c %compile_link% %out%ryan_scratch.exe || exit /b 1
|
||||
if "%cpp_tests%"=="1" set didbuild=1 && %compile% ..\src\scratch\i_hate_c_plus_plus.cpp %compile_link% %out%cpp_tests.exe || exit /b 1
|
||||
if "%look_at_raddbg%"=="1" set didbuild=1 && %compile% ..\src\scratch\look_at_raddbg.c %compile_link% %out%look_at_raddbg.exe || exit /b 1
|
||||
if "%mule_main%"=="1" set didbuild=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" set didbuild=1 && %compile% ..\src\mule\mule_module.cpp %compile_link% %link_dll% %out%mule_module.dll || exit /b 1
|
||||
if "%mule_hotload%"=="1" set didbuild=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" (
|
||||
set didbuild=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 ------------------------------------------------------------------
|
||||
@@ -117,3 +128,10 @@ set compile_link=
|
||||
set out=
|
||||
set msvc=
|
||||
set debug=
|
||||
set release=
|
||||
|
||||
:: --- Warn On No Builds ------------------------------------------------------
|
||||
if "%didbuild%"=="" (
|
||||
echo [WARNING] no valid build target specified; must use build target names as arguments to this script, like `build raddbg` or `build rdi_from_pdb`.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
+9
-8
@@ -47,6 +47,7 @@ commands =
|
||||
{
|
||||
.rjf_f1 =
|
||||
{
|
||||
//.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main.rdi && rdi_dump mule_main.rdi > mule_main.dump && popd",
|
||||
.win = "build raddbg telemetry",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
@@ -56,7 +57,7 @@ commands =
|
||||
},
|
||||
.rjf_f2 =
|
||||
{
|
||||
.win = "build raddbgi_from_pdb telemetry release",
|
||||
.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main.rdi && rdi_dump mule_main.rdi > mule_main.dump && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
@@ -65,7 +66,7 @@ commands =
|
||||
},
|
||||
.rjf_f3 =
|
||||
{
|
||||
.win = "pushd build && raddbg.exe --user:local_dev.raddbg_user --profile:local_dev.raddbg_profile && popd",
|
||||
.win = "pushd build && raddbg.exe --user:local_dev.raddbg_user --project:local_dev.raddbg_project && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
@@ -74,7 +75,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 --pdb:UnrealEditorFortnite.pdb --out:profile.rdi --capture && popd",
|
||||
.linux = "",
|
||||
.out = "*compilation*",
|
||||
.footer_panel = true,
|
||||
@@ -83,7 +84,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 +109,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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -765,4 +779,9 @@ internal U64 ring_read(U8 *ring_base, U64 ring_size, U64 ring_pos, void *dst_dat
|
||||
#define ring_write_struct(ring_base, ring_size, ring_pos, ptr) ring_write((ring_base), (ring_size), (ring_pos), (ptr), sizeof(*(ptr)))
|
||||
#define ring_read_struct(ring_base, ring_size, ring_pos, ptr) ring_read((ring_base), (ring_size), (ring_pos), (ptr), sizeof(*(ptr)))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Sorts
|
||||
|
||||
#define quick_sort(ptr, count, element_size, cmp_function) qsort((ptr), (count), (element_size), (int (*)(const void *, const void *))(cmp_function))
|
||||
|
||||
#endif // BASE_CORE_H
|
||||
|
||||
+23
-23
@@ -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(MUTABLE_TEXT_H) && !defined(MTX_INIT_MANUAL)
|
||||
mtx_init();
|
||||
#endif
|
||||
#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)
|
||||
txti_init();
|
||||
#if defined(FUZZY_SEARCH_H) && !defined(FZY_INIT_MANUAL)
|
||||
fzy_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);
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
// 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))
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8 result_unindented = str8_list_join(scratch.arena, &scope->strings[kind], 0);
|
||||
result.strings[kind] = indented_from_string(arena, result_unindented);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
arena_pop_to(log_active->arena, scope->pos);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// 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__)
|
||||
|
||||
#define LogInfoNamedBlock(s) DeferLoop(log_infof("%S:\n{\n", (s)), log_infof("}\n"))
|
||||
#define LogInfoNamedBlockF(fmt, ...) DeferLoop((log_infof(fmt, __VA_ARGS__), log_infof(":\n{\n")), log_infof("}\n"))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Scopes
|
||||
|
||||
internal void log_scope_begin(void);
|
||||
internal LogScopeResult log_scope_end(Arena *arena);
|
||||
|
||||
#endif // BASE_LOG_H
|
||||
@@ -2,20 +2,20 @@
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
internal void
|
||||
thread_name(String8 string)
|
||||
set_thread_name(String8 string)
|
||||
{
|
||||
ProfThreadName("%.*s", str8_varg(string));
|
||||
os_set_thread_name(string);
|
||||
}
|
||||
|
||||
internal void
|
||||
thread_namef(char *fmt, ...)
|
||||
set_thread_namef(char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
thread_name(string);
|
||||
set_thread_name(string);
|
||||
va_end(args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#ifndef BASE_MARKUP_H
|
||||
#define BASE_MARKUP_H
|
||||
|
||||
internal void thread_namef(char *fmt, ...);
|
||||
internal void thread_name(String8 string);
|
||||
#define ThreadNameF(...) (ProfThreadName(__VA_ARGS__), thread_namef(__VA_ARGS__))
|
||||
#define ThreadName(str) (ProfThreadName("%s", str8_varg(str)), thread_name(str))
|
||||
internal void set_thread_name(String8 string);
|
||||
internal void set_thread_namef(char *fmt, ...);
|
||||
#define ThreadNameF(...) (set_thread_namef(__VA_ARGS__))
|
||||
#define ThreadName(str) (set_thread_name(str))
|
||||
|
||||
#endif // BASE_MARKUP_H
|
||||
|
||||
+42
-4
@@ -946,11 +946,11 @@ str8_array_from_list(Arena *arena, String8List *list)
|
||||
{
|
||||
String8Array array;
|
||||
array.count = list->node_count;
|
||||
array.strings = push_array_no_zero(arena, String8, array.count);
|
||||
array.v = push_array_no_zero(arena, String8, array.count);
|
||||
U64 idx = 0;
|
||||
for(String8Node *n = list->first; n != 0; n = n->next, idx += 1)
|
||||
{
|
||||
array.strings[idx] = n->string;
|
||||
array.v[idx] = n->string;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
@@ -960,7 +960,7 @@ str8_array_reserve(Arena *arena, U64 count)
|
||||
{
|
||||
String8Array arr;
|
||||
arr.count = 0;
|
||||
arr.strings = push_array(arena, String8, count);
|
||||
arr.v = push_array(arena, String8, count);
|
||||
return arr;
|
||||
}
|
||||
|
||||
@@ -1566,7 +1566,45 @@ string_from_elapsed_time(Arena *arena, DateTime dt){
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Textual String Wrapping
|
||||
//~ rjf: Basic Text Indentation
|
||||
|
||||
internal String8
|
||||
indented_from_string(Arena *arena, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
read_only local_persist U8 indentation_bytes[] = " ";
|
||||
String8List indented_strings = {0};
|
||||
S64 depth = 0;
|
||||
S64 next_depth = 0;
|
||||
U64 line_begin_off = 0;
|
||||
for(U64 off = 0; off <= string.size; off += 1)
|
||||
{
|
||||
U8 byte = off<string.size ? string.str[off] : 0;
|
||||
switch(byte)
|
||||
{
|
||||
default:{}break;
|
||||
case '{':case '[':case '(':{next_depth += 1; next_depth = Max(0, next_depth);}break;
|
||||
case '}':case ']':case ')':{next_depth -= 1; next_depth = Max(0, next_depth); depth = next_depth;}break;
|
||||
case '\n':
|
||||
case 0:
|
||||
{
|
||||
String8 line = str8_skip_chop_whitespace(str8_substr(string, r1u64(line_begin_off, off)));
|
||||
if(line.size != 0)
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &indented_strings, "%.*s%S\n", (int)depth*2, indentation_bytes, line);
|
||||
}
|
||||
line_begin_off = off+1;
|
||||
depth = next_depth;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
String8 result = str8_list_join(arena, &indented_strings, 0);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Text Wrapping
|
||||
|
||||
internal String8List
|
||||
wrapped_lines_from_string(Arena *arena, String8 string, U64 first_line_max_width, U64 max_width, U64 wrap_indent)
|
||||
|
||||
@@ -63,7 +63,7 @@ struct String8List
|
||||
typedef struct String8Array String8Array;
|
||||
struct String8Array
|
||||
{
|
||||
String8 *strings;
|
||||
String8 *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
@@ -327,7 +327,12 @@ internal String8 push_file_name_date_time_string(Arena *arena, DateTime *date_ti
|
||||
internal String8 string_from_elapsed_time(Arena *arena, DateTime dt);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Textual String Wrapping
|
||||
//~ rjf: Basic Text Indentation
|
||||
|
||||
internal String8 indented_from_string(Arena *arena, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Text Wrapping
|
||||
|
||||
internal String8List wrapped_lines_from_string(Arena *arena, String8 string, U64 first_line_max_width, U64 max_width, U64 wrap_indent);
|
||||
|
||||
|
||||
+401
-270
@@ -7,21 +7,44 @@
|
||||
#include "generated/codeview.meta.c"
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView Common Functions
|
||||
//~ CodeView Common Decoding Helper Functions
|
||||
|
||||
internal U64
|
||||
cv_hash_from_string(String8 string)
|
||||
{
|
||||
U64 result = 5381;
|
||||
for(U64 i = 0; i < string.size; i += 1)
|
||||
{
|
||||
result = ((result << 5) + result) + string.str[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
cv_hash_from_item_id(CV_ItemId item_id)
|
||||
{
|
||||
U64 result = cv_hash_from_string(str8_struct(&item_id));
|
||||
return result;
|
||||
}
|
||||
|
||||
internal CV_NumericParsed
|
||||
cv_numeric_from_data_range(U8 *first, U8 *opl){
|
||||
cv_numeric_from_data_range(U8 *first, U8 *opl)
|
||||
{
|
||||
CV_NumericParsed result = {0};
|
||||
if (first + 2 <= opl){
|
||||
if(first + 2 <= opl)
|
||||
{
|
||||
U16 x = *(U16*)first;
|
||||
if (x < 0x8000){
|
||||
if(x < 0x8000)
|
||||
{
|
||||
result.kind = CV_NumericKind_USHORT;
|
||||
result.val = first;
|
||||
result.encoded_size = 2;
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
U64 val_size = 0;
|
||||
switch (x){
|
||||
switch(x)
|
||||
{
|
||||
case CV_NumericKind_CHAR: val_size = 1; break;
|
||||
case CV_NumericKind_SHORT:
|
||||
case CV_NumericKind_USHORT: val_size = 2; break;
|
||||
@@ -46,21 +69,23 @@ cv_numeric_from_data_range(U8 *first, U8 *opl){
|
||||
case CV_NumericKind_UTF8STRING:val_size = 0; break; // TODO: ???
|
||||
case CV_NumericKind_FLOAT16: val_size = 2; break;
|
||||
}
|
||||
|
||||
if (first + 2 + val_size <= opl){
|
||||
if(first + 2 + val_size <= opl)
|
||||
{
|
||||
result.kind = x;
|
||||
result.val = (first + 2);
|
||||
result.encoded_size = 2 + val_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal B32
|
||||
cv_numeric_fits_in_u64(CV_NumericParsed *num){
|
||||
cv_numeric_fits_in_u64(CV_NumericParsed *num)
|
||||
{
|
||||
B32 result = 0;
|
||||
switch (num->kind){
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_USHORT:
|
||||
case CV_NumericKind_ULONG:
|
||||
case CV_NumericKind_UQUADWORD:
|
||||
@@ -68,13 +93,15 @@ cv_numeric_fits_in_u64(CV_NumericParsed *num){
|
||||
result = 1;
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal B32
|
||||
cv_numeric_fits_in_s64(CV_NumericParsed *num){
|
||||
cv_numeric_fits_in_s64(CV_NumericParsed *num)
|
||||
{
|
||||
B32 result = 0;
|
||||
switch (num->kind){
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_CHAR:
|
||||
case CV_NumericKind_SHORT:
|
||||
case CV_NumericKind_LONG:
|
||||
@@ -83,111 +110,170 @@ cv_numeric_fits_in_s64(CV_NumericParsed *num){
|
||||
result = 1;
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal B32
|
||||
cv_numeric_fits_in_f64(CV_NumericParsed *num){
|
||||
cv_numeric_fits_in_f64(CV_NumericParsed *num)
|
||||
{
|
||||
B32 result = 0;
|
||||
switch (num->kind){
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_FLOAT32:
|
||||
case CV_NumericKind_FLOAT64:
|
||||
{
|
||||
result = 1;
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
cv_u64_from_numeric(CV_NumericParsed *num){
|
||||
cv_u64_from_numeric(CV_NumericParsed *num)
|
||||
{
|
||||
U64 result = 0;
|
||||
switch (num->kind){
|
||||
case CV_NumericKind_USHORT:
|
||||
{
|
||||
result = *(U16*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_ULONG:
|
||||
{
|
||||
result = *(U32*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_UQUADWORD:
|
||||
{
|
||||
result = *(U64*)num->val;
|
||||
}break;
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_USHORT: {result = *(U16*)num->val;}break;
|
||||
case CV_NumericKind_ULONG: {result = *(U32*)num->val;}break;
|
||||
case CV_NumericKind_UQUADWORD:{result = *(U64*)num->val;}break;
|
||||
}
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal S64
|
||||
cv_s64_from_numeric(CV_NumericParsed *num){
|
||||
cv_s64_from_numeric(CV_NumericParsed *num)
|
||||
{
|
||||
S64 result = 0;
|
||||
switch (num->kind){
|
||||
case CV_NumericKind_CHAR:
|
||||
{
|
||||
result = *(S8*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_SHORT:
|
||||
{
|
||||
result = *(S16*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_LONG:
|
||||
{
|
||||
result = *(S32*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_QUADWORD:
|
||||
{
|
||||
result = *(S64*)num->val;
|
||||
}break;
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_CHAR: {result = *(S8*)num->val;}break;
|
||||
case CV_NumericKind_SHORT: {result = *(S16*)num->val;}break;
|
||||
case CV_NumericKind_LONG: {result = *(S32*)num->val;}break;
|
||||
case CV_NumericKind_QUADWORD: {result = *(S64*)num->val;}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal F64
|
||||
cv_f64_from_numeric(CV_NumericParsed *num){
|
||||
cv_f64_from_numeric(CV_NumericParsed *num)
|
||||
{
|
||||
F64 result = 0;
|
||||
switch (num->kind){
|
||||
case CV_NumericKind_FLOAT32:
|
||||
{
|
||||
result = *(F32*)num->val;
|
||||
}break;
|
||||
|
||||
case CV_NumericKind_FLOAT64:
|
||||
{
|
||||
result = *(F64*)num->val;
|
||||
}break;
|
||||
switch(num->kind)
|
||||
{
|
||||
case CV_NumericKind_FLOAT32:{result = *(F32*)num->val;}break;
|
||||
case CV_NumericKind_FLOAT64:{result = *(F64*)num->val;}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal U64
|
||||
cv_decode_inline_annot_u32(String8 data, U64 offset, U32 *out_value)
|
||||
{
|
||||
U64 cursor = offset;
|
||||
|
||||
// rjf: read header
|
||||
U8 header = 0;
|
||||
cursor += str8_deserial_read_struct(data, cursor, &header);
|
||||
|
||||
// rjf: decode value
|
||||
U32 value = 0;
|
||||
{
|
||||
// 1 byte
|
||||
if((header & 0x80) == 0)
|
||||
{
|
||||
value = header;
|
||||
}
|
||||
|
||||
// 2 bytes
|
||||
else if((header & 0xC0) == 0x80 && cursor+2 <= data.size)
|
||||
{
|
||||
U8 second_byte;
|
||||
cursor += str8_deserial_read_struct(data, cursor, &second_byte);
|
||||
value = ((header & 0x3F) << 8) | second_byte;
|
||||
}
|
||||
|
||||
// 4 bytes
|
||||
else if((header & 0xE0) == 0xC0 && cursor+3 <= data.size)
|
||||
{
|
||||
U8 second_byte, third_byte, fourth_byte;
|
||||
cursor += str8_deserial_read_struct(data, cursor, &second_byte);
|
||||
cursor += str8_deserial_read_struct(data, cursor, &third_byte);
|
||||
cursor += str8_deserial_read_struct(data, cursor, &fourth_byte);
|
||||
value = (((U32)header & 0x1F) << 24) | ((U32)second_byte << 16) | ((U32)third_byte << 8) | (U32)fourth_byte;
|
||||
}
|
||||
|
||||
// bad encode
|
||||
else if((header & 0xE0) == 0xE0)
|
||||
{
|
||||
value = max_U32;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: output results
|
||||
if(out_value)
|
||||
{
|
||||
*out_value = value;
|
||||
}
|
||||
|
||||
U64 read_size = cursor - offset;
|
||||
return read_size;
|
||||
}
|
||||
|
||||
internal U64
|
||||
cv_decode_inline_annot_s32(String8 data, U64 offset, S32 *out_value)
|
||||
{
|
||||
U32 value;
|
||||
U64 read_size = cv_decode_inline_annot_u32(data, offset, &value);
|
||||
if(value & 1)
|
||||
{
|
||||
value = -(value >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = value >> 1;
|
||||
}
|
||||
*out_value = (S32)value;
|
||||
return read_size;
|
||||
}
|
||||
|
||||
internal S32
|
||||
cv_inline_annot_signed_from_unsigned_operand(U32 value)
|
||||
{
|
||||
if(value & 1)
|
||||
{
|
||||
value = -(value >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = value >> 1;
|
||||
}
|
||||
S32 result = (S32)value;
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView Sym Parser Functions
|
||||
//~ CodeView Parsing Functions
|
||||
|
||||
//- the first pass parser
|
||||
//- rjf: record range stream parsing
|
||||
|
||||
internal CV_RecRangeStream*
|
||||
cv_rec_range_stream_from_data(Arena *arena, String8 sym_data, U64 sym_align){
|
||||
cv_rec_range_stream_from_data(Arena *arena, String8 sym_data, U64 sym_align)
|
||||
{
|
||||
Assert(1 <= sym_align && IsPow2OrZero(sym_align));
|
||||
|
||||
CV_RecRangeStream *result = push_array(arena, CV_RecRangeStream, 1);
|
||||
|
||||
U8 *data = sym_data.str;
|
||||
U64 cursor = 0;
|
||||
U64 cap = sym_data.size;
|
||||
for (;cursor + sizeof(CV_RecHeader) <= cap;){
|
||||
for(;cursor + sizeof(CV_RecHeader) <= cap;)
|
||||
{
|
||||
// setup a new chunk
|
||||
arena_push_align(arena, 64);
|
||||
CV_RecRangeChunk *cur_chunk = cv_rec_range_stream_push_chunk(arena, result);
|
||||
|
||||
CV_RecRangeChunk *cur_chunk = push_array_no_zero(arena, CV_RecRangeChunk, 1);
|
||||
SLLQueuePush(result->first_chunk, result->last_chunk, cur_chunk);
|
||||
U64 partial_count = 0;
|
||||
for (;partial_count < CV_REC_RANGE_CHUNK_SIZE && cursor + sizeof(CV_RecHeader) <= cap;
|
||||
partial_count += 1){
|
||||
for(;partial_count < CV_REC_RANGE_CHUNK_SIZE && cursor + sizeof(CV_RecHeader) <= cap; partial_count += 1)
|
||||
{
|
||||
// compute cap
|
||||
CV_RecHeader *hdr = (CV_RecHeader*)(data + cursor);
|
||||
U64 symbol_cap_unclamped = cursor + 2 + hdr->size;
|
||||
@@ -201,110 +287,110 @@ cv_rec_range_stream_from_data(Arena *arena, String8 sym_data, U64 sym_align){
|
||||
U32 next_pos = AlignPow2(symbol_cap, sym_align);
|
||||
cursor = next_pos;
|
||||
}
|
||||
|
||||
result->total_count += partial_count;
|
||||
}
|
||||
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
//- sym
|
||||
internal CV_RecRangeArray
|
||||
cv_rec_range_array_from_stream(Arena *arena, CV_RecRangeStream *stream)
|
||||
{
|
||||
U64 total_count = stream->total_count;
|
||||
CV_RecRange *ranges = push_array_no_zero(arena, CV_RecRange, total_count);
|
||||
U64 idx = 0;
|
||||
for(CV_RecRangeChunk *chunk = stream->first_chunk; chunk != 0; chunk = chunk->next)
|
||||
{
|
||||
U64 copy_count_raw = total_count - idx;
|
||||
U64 copy_count = ClampTop(copy_count_raw, CV_REC_RANGE_CHUNK_SIZE);
|
||||
MemoryCopy(ranges + idx, chunk->ranges, copy_count*sizeof(CV_RecRange));
|
||||
idx += copy_count;
|
||||
}
|
||||
CV_RecRangeArray result = {0};
|
||||
result.ranges = ranges;
|
||||
result.count = total_count;
|
||||
return result;
|
||||
}
|
||||
|
||||
internal CV_SymParsed*
|
||||
cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align){
|
||||
//- rjf: sym stream parsing
|
||||
|
||||
internal CV_SymParsed *
|
||||
cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align)
|
||||
{
|
||||
Assert(1 <= sym_align && IsPow2OrZero(sym_align));
|
||||
ProfBegin("cv_sym_from_data");
|
||||
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
// gather up symbols
|
||||
//- rjf: gather symbols
|
||||
CV_RecRangeStream *stream = cv_rec_range_stream_from_data(scratch.arena, sym_data, sym_align);
|
||||
|
||||
// convert to result
|
||||
//- rjf: convert to result, fill basics
|
||||
CV_SymParsed *result = push_array(arena, CV_SymParsed, 1);
|
||||
result->data = sym_data;
|
||||
result->sym_align = sym_align;
|
||||
result->sym_ranges = cv_rec_range_array_from_stream(arena, stream);
|
||||
cv_sym_top_level_info_from_syms(arena, sym_data, &result->sym_ranges, &result->info);
|
||||
|
||||
scratch_end(scratch);
|
||||
|
||||
ProfEnd();
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal void
|
||||
cv_sym_top_level_info_from_syms(Arena *arena, String8 sym_data,
|
||||
CV_RecRangeArray *ranges,
|
||||
CV_SymTopLevelInfo *info_out){
|
||||
MemoryZeroStruct(info_out);
|
||||
|
||||
CV_RecRange *range = ranges->ranges;
|
||||
CV_RecRange *opl = range + ranges->count;
|
||||
for (; range < opl; range += 1){
|
||||
U8 *first = sym_data.str + range->off + 2;
|
||||
U64 cap = range->hdr.size - 2;
|
||||
|
||||
switch (range->hdr.kind){
|
||||
case CV_SymKind_COMPILE:
|
||||
//- rjf: extract top-level-info
|
||||
{
|
||||
CV_RecRange *range = result->sym_ranges.ranges;
|
||||
CV_RecRange *opl = range + result->sym_ranges.count;
|
||||
for(;range < opl; range += 1)
|
||||
{
|
||||
U8 *first = sym_data.str + range->off + 2;
|
||||
U64 cap = range->hdr.size - 2;
|
||||
switch(range->hdr.kind)
|
||||
{
|
||||
if (sizeof(CV_SymCompile) <= cap){
|
||||
case CV_SymKind_COMPILE:
|
||||
if(sizeof(CV_SymCompile) <= cap)
|
||||
{
|
||||
CV_SymCompile *compile = (CV_SymCompile*)first;
|
||||
|
||||
String8 ver_str = str8_cstring_capped((char*)(compile + 1), (char *)(first + cap));
|
||||
|
||||
info_out->arch = compile->machine;
|
||||
info_out->language = CV_CompileFlags_ExtractLanguage(compile->flags);;
|
||||
info_out->compiler_name = ver_str;
|
||||
}
|
||||
}break;
|
||||
|
||||
case CV_SymKind_COMPILE2:
|
||||
{
|
||||
if (sizeof(CV_SymCompile2) <= cap){
|
||||
result->info.arch = compile->machine;
|
||||
result->info.language = CV_CompileFlags_ExtractLanguage(compile->flags);;
|
||||
result->info.compiler_name = ver_str;
|
||||
}break;
|
||||
case CV_SymKind_COMPILE2:
|
||||
if(sizeof(CV_SymCompile2) <= cap)
|
||||
{
|
||||
CV_SymCompile2 *compile2 = (CV_SymCompile2*)first;
|
||||
|
||||
String8 ver_str = str8_cstring_capped((char*)(compile2 + 1), (char*)(first + cap));
|
||||
String8 compiler_name = push_str8f(arena, "%.*s %u.%u.%u",
|
||||
str8_varg(ver_str),
|
||||
compile2->ver_major,
|
||||
compile2->ver_minor,
|
||||
compile2->ver_build);
|
||||
|
||||
info_out->arch = compile2->machine;
|
||||
info_out->language = CV_Compile2Flags_ExtractLanguage(compile2->flags);;
|
||||
info_out->compiler_name = compiler_name;
|
||||
}
|
||||
}break;
|
||||
|
||||
case CV_SymKind_COMPILE3:
|
||||
{
|
||||
if (sizeof(CV_SymCompile3) <= cap){
|
||||
result->info.arch = compile2->machine;
|
||||
result->info.language = CV_Compile2Flags_ExtractLanguage(compile2->flags);;
|
||||
result->info.compiler_name = compiler_name;
|
||||
}break;
|
||||
case CV_SymKind_COMPILE3:
|
||||
if(sizeof(CV_SymCompile3) <= cap)
|
||||
{
|
||||
CV_SymCompile3 *compile3 = (CV_SymCompile3*)first;
|
||||
|
||||
String8 ver_str = str8_cstring_capped((char*)(compile3 + 1), (char *)(first + cap));
|
||||
String8 compiler_name = push_str8f(arena, "%.*s %u.%u.%u",
|
||||
str8_varg(ver_str),
|
||||
compile3->ver_major,
|
||||
compile3->ver_minor,
|
||||
compile3->ver_build);
|
||||
|
||||
info_out->arch = compile3->machine;
|
||||
info_out->language = CV_Compile3Flags_ExtractLanguage(compile3->flags);;
|
||||
info_out->compiler_name = compiler_name;
|
||||
}
|
||||
}break;
|
||||
result->info.arch = compile3->machine;
|
||||
result->info.language = CV_Compile3Flags_ExtractLanguage(compile3->flags);;
|
||||
result->info.compiler_name = compiler_name;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
return result;
|
||||
}
|
||||
|
||||
//- leaf
|
||||
//- rjf: leaf stream parsing
|
||||
|
||||
internal CV_LeafParsed*
|
||||
cv_leaf_from_data(Arena *arena, String8 leaf_data, CV_TypeId itype_first){
|
||||
ProfBegin("cv_leaf_from_data");
|
||||
|
||||
internal CV_LeafParsed *
|
||||
cv_leaf_from_data(Arena *arena, String8 leaf_data, CV_TypeId itype_first)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
// gather up symbols
|
||||
@@ -318,57 +404,31 @@ cv_leaf_from_data(Arena *arena, String8 leaf_data, CV_TypeId itype_first){
|
||||
result->leaf_ranges = cv_rec_range_array_from_stream(arena, stream);
|
||||
|
||||
scratch_end(scratch);
|
||||
|
||||
ProfEnd();
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
//- range streams
|
||||
|
||||
internal CV_RecRangeChunk*
|
||||
cv_rec_range_stream_push_chunk(Arena *arena, CV_RecRangeStream *stream){
|
||||
CV_RecRangeChunk *result = push_array_no_zero(arena, CV_RecRangeChunk, 1);
|
||||
SLLQueuePush(stream->first_chunk, stream->last_chunk, result);
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal CV_RecRangeArray
|
||||
cv_rec_range_array_from_stream(Arena *arena, CV_RecRangeStream *stream){
|
||||
U64 total_count = stream->total_count;
|
||||
CV_RecRange *ranges = push_array_no_zero(arena, CV_RecRange, total_count);
|
||||
U64 idx = 0;
|
||||
for (CV_RecRangeChunk *chunk = stream->first_chunk;
|
||||
chunk != 0;
|
||||
chunk = chunk->next){
|
||||
U64 copy_count_raw = total_count - idx;
|
||||
U64 copy_count = ClampTop(copy_count_raw, CV_REC_RANGE_CHUNK_SIZE);
|
||||
MemoryCopy(ranges + idx, chunk->ranges, copy_count*sizeof(CV_RecRange));
|
||||
idx += copy_count;
|
||||
}
|
||||
CV_RecRangeArray result = {0};
|
||||
result.ranges = ranges;
|
||||
result.count = total_count;
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView C13 Parser Functions
|
||||
|
||||
internal CV_C13Parsed*
|
||||
cv_c13_from_data(Arena *arena, String8 c13_data, PDB_Strtbl *strtbl, PDB_CoffSectionArray *sections){
|
||||
ProfBegin("cv_c13_from_data");
|
||||
internal CV_C13Parsed *
|
||||
cv_c13_parsed_from_data(Arena *arena, String8 c13_data, PDB_Strtbl *strtbl, PDB_CoffSectionArray *sections)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
// gather c13 data
|
||||
//////////////////////////////
|
||||
//- rjf: gather c13 sub-sections
|
||||
//
|
||||
CV_C13SubSectionNode *file_chksms = 0;
|
||||
CV_C13SubSectionNode *first = 0;
|
||||
CV_C13SubSectionNode *last = 0;
|
||||
U64 count = 0;
|
||||
{
|
||||
U32 cursor = 0;
|
||||
for (; cursor + sizeof(CV_C13_SubSectionHeader) <= c13_data.size;){
|
||||
for(; cursor + sizeof(CV_C13SubSectionHeader) <= c13_data.size;)
|
||||
{
|
||||
// read header
|
||||
CV_C13_SubSectionHeader *hdr = (CV_C13_SubSectionHeader*)(c13_data.str + cursor);
|
||||
CV_C13SubSectionHeader *hdr = (CV_C13SubSectionHeader*)(c13_data.str + cursor);
|
||||
|
||||
// get sub section info
|
||||
U32 sub_section_off = cursor + sizeof(*hdr);
|
||||
@@ -378,15 +438,16 @@ cv_c13_from_data(Arena *arena, String8 c13_data, PDB_Strtbl *strtbl, PDB_CoffSec
|
||||
U32 sub_section_size = after_sub_section_off - sub_section_off;
|
||||
|
||||
// emit sub section
|
||||
if (!(hdr->kind & CV_C13_SubSectionKind_IgnoreFlag)){
|
||||
if(!(hdr->kind & CV_C13SubSectionKind_IgnoreFlag))
|
||||
{
|
||||
CV_C13SubSectionNode *node = push_array(arena, CV_C13SubSectionNode, 1);
|
||||
SLLQueuePush(first, last, node);
|
||||
count += 1;
|
||||
node->kind = hdr->kind;
|
||||
node->off = sub_section_off;
|
||||
node->size = sub_section_size;
|
||||
|
||||
if (hdr->kind == CV_C13_SubSectionKind_FileChksms){
|
||||
if(hdr->kind == CV_C13SubSectionKind_FileChksms)
|
||||
{
|
||||
file_chksms = node;
|
||||
}
|
||||
}
|
||||
@@ -396,112 +457,182 @@ cv_c13_from_data(Arena *arena, String8 c13_data, PDB_Strtbl *strtbl, PDB_CoffSec
|
||||
}
|
||||
}
|
||||
|
||||
// parse each section
|
||||
for (CV_C13SubSectionNode *node = first;
|
||||
node != 0;
|
||||
node = node->next){
|
||||
//////////////////////////////
|
||||
//- rjf: parse each sub-section
|
||||
//
|
||||
U64 inlinee_lines_parsed_slots_count = 4096;
|
||||
CV_C13InlineeLinesParsedNode **inlinee_lines_parsed_slots = push_array(arena, CV_C13InlineeLinesParsedNode *, inlinee_lines_parsed_slots_count);
|
||||
for(CV_C13SubSectionNode *node = first;
|
||||
node != 0;
|
||||
node = node->next)
|
||||
{
|
||||
U8 *first = c13_data.str + node->off;
|
||||
U32 cap = node->size;
|
||||
|
||||
switch (node->kind){
|
||||
case CV_C13_SubSectionKind_Lines:
|
||||
switch(node->kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: line info sub-section
|
||||
//
|
||||
case CV_C13SubSectionKind_Lines:
|
||||
if(sizeof(CV_C13SubSecLinesHeader) <= cap)
|
||||
{
|
||||
// read header
|
||||
if (sizeof(CV_C13_SubSecLinesHeader) <= cap){
|
||||
U32 read_off = 0;
|
||||
U64 read_off_opl = node->size;
|
||||
CV_C13_SubSecLinesHeader *hdr = (CV_C13_SubSecLinesHeader*)(first + read_off);
|
||||
U32 read_off = 0;
|
||||
U64 read_off_opl = node->size;
|
||||
CV_C13SubSecLinesHeader *hdr = (CV_C13SubSecLinesHeader*)(first + read_off);
|
||||
read_off += sizeof(*hdr);
|
||||
|
||||
// extract top level info
|
||||
U32 sec_idx = hdr->sec;
|
||||
B32 has_cols = !!(hdr->flags & CV_C13SubSecLinesFlag_HasColumns);
|
||||
U64 secrel_off = hdr->sec_off;
|
||||
U64 secrel_opl = secrel_off + hdr->len;
|
||||
U64 sec_base_off = sections->sections[sec_idx - 1].voff;
|
||||
|
||||
// rjf: bad section index -> skip
|
||||
if(sec_idx < 1 || sections->count < sec_idx)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// read files
|
||||
for(;read_off+sizeof(CV_C13File) <= read_off_opl;)
|
||||
{
|
||||
// rjf: grab next file header
|
||||
CV_C13File *file = (CV_C13File*)(first + read_off);
|
||||
U32 file_off = file->file_off;
|
||||
U32 line_count_unclamped = file->num_lines;
|
||||
U32 block_size = file->block_size;
|
||||
|
||||
// file_name from file_off
|
||||
String8 file_name = {0};
|
||||
if(file_off + sizeof(CV_C13Checksum) <= file_chksms->size)
|
||||
{
|
||||
CV_C13Checksum *checksum = (CV_C13Checksum*)(c13_data.str + file_chksms->off + file_off);
|
||||
U32 name_off = checksum->name_off;
|
||||
file_name = pdb_strtbl_string_from_off(strtbl, name_off);
|
||||
}
|
||||
|
||||
// array layouts
|
||||
U32 line_item_size = sizeof(CV_C13Line);
|
||||
if (has_cols){
|
||||
line_item_size += sizeof(CV_C13Column);
|
||||
}
|
||||
|
||||
U32 line_array_off = read_off + sizeof(*file);
|
||||
U32 line_count_max = (read_off_opl - line_array_off) / line_item_size;
|
||||
U32 line_count = ClampTop(line_count_unclamped, line_count_max);
|
||||
|
||||
U32 col_array_off = line_array_off + line_count*sizeof(CV_C13Line);
|
||||
|
||||
// parse lines
|
||||
U64 *voffs = push_array_no_zero(arena, U64, line_count + 1);
|
||||
U32 *line_nums = push_array_no_zero(arena, U32, line_count);
|
||||
|
||||
{
|
||||
CV_C13Line *line_ptr = (CV_C13Line*)(first + line_array_off);
|
||||
CV_C13Line *line_opl = line_ptr + line_count;
|
||||
|
||||
// TODO(allen): check order correctness here
|
||||
|
||||
U32 i = 0;
|
||||
for (; line_ptr < line_opl; line_ptr += 1, i += 1){
|
||||
voffs[i] = line_ptr->off + secrel_off + sec_base_off;
|
||||
line_nums[i] = CV_C13LineFlags_ExtractLineNumber(line_ptr->flags);
|
||||
}
|
||||
voffs[i] = secrel_opl + sec_base_off;
|
||||
}
|
||||
|
||||
// emit parsed lines
|
||||
CV_C13LinesParsedNode *lines_parsed_node = push_array(arena, CV_C13LinesParsedNode, 1);
|
||||
CV_C13LinesParsed *lines_parsed = &lines_parsed_node->v;
|
||||
lines_parsed->sec_idx = sec_idx;
|
||||
lines_parsed->file_off = file_off;
|
||||
lines_parsed->secrel_base_off = secrel_off;
|
||||
lines_parsed->file_name = file_name;
|
||||
lines_parsed->voffs = voffs;
|
||||
lines_parsed->line_nums = line_nums;
|
||||
lines_parsed->line_count = line_count;
|
||||
SLLQueuePush(node->lines_first, node->lines_last, lines_parsed_node);
|
||||
|
||||
// rjf: advance
|
||||
read_off += sizeof(*file);
|
||||
read_off += line_item_size*line_count;
|
||||
}
|
||||
}break;
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: inlinee line info sub-section
|
||||
//
|
||||
case CV_C13SubSectionKind_InlineeLines:
|
||||
if(sizeof(CV_C13InlineeLinesSig) <= cap)
|
||||
{
|
||||
// rjf: read sig
|
||||
U32 read_off = 0;
|
||||
U64 read_off_opl = node->size;
|
||||
CV_C13InlineeLinesSig *sig = (CV_C13InlineeLinesSig *)(first + read_off);
|
||||
read_off += sizeof(*sig);
|
||||
|
||||
// rjf: read source lines
|
||||
for(;read_off + sizeof(CV_C13InlineeSourceLineHeader) <= read_off_opl;)
|
||||
{
|
||||
// rjf: read next header
|
||||
CV_C13InlineeSourceLineHeader *hdr = (CV_C13InlineeSourceLineHeader *)(first + read_off);
|
||||
read_off += sizeof(*hdr);
|
||||
|
||||
// extract top level info
|
||||
U32 sec_idx = hdr->sec;
|
||||
B32 has_cols = !!(hdr->flags & CV_C13_SubSecLinesFlag_HasColumns);
|
||||
U64 secrel_off = hdr->sec_off;
|
||||
U64 secrel_opl = secrel_off + hdr->len;
|
||||
U64 sec_base_off = sections->sections[sec_idx - 1].voff;
|
||||
|
||||
// rjf: bad section index -> skip
|
||||
if(sec_idx < 1 || sections->count < sec_idx)
|
||||
// rjf: file_off -> file_name
|
||||
String8 file_name = {0};
|
||||
if(hdr->file_off + sizeof(CV_C13Checksum) <= file_chksms->size)
|
||||
{
|
||||
continue;
|
||||
CV_C13Checksum *checksum = (CV_C13Checksum*)(c13_data.str + file_chksms->off + hdr->file_off);
|
||||
U32 name_off = checksum->name_off;
|
||||
file_name = pdb_strtbl_string_from_off(strtbl, name_off);
|
||||
}
|
||||
|
||||
// read files
|
||||
for(;read_off+sizeof(CV_C13_File) <= read_off_opl;)
|
||||
// rjf: parse extra files
|
||||
U32 extra_file_count = 0;
|
||||
U32 *extra_files = 0;
|
||||
if(*sig == CV_C13InlineeLinesSig_EXTRA_FILES && read_off+sizeof(U32) <= read_off_opl)
|
||||
{
|
||||
// rjf: grab next file header
|
||||
CV_C13_File *file = (CV_C13_File*)(first + read_off);
|
||||
U32 file_off = file->file_off;
|
||||
U32 line_count_unclamped = file->num_lines;
|
||||
U32 block_size = file->block_size;
|
||||
|
||||
// file_name from file_off
|
||||
String8 file_name = {0};
|
||||
if (file_off + sizeof(CV_C13_Checksum) <= file_chksms->size){
|
||||
CV_C13_Checksum *checksum = (CV_C13_Checksum*)(c13_data.str + file_chksms->off + file_off);
|
||||
U32 name_off = checksum->name_off;
|
||||
file_name = pdb_strtbl_string_from_off(strtbl, name_off);
|
||||
}
|
||||
|
||||
// array layouts
|
||||
U32 line_item_size = sizeof(CV_C13_Line);
|
||||
if (has_cols){
|
||||
line_item_size += sizeof(CV_C13_Column);
|
||||
}
|
||||
|
||||
U32 line_array_off = read_off + sizeof(*file);
|
||||
U32 line_count_max = (read_off_opl - line_array_off) / line_item_size;
|
||||
U32 line_count = ClampTop(line_count_unclamped, line_count_max);
|
||||
|
||||
U32 col_array_off = line_array_off + line_count*sizeof(CV_C13_Line);
|
||||
|
||||
// parse lines
|
||||
U64 *voffs = push_array_no_zero(arena, U64, line_count + 1);
|
||||
U32 *line_nums = push_array_no_zero(arena, U32, line_count);
|
||||
|
||||
{
|
||||
CV_C13_Line *line_ptr = (CV_C13_Line*)(first + line_array_off);
|
||||
CV_C13_Line *line_opl = line_ptr + line_count;
|
||||
|
||||
// TODO(allen): check order correctness here
|
||||
|
||||
U32 i = 0;
|
||||
for (; line_ptr < line_opl; line_ptr += 1, i += 1){
|
||||
voffs[i] = line_ptr->off + secrel_off + sec_base_off;
|
||||
line_nums[i] = CV_C13_LineFlags_ExtractLineNumber(line_ptr->flags);
|
||||
}
|
||||
voffs[i] = secrel_opl + sec_base_off;
|
||||
}
|
||||
|
||||
// emit parsed lines
|
||||
CV_C13LinesParsedNode *lines_parsed_node = push_array(arena, CV_C13LinesParsedNode, 1);
|
||||
CV_C13LinesParsed *lines_parsed = &lines_parsed_node->v;
|
||||
lines_parsed->sec_idx = sec_idx;
|
||||
lines_parsed->file_off = file_off;
|
||||
lines_parsed->secrel_base_off = secrel_off;
|
||||
lines_parsed->file_name = file_name;
|
||||
lines_parsed->voffs = voffs;
|
||||
lines_parsed->line_nums = line_nums;
|
||||
lines_parsed->line_count = line_count;
|
||||
SLLQueuePush(node->lines_first, node->lines_last, lines_parsed_node);
|
||||
|
||||
// rjf: advance
|
||||
read_off += sizeof(*file);
|
||||
read_off += line_item_size*line_count;
|
||||
U32 *extra_file_count_ptr = (U32 *)(first + read_off);
|
||||
read_off += sizeof(*extra_file_count_ptr);
|
||||
U32 max_extra_file_count = (read_off_opl-read_off)/sizeof(U32);
|
||||
extra_file_count = Min(*extra_file_count_ptr, max_extra_file_count);
|
||||
extra_files = (U32 *)(first + read_off);
|
||||
read_off += sizeof(*extra_files)*extra_file_count;
|
||||
}
|
||||
|
||||
// rjf: push node for this inlinee lines parsed into this subsection's list
|
||||
CV_C13InlineeLinesParsedNode *n = push_array(arena, CV_C13InlineeLinesParsedNode, 1);
|
||||
SLLQueuePush(node->inlinee_lines_first, node->inlinee_lines_last, n);
|
||||
n->v.inlinee = hdr->inlinee;
|
||||
n->v.file_name = file_name;
|
||||
n->v.first_source_ln = hdr->first_source_ln;
|
||||
n->v.extra_file_count = extra_file_count;
|
||||
n->v.extra_files = extra_files;
|
||||
|
||||
// rjf: push node into inlinee parse hash table
|
||||
U64 hash = cv_hash_from_item_id(hdr->inlinee);
|
||||
U64 slot_idx = hash%inlinee_lines_parsed_slots_count;
|
||||
SLLStackPush_N(inlinee_lines_parsed_slots[slot_idx], n, hash_next);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
// convert to result
|
||||
//////////////////////////////
|
||||
//- rjf: fill output
|
||||
//
|
||||
CV_C13Parsed *result = push_array(arena, CV_C13Parsed, 1);
|
||||
result->data = c13_data;
|
||||
result->first_sub_section = first;
|
||||
result->last_sub_section = last;
|
||||
result->sub_section_count = count;
|
||||
result->file_chksms_sub_section = file_chksms;
|
||||
|
||||
result->inlinee_lines_parsed_slots = inlinee_lines_parsed_slots;
|
||||
result->inlinee_lines_parsed_slots_count = inlinee_lines_parsed_slots_count;
|
||||
ProfEnd();
|
||||
|
||||
return(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
+171
-92
@@ -27,7 +27,7 @@ read_only global CV_TypeId cv_type_id_variadic = 0xFFFFFFFF;
|
||||
////////////////////////////////
|
||||
//~ rjf: Registers
|
||||
|
||||
// X(NAME, CODE, (RDI_RegisterCode_X86) NAME, BYTE_POS, BYTE_SIZE)
|
||||
// X(NAME, CODE, (RDI_RegCode_X86) NAME, BYTE_POS, BYTE_SIZE)
|
||||
#define CV_Reg_X86_XList(X) \
|
||||
X(NONE, 0, nil, 0, 0)\
|
||||
X(AL, 1, eax, 0, 1)\
|
||||
@@ -1152,6 +1152,7 @@ struct CV_SymFrameproc
|
||||
};
|
||||
|
||||
//- (SymKind: ANNOTATION)
|
||||
|
||||
typedef struct CV_SymAnnotation CV_SymAnnotation;
|
||||
struct CV_SymAnnotation
|
||||
{
|
||||
@@ -1761,13 +1762,53 @@ struct CV_SymBuildInfo
|
||||
|
||||
//- (SymKind: INLINESITE)
|
||||
|
||||
typedef U32 CV_InlineBinaryAnnotation;
|
||||
typedef enum CV_InlineBinaryAnnotationEnum
|
||||
{
|
||||
CV_InlineBinaryAnnotation_Null,
|
||||
CV_InlineBinaryAnnotation_CodeOffset,
|
||||
CV_InlineBinaryAnnotation_ChangeCodeOffsetBase,
|
||||
CV_InlineBinaryAnnotation_ChangeCodeOffset,
|
||||
CV_InlineBinaryAnnotation_ChangeCodeLength,
|
||||
CV_InlineBinaryAnnotation_ChangeFile,
|
||||
CV_InlineBinaryAnnotation_ChangeLineOffset,
|
||||
CV_InlineBinaryAnnotation_ChangeLineEndDelta,
|
||||
CV_InlineBinaryAnnotation_ChangeRangeKind,
|
||||
CV_InlineBinaryAnnotation_ChangeColumnStart,
|
||||
CV_InlineBinaryAnnotation_ChangeColumnEndDelta,
|
||||
CV_InlineBinaryAnnotation_ChangeCodeOffsetAndLineOffset,
|
||||
CV_InlineBinaryAnnotation_ChangeCodeLengthAndCodeOffset,
|
||||
CV_InlineBinaryAnnotation_ChangeColumnEnd
|
||||
}
|
||||
CV_InlineBinaryAnnotationEnum;
|
||||
|
||||
typedef U32 CV_InlineRangeKind;
|
||||
typedef enum CV_InlineRangeKindEnum
|
||||
{
|
||||
CV_InlineRangeKind_Expr,
|
||||
CV_InlineRangeKind_Stmt
|
||||
}
|
||||
CV_InlineRangeKindEnum;
|
||||
|
||||
typedef struct CV_SymInlineSite CV_SymInlineSite;
|
||||
struct CV_SymInlineSite
|
||||
{
|
||||
U32 parent;
|
||||
U32 end;
|
||||
CV_ItemId inlinee;
|
||||
// CV_BinaryAnnotation annotations (rest of data)
|
||||
// U8 annotations[] (rest of data)
|
||||
};
|
||||
|
||||
//- (SymKind: INLINESITE2)
|
||||
|
||||
typedef struct CV_SymInlineSite2 CV_SymInlineSite2;
|
||||
struct CV_SymInlineSite2
|
||||
{
|
||||
U32 parent_off;
|
||||
U32 end_off;
|
||||
CV_ItemId inlinee;
|
||||
U32 invocations;
|
||||
// U8 annotations[] (rest of data)
|
||||
};
|
||||
|
||||
//- (SymKind: INLINESITE_END) (empty)
|
||||
@@ -1786,7 +1827,7 @@ struct CV_SymFileStatic
|
||||
//- (SymKind: ARMSWITCHTABLE)
|
||||
|
||||
typedef U16 CV_ArmSwitchKind;
|
||||
typedef enum
|
||||
typedef enum CV_ArmSwitchKindEnum
|
||||
{
|
||||
CV_ArmSwitchKind_INT1,
|
||||
CV_ArmSwitchKind_UINT1,
|
||||
@@ -1799,7 +1840,8 @@ typedef enum
|
||||
CV_ArmSwitchKind_UINT2SHL1,
|
||||
CV_ArmSwitchKind_INT1SSHL1,
|
||||
CV_ArmSwitchKind_INT2SSHL1,
|
||||
} CV_ArmSwitchKindEnum;
|
||||
}
|
||||
CV_ArmSwitchKindEnum;
|
||||
|
||||
typedef struct CV_SymArmSwitchTable CV_SymArmSwitchTable;
|
||||
struct CV_SymArmSwitchTable
|
||||
@@ -1835,18 +1877,6 @@ struct CV_SymPogoInfo
|
||||
U32 post_inline_static_inst_count;
|
||||
};
|
||||
|
||||
//- (SymKind: INLINESITE2)
|
||||
|
||||
typedef struct CV_SymInlineSite2 CV_SymInlineSite2;
|
||||
struct CV_SymInlineSite2
|
||||
{
|
||||
U32 parent_off;
|
||||
U32 end_off;
|
||||
CV_ItemId inlinee;
|
||||
U32 invocations;
|
||||
// CV_BinaryAnnotation annotations (rest of data)
|
||||
};
|
||||
|
||||
//- (SymKind: HEAPALLOCSITE)
|
||||
|
||||
typedef struct CV_SymHeapAllocSite CV_SymHeapAllocSite;
|
||||
@@ -2621,9 +2651,9 @@ struct CV_LeafUDTModSrcLine
|
||||
////////////////////////////////
|
||||
//~ CodeView Format C13 Line Info Types
|
||||
|
||||
#define CV_C13_SubSectionKind_IgnoreFlag 0x80000000
|
||||
#define CV_C13SubSectionKind_IgnoreFlag 0x80000000
|
||||
|
||||
#define CV_C13_SubSectionKindXList(X)\
|
||||
#define CV_C13SubSectionKindXList(X)\
|
||||
X(Symbols, 0xF1)\
|
||||
X(Lines, 0xF2)\
|
||||
X(StringTable, 0xF3)\
|
||||
@@ -2636,83 +2666,87 @@ X(IlLines, 0xF9)\
|
||||
X(FuncMDTokenMap, 0xFA)\
|
||||
X(TypeMDTokenMap, 0xFB)\
|
||||
X(MergedAssemblyInput, 0xFC)\
|
||||
X(CoffSymbolRVA, 0xFD)
|
||||
X(CoffSymbolRVA, 0xFD)\
|
||||
X(XfgHashType, 0xFF)\
|
||||
X(XfgHashVirtual, 0x100)
|
||||
|
||||
typedef U32 CV_C13_SubSectionKind;
|
||||
typedef enum
|
||||
typedef U32 CV_C13SubSectionKind;
|
||||
typedef enum CV_C13SubSectionKindEnum
|
||||
{
|
||||
#define X(N,c) CV_C13_SubSectionKind_##N = c,
|
||||
CV_C13_SubSectionKindXList(X)
|
||||
#define X(N,c) CV_C13SubSectionKind_##N = c,
|
||||
CV_C13SubSectionKindXList(X)
|
||||
#undef X
|
||||
} CV_C13_SubSectionKindEnum;
|
||||
}
|
||||
CV_C13SubSectionKindEnum;
|
||||
|
||||
typedef struct CV_C13_SubSectionHeader CV_C13_SubSectionHeader;
|
||||
struct CV_C13_SubSectionHeader
|
||||
typedef struct CV_C13SubSectionHeader CV_C13SubSectionHeader;
|
||||
struct CV_C13SubSectionHeader
|
||||
{
|
||||
CV_C13_SubSectionKind kind;
|
||||
CV_C13SubSectionKind kind;
|
||||
U32 size;
|
||||
};
|
||||
|
||||
//- FileChksms sub-section
|
||||
|
||||
typedef U8 CV_C13_ChecksumKind;
|
||||
typedef enum
|
||||
typedef U8 CV_C13ChecksumKind;
|
||||
typedef enum CV_C13ChecksumKindEnum
|
||||
{
|
||||
CV_C13_ChecksumKind_Null,
|
||||
CV_C13_ChecksumKind_MD5,
|
||||
CV_C13_ChecksumKind_SHA1,
|
||||
CV_C13_ChecksumKind_SHA256,
|
||||
} CV_C13_ChecksumKindEnum;
|
||||
CV_C13ChecksumKind_Null,
|
||||
CV_C13ChecksumKind_MD5,
|
||||
CV_C13ChecksumKind_SHA1,
|
||||
CV_C13ChecksumKind_SHA256,
|
||||
}
|
||||
CV_C13ChecksumKindEnum;
|
||||
|
||||
typedef struct CV_C13_Checksum CV_C13_Checksum;
|
||||
struct CV_C13_Checksum
|
||||
typedef struct CV_C13Checksum CV_C13Checksum;
|
||||
struct CV_C13Checksum
|
||||
{
|
||||
U32 name_off;
|
||||
U8 len;
|
||||
CV_C13_ChecksumKind kind;
|
||||
CV_C13ChecksumKind kind;
|
||||
};
|
||||
|
||||
//- Lines sub-section
|
||||
|
||||
typedef U16 CV_C13_SubSecLinesFlags;
|
||||
typedef U16 CV_C13SubSecLinesFlags;
|
||||
enum
|
||||
{
|
||||
CV_C13_SubSecLinesFlag_HasColumns = (1 << 0)
|
||||
CV_C13SubSecLinesFlag_HasColumns = (1 << 0)
|
||||
};
|
||||
|
||||
typedef struct CV_C13_SubSecLinesHeader CV_C13_SubSecLinesHeader;
|
||||
struct CV_C13_SubSecLinesHeader
|
||||
typedef struct CV_C13SubSecLinesHeader CV_C13SubSecLinesHeader;
|
||||
struct CV_C13SubSecLinesHeader
|
||||
{
|
||||
U32 sec_off;
|
||||
CV_SectionIndex sec;
|
||||
CV_C13_SubSecLinesFlags flags;
|
||||
CV_C13SubSecLinesFlags flags;
|
||||
U32 len;
|
||||
};
|
||||
|
||||
typedef struct CV_C13_File CV_C13_File;
|
||||
struct CV_C13_File
|
||||
typedef struct CV_C13File CV_C13File;
|
||||
struct CV_C13File
|
||||
{
|
||||
U32 file_off;
|
||||
U32 num_lines;
|
||||
U32 block_size;
|
||||
// CV_C13_Line[num_lines] lines;
|
||||
// CV_C13_Column[num_lines] columns; (if HasColumns)
|
||||
// CV_C13Line[num_lines] lines;
|
||||
// CV_C13Column[num_lines] columns; (if HasColumns)
|
||||
};
|
||||
|
||||
typedef U32 CV_C13_LineFlags;
|
||||
#define CV_C13_LineFlags_ExtractLineNumber(f) ((f)&0xFFFFFF)
|
||||
#define CV_C13_LineFlags_ExtractDeltaToEnd(f) (((f)>>24)&0x7F)
|
||||
#define CV_C13_LineFlags_ExtractStatement(f) (((f)>>31)&0x1)
|
||||
typedef U32 CV_C13LineFlags;
|
||||
#define CV_C13LineFlags_ExtractLineNumber(f) ((f)&0xFFFFFF)
|
||||
#define CV_C13LineFlags_ExtractDeltaToEnd(f) (((f)>>24)&0x7F)
|
||||
#define CV_C13LineFlags_ExtractStatement(f) (((f)>>31)&0x1)
|
||||
|
||||
typedef struct CV_C13_Line CV_C13_Line;
|
||||
struct CV_C13_Line
|
||||
typedef struct CV_C13Line CV_C13Line;
|
||||
struct CV_C13Line
|
||||
{
|
||||
U32 off;
|
||||
CV_C13_LineFlags flags;
|
||||
CV_C13LineFlags flags;
|
||||
};
|
||||
|
||||
typedef struct CV_C13_Column CV_C13_Column;
|
||||
struct CV_C13_Column
|
||||
typedef struct CV_C13Column CV_C13Column;
|
||||
struct CV_C13Column
|
||||
{
|
||||
U16 start;
|
||||
U16 end;
|
||||
@@ -2720,16 +2754,16 @@ struct CV_C13_Column
|
||||
|
||||
//- FrameData sub-section
|
||||
|
||||
typedef U32 CV_C13_FrameDataFlags;
|
||||
typedef U32 CV_C13FrameDataFlags;
|
||||
enum
|
||||
{
|
||||
CV_C13_FrameDataFlag_HasStructuredExceptionHandling = (1 << 0),
|
||||
CV_C13_FrameDataFlag_HasExceptionHandling = (1 << 1),
|
||||
CV_C13_FrameDataFlag_HasIsFuncStart = (1 << 2),
|
||||
CV_C13FrameDataFlag_HasStructuredExceptionHandling = (1 << 0),
|
||||
CV_C13FrameDataFlag_HasExceptionHandling = (1 << 1),
|
||||
CV_C13FrameDataFlag_HasIsFuncStart = (1 << 2),
|
||||
};
|
||||
|
||||
typedef struct CV_C13_FrameData CV_C13_FrameData;
|
||||
struct CV_C13_FrameData
|
||||
typedef struct CV_C13FrameData CV_C13FrameData;
|
||||
struct CV_C13FrameData
|
||||
{
|
||||
U32 start_voff;
|
||||
U32 code_size;
|
||||
@@ -2739,7 +2773,27 @@ struct CV_C13_FrameData
|
||||
U32 frame_func;
|
||||
U16 prolog_size;
|
||||
U16 saved_reg_size;
|
||||
CV_C13_FrameDataFlags flags;
|
||||
CV_C13FrameDataFlags flags;
|
||||
};
|
||||
|
||||
//- InlineLines sub-section
|
||||
|
||||
typedef U32 CV_C13InlineeLinesSig;
|
||||
enum
|
||||
{
|
||||
CV_C13InlineeLinesSig_NORMAL,
|
||||
CV_C13InlineeLinesSig_EXTRA_FILES,
|
||||
};
|
||||
|
||||
typedef struct CV_C13InlineeSourceLineHeader CV_C13InlineeSourceLineHeader;
|
||||
struct CV_C13InlineeSourceLineHeader
|
||||
{
|
||||
CV_ItemId inlinee; // LF_FUNC_ID or LF_MFUNC_ID
|
||||
U32 file_off; // offset into FileChksms sub-section
|
||||
U32 first_source_ln; // base source line number for binary annotations
|
||||
// if sig set to CV_C13InlineeLinesSig_EXTRA_FILES
|
||||
// U32 extra_file_count;
|
||||
// U32 files[];
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
@@ -2817,7 +2871,6 @@ struct CV_SymParsed
|
||||
CV_SymTopLevelInfo info;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView Leaf Parser Types
|
||||
|
||||
@@ -2859,26 +2912,54 @@ struct CV_C13LinesParsedNode
|
||||
CV_C13LinesParsed v;
|
||||
};
|
||||
|
||||
typedef struct CV_C13InlineeLinesParsed CV_C13InlineeLinesParsed;
|
||||
struct CV_C13InlineeLinesParsed
|
||||
{
|
||||
CV_ItemId inlinee;
|
||||
String8 file_name;
|
||||
U32 first_source_ln;
|
||||
U32 extra_file_count;
|
||||
U32 *extra_files;
|
||||
};
|
||||
|
||||
typedef struct CV_C13InlineeLinesParsedNode CV_C13InlineeLinesParsedNode;
|
||||
struct CV_C13InlineeLinesParsedNode
|
||||
{
|
||||
CV_C13InlineeLinesParsedNode *next;
|
||||
CV_C13InlineeLinesParsedNode *hash_next;
|
||||
CV_C13InlineeLinesParsed v;
|
||||
};
|
||||
|
||||
typedef struct CV_C13SubSectionNode CV_C13SubSectionNode;
|
||||
struct CV_C13SubSectionNode
|
||||
{
|
||||
struct CV_C13SubSectionNode *next;
|
||||
CV_C13_SubSectionKind kind;
|
||||
CV_C13SubSectionKind kind;
|
||||
U32 off;
|
||||
U32 size;
|
||||
CV_C13LinesParsedNode *lines_first;
|
||||
CV_C13LinesParsedNode *lines_last;
|
||||
CV_C13InlineeLinesParsedNode *inlinee_lines_first;
|
||||
CV_C13InlineeLinesParsedNode *inlinee_lines_last;
|
||||
};
|
||||
|
||||
typedef struct CV_C13Parsed CV_C13Parsed;
|
||||
struct CV_C13Parsed
|
||||
{
|
||||
// rjf: source data
|
||||
String8 data;
|
||||
|
||||
// rjf: full sub-section list
|
||||
CV_C13SubSectionNode *first_sub_section;
|
||||
CV_C13SubSectionNode *last_sub_section;
|
||||
U64 sub_section_count;
|
||||
|
||||
// accelerator
|
||||
// rjf: fastpath to file checksums section
|
||||
CV_C13SubSectionNode *file_chksms_sub_section;
|
||||
|
||||
// rjf: fastpath to map inlinee CV_ItemId -> CV_InlineeLinesParsed quickly
|
||||
CV_C13InlineeLinesParsedNode **inlinee_lines_parsed_slots;
|
||||
U64 inlinee_lines_parsed_slots_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -2891,48 +2972,46 @@ struct CV_TypeIdArray
|
||||
U64 count;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView Common Functions
|
||||
//~ CodeView Common Decoding Helper Functions
|
||||
|
||||
internal U64 cv_hash_from_string(String8 string);
|
||||
internal U64 cv_hash_from_item_id(CV_ItemId item_id);
|
||||
|
||||
internal CV_NumericParsed cv_numeric_from_data_range(U8 *first, U8 *opl);
|
||||
|
||||
internal B32 cv_numeric_fits_in_u64(CV_NumericParsed *num);
|
||||
internal B32 cv_numeric_fits_in_s64(CV_NumericParsed *num);
|
||||
internal B32 cv_numeric_fits_in_f64(CV_NumericParsed *num);
|
||||
internal B32 cv_numeric_fits_in_u64(CV_NumericParsed *num);
|
||||
internal B32 cv_numeric_fits_in_s64(CV_NumericParsed *num);
|
||||
internal B32 cv_numeric_fits_in_f64(CV_NumericParsed *num);
|
||||
|
||||
internal U64 cv_u64_from_numeric(CV_NumericParsed *num);
|
||||
internal S64 cv_s64_from_numeric(CV_NumericParsed *num);
|
||||
internal F64 cv_f64_from_numeric(CV_NumericParsed *num);
|
||||
|
||||
internal U64 cv_decode_inline_annot_u32(String8 data, U64 offset, U32 *out_value);
|
||||
internal U64 cv_decode_inline_annot_s32(String8 data, U64 offset, S32 *out_value);
|
||||
|
||||
internal S32 cv_inline_annot_signed_from_unsigned_operand(U32 value);
|
||||
|
||||
internal U64 cv_u64_from_numeric(CV_NumericParsed *num);
|
||||
internal S64 cv_s64_from_numeric(CV_NumericParsed *num);
|
||||
internal F64 cv_f64_from_numeric(CV_NumericParsed *num);
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView Sym/Leaf Parser Functions
|
||||
//~ CodeView Parsing Functions
|
||||
|
||||
//- the first pass parser
|
||||
internal CV_RecRangeStream* cv_rec_range_stream_from_data(Arena *arena, String8 data, U64 align);
|
||||
//- rjf: record range stream parsing
|
||||
internal CV_RecRangeStream *cv_rec_range_stream_from_data(Arena *arena, String8 data, U64 align);
|
||||
internal CV_RecRangeArray cv_rec_range_array_from_stream(Arena *arena, CV_RecRangeStream *stream);
|
||||
|
||||
//- sym
|
||||
internal CV_SymParsed* cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align);
|
||||
//- rjf: sym stream parsing
|
||||
internal CV_SymParsed *cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align);
|
||||
|
||||
internal void cv_sym_top_level_info_from_syms(Arena *arena, String8 sym_data,
|
||||
CV_RecRangeArray *ranges,
|
||||
CV_SymTopLevelInfo *info_out);
|
||||
|
||||
//- leaf
|
||||
internal CV_LeafParsed* cv_leaf_from_data(Arena *arena, String8 leaf_data, CV_TypeId first);
|
||||
|
||||
//- range streams
|
||||
internal CV_RecRangeChunk* cv_rec_range_stream_push_chunk(Arena *arena,
|
||||
CV_RecRangeStream *stream);
|
||||
// TODO(allen): check why this isn't a pointer return -
|
||||
// leave a note if there's a good reason, otherwise switch to pointer return
|
||||
internal CV_RecRangeArray cv_rec_range_array_from_stream(Arena *arena, CV_RecRangeStream *stream);
|
||||
//- rjf: leaf stream parsing
|
||||
internal CV_LeafParsed *cv_leaf_from_data(Arena *arena, String8 leaf_data, CV_TypeId first);
|
||||
|
||||
////////////////////////////////
|
||||
//~ CodeView C13 Parser Functions
|
||||
|
||||
typedef struct PDB_Strtbl PDB_Strtbl;
|
||||
typedef struct PDB_CoffSectionArray PDB_CoffSectionArray;
|
||||
internal CV_C13Parsed* cv_c13_from_data(Arena *arena, String8 c13_data, struct PDB_Strtbl *strtbl, struct PDB_CoffSectionArray *sections);
|
||||
internal CV_C13Parsed *cv_c13_parsed_from_data(Arena *arena, String8 c13_data, struct PDB_Strtbl *strtbl, struct PDB_CoffSectionArray *sections);
|
||||
|
||||
#endif // CODEVIEW_H
|
||||
|
||||
@@ -49,12 +49,12 @@ cv_stringize_lvar_addr_gap_list(Arena *arena, String8List *out, void *first, voi
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_c13_sub_section_kind(CV_C13_SubSectionKind kind){
|
||||
cv_string_from_c13_sub_section_kind(CV_C13SubSectionKind kind){
|
||||
String8 result = str8_lit("UNRECOGNIZED_C13_SUB_SECTION_KIND");
|
||||
switch (kind){
|
||||
case 0: str8_lit("PARSE_ERROR"); break;
|
||||
#define X(N,c) case CV_C13_SubSectionKind_##N: result = str8_lit(#N); break;
|
||||
CV_C13_SubSectionKindXList(X)
|
||||
#define X(N,c) case CV_C13SubSectionKind_##N: result = str8_lit(#N); break;
|
||||
CV_C13SubSectionKindXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
@@ -2280,7 +2280,7 @@ cv_stringize_c13_parsed(Arena *arena, String8List *out, CV_C13Parsed *c13){
|
||||
|
||||
switch(node->kind)
|
||||
{
|
||||
case CV_C13_SubSectionKind_Lines:
|
||||
case CV_C13SubSectionKind_Lines:
|
||||
{
|
||||
if (node->lines_first == 0)
|
||||
{
|
||||
@@ -2309,12 +2309,12 @@ cv_stringize_c13_parsed(Arena *arena, String8List *out, CV_C13Parsed *c13){
|
||||
}
|
||||
}break;
|
||||
|
||||
case CV_C13_SubSectionKind_FileChksms:
|
||||
case CV_C13SubSectionKind_FileChksms:
|
||||
{
|
||||
str8_list_push(arena, out, str8_lit(" no stringizer path\n"));
|
||||
}break;
|
||||
|
||||
case CV_C13_SubSectionKind_InlineeLines:
|
||||
case CV_C13SubSectionKind_InlineeLines:
|
||||
{
|
||||
str8_list_push(arena, out, str8_lit(" no stringizer path\n"));
|
||||
}break;
|
||||
|
||||
@@ -27,7 +27,7 @@ internal void cv_stringize_lvar_addr_gap_list(Arena *arena, String8List *out,
|
||||
void *first, void *opl);
|
||||
|
||||
internal String8 cv_string_from_basic_type(CV_BasicType basic_type);
|
||||
internal String8 cv_string_from_c13_sub_section_kind(CV_C13_SubSectionKind kind);
|
||||
internal String8 cv_string_from_c13_sub_section_kind(CV_C13SubSectionKind kind);
|
||||
internal String8 cv_string_from_reg(CV_Arch arch, CV_Reg reg);
|
||||
internal String8 cv_string_from_pointer_kind(CV_PointerKind ptr_kind);
|
||||
internal String8 cv_string_from_pointer_mode(CV_PointerMode ptr_mode);
|
||||
|
||||
@@ -701,6 +701,3 @@ case CV_LeafKind_STRUCT2:{result = sizeof(CV_LeafStruct2);}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
C_LINKAGE_BEGIN
|
||||
C_LINKAGE_END
|
||||
|
||||
|
||||
@@ -517,7 +517,4 @@ internal String8 cv_type_name_from_basic_type(CV_BasicType v);
|
||||
internal String8 cv_string_from_leaf_kind(CV_LeafKind v);
|
||||
internal U64 cv_header_struct_size_from_sym_kind(CV_SymKind v);
|
||||
internal U64 cv_header_struct_size_from_leaf_kind(CV_LeafKind v);
|
||||
C_LINKAGE_BEGIN
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // CODEVIEW_META_H
|
||||
|
||||
+1973
-324
File diff suppressed because it is too large
Load Diff
+123
-8
@@ -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;
|
||||
@@ -507,6 +579,7 @@ struct CTRL_State
|
||||
|
||||
// rjf: ctrl -> user event ring buffer
|
||||
U64 c2u_ring_size;
|
||||
U64 c2u_ring_max_string_size;
|
||||
U8 *c2u_ring_base;
|
||||
U64 c2u_ring_write_pos;
|
||||
U64 c2u_ring_read_pos;
|
||||
@@ -514,7 +587,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,12 +626,19 @@ 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
|
||||
|
||||
internal U64 ctrl_hash_from_string(String8 string);
|
||||
internal U64 ctrl_hash_from_machine_id_handle(CTRL_MachineID machine_id, DMN_Handle handle);
|
||||
internal CTRL_EventCause ctrl_event_cause_from_dmn_event_kind(DMN_EventKind event_kind);
|
||||
internal String8 ctrl_string_from_event_kind(CTRL_EventKind kind);
|
||||
internal String8 ctrl_string_from_msg_kind(CTRL_MsgKind kind);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Machine/Handle Pair Type Functions
|
||||
@@ -597,7 +679,7 @@ internal CTRL_Event *ctrl_event_list_push(Arena *arena, CTRL_EventList *list);
|
||||
internal void ctrl_event_list_concat_in_place(CTRL_EventList *dst, CTRL_EventList *to_push);
|
||||
|
||||
//- rjf: serialization
|
||||
internal String8 ctrl_serialized_string_from_event(Arena *arena, CTRL_Event *event);
|
||||
internal String8 ctrl_serialized_string_from_event(Arena *arena, CTRL_Event *event, U64 max);
|
||||
internal CTRL_Event ctrl_event_from_serialized_string(Arena *arena, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -608,6 +690,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 +703,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 +731,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);
|
||||
@@ -658,13 +744,34 @@ internal B32 ctrl_process_write(CTRL_MachineID machine_id, DMN_Handle process, R
|
||||
internal void *ctrl_query_cached_reg_block_from_thread(Arena *arena, CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle thread);
|
||||
internal U64 ctrl_query_cached_tls_root_vaddr_from_thread(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle thread);
|
||||
internal U64 ctrl_query_cached_rip_from_thread(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle thread);
|
||||
internal U64 ctrl_query_cached_rsp_from_thread(CTRL_EntityStore *store, CTRL_MachineID machine_id, DMN_Handle thread);
|
||||
|
||||
//- 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 +809,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);
|
||||
internal void ctrl_thread__module_close(CTRL_MachineID machine_id, DMN_Handle module);
|
||||
|
||||
//- 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);
|
||||
|
||||
@@ -54,6 +54,7 @@ extern U32 ctrl_exception_code_kind_code_table[38];
|
||||
extern String8 ctrl_exception_code_kind_display_string_table[38];
|
||||
extern String8 ctrl_exception_code_kind_lowercase_code_string_table[38];
|
||||
extern B8 ctrl_exception_code_kind_default_enable_table[38];
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // CTRL_META_H
|
||||
|
||||
+240
-101
@@ -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
|
||||
|
||||
@@ -54,10 +69,14 @@ dasm_inst_array_idx_from_code_off__linear_scan(DASM_InstArray *array, U64 off)
|
||||
U64 result = 0;
|
||||
for(U64 idx = 0; idx < array->count; idx += 1)
|
||||
{
|
||||
if(array->v[idx].code_off == off)
|
||||
U64 next_off = (idx+1 < array->count ? array->v[idx+1].code_off : max_U64);
|
||||
if(array->v[idx].code_off <= off && off < next_off)
|
||||
{
|
||||
result = idx;
|
||||
break;
|
||||
if(!(array->v[idx].flags & DASM_InstFlag_Decorative))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -103,7 +122,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 +153,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 +173,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 +201,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 +215,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 +232,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 +240,16 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
|
||||
}
|
||||
if(node == 0)
|
||||
{
|
||||
LogInfoNamedBlockF("dasm_new_node")
|
||||
{
|
||||
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 +262,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 +301,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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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,23 +338,30 @@ 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, ¶ms_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, ¶ms_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, ¶ms_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, ¶ms_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, ¶ms_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, ¶ms_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, ¶ms_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);
|
||||
}
|
||||
os_condition_variable_broadcast(dasm_shared->u2p_ring_mutex);
|
||||
os_condition_variable_broadcast(dasm_shared->u2p_ring_cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
@@ -364,12 +374,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, ¶ms);
|
||||
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 +393,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, ¶ms))
|
||||
{
|
||||
got_task = !ins_atomic_u32_eval_cond_assign(&n->is_working, 1, 0);
|
||||
break;
|
||||
@@ -395,6 +401,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, ¶ms.dbgi_key, max_U64);
|
||||
}
|
||||
|
||||
//- rjf: hash -> data
|
||||
String8 data = {0};
|
||||
if(got_task)
|
||||
@@ -402,12 +415,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 +431,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_nil_element_union.source_file;
|
||||
RDI_Line *last_line = 0;
|
||||
for(U64 off = 0; off < data.size;)
|
||||
{
|
||||
// rjf: disassemble one instruction
|
||||
@@ -438,15 +452,97 @@ 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_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, voff);
|
||||
RDI_Unit *unit = rdi_element_from_name_idx(rdi, Units, unit_idx);
|
||||
RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, unit->line_table_idx);
|
||||
RDI_ParsedLineTable unit_line_info = {0};
|
||||
rdi_parsed_from_line_table(rdi, line_table, &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_name_idx(rdi, SourceFiles, 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)
|
||||
{
|
||||
String8 inst_string = push_str8f(scratch.arena, "> %S", file_normalized_full_path);
|
||||
DASM_Inst inst = {u32_from_u64_saturate(off), DASM_InstFlag_Decorative, 0, 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);
|
||||
str8_list_push(scratch.arena, &inst_strings, inst_string);
|
||||
}
|
||||
if(params.style_flags & DASM_StyleFlag_SourceFilesNames && file->normal_full_path_string_idx == 0)
|
||||
{
|
||||
String8 inst_string = str8_lit(">");
|
||||
DASM_Inst inst = {u32_from_u64_saturate(off), DASM_InstFlag_Decorative, 0, 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);
|
||||
str8_list_push(scratch.arena, &inst_strings, inst_string);
|
||||
}
|
||||
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)
|
||||
{
|
||||
String8 inst_string = push_str8f(scratch.arena, "> %S", line_text);
|
||||
DASM_Inst inst = {u32_from_u64_saturate(off), DASM_InstFlag_Decorative, 0, 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);
|
||||
str8_list_push(scratch.arena, &inst_strings, inst_string);
|
||||
}
|
||||
}
|
||||
}
|
||||
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, "%s0x%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,9 +560,26 @@ 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);
|
||||
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)};
|
||||
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_section_kind_voff(rdi, RDI_SectionKind_ScopeVMap, jump_dst_vaddr-params.base_vaddr);
|
||||
if(scope_idx != 0)
|
||||
{
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, scope_idx);
|
||||
RDI_U32 procedure_idx = scope->proc_idx;
|
||||
RDI_Procedure *procedure = rdi_element_from_name_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 = {u32_from_u64_saturate(off), 0, 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);
|
||||
str8_list_push(scratch.arena, &inst_strings, inst_string);
|
||||
|
||||
@@ -495,10 +608,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 +632,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, ¶ms))
|
||||
{
|
||||
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 +651,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 +693,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 +720,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);
|
||||
}
|
||||
}
|
||||
|
||||
+48
-21
@@ -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,13 +25,34 @@ 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
|
||||
|
||||
typedef U32 DASM_InstFlags;
|
||||
enum
|
||||
{
|
||||
DASM_InstFlag_Decorative = (1<<0),
|
||||
};
|
||||
|
||||
typedef struct DASM_Inst DASM_Inst;
|
||||
struct DASM_Inst
|
||||
{
|
||||
U64 code_off;
|
||||
U32 code_off;
|
||||
DASM_InstFlags flags;
|
||||
U64 addr;
|
||||
Rng1U64 text_range;
|
||||
};
|
||||
@@ -80,10 +104,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 +119,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 +147,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 +155,7 @@ struct DASM_Scope
|
||||
{
|
||||
DASM_Scope *next;
|
||||
DASM_Touch *top_touch;
|
||||
U64 base_pos;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -141,8 +165,6 @@ typedef struct DASM_TCTX DASM_TCTX;
|
||||
struct DASM_TCTX
|
||||
{
|
||||
Arena *arena;
|
||||
DASM_Scope *free_scope;
|
||||
DASM_Touch *free_touch;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -174,8 +196,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 +206,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 +240,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
|
||||
|
||||
+622
-1082
File diff suppressed because it is too large
Load Diff
+168
-344
@@ -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,71 @@ 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 =
|
||||
{
|
||||
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,
|
||||
},
|
||||
};
|
||||
global DI_Shared *di_shared = 0;
|
||||
thread_static DI_TCTX *di_tctx = 0;
|
||||
global RDI_Parsed di_rdi_parsed_nil = {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 DI_Key di_key_zero(void);
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
typedef struct DMN_CtrlCtx DMN_CtrlCtx;
|
||||
struct DMN_CtrlCtx
|
||||
{
|
||||
U64 u64 [1];
|
||||
U64 u64[1];
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -217,6 +217,11 @@ internal void dmn_access_close(void);
|
||||
#define DMN_AccessScope DeferLoopChecked(dmn_access_open(), dmn_access_close())
|
||||
|
||||
//- rjf: processes
|
||||
internal U64 dmn_process_memory_reserve(DMN_Handle process, U64 vaddr, U64 size);
|
||||
internal void dmn_process_memory_commit(DMN_Handle process, U64 vaddr, U64 size);
|
||||
internal void dmn_process_memory_decommit(DMN_Handle process, U64 vaddr, U64 size);
|
||||
internal void dmn_process_memory_release(DMN_Handle process, U64 vaddr, U64 size);
|
||||
internal void dmn_process_memory_protect(DMN_Handle process, U64 vaddr, U64 size, OS_AccessFlags flags);
|
||||
internal U64 dmn_process_read(DMN_Handle process, Rng1U64 range, void *dst);
|
||||
internal B32 dmn_process_write(DMN_Handle process, Rng1U64 range, void *src);
|
||||
#define dmn_process_read_struct(process, vaddr, ptr) dmn_process_read((process), r1u64((vaddr), (vaddr)+(sizeof(*ptr))), ptr)
|
||||
|
||||
@@ -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)")`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -58,6 +58,9 @@ 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
|
||||
|
||||
+860
-655
File diff suppressed because it is too large
Load Diff
@@ -54,6 +54,8 @@
|
||||
#define DMN_W32_EXCEPTION_NO_MEMORY 0xC0000017u
|
||||
#define DMN_W32_EXCEPTION_THROW 0xE06D7363u
|
||||
#define DMN_W32_EXCEPTION_SET_THREAD_NAME 0x406d1388u
|
||||
#define DMN_w32_EXCEPTION_CLRDBG_NOTIFICATION 0x04242420u
|
||||
#define DMN_w32_EXCEPTION_CLR 0xE0434352u
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Win32 Register Codes
|
||||
@@ -61,11 +63,11 @@
|
||||
#define DMN_W32_CTX_X86 0x00010000
|
||||
#define DMN_W32_CTX_X64 0x00100000
|
||||
|
||||
#define DMN_W32_CTX_INTEL_CONTROL 0x0001
|
||||
#define DMN_W32_CTX_INTEL_INTEGER 0x0002
|
||||
#define DMN_W32_CTX_INTEL_SEGMENTS 0x0004
|
||||
#define DMN_W32_CTX_INTEL_FLOATS 0x0008
|
||||
#define DMN_W32_CTX_INTEL_DEBUG 0x0010
|
||||
#define DMN_W32_CTX_INTEL_CONTROL 0x0001 // segss, rsp, segcs, rip, and rflags
|
||||
#define DMN_W32_CTX_INTEL_INTEGER 0x0002 // rax, rcx, rdx, rbx, rbp, rsi, rdi, and r8-r15
|
||||
#define DMN_W32_CTX_INTEL_SEGMENTS 0x0004 // segds, seges, segfs, and seggs
|
||||
#define DMN_W32_CTX_INTEL_FLOATS 0x0008 // xmm0-xmm15
|
||||
#define DMN_W32_CTX_INTEL_DEBUG 0x0010 // dr0-dr3 and dr6-dr7
|
||||
#define DMN_W32_CTX_INTEL_EXTENDED 0x0020
|
||||
#define DMN_W32_CTX_INTEL_XSTATE 0x0040
|
||||
|
||||
@@ -118,9 +120,6 @@ struct DMN_W32_Entity
|
||||
U64 thread_local_base;
|
||||
U64 last_name_hash;
|
||||
U64 name_gather_time_us;
|
||||
B32 last_run_reported_trap;
|
||||
U64 last_run_reported_trap_pre_rip;
|
||||
U64 last_run_reported_trap_post_rip;
|
||||
}
|
||||
thread;
|
||||
struct
|
||||
|
||||
+1336
-637
File diff suppressed because it is too large
Load Diff
+226
-75
@@ -77,6 +77,7 @@ struct DF_CtrlCtx
|
||||
{
|
||||
DF_Handle thread;
|
||||
U64 unwind_count;
|
||||
U64 inline_unwind_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -87,8 +88,8 @@ enum
|
||||
{
|
||||
DF_EntityKindFlag_LeafMutationUserConfig = (1<<0),
|
||||
DF_EntityKindFlag_TreeMutationUserConfig = (1<<1),
|
||||
DF_EntityKindFlag_LeafMutationProfileConfig= (1<<2),
|
||||
DF_EntityKindFlag_TreeMutationProfileConfig= (1<<3),
|
||||
DF_EntityKindFlag_LeafMutationProjectConfig= (1<<2),
|
||||
DF_EntityKindFlag_TreeMutationProjectConfig= (1<<3),
|
||||
DF_EntityKindFlag_LeafMutationSoftHalt = (1<<4),
|
||||
DF_EntityKindFlag_TreeMutationSoftHalt = (1<<5),
|
||||
DF_EntityKindFlag_LeafMutationDebugInfoMap = (1<<6),
|
||||
@@ -222,7 +223,7 @@ typedef struct DF_CtrlFlowPointNode DF_CtrlFlowPointNode;
|
||||
struct DF_CtrlFlowPointNode
|
||||
{
|
||||
DF_CtrlFlowPointNode *next;
|
||||
DF_CtrlFlowPoint point;
|
||||
DF_CtrlFlowPoint v;
|
||||
};
|
||||
|
||||
typedef struct DF_CtrlFlowPointList DF_CtrlFlowPointList;
|
||||
@@ -265,10 +266,15 @@ 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)
|
||||
typedef struct DF_CfgNode DF_CfgNode;
|
||||
typedef struct DF_CfgVal DF_CfgVal;
|
||||
typedef struct DF_CfgTable DF_CfgTable;
|
||||
typedef struct DF_EvalView DF_EvalView;
|
||||
typedef struct DF_EvalVizBlockList DF_EvalVizBlockList;
|
||||
#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, 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, DF_EvalView *eval_view, DF_Eval eval, String8 string, DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, 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 +360,7 @@ struct DF_CoreViewRuleSpecInfo
|
||||
{
|
||||
String8 string;
|
||||
String8 display_string;
|
||||
String8 schema;
|
||||
String8 description;
|
||||
DF_CoreViewRuleSpecInfoFlags flags;
|
||||
DF_CoreViewRuleEvalResolutionHookFunctionType *eval_resolution;
|
||||
@@ -377,8 +384,6 @@ struct DF_CoreViewRuleSpec
|
||||
////////////////////////////////
|
||||
//~ rjf: Entity Types
|
||||
|
||||
typedef U32 DF_EntitySubKind;
|
||||
|
||||
typedef U32 DF_EntityFlags;
|
||||
enum
|
||||
{
|
||||
@@ -426,7 +431,6 @@ struct DF_Entity
|
||||
|
||||
// rjf: metadata
|
||||
DF_EntityKind kind;
|
||||
DF_EntitySubKind subkind;
|
||||
DF_EntityFlags flags;
|
||||
DF_EntityID id;
|
||||
U64 generation;
|
||||
@@ -510,6 +514,83 @@ struct DF_EntityFuzzyItemArray
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Rich (Including Inline) Unwind Types
|
||||
|
||||
typedef struct DF_UnwindFrame DF_UnwindFrame;
|
||||
struct DF_UnwindFrame
|
||||
{
|
||||
void *regs;
|
||||
RDI_Parsed *rdi;
|
||||
RDI_Procedure *procedure;
|
||||
RDI_InlineSite *inline_site;
|
||||
U64 base_unwind_idx;
|
||||
U64 inline_unwind_idx;
|
||||
};
|
||||
|
||||
typedef struct DF_UnwindFrameNode DF_UnwindFrameNode;
|
||||
struct DF_UnwindFrameNode
|
||||
{
|
||||
DF_UnwindFrameNode *next;
|
||||
DF_UnwindFrame v;
|
||||
};
|
||||
|
||||
typedef struct DF_UnwindFrameList DF_UnwindFrameList;
|
||||
struct DF_UnwindFrameList
|
||||
{
|
||||
DF_UnwindFrameNode *first;
|
||||
DF_UnwindFrameNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_UnwindFrameArray DF_UnwindFrameArray;
|
||||
struct DF_UnwindFrameArray
|
||||
{
|
||||
DF_UnwindFrame *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_Unwind DF_Unwind;
|
||||
struct DF_Unwind
|
||||
{
|
||||
DF_UnwindFrameArray frames;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Line Info Types
|
||||
|
||||
typedef struct DF_Line DF_Line;
|
||||
struct DF_Line
|
||||
{
|
||||
DF_Handle file;
|
||||
TxtPt pt;
|
||||
Rng1U64 voff_range;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
typedef struct DF_LineNode DF_LineNode;
|
||||
struct DF_LineNode
|
||||
{
|
||||
DF_LineNode *next;
|
||||
DF_Line v;
|
||||
};
|
||||
|
||||
typedef struct DF_LineList DF_LineList;
|
||||
struct DF_LineList
|
||||
{
|
||||
DF_LineNode *first;
|
||||
DF_LineNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_LineListArray DF_LineListArray;
|
||||
struct DF_LineListArray
|
||||
{
|
||||
DF_LineList *v;
|
||||
U64 count;
|
||||
DI_KeyList dbgi_keys;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Source <-> Disasm Types
|
||||
|
||||
@@ -520,7 +601,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 +623,7 @@ typedef struct DF_TextLineSrc2DasmInfoListArray DF_TextLineSrc2DasmInfoListArray
|
||||
struct DF_TextLineSrc2DasmInfoListArray
|
||||
{
|
||||
DF_TextLineSrc2DasmInfoList *v;
|
||||
DF_EntityList binaries;
|
||||
DI_KeyList dbgi_keys;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
@@ -551,7 +632,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;
|
||||
@@ -572,6 +653,38 @@ struct DF_TextLineDasm2SrcInfoList
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Interaction Context Register Types
|
||||
|
||||
typedef struct DF_InteractRegs DF_InteractRegs;
|
||||
struct DF_InteractRegs
|
||||
{
|
||||
DF_Handle module;
|
||||
DF_Handle process;
|
||||
DF_Handle thread;
|
||||
U64 unwind_count;
|
||||
U64 inline_unwind_count;
|
||||
DF_Handle window;
|
||||
DF_Handle panel;
|
||||
DF_Handle view;
|
||||
DF_Handle file;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
U128 text_key;
|
||||
TXT_LangKind lang_kind;
|
||||
Rng1U64 vaddr_range;
|
||||
Rng1U64 voff_range;
|
||||
DF_LineList lines;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
typedef struct DF_InteractRegsNode DF_InteractRegsNode;
|
||||
struct DF_InteractRegsNode
|
||||
{
|
||||
DF_InteractRegsNode *next;
|
||||
DF_InteractRegs v;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Visualization Types
|
||||
|
||||
@@ -707,8 +820,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 +887,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 +1033,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 +1120,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;
|
||||
};
|
||||
@@ -1091,10 +1234,18 @@ struct DF_State
|
||||
F32 dt;
|
||||
F32 seconds_til_autosave;
|
||||
|
||||
// rjf: interaction registers
|
||||
Arena *frame_arenas[2];
|
||||
DF_InteractRegsNode base_interact_regs;
|
||||
DF_InteractRegsNode *top_interact_regs;
|
||||
|
||||
// rjf: top-level command batch
|
||||
Arena *root_cmd_arena;
|
||||
DF_CmdList root_cmds;
|
||||
|
||||
// rjf: output log key
|
||||
U128 output_log_key;
|
||||
|
||||
// rjf: history cache
|
||||
DF_StateDeltaHistory *hist;
|
||||
|
||||
@@ -1116,14 +1267,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];
|
||||
@@ -1167,7 +1314,6 @@ struct DF_State
|
||||
Arena *ctrl_msg_arena;
|
||||
CTRL_MsgList ctrl_msgs;
|
||||
U64 ctrl_exception_code_filters[(CTRL_ExceptionCodeKind_COUNT+63)/64];
|
||||
B32 ctrl_solo_stepping_mode;
|
||||
|
||||
// rjf: control thread ctrl -> user reading state
|
||||
CTRL_EntityStore *ctrl_entity_store;
|
||||
@@ -1219,7 +1365,6 @@ read_only global DF_Entity df_g_nil_entity =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
// rjf: allocationless, simple equipment
|
||||
{0},
|
||||
@@ -1243,8 +1388,7 @@ read_only global DF_Entity df_g_nil_entity =
|
||||
0,
|
||||
|
||||
// rjf: name equipment
|
||||
0,
|
||||
zero_struct,
|
||||
{0},
|
||||
0,
|
||||
|
||||
// rjf: timestamp
|
||||
@@ -1293,7 +1437,6 @@ internal B32 df_expand_key_match(DF_ExpandKey a, DF_ExpandKey b);
|
||||
|
||||
//- rjf: table
|
||||
internal void df_expand_tree_table_init(Arena *arena, DF_ExpandTreeTable *table, U64 slot_count);
|
||||
internal void df_expand_tree_table_animate(DF_ExpandTreeTable *table, F32 dt);
|
||||
internal DF_ExpandNode *df_expand_node_from_key(DF_ExpandTreeTable *table, DF_ExpandKey key);
|
||||
internal B32 df_expand_key_is_set(DF_ExpandTreeTable *table, DF_ExpandKey key);
|
||||
internal void df_expand_set_expansion(Arena *arena, DF_ExpandTreeTable *table, DF_ExpandKey parent_key, DF_ExpandKey key, B32 expanded);
|
||||
@@ -1319,6 +1462,11 @@ internal String8 df_string_from_cfg_node_key(DF_CfgNode *node, String8 key, Stri
|
||||
internal DF_Inst df_single_inst_from_machine_code__x64(Arena *arena, U64 start_voff, String8 string);
|
||||
internal DF_Inst df_single_inst_from_machine_code(Arena *arena, Architecture arch, U64 start_voff, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Debug Info Extraction Type Pure Functions
|
||||
|
||||
internal DF_LineList df_line_list_copy(Arena *arena, DF_LineList *list);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Control Flow Analysis Pure Functions
|
||||
|
||||
@@ -1387,9 +1535,6 @@ internal DF_EntityArray df_entity_array_from_list(Arena *arena, DF_EntityList *l
|
||||
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_list_needle(Arena *arena, DF_EntityList *list, String8 needle);
|
||||
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_array_needle(Arena *arena, DF_EntityArray *array, String8 needle);
|
||||
|
||||
//- rjf: entity -> text info
|
||||
internal TXTI_Handle df_txti_handle_from_entity(DF_Entity *entity);
|
||||
|
||||
//- rjf: full path building, from file/folder entities
|
||||
internal String8 df_full_path_from_entity(Arena *arena, DF_Entity *entity);
|
||||
|
||||
@@ -1433,6 +1578,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 +1627,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 +1637,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,35 +1651,37 @@ 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: symbol -> voff lookups
|
||||
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: voff -> line info
|
||||
internal DF_LineList df_lines_from_dbgi_key_voff(Arena *arena, DI_Key *dbgi_key, U64 voff);
|
||||
|
||||
//- rjf: file:line -> line info
|
||||
internal DF_LineListArray df_lines_array_from_file_line_range(Arena *arena, DF_Entity *file, Rng1S64 line_num_range);
|
||||
internal DF_LineList df_lines_from_file_line_num(Arena *arena, DF_Entity *file, S64 line_num);
|
||||
|
||||
//- 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);
|
||||
|
||||
//- 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);
|
||||
|
||||
////////////////////////////////
|
||||
//~ 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);
|
||||
internal DF_Unwind df_unwind_from_ctrl_unwind(Arena *arena, DI_Scope *di_scope, DF_Entity *process, CTRL_Unwind *base_unwind);
|
||||
internal DF_UnwindFrame *df_frame_from_unwind_idxs(DF_Unwind *unwind, U64 base_unwind_idx, U64 inline_unwind_idx);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Entity -> Log Entities
|
||||
@@ -1552,7 +1695,7 @@ internal DF_Entity *df_log_from_entity(DF_Entity *entity);
|
||||
internal void df_push_ctrl_msg(CTRL_Msg *msg);
|
||||
|
||||
//- rjf: control thread running
|
||||
internal void df_ctrl_run(DF_RunKind run, DF_Entity *target, DF_Entity *run_thread, CTRL_RunFlags flags, CTRL_TrapList *run_traps);
|
||||
internal void df_ctrl_run(DF_RunKind run, DF_Entity *run_thread, CTRL_RunFlags flags, CTRL_TrapList *run_traps);
|
||||
|
||||
//- rjf: stopped info from the control thread
|
||||
internal CTRL_Event df_ctrl_last_stop_event(void);
|
||||
@@ -1561,12 +1704,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 +1747,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
|
||||
@@ -1619,11 +1762,17 @@ internal DF_EvalVizRow *df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCt
|
||||
////////////////////////////////
|
||||
//~ rjf: Main State Accessors/Mutators
|
||||
|
||||
//- rjf: frame metadata
|
||||
//- rjf: frame data
|
||||
internal F32 df_dt(void);
|
||||
internal U64 df_frame_index(void);
|
||||
internal Arena *df_frame_arena(void);
|
||||
internal F64 df_time_in_seconds(void);
|
||||
|
||||
//- rjf: interaction registers
|
||||
internal DF_InteractRegs *df_interact_regs(void);
|
||||
internal DF_InteractRegs *df_push_interact_regs(void);
|
||||
internal DF_InteractRegs *df_pop_interact_regs(void);
|
||||
|
||||
//- rjf: undo/redo history
|
||||
internal DF_StateDeltaHistory *df_state_delta_history(void);
|
||||
|
||||
@@ -1658,7 +1807,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 +1817,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);
|
||||
|
||||
+74
-51
@@ -8,7 +8,7 @@
|
||||
DF_CfgSrcTable:
|
||||
{
|
||||
{"user" User OpenUser WriteUserData ApplyUserData }
|
||||
{"profile" Profile OpenProfile WriteProfileData ApplyProfileData }
|
||||
{"project" Project OpenProject WriteProjectData ApplyProjectData }
|
||||
{"command_line" CommandLine Null Null Null }
|
||||
{"transient" Transient Null Null Null }
|
||||
}
|
||||
@@ -26,13 +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: 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" }
|
||||
//- 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: watch pins
|
||||
{WatchPin watch_pin 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 "Expression" Pin "Watch Pin" }
|
||||
@@ -48,6 +44,9 @@ DF_EntityKindTable:
|
||||
{ExecutionPath execution_path 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 "Execution Path" Null "Execution Path" }
|
||||
{EntryPointName entry_point_name 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 "Symbol Name" Null "Entry Point Name" }
|
||||
|
||||
//- rjf: recent projects
|
||||
{RecentProject recent_project 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 "Path" Briefcase "Recent Project" }
|
||||
|
||||
//- rjf: src -> dst mapping
|
||||
{Source source 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Source" }
|
||||
{Dest dest 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Destination" }
|
||||
@@ -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,17 @@ 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`}
|
||||
{BaseUnwindIndex base_unwind_index `U64`}
|
||||
{InlineUnwindIndex inline_unwind_index `U64`}
|
||||
}
|
||||
|
||||
@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 +113,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" }
|
||||
@@ -135,18 +142,14 @@ DF_CoreCmdTable:// | | |
|
||||
{RunToCursor 0 Null Nil 0 0 0 0 0 0 Play "run_to_cursor" "Run To Cursor" "Runs the selected thread to the current cursor." "" }
|
||||
{SetNextStatement 0 Null Nil 0 0 0 0 0 0 RightArrow "set_next_statement" "Set Next Statement" "Sets the selected thread's instruction pointer to the cursor's position." "" }
|
||||
|
||||
//- rjf: solo stepping mode
|
||||
{EnableSoloSteppingMode 0 Null Nil 0 0 0 0 0 0 Thread "enable_solo_stepping_mode" "Enable Solo Stepping Mode" "Enables 'solo stepping mode', which suspends all non-selected threads before stepping." "solo,stepping,mode,suspend" }
|
||||
{DisableSoloSteppingMode 0 Null Nil 0 0 0 0 0 0 Thread "disable_solo_stepping_mode" "Disable Solo Stepping Mode" "Disables 'solo stepping mode', which suspends all non-selected threads before stepping." "solo,stepping,mode,suspend" }
|
||||
|
||||
//- rjf: debug control context management operations
|
||||
{SelectThread 0 Entity Thread 0 0 0 0 0 1 Null "select_thread" "Select Thread" "Selects a thread." "" }
|
||||
{SelectThreadWindow 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_window" "Select Thread On Window" "Selects a thread for the active window, overriding the global selected thread." "" }
|
||||
{SelectThreadView 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_view" "Select Thread On View" "Selects a thread for the active view, overriding the global and per-window selected threads." "" }
|
||||
{SelectUnwind 1 Null Nil 0 0 0 0 0 0 Null "select_unwind" "Select Unwind" "Selects an unwind frame number for the selected thread." "" }
|
||||
{UpOneFrame 0 Null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the callstack frame above the currently selected." "" }
|
||||
{DownOneFrame 0 Null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the callstack frame below the currently selected." "" }
|
||||
{FreezeThread 0 Entity Thread 0 0 0 0 0 1 Locked "freeze_thread" "Freeze Thread" "Freezes the passed thread." "" }
|
||||
{UpOneFrame 0 Null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the call stack frame above the currently selected." "" }
|
||||
{DownOneFrame 0 Null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the call stack frame below the currently selected." "callstack,unwind" }
|
||||
{FreezeThread 0 Entity Thread 0 0 0 0 0 1 Locked "freeze_thread" "Freeze Thread" "Freezes the passed thread." "callstack,unwind" }
|
||||
{ThawThread 0 Entity Thread 0 0 0 0 0 1 Unlocked "thaw_thread" "Thaw Thread" "Thaws the passed thread." "" }
|
||||
{FreezeProcess 0 Entity Process 0 0 0 0 0 1 Locked "freeze_process" "Freeze Process" "Freezes the passed process." "" }
|
||||
{ThawProcess 0 Entity Process 0 0 0 0 0 1 Unlocked "thaw_process" "Thaw Process" "Thaws the passed process." "" }
|
||||
@@ -172,8 +175,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." "" }
|
||||
@@ -212,27 +219,39 @@ DF_CoreCmdTable:// | | |
|
||||
//- rjf: files
|
||||
{SetCurrentPath 1 Null Nil 0 0 0 0 0 0 FileOutline "set_current_path" "Set Current Path" "Sets the debugger's current path, which is used as a starting point when browsing for files." "" }
|
||||
{Open 0 FilePath Nil 1 0 0 0 0 1 FileOutline "open" "Open" "Opens a file." "code,source,file" }
|
||||
{Reload 0 Entity File 0 0 0 0 0 1 FileOutline "reload" "Reload" "Reloads a loaded file." "code,source,file,reload" }
|
||||
{ReloadActive 0 Null Nil 0 0 0 0 0 0 FileOutline "reload_active" "Reload Active File" "Reloads the active file." "code,source,file,reload" }
|
||||
{Switch 0 Entity File 0 0 0 0 0 1 FileOutline "switch" "Switch" "Switches to a loaded file." "code,source,file" }
|
||||
{SwitchToPartnerFile 0 Null Nil 0 0 0 0 0 0 FileOutline "switch_to_partner_file" "Switch To Partner File" "Switches to the focused file's partner; or from header to implementation or vice versa." "code,source,file" }
|
||||
|
||||
//- rjf: source <-> disasm
|
||||
{GoToDisassembly 0 Null Nil 0 0 0 0 0 0 Glasses "go_to_disassembly" "Go To Disassembly" "Goes to the disassembly, if any, for a given source code line." "code,source,disassembly,disasm" }
|
||||
{GoToSource 0 Null Nil 0 0 0 0 0 0 FileOutline "go_to_source" "Go To Source" "Goes to the source code, if any, for a given disassembly line." "code,source,disassembly,disasm" }
|
||||
|
||||
//- rjf: override file links
|
||||
{SetFileOverrideLinkSrc 1 Null Nil 0 0 0 0 0 0 Null "set_file_override_link_src" "Set File Override Link Source" "Sets the source path for an override file link." "" }
|
||||
{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" }
|
||||
{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,project,layout" }
|
||||
{OpenProject 0 FilePath Nil 1 0 0 0 0 1 Briefcase "open_project" "Open Project" "Opens a project file path, immediately loading it, and begins autosaving to it." "project,project,session" }
|
||||
{OpenRecentProject 0 Entity RecentProject 0 0 0 0 0 1 Briefcase "open_recent_project" "Open Recent Project" "Opens a recently used project file." "project,project,session" }
|
||||
|
||||
//- rjf: loading/applying stateful config changes
|
||||
{ApplyUserData 1 Null Nil 0 0 0 0 0 0 Null "apply_user_data" "Apply User Data" "Applies user data from the active user file." "" }
|
||||
{ApplyProfileData 1 Null Nil 0 0 0 0 0 0 Null "apply_profile_data" "Apply Profile Data" "Applies profile data from the active profile file." "" }
|
||||
{ApplyProjectData 1 Null Nil 0 0 0 0 0 0 Null "apply_project_data" "Apply Project Data" "Applies project data from the active project file." "" }
|
||||
|
||||
//- rjf: writing config changes
|
||||
{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." "" }
|
||||
{WriteProjectData 1 Null Nil 0 0 0 0 0 0 Null "write_project_data" "Write Project Data" "Writes project data to the active project 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." "" }
|
||||
@@ -259,6 +278,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 +334,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,12 +372,14 @@ 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" }
|
||||
{CallStack 0 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread,unwind" }
|
||||
{Modules 0 Null Nil 0 0 0 0 0 0 Module "modules" "Modules" "Opens the modules view." "" }
|
||||
{PendingEntity 1 Null Nil 0 0 0 0 0 0 FileOutline "pending_entity" "Pending Entity" "Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view." "" }
|
||||
{Code 1 Null Nil 0 0 0 0 0 0 FileOutline "code" "Code" "Opens the code view for an already-loaded file." "" }
|
||||
@@ -373,7 +396,7 @@ DF_CoreCmdTable:// | | |
|
||||
{Breakpoints 0 Null Nil 0 0 0 0 0 0 CircleFilled "breakpoints" "Breakpoints" "Opens the breakpoints view." "" }
|
||||
{WatchPins 0 Null Nil 0 0 0 0 0 0 Pin "watch_pins" "Watch Pins" "Opens the watch pins view." "" }
|
||||
{ExceptionFilters 0 Null Nil 0 0 0 0 0 0 Gear "exception_filters" "Exception Filters" "Opens the exception filters view." "exceptions,filters" }
|
||||
{Theme 0 Null Nil 0 0 0 0 0 0 Palette "theme" "Theme" "Opens the theme view." "theme,color,scheme,palette" }
|
||||
{Settings 0 Null Nil 0 0 0 0 0 0 Gear "settings" "Settings" "Opens the settings view." "theme,color,scheme,options" }
|
||||
{PickFile 1 FilePath Nil 1 0 0 0 0 1 FileOutline "pick_file" "Pick File" "Opens the file browser to pick a file." "" }
|
||||
{PickFolder 1 FilePath Nil 0 1 0 0 0 1 FolderOpenFilled "pick_folder" "Pick Folder" "Opens the file browser to pick a folder." "" }
|
||||
{PickFileOrFolder 1 FilePath Nil 1 1 0 0 0 1 FileOutline "pick_file_or_folder" "Pick File/Folder" "Opens the file browser to pick a file or folder." "" }
|
||||
@@ -384,6 +407,7 @@ DF_CoreCmdTable:// | | |
|
||||
|
||||
//- rjf: developer commands
|
||||
{ToggleDevMenu 0 Null Nil 0 0 0 0 0 0 Null "toggle_dev_menu" "Toggle Developer Menu" "Opens and closes the developer menu." "" }
|
||||
{LogMarker 0 Null Nil 0 0 0 0 0 0 Null "log_marker" "Log Marker" "Logs a marker in the application log, to denote specific points in time within the log." "" }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -454,12 +478,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 +502,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." }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1756,7 +1779,7 @@ DF_DevToggleTable:
|
||||
|
||||
@data(DF_EntityKindFlags) df_g_entity_kind_flags_table:
|
||||
{
|
||||
@expand(DF_EntityKindTable a) `($(a.lf_mut_user_cfg)*DF_EntityKindFlag_LeafMutationUserConfig | $(a.lf_mut_prof_cfg)*DF_EntityKindFlag_LeafMutationProfileConfig | $(a.lf_mut_halt)*DF_EntityKindFlag_LeafMutationSoftHalt | $(a.lf_mut_dbg)*DF_EntityKindFlag_LeafMutationDebugInfoMap | $(a.tr_mut_user_cfg)*DF_EntityKindFlag_TreeMutationUserConfig | $(a.tr_mut_prof_cfg)*DF_EntityKindFlag_TreeMutationProfileConfig | $(a.tr_mut_halt)*DF_EntityKindFlag_TreeMutationSoftHalt | $(a.tr_mut_dbg)*DF_EntityKindFlag_TreeMutationDebugInfoMap | $(a.name_is_code)*DF_EntityKindFlag_NameIsCode | $(a.user_lifetime)*DF_EntityKindFlag_UserDefinedLifetime)`,
|
||||
@expand(DF_EntityKindTable a) `($(a.lf_mut_user_cfg)*DF_EntityKindFlag_LeafMutationUserConfig | $(a.lf_mut_prof_cfg)*DF_EntityKindFlag_LeafMutationProjectConfig | $(a.lf_mut_halt)*DF_EntityKindFlag_LeafMutationSoftHalt | $(a.lf_mut_dbg)*DF_EntityKindFlag_LeafMutationDebugInfoMap | $(a.tr_mut_user_cfg)*DF_EntityKindFlag_TreeMutationUserConfig | $(a.tr_mut_prof_cfg)*DF_EntityKindFlag_TreeMutationProjectConfig | $(a.tr_mut_halt)*DF_EntityKindFlag_TreeMutationSoftHalt | $(a.tr_mut_dbg)*DF_EntityKindFlag_TreeMutationDebugInfoMap | $(a.name_is_code)*DF_EntityKindFlag_NameIsCode | $(a.user_lifetime)*DF_EntityKindFlag_UserDefinedLifetime)`,
|
||||
}
|
||||
|
||||
@data(DF_EntityOpFlags) df_g_entity_kind_op_flags_table:
|
||||
@@ -1807,7 +1830,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
|
||||
|
||||
@@ -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[24] =
|
||||
{
|
||||
{0},
|
||||
{OffsetOf(DF_CmdParams, window), OffsetOf(DF_CmdParams, window) + sizeof(DF_Handle)},
|
||||
@@ -19,24 +19,27 @@ 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)},
|
||||
{OffsetOf(DF_CmdParams, base_unwind_index), OffsetOf(DF_CmdParams, base_unwind_index) + sizeof(U64)},
|
||||
{OffsetOf(DF_CmdParams, inline_unwind_index), OffsetOf(DF_CmdParams, inline_unwind_index) + sizeof(U64)},
|
||||
};
|
||||
|
||||
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_Null,
|
||||
DF_IconKind_Binoculars,
|
||||
DF_IconKind_Pin,
|
||||
DF_IconKind_CircleFilled,
|
||||
DF_IconKind_CircleFilled,
|
||||
@@ -45,28 +48,27 @@ DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Briefcase,
|
||||
DF_IconKind_Null,
|
||||
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("Flash Marker"),
|
||||
str8_lit_comp("Auto View Rule"),
|
||||
str8_lit_comp("Watch Pin"),
|
||||
str8_lit_comp("Breakpoint"),
|
||||
str8_lit_comp("Condition"),
|
||||
@@ -75,19 +77,20 @@ str8_lit_comp("Executable"),
|
||||
str8_lit_comp("Arguments"),
|
||||
str8_lit_comp("Execution Path"),
|
||||
str8_lit_comp("Entry Point Name"),
|
||||
str8_lit_comp("Recent Project"),
|
||||
str8_lit_comp("Source"),
|
||||
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"),
|
||||
@@ -95,8 +98,6 @@ str8_lit_comp("Label"),
|
||||
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"),
|
||||
@@ -107,6 +108,7 @@ str8_lit_comp("Execution Path"),
|
||||
str8_lit_comp("Symbol Name"),
|
||||
str8_lit_comp("Path"),
|
||||
str8_lit_comp("Path"),
|
||||
str8_lit_comp("Path"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
@@ -117,37 +119,36 @@ 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 | 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),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProfileConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*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 | 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 | 1*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 | 1*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 | 1*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 | 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),
|
||||
(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),
|
||||
(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_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 1*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 1*DF_EntityKindFlag_LeafMutationProjectConfig | 1*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 1*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProjectConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProjectConfig | 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),
|
||||
@@ -155,8 +156,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),
|
||||
(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),
|
||||
@@ -167,6 +166,7 @@ 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),
|
||||
(0*DF_EntityOpFlag_Delete) | (1*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (1*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*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),
|
||||
@@ -180,7 +180,7 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
|
||||
String8 df_g_cfg_src_string_table[4] =
|
||||
{
|
||||
str8_lit_comp("user"),
|
||||
str8_lit_comp("profile"),
|
||||
str8_lit_comp("project"),
|
||||
str8_lit_comp("command_line"),
|
||||
str8_lit_comp("transient"),
|
||||
};
|
||||
@@ -188,7 +188,7 @@ str8_lit_comp("transient"),
|
||||
DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4] =
|
||||
{
|
||||
DF_CoreCmdKind_OpenUser,
|
||||
DF_CoreCmdKind_OpenProfile,
|
||||
DF_CoreCmdKind_OpenProject,
|
||||
DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind_Null,
|
||||
};
|
||||
@@ -196,7 +196,7 @@ DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4] =
|
||||
{
|
||||
DF_CoreCmdKind_WriteUserData,
|
||||
DF_CoreCmdKind_WriteProfileData,
|
||||
DF_CoreCmdKind_WriteProjectData,
|
||||
DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind_Null,
|
||||
};
|
||||
@@ -204,17 +204,18 @@ DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind df_g_cfg_src_apply_cmd_kind_table[4] =
|
||||
{
|
||||
DF_CoreCmdKind_ApplyUserData,
|
||||
DF_CoreCmdKind_ApplyProfileData,
|
||||
DF_CoreCmdKind_ApplyProjectData,
|
||||
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},
|
||||
@@ -237,15 +238,13 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("step_over"), str8_lit_comp("Steps once, always over function calls, for either line or instructions."), str8_lit_comp(""), str8_lit_comp("Step Over"), (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_StepOver},
|
||||
{ str8_lit_comp("run_to_cursor"), str8_lit_comp("Runs the selected thread to the current cursor."), str8_lit_comp(""), str8_lit_comp("Run To 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_Play},
|
||||
{ str8_lit_comp("set_next_statement"), str8_lit_comp("Sets the selected thread's instruction pointer to the cursor's position."), str8_lit_comp(""), str8_lit_comp("Set Next Statement"), (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("enable_solo_stepping_mode"), str8_lit_comp("Enables 'solo stepping mode', which suspends all non-selected threads before stepping."), str8_lit_comp("solo,stepping,mode,suspend"), str8_lit_comp("Enable Solo Stepping Mode"), (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("disable_solo_stepping_mode"), str8_lit_comp("Disables 'solo stepping mode', which suspends all non-selected threads before stepping."), str8_lit_comp("solo,stepping,mode,suspend"), str8_lit_comp("Disable Solo Stepping Mode"), (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("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Null},
|
||||
{ str8_lit_comp("select_thread_window"), str8_lit_comp("Selects a thread for the active window, overriding the global selected thread."), str8_lit_comp(""), str8_lit_comp("Select Thread On Window"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Null},
|
||||
{ str8_lit_comp("select_thread_view"), str8_lit_comp("Selects a thread for the active view, overriding the global and per-window selected threads."), str8_lit_comp(""), str8_lit_comp("Select Thread On View"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Null},
|
||||
{ str8_lit_comp("select_unwind"), str8_lit_comp("Selects an unwind frame number for the selected thread."), str8_lit_comp(""), str8_lit_comp("Select Unwind"), (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("up_one_frame"), str8_lit_comp("Selects the callstack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (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_UpArrow},
|
||||
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the callstack frame below the currently selected."), str8_lit_comp(""), str8_lit_comp("Down One Frame"), (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_DownArrow},
|
||||
{ str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp(""), str8_lit_comp("Freeze Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Locked},
|
||||
{ str8_lit_comp("up_one_frame"), str8_lit_comp("Selects the call stack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (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_UpArrow},
|
||||
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the call stack frame below the currently selected."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Down One Frame"), (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_DownArrow},
|
||||
{ str8_lit_comp("freeze_thread"), str8_lit_comp("Freezes the passed thread."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Freeze Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Locked},
|
||||
{ str8_lit_comp("thaw_thread"), str8_lit_comp("Thaws the passed thread."), str8_lit_comp(""), str8_lit_comp("Thaw Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (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_Unlocked},
|
||||
{ str8_lit_comp("freeze_process"), str8_lit_comp("Freezes the passed process."), str8_lit_comp(""), str8_lit_comp("Freeze Process"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, 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_Locked},
|
||||
{ str8_lit_comp("thaw_process"), str8_lit_comp("Thaws the passed process."), str8_lit_comp(""), str8_lit_comp("Thaw Process"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, 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_Unlocked},
|
||||
@@ -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},
|
||||
@@ -289,19 +292,25 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("tab_bar_bottom"), str8_lit_comp("Anchors a panel's tab bar to the bottom of the panel."), str8_lit_comp(""), str8_lit_comp("Anchor Tab Bar To Bottom"), (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_DownArrow},
|
||||
{ str8_lit_comp("set_current_path"), str8_lit_comp("Sets the debugger's current path, which is used as a starting point when browsing for files."), str8_lit_comp(""), str8_lit_comp("Set Current 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_FileOutline},
|
||||
{ str8_lit_comp("open"), str8_lit_comp("Opens a file."), str8_lit_comp("code,source,file"), str8_lit_comp("Open"), (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_FileOutline},
|
||||
{ str8_lit_comp("reload"), str8_lit_comp("Reloads a loaded file."), str8_lit_comp("code,source,file,reload"), str8_lit_comp("Reload"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_File, (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_FileOutline},
|
||||
{ str8_lit_comp("reload_active"), str8_lit_comp("Reloads the active file."), str8_lit_comp("code,source,file,reload"), str8_lit_comp("Reload Active File"), (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("switch"), str8_lit_comp("Switches to a loaded file."), str8_lit_comp("code,source,file"), str8_lit_comp("Switch"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_File, (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_FileOutline},
|
||||
{ str8_lit_comp("switch_to_partner_file"), str8_lit_comp("Switches to the focused file's partner; or from header to implementation or vice versa."), str8_lit_comp("code,source,file"), str8_lit_comp("Switch To Partner File"), (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("go_to_disassembly"), str8_lit_comp("Goes to the disassembly, if any, for a given source code line."), str8_lit_comp("code,source,disassembly,disasm"), str8_lit_comp("Go To Disassembly"), (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_Glasses},
|
||||
{ str8_lit_comp("go_to_source"), str8_lit_comp("Goes to the source code, if any, for a given disassembly line."), str8_lit_comp("code,source,disassembly,disasm"), str8_lit_comp("Go To Source"), (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("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("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("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,project,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_project"), str8_lit_comp("Opens a project file path, immediately loading it, and begins autosaving to it."), str8_lit_comp("project,project,session"), str8_lit_comp("Open Project"), (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("open_recent_project"), str8_lit_comp("Opens a recently used project file."), str8_lit_comp("project,project,session"), str8_lit_comp("Open Recent Project"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_RecentProject, (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_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("apply_project_data"), str8_lit_comp("Applies project data from the active project file."), str8_lit_comp(""), str8_lit_comp("Apply Project 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("write_project_data"), str8_lit_comp("Writes project data to the active project file."), str8_lit_comp(""), str8_lit_comp("Write Project 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 +335,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 +375,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,12 +399,14 @@ 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("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread,unwind"), 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},
|
||||
{ str8_lit_comp("pending_entity"), str8_lit_comp("Opens a view which waits for the passed entity to be completely loaded, then replaces itself with a new view."), str8_lit_comp(""), str8_lit_comp("Pending 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_FileOutline},
|
||||
{ str8_lit_comp("code"), str8_lit_comp("Opens the code view for an already-loaded file."), str8_lit_comp(""), str8_lit_comp("Code"), (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_FileOutline},
|
||||
@@ -410,33 +423,35 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("breakpoints"), str8_lit_comp("Opens the breakpoints view."), str8_lit_comp(""), str8_lit_comp("Breakpoints"), (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},
|
||||
{ str8_lit_comp("watch_pins"), str8_lit_comp("Opens the watch pins view."), str8_lit_comp(""), str8_lit_comp("Watch Pins"), (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_Pin},
|
||||
{ str8_lit_comp("exception_filters"), str8_lit_comp("Opens the exception filters view."), str8_lit_comp("exceptions,filters"), str8_lit_comp("Exception Filters"), (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_Gear},
|
||||
{ str8_lit_comp("theme"), str8_lit_comp("Opens the theme view."), str8_lit_comp("theme,color,scheme,palette"), str8_lit_comp("Theme"), (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_Palette},
|
||||
{ str8_lit_comp("settings"), str8_lit_comp("Opens the settings view."), str8_lit_comp("theme,color,scheme,options"), str8_lit_comp("Settings"), (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_Gear},
|
||||
{ str8_lit_comp("pick_file"), str8_lit_comp("Opens the file browser to pick a file."), str8_lit_comp(""), str8_lit_comp("Pick File"), (DF_CmdSpecFlag_OmitFromLists*1), {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_FileOutline},
|
||||
{ str8_lit_comp("pick_folder"), str8_lit_comp("Opens the file browser to pick a folder."), str8_lit_comp(""), str8_lit_comp("Pick Folder"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*1)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FolderOpenFilled},
|
||||
{ str8_lit_comp("pick_file_or_folder"), str8_lit_comp("Opens the file browser to pick a file or folder."), str8_lit_comp(""), str8_lit_comp("Pick File/Folder"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*1)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("complete_query"), str8_lit_comp("Completes a query."), str8_lit_comp(""), str8_lit_comp("Complete Query"), (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("cancel_query"), str8_lit_comp("Cancels a query."), str8_lit_comp(""), str8_lit_comp("Cancel Query"), (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("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},
|
||||
{ str8_lit_comp("log_marker"), str8_lit_comp("Logs a marker in the application log, to denote specific points in time within the log."), str8_lit_comp(""), str8_lit_comp("Log Marker"), (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] =
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
typedef enum DF_CfgSrc
|
||||
{
|
||||
DF_CfgSrc_User,
|
||||
DF_CfgSrc_Profile,
|
||||
DF_CfgSrc_Project,
|
||||
DF_CfgSrc_CommandLine,
|
||||
DF_CfgSrc_Transient,
|
||||
DF_CfgSrc_COUNT,
|
||||
@@ -22,9 +22,7 @@ DF_EntityKind_Root,
|
||||
DF_EntityKind_Machine,
|
||||
DF_EntityKind_File,
|
||||
DF_EntityKind_OverrideFileLink,
|
||||
DF_EntityKind_PendingFileChange,
|
||||
DF_EntityKind_DiagLog,
|
||||
DF_EntityKind_FlashMarker,
|
||||
DF_EntityKind_AutoViewRule,
|
||||
DF_EntityKind_WatchPin,
|
||||
DF_EntityKind_Breakpoint,
|
||||
DF_EntityKind_Condition,
|
||||
@@ -33,13 +31,14 @@ DF_EntityKind_Executable,
|
||||
DF_EntityKind_Arguments,
|
||||
DF_EntityKind_ExecutionPath,
|
||||
DF_EntityKind_EntryPointName,
|
||||
DF_EntityKind_RecentProject,
|
||||
DF_EntityKind_Source,
|
||||
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,
|
||||
@@ -74,8 +74,6 @@ DF_CoreCmdKind_StepInto,
|
||||
DF_CoreCmdKind_StepOver,
|
||||
DF_CoreCmdKind_RunToCursor,
|
||||
DF_CoreCmdKind_SetNextStatement,
|
||||
DF_CoreCmdKind_EnableSoloSteppingMode,
|
||||
DF_CoreCmdKind_DisableSoloSteppingMode,
|
||||
DF_CoreCmdKind_SelectThread,
|
||||
DF_CoreCmdKind_SelectThreadWindow,
|
||||
DF_CoreCmdKind_SelectThreadView,
|
||||
@@ -100,8 +98,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,
|
||||
@@ -126,19 +128,25 @@ DF_CoreCmdKind_TabBarTop,
|
||||
DF_CoreCmdKind_TabBarBottom,
|
||||
DF_CoreCmdKind_SetCurrentPath,
|
||||
DF_CoreCmdKind_Open,
|
||||
DF_CoreCmdKind_Reload,
|
||||
DF_CoreCmdKind_ReloadActive,
|
||||
DF_CoreCmdKind_Switch,
|
||||
DF_CoreCmdKind_SwitchToPartnerFile,
|
||||
DF_CoreCmdKind_GoToDisassembly,
|
||||
DF_CoreCmdKind_GoToSource,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkSrc,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkDst,
|
||||
DF_CoreCmdKind_SetFileReplacementPath,
|
||||
DF_CoreCmdKind_SetAutoViewRuleType,
|
||||
DF_CoreCmdKind_SetAutoViewRuleViewRule,
|
||||
DF_CoreCmdKind_OpenUser,
|
||||
DF_CoreCmdKind_OpenProfile,
|
||||
DF_CoreCmdKind_OpenProject,
|
||||
DF_CoreCmdKind_OpenRecentProject,
|
||||
DF_CoreCmdKind_ApplyUserData,
|
||||
DF_CoreCmdKind_ApplyProfileData,
|
||||
DF_CoreCmdKind_ApplyProjectData,
|
||||
DF_CoreCmdKind_WriteUserData,
|
||||
DF_CoreCmdKind_WriteProfileData,
|
||||
DF_CoreCmdKind_WriteProjectData,
|
||||
DF_CoreCmdKind_Edit,
|
||||
DF_CoreCmdKind_Accept,
|
||||
DF_CoreCmdKind_Cancel,
|
||||
DF_CoreCmdKind_MoveLeft,
|
||||
DF_CoreCmdKind_MoveRight,
|
||||
DF_CoreCmdKind_MoveUp,
|
||||
@@ -163,6 +171,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 +235,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,
|
||||
@@ -247,13 +259,14 @@ DF_CoreCmdKind_Disassembly,
|
||||
DF_CoreCmdKind_Breakpoints,
|
||||
DF_CoreCmdKind_WatchPins,
|
||||
DF_CoreCmdKind_ExceptionFilters,
|
||||
DF_CoreCmdKind_Theme,
|
||||
DF_CoreCmdKind_Settings,
|
||||
DF_CoreCmdKind_PickFile,
|
||||
DF_CoreCmdKind_PickFolder,
|
||||
DF_CoreCmdKind_PickFileOrFolder,
|
||||
DF_CoreCmdKind_CompleteQuery,
|
||||
DF_CoreCmdKind_CancelQuery,
|
||||
DF_CoreCmdKind_ToggleDevMenu,
|
||||
DF_CoreCmdKind_LogMarker,
|
||||
DF_CoreCmdKind_COUNT,
|
||||
} DF_CoreCmdKind;
|
||||
|
||||
@@ -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,17 @@ 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_BaseUnwindIndex,
|
||||
DF_CmdParamSlot_InlineUnwindIndex,
|
||||
DF_CmdParamSlot_COUNT,
|
||||
} DF_CmdParamSlot;
|
||||
|
||||
@@ -392,12 +411,17 @@ 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;
|
||||
U64 base_unwind_index;
|
||||
U64 inline_unwind_index;
|
||||
};
|
||||
|
||||
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array);
|
||||
@@ -408,6 +432,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,17 +1532,18 @@ 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[24];
|
||||
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];
|
||||
extern DF_CoreCmdKind df_g_cfg_src_apply_cmd_kind_table[4];
|
||||
extern String8 df_g_icon_kind_text_table[69];
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // DF_CORE_META_H
|
||||
|
||||
+1
-1
@@ -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
@@ -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
|
||||
|
||||
+4320
-2210
File diff suppressed because it is too large
Load Diff
+164
-60
@@ -66,14 +66,24 @@ struct DF_KeyMapSlot
|
||||
DF_KeyMapNode *last;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Setting Types
|
||||
|
||||
typedef struct DF_SettingVal DF_SettingVal;
|
||||
struct DF_SettingVal
|
||||
{
|
||||
B32 set;
|
||||
S32 s32;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Functions
|
||||
|
||||
struct DF_View;
|
||||
struct DF_Panel;
|
||||
struct DF_Window;
|
||||
typedef struct DF_View DF_View;
|
||||
typedef struct DF_Panel DF_Panel;
|
||||
typedef struct DF_Window 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);
|
||||
@@ -100,20 +110,30 @@ typedef U32 DF_ViewSpecFlags;
|
||||
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_ProjectSpecific = (1<<1),
|
||||
DF_ViewSpecFlag_CanSerialize = (1<<2),
|
||||
DF_ViewSpecFlag_CanSerializeEntityPath = (1<<3),
|
||||
DF_ViewSpecFlag_CanSerializeQuery = (1<<4),
|
||||
DF_ViewSpecFlag_CanFilter = (1<<5),
|
||||
DF_ViewSpecFlag_FilterIsCode = (1<<6),
|
||||
DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<7),
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -177,11 +197,10 @@ struct DF_View
|
||||
U64 loading_progress_v;
|
||||
U64 loading_progress_v_target;
|
||||
|
||||
// rjf: update flash animation state
|
||||
F32 flash_t;
|
||||
|
||||
// rjf: view state
|
||||
UI_ScrollPt2 scroll_pos;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
|
||||
// rjf: ctrl context overrides
|
||||
DF_CtrlCtx ctrl_ctx_overrides;
|
||||
@@ -195,6 +214,7 @@ struct DF_View
|
||||
// rjf: view kind info
|
||||
DF_ViewSpec *spec;
|
||||
DF_Handle entity;
|
||||
DF_Handle project;
|
||||
|
||||
// rjf: filter mode
|
||||
B32 is_filtering;
|
||||
@@ -226,15 +246,15 @@ 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;
|
||||
|
||||
// rjf: stable view stacks (tabs)
|
||||
// rjf: stable views (tabs)
|
||||
DF_View *first_tab_view;
|
||||
DF_View *last_tab_view;
|
||||
U64 tab_view_count;
|
||||
@@ -271,6 +291,19 @@ struct DF_DragDropPayload
|
||||
TxtPt text_point;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Rich Hover Types
|
||||
|
||||
typedef struct DF_RichHoverInfo DF_RichHoverInfo;
|
||||
struct DF_RichHoverInfo
|
||||
{
|
||||
DF_Handle process;
|
||||
Rng1U64 vaddr_range;
|
||||
DF_Handle module;
|
||||
Rng1U64 voff_range;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Spec Types
|
||||
|
||||
@@ -281,7 +314,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 +324,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 +346,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;
|
||||
@@ -359,6 +386,24 @@ typedef enum DF_FontSlot
|
||||
}
|
||||
DF_FontSlot;
|
||||
|
||||
typedef enum DF_PaletteCode
|
||||
{
|
||||
DF_PaletteCode_Base,
|
||||
DF_PaletteCode_MenuBar,
|
||||
DF_PaletteCode_Floating,
|
||||
DF_PaletteCode_ImplicitButton,
|
||||
DF_PaletteCode_PlainButton,
|
||||
DF_PaletteCode_PositivePopButton,
|
||||
DF_PaletteCode_NegativePopButton,
|
||||
DF_PaletteCode_NeutralPopButton,
|
||||
DF_PaletteCode_ScrollBarButton,
|
||||
DF_PaletteCode_Tab,
|
||||
DF_PaletteCode_TabInactive,
|
||||
DF_PaletteCode_DropSiteOverlay,
|
||||
DF_PaletteCode_COUNT
|
||||
}
|
||||
DF_PaletteCode;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Helper & Widget Types
|
||||
|
||||
@@ -383,9 +428,10 @@ enum
|
||||
typedef U32 DF_CodeSliceFlags;
|
||||
enum
|
||||
{
|
||||
DF_CodeSliceFlag_Clickable = (1<<0),
|
||||
DF_CodeSliceFlag_Margin = (1<<1),
|
||||
DF_CodeSliceFlag_LineNums = (1<<2),
|
||||
DF_CodeSliceFlag_Clickable = (1<<0),
|
||||
DF_CodeSliceFlag_PriorityMargin = (1<<1),
|
||||
DF_CodeSliceFlag_CatchallMargin = (1<<2),
|
||||
DF_CodeSliceFlag_LineNums = (1<<3),
|
||||
};
|
||||
|
||||
typedef struct DF_CodeSliceParams DF_CodeSliceParams;
|
||||
@@ -400,19 +446,21 @@ struct DF_CodeSliceParams
|
||||
DF_EntityList *line_bps;
|
||||
DF_EntityList *line_ips;
|
||||
DF_EntityList *line_pins;
|
||||
DF_TextLineDasm2SrcInfoList *line_dasm2src;
|
||||
DF_TextLineSrc2DasmInfoList *line_src2dasm;
|
||||
DF_EntityList relevant_binaries;
|
||||
U64 *line_vaddrs;
|
||||
DF_LineList *line_infos;
|
||||
DI_KeyList relevant_dbgi_keys;
|
||||
|
||||
// rjf: visual parameters
|
||||
F_Tag font;
|
||||
F32 font_size;
|
||||
F32 tab_size;
|
||||
String8 search_query;
|
||||
F32 line_height_px;
|
||||
F32 margin_width_px;
|
||||
F32 priority_margin_width_px;
|
||||
F32 catchall_margin_width_px;
|
||||
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 +487,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 +530,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,34 +557,51 @@ 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;
|
||||
|
||||
// rjf: context menu info
|
||||
// rjf: dev interface state
|
||||
B32 dev_menu_is_open;
|
||||
|
||||
// rjf: menu bar state
|
||||
B32 menu_bar_focused;
|
||||
B32 menu_bar_focused_on_press;
|
||||
B32 menu_bar_key_held;
|
||||
B32 menu_bar_focus_press_started;
|
||||
UI_Key drop_completion_ctx_menu_key;
|
||||
DF_Handle drop_completion_entity;
|
||||
DF_Handle drop_completion_panel;
|
||||
|
||||
// rjf: code context menu state
|
||||
Arena *code_ctx_menu_arena;
|
||||
UI_Key code_ctx_menu_key;
|
||||
DF_Handle code_ctx_menu_file;
|
||||
U128 code_ctx_menu_text_key;
|
||||
TXT_LangKind code_ctx_menu_lang_kind;
|
||||
TxtRng code_ctx_menu_range;
|
||||
U64 code_ctx_menu_vaddr;
|
||||
DF_LineList code_ctx_menu_lines;
|
||||
|
||||
// rjf: entity context menu state
|
||||
UI_Key entity_ctx_menu_key;
|
||||
DF_Handle entity_ctx_menu_entity;
|
||||
U8 entity_ctx_menu_input_buffer[1024];
|
||||
U64 entity_ctx_menu_input_size;
|
||||
TxtPt entity_ctx_menu_input_cursor;
|
||||
TxtPt entity_ctx_menu_input_mark;
|
||||
|
||||
// rjf: tab context menu state
|
||||
UI_Key tab_ctx_menu_key;
|
||||
DF_Handle tab_ctx_menu_view;
|
||||
|
||||
// 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;
|
||||
@@ -549,6 +626,7 @@ struct DF_Window
|
||||
Vec2F32 hover_eval_spawn_pos;
|
||||
String8 hover_eval_string;
|
||||
|
||||
|
||||
// rjf: hover eval timer
|
||||
U64 hover_eval_first_frame_idx;
|
||||
U64 hover_eval_last_frame_idx;
|
||||
@@ -694,10 +772,11 @@ struct DF_GfxState
|
||||
// rjf: drag/drop state machine
|
||||
DF_DragDropState drag_drop_state;
|
||||
|
||||
// rjf: hover line info correllation state
|
||||
DF_Handle hover_line_binary;
|
||||
U64 hover_line_voff;
|
||||
B32 hover_line_set_this_frame;
|
||||
// rjf: rich hover info
|
||||
Arena *rich_hover_info_next_arena;
|
||||
Arena *rich_hover_info_current_arena;
|
||||
DF_RichHoverInfo rich_hover_info_next;
|
||||
DF_RichHoverInfo rich_hover_info_current;
|
||||
|
||||
// rjf: running theme state
|
||||
DF_Theme cfg_theme_target;
|
||||
@@ -706,7 +785,14 @@ struct DF_GfxState
|
||||
Arena *cfg_code_font_path_arena;
|
||||
String8 cfg_main_font_path;
|
||||
String8 cfg_code_font_path;
|
||||
F_Tag cfg_font_tags[DF_FontSlot_COUNT];
|
||||
F_Tag cfg_font_tags[DF_FontSlot_COUNT]; // derivative from font paths
|
||||
UI_Palette cfg_palettes[DF_PaletteCode_COUNT]; // derivative from theme
|
||||
|
||||
// rjf: settings
|
||||
DF_SettingVal cfg_setting_vals[DF_CfgSrc_COUNT][DF_SettingCode_COUNT];
|
||||
|
||||
// rjf: icon texture
|
||||
R_Handle icon_texture;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -742,7 +828,8 @@ read_only global DF_View df_g_nil_view =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
0,
|
||||
@@ -765,6 +852,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
|
||||
@@ -775,6 +864,7 @@ internal DF_PathQuery df_path_query_from_string(String8 string);
|
||||
//~ rjf: View Type Functions
|
||||
|
||||
internal B32 df_view_is_nil(DF_View *view);
|
||||
internal B32 df_view_is_project_filtered(DF_View *view);
|
||||
internal DF_Handle df_handle_from_view(DF_View *view);
|
||||
internal DF_View *df_view_from_handle(DF_Handle handle);
|
||||
|
||||
@@ -805,12 +895,13 @@ 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);
|
||||
internal void df_panel_remove_tab_view(DF_Panel *panel, DF_View *view);
|
||||
internal DF_View *df_selected_tab_from_panel(DF_Panel *panel);
|
||||
|
||||
//- rjf: icons & display strings
|
||||
internal String8 df_display_string_from_view(Arena *arena, DF_CtrlCtx ctrl_ctx, DF_View *view);
|
||||
@@ -847,9 +938,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 U64 df_get_hovered_line_info_voff(void);
|
||||
internal void df_set_rich_hover_info(DF_RichHoverInfo *info);
|
||||
internal DF_RichHoverInfo df_get_rich_hover_info(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Spec State Functions
|
||||
@@ -864,13 +954,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 +989,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 +1011,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
|
||||
@@ -944,11 +1037,18 @@ internal DF_CmdSpecList df_cmd_spec_list_from_event_flags(Arena *arena, OS_Event
|
||||
internal Vec4F32 df_rgba_from_theme_color(DF_ThemeColor color);
|
||||
internal DF_ThemeColor df_theme_color_from_txt_token_kind(TXT_TokenKind kind);
|
||||
|
||||
//- rjf: code -> palette
|
||||
internal UI_Palette *df_palette_from_code(DF_PaletteCode code);
|
||||
|
||||
//- rjf: fonts/sizes
|
||||
internal F_Tag df_font_from_slot(DF_FontSlot slot);
|
||||
internal F32 df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot);
|
||||
|
||||
//- rjf: settings
|
||||
internal DF_SettingVal df_setting_val_from_code(DF_SettingCode code);
|
||||
|
||||
//- rjf: config serialization
|
||||
internal int df_qsort_compare__cfg_string_bindings(DF_StringBindingPair *a, DF_StringBindingPair *b);
|
||||
internal String8List df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF_CfgSrc source);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -957,6 +1057,11 @@ internal String8List df_cfg_strings_from_gfx(Arena *arena, String8 root_path, DF
|
||||
internal String8 df_string_from_exception_code(U32 code);
|
||||
internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, CTRL_Event *event, DF_IconKind *icon_out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Building Helpers
|
||||
|
||||
#define DF_Palette(code) UI_Palette(df_palette_from_code(code))
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Fancy Buttons
|
||||
|
||||
@@ -967,7 +1072,7 @@ internal void df_cmd_list_menu_buttons(DF_Window *ws, U64 count, DF_CoreCmdKind
|
||||
internal UI_Signal df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string);
|
||||
internal UI_Signal df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...);
|
||||
internal void df_entity_tooltips(DF_Entity *entity);
|
||||
internal void df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query);
|
||||
internal UI_Signal df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit);
|
||||
internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -979,7 +1084,6 @@ internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, E
|
||||
internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...);
|
||||
|
||||
internal B32 df_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column);
|
||||
internal B32 df_do_txti_controls(TXTI_Handle handle, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: UI Widgets: Fancy Labels
|
||||
|
||||
+350
-347
@@ -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
|
||||
@@ -86,8 +87,13 @@ DF_DefaultBindingTable:
|
||||
{ "switch_to_partner_file" O 0 0 alt }
|
||||
|
||||
//- rjf: setting config paths
|
||||
{ "load_user" O ctrl shift alt }
|
||||
{ "load_profile" O ctrl 0 alt }
|
||||
{ "open_user" O ctrl shift alt }
|
||||
{ "open_project" 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 }
|
||||
@@ -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
|
||||
@@ -161,6 +171,14 @@ DF_DefaultBindingTable:
|
||||
|
||||
//- rjf: command lister
|
||||
{ "run_command" F1 0 0 0 }
|
||||
|
||||
//- rjf: developer commands
|
||||
{ "log_marker" M ctrl shift alt }
|
||||
}
|
||||
|
||||
@data(DF_StringBindingPair) df_g_default_binding_table:
|
||||
{
|
||||
@expand(DF_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_EventFlag_Ctrl`) $(a.shift != 0 -> `|OS_EventFlag_Shift`) $(a.alt != 0 -> `|OS_EventFlag_Alt`)}}```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -172,52 +190,76 @@ DF_BindingVersionRemapTable:
|
||||
{"commands" "run_command"}
|
||||
{"load_user" "open_user"}
|
||||
{"load_profile" "open_profile"}
|
||||
{"load_project" "open_project"}
|
||||
{"open_profile" "open_project"}
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ 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)
|
||||
@table(name, name_lower, display_string, name_kind, icon, parameterized_by_entity, project_specific, 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 "" }
|
||||
{ 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 "" }
|
||||
{ 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." }
|
||||
{ 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." }
|
||||
{ Globals "globals" "Globals" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ ThreadLocals "thread_locals" "Thread Locals" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Types "types" "Types" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Procedures "procedures" "Procedures" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Output "output" "Output" Null List 0 1 0 0 0 0 1 "Displays textual output from the selected thread's containing process." }
|
||||
{ Memory "memory" "Memory" Null Grid 0 1 1 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." }
|
||||
{ Breakpoints "breakpoints" "Breakpoints" Null CircleFilled 0 1 0 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." }
|
||||
{ WatchPins "watch_pins" "Watch Pins" Null Pin 0 1 0 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." }
|
||||
{ ExceptionFilters "exception_filters" "Exception Filters" Null Gear 0 1 0 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." }
|
||||
{ Theme "theme" "Theme" Null Palette 0 1 0 0 0 0 1 "An interface for modifying the colors used in the debugger's UI. Allows selecting a theme preset, loading a theme from a file, and modifying individual colors within a theme." }
|
||||
{ Null "null" "" Null Null 0 0 0 0 0 0 0 0 "" }
|
||||
{ Empty "empty" "" Null Null 0 0 0 0 0 0 0 0 "" }
|
||||
{ GettingStarted "getting_started" "Getting Started" Null QuestionMark 0 0 1 0 0 0 0 0 "" }
|
||||
{ Commands "commands" "Commands" Null List 0 0 0 0 0 0 0 0 "" }
|
||||
{ FileSystem "file_system" "File System" Null FileOutline 0 0 0 0 0 0 0 0 "" }
|
||||
{ SystemProcesses "system_processes" "System Processes" Null Null 0 0 0 0 0 0 0 0 "" }
|
||||
{ EntityLister "entity_lister" "Entity List" Null Null 0 0 0 0 0 0 0 0 "" }
|
||||
{ SymbolLister "symbol_lister" "Symbols" Null Null 0 0 0 0 0 0 0 0 "" }
|
||||
{ Target "target" "Target" EntityName Target 1 0 0 0 0 0 0 0 "" }
|
||||
{ Targets "targets" "Targets" Null Target 0 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 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 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 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 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 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 0 "" }
|
||||
{ Code "code" "Code" EntityName FileOutline 1 1 1 1 0 0 0 0 "" }
|
||||
{ Disassembly "disassembly" "Disassembly" Null Glasses 0 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." }
|
||||
{ Watch "watch" "Watch" Null Binoculars 0 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 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 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." }
|
||||
{ Globals "globals" "Globals" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all global variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ ThreadLocals "thread_locals" "Thread Locals" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all thread local variables within the selected thread's module. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Types "types" "Types" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all types within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Procedures "procedures" "Procedures" Null Binoculars 0 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all procedures within the selected thread's module. View rules can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Output "output" "Output" Null List 0 0 1 0 0 0 0 1 "Displays textual output from the selected thread's containing process." }
|
||||
{ Memory "memory" "Memory" Null Grid 0 0 1 0 0 0 0 1 "A familiar hex-editor-like interface for viewing memory of attached processes." }
|
||||
{ Breakpoints "breakpoints" "Breakpoints" Null CircleFilled 0 0 1 0 1 0 1 1 "Displays a table of all breakpoints, containing information about each breakpoint's name, location, and hit count. Also contains per-breakpoint controls for enabling, deleting, or editing each breakpoint. For more information on breakpoints and their features, read the 'Breakpoints' section." }
|
||||
{ WatchPins "watch_pins" "Watch Pins" Null Pin 0 0 1 0 1 1 1 1 "Displays a table of all watch pins (watched expressions, like those found in `Watch`, but instead of being within a table, being pinned to some source code location, like breakpoints). This table contains each pin's name, location, and controls for editing or deleting each pin." }
|
||||
{ ExceptionFilters "exception_filters" "Exception Filters" Null Gear 0 0 1 0 1 0 1 1 "An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time." }
|
||||
{ Settings "settings" "Settings" Null Gear 0 0 1 0 1 0 1 1 "An interface to modify general settings for the debugger's appearance and behavior." }
|
||||
}
|
||||
|
||||
@enum DF_GfxViewKind:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@gen
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_SETUP_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_CMD_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_UI_FUNCTION_DEF($(a.name));`;
|
||||
}
|
||||
|
||||
@data(DF_ViewSpecInfo) df_g_gfx_view_kind_spec_info_table:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.project_specific)*DF_ViewSpecFlag_ProjectSpecific|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_entity_path)*DF_ViewSpecFlag_CanSerializeEntityPath|$(a.can_filter)*DF_ViewSpecFlag_CanFilter|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_NameKind_$(a.name_kind), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -235,270 +277,6 @@ DF_CmdParamSlot2ViewSpecMap:
|
||||
{String "symbol_lister" "function_breakpoint" }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Built-In Graphical View Rule Extensions
|
||||
//
|
||||
// NOTE(rjf): see @view_rule_info
|
||||
|
||||
@table(string vr ls ru bu wu)
|
||||
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 - }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Color Codes
|
||||
|
||||
@table(name display_name name_lower)
|
||||
DF_ThemeTable:
|
||||
{
|
||||
{Null "Null" null }
|
||||
{PlainText "Plain Text" plain_text }
|
||||
{PlainBackground "Plain Background" plain_background }
|
||||
{PlainBorder "Plain Border" plain_border }
|
||||
{PlainOverlay "Plain Overlay" plain_overlay }
|
||||
{CodeDefault "Code (Default)" code_default }
|
||||
{CodeFunction "Code (Function)" code_function }
|
||||
{CodeType "Code (Type)" code_type }
|
||||
{CodeLocal "Code (Local)" code_local }
|
||||
{CodeRegister "Code (Register)" code_register }
|
||||
{CodeKeyword "Code (Keyword)" code_keyword }
|
||||
{CodeSymbol "Code (Symbol)" code_symbol }
|
||||
{CodeNumeric "Code (Numeric)" code_numeric }
|
||||
{CodeString "Code (String)" code_string }
|
||||
{CodeMeta "Code (Meta)" code_meta }
|
||||
{CodeComment "Code (Comment)" code_comment }
|
||||
{LineInfo0 "Line Info (0)" line_info_0 }
|
||||
{LineInfo1 "Line Info (1)" line_info_1 }
|
||||
{LineInfo2 "Line Info (2)" line_info_2 }
|
||||
{LineInfo3 "Line Info (3)" line_info_3 }
|
||||
{AltText "Alt Text" alt_text }
|
||||
{AltBackground "Alt Background" alt_background }
|
||||
{AltBorder "Alt Border" alt_border }
|
||||
{AltOverlay "Alt Overlay" alt_overlay }
|
||||
{TabInactive "Inactive Tab" tab_inactive }
|
||||
{TabActive "Active Tab" tab_active }
|
||||
{EntityBackground "Entity Background" entity_background }
|
||||
{QueryBar "Query Bar" query_bar }
|
||||
{WeakText "Weak Text" weak_text }
|
||||
{TextSelection "Text Selection" text_selection }
|
||||
{Cursor "Cursor" cursor }
|
||||
{Highlight0 "Highlight (0)" highlight_0 }
|
||||
{Highlight1 "Highlight (1)" highlight_1 }
|
||||
{SuccessText "Success Text" success_text }
|
||||
{SuccessBackground "Success Background" success_background }
|
||||
{SuccessBorder "Success Border" success_border }
|
||||
{FailureText "Failure Text" failure_text }
|
||||
{FailureBackground "Failure Background" failure_background }
|
||||
{FailureBorder "Failure Border" failure_border }
|
||||
{ActionText "Action Text" action_text }
|
||||
{ActionBackground "Action Background" action_background }
|
||||
{ActionBorder "Action Border" action_border }
|
||||
{DropSiteOverlay "Drop Site Overlay" drop_site_overlay }
|
||||
{Thread0 "Thread (0)" thread_0 }
|
||||
{Thread1 "Thread (1)" thread_1 }
|
||||
{Thread2 "Thread (2)" thread_2 }
|
||||
{Thread3 "Thread (3)" thread_3 }
|
||||
{Thread4 "Thread (4)" thread_4 }
|
||||
{Thread5 "Thread (5)" thread_5 }
|
||||
{Thread6 "Thread (6)" thread_6 }
|
||||
{Thread7 "Thread (7)" thread_7 }
|
||||
{ThreadUnwound "Thread (Unwound)" thread_unwound }
|
||||
{InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay }
|
||||
{DropShadow "Drop Shadow" drop_shadow }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Color Version Remap Table
|
||||
|
||||
@table(old_name new_name)
|
||||
DF_ThemeColorVersionRemapTable:
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Presets
|
||||
|
||||
@table(name_upper name_lower display_string)
|
||||
DF_ThemePresetTable:
|
||||
{
|
||||
{ DefaultDark default_dark "Default (Dark)" }
|
||||
{ DefaultLight default_light "Default (Light)" }
|
||||
{ VSDark vs_dark "VS (Dark)" }
|
||||
{ VSLight vs_light "VS (Light)" }
|
||||
{ SolarizedDark solarized_dark "Solarized (Dark)" }
|
||||
{ SolarizedLight solarized_light "Solarized (Light)" }
|
||||
{ HandmadeHero handmade_hero "Handmade Hero" }
|
||||
{ FourCoder four_coder "4coder" }
|
||||
{ FarManager far_manager "Far Manager" }
|
||||
}
|
||||
|
||||
@table(name default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager)
|
||||
DF_ThemePresetColorTable:
|
||||
{
|
||||
(null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff )
|
||||
(plain_text 0xe5e5e5ff 0x383838ff 0xe5e5e5ff 0x1e1e1eff 0xe5e5e5ff 0x1e1e1eff 0xa08563ff 0x90b080ff 0x00ffffff )
|
||||
(plain_background 0x3333337f 0xedededfe 0x1e1e1eff 0xffffffff 0x002b36ff 0xfcf6e2ff 0x0c0c0cff 0x0c0c0cff 0x000082ff )
|
||||
(plain_border 0xffffff19 0x0000001d 0xffffff19 0xcccedb1d 0xffffff19 0xcccedb1d 0xffffff19 0x181818a0 0xffffff19 )
|
||||
(plain_overlay 0xffffff33 0x00000033 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(code_default 0xe5e5e5ff 0x282828ff 0xd4d4d4ff 0x000000ff 0x839496ff 0x74878cff 0xa08563ff 0x90b080ff 0x00ffffff )
|
||||
(code_function 0x7fcc99ff 0x2a7a45ff 0xdcdcaaff 0x74531fff 0x1c7dd1ff 0xc39d36ff 0xcc5735ff 0x7fcc99ff 0x49b2ffff )
|
||||
(code_type 0x66b2e5ff 0x2c688fff 0x4ec9b0ff 0x2b91afff 0x1c7dd1ff 0x66b2e5ff 0xd8a51dff 0x66b2e5ff 0x49b2ffff )
|
||||
(code_local 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff 0xfe9548ff )
|
||||
(code_register 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff 0xd45d90ff )
|
||||
(code_keyword 0xf7bf5eff 0xa47729ff 0x569cd6ff 0x0000ffff 0x63980fff 0xc39d36ff 0xac7b0bff 0xd08f20ff 0xff0000ff )
|
||||
(code_symbol 0x994c32ff 0x6c2d18ff 0xb4b4b4ff 0x000000ff 0x839496ff 0x2e5256ff 0x994c32ff 0x994c32ff 0xffffffff )
|
||||
(code_numeric 0x4ce54cff 0x2c7d2cff 0xb5cea8ff 0x000000ff 0xcb4b20ff 0x657b83ff 0x6b8e23ff 0x50ff30ff 0x2cff50ff )
|
||||
(code_string 0xe5cc66ff 0xcc5a0fff 0xd69d85ff 0xc11515ff 0x2aa198ff 0x5ab4a9ff 0x6b8e23ff 0x50ff30ff 0xe5cc66ff )
|
||||
(code_meta 0xe54c4cff 0x8a0c0cff 0x9b9b9bff 0x808080ff 0xe54c4cff 0xe54c4cff 0xdab98fff 0x50ff30ff 0xffff00ff )
|
||||
(code_comment 0x7f7f7fff 0x7f7f7fff 0x6a9955ff 0x008000ff 0x7f7f7fff 0xadafb2ff 0x686868ff 0x2090f0ff 0x7f7f7fff )
|
||||
(line_info_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f )
|
||||
(line_info_1 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f )
|
||||
(line_info_2 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f )
|
||||
(line_info_3 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f )
|
||||
(alt_text 0xe5e5e5ff 0x535353ff 0xf1f1f1ff 0x535353ff 0xe5e5e5ff 0x535353ff 0xa08563ff 0x90b080ff 0x000000ff )
|
||||
(alt_background 0x42474c7f 0xfefefebc 0x1b1b1cff 0xfefefebc 0x002b36ff 0xfcf6e2ff 0x0c0c0cff 0x0c0c0cff 0x008184ff )
|
||||
(alt_border 0xffffff19 0xffffff19 0x333337ff 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 0xffffff19 )
|
||||
(alt_overlay 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(tab_inactive 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f 0x42474c7f )
|
||||
(tab_active 0xa87a4c99 0xc7a27dff 0x007accff 0x007accff 0x28515eff 0xa87a4c99 0xa87a4c99 0xa87a4c99 0xa87a4c99 )
|
||||
(entity_background 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 0x4293cc99 )
|
||||
(query_bar 0x8e2d4ccc 0xd76489cc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc 0x8e2d4ccc )
|
||||
(weak_text 0xffffff7f 0x0000007f 0xffffff7f 0x0000007f 0xffffff7f 0x0000007f 0xa08563af 0x90b080af 0xffffff7f )
|
||||
(text_selection 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x7d98b34c 0x99ccff4c 0x99ccff4c 0x99ccff4c )
|
||||
(cursor 0x66e566e5 0x101010ff 0x66e566e5 0x101010ff 0x66e566e5 0x101010ff 0x66e566e5 0x66e566e5 0x66e566e5 )
|
||||
(highlight_0 0xb27219ff 0xb272189b 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff 0xb27219ff )
|
||||
(highlight_1 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff 0x327f19ff )
|
||||
(success_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff )
|
||||
(success_background 0x32b219ff 0x75db61ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff 0x32b219ff )
|
||||
(success_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(failure_text 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff 0xe5e5e5ff )
|
||||
(failure_background 0xb23219ff 0xf27961ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff )
|
||||
(failure_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(action_text 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff )
|
||||
(action_background 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff 0x327fb2ff )
|
||||
(action_border 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 0xffffff33 )
|
||||
(drop_site_overlay 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c )
|
||||
(thread_0 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xad7c34ff 0xffcb7fff 0xffcb7fff 0xffcb7fff )
|
||||
(thread_1 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0x639b2aff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff )
|
||||
(thread_2 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xa94c91ff 0xff99e5ff 0xff99e5ff 0xff99e5ff )
|
||||
(thread_3 0x6598ffff 0x305398ff 0x6598ffff 0x305398ff 0x6598ffff 0x305398ff 0x6598ffff 0x6598ffff 0x6598ffff )
|
||||
(thread_4 0x65ffcbff 0x339574ff 0x65ffcbff 0x339574ff 0x65ffcbff 0x339574ff 0x65ffcbff 0x65ffcbff 0x65ffcbff )
|
||||
(thread_5 0xff9819ff 0xbf7416ff 0xff9819ff 0xbf7416ff 0xff9819ff 0xbf7416ff 0xff9819ff 0xff9819ff 0xff9819ff )
|
||||
(thread_6 0x9932ffff 0x57238bff 0x9932ffff 0x57238bff 0x9932ffff 0x57238bff 0x9932ffff 0x9932ffff 0x9932ffff )
|
||||
(thread_7 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x2a7e1cff 0x65ff4cff 0x65ff4cff 0x65ff4cff )
|
||||
(thread_unwound 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0x236481ff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff )
|
||||
(inactive_panel_overlay 0x0000003f 0x0000000d 0x0000003f 0x0000000d 0x0000003f 0x0000000d 0x0000003f 0x0000003f 0x0000003f )
|
||||
(drop_shadow 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000003b 0x0000007f 0x0000007f 0x0000007f )
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Generators
|
||||
|
||||
//- rjf: enums
|
||||
|
||||
@enum DF_NameKind:
|
||||
{
|
||||
@expand(DF_NameKindTable, a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_GfxViewKind:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemeColor:
|
||||
{
|
||||
@expand(DF_ThemeTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemePreset:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
//- rjf: theme preset color tables
|
||||
|
||||
@data(String8) df_g_theme_preset_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_code_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)")`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.default_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.vs_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_dark:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_light:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__handmade_hero:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__four_coder:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.four_coder))`,
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__far_manager:
|
||||
{
|
||||
@expand(DF_ThemePresetColorTable a) `rgba_from_u32_lit_comp($(a.far_manager))`;
|
||||
}
|
||||
|
||||
@data(`Vec4F32*`) df_g_theme_preset_colors_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`,
|
||||
}
|
||||
|
||||
//- rjf: cmd param slot -> view spec tables
|
||||
|
||||
@data(DF_CmdParamSlot) df_g_cmd_param_slot_2_view_spec_src_map:
|
||||
{
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `DF_CmdParamSlot_$(a.slot)`
|
||||
@@ -514,37 +292,30 @@ DF_ThemePresetColorTable:
|
||||
@expand(DF_CmdParamSlot2ViewSpecMap a) `str8_lit_comp("$(a.opt_cmd_spec)")`
|
||||
}
|
||||
|
||||
//- rjf: default bindings table
|
||||
////////////////////////////////
|
||||
//~ rjf: Built-In Graphical View Rule Extensions
|
||||
//
|
||||
// NOTE(rjf): see @view_rule_info
|
||||
|
||||
@data(DF_StringBindingPair) df_g_default_binding_table:
|
||||
@table(string vr ls ru bu tu tab_display_string)
|
||||
DF_GfxViewRuleTable:
|
||||
{
|
||||
@expand(DF_DefaultBindingTable a) ```{str8_lit_comp("$(a.name)"), {OS_Key_$(a.key), 0 $(a.ctrl != 0 -> `|OS_EventFlag_Ctrl`) $(a.shift != 0 -> `|OS_EventFlag_Shift`) $(a.alt != 0 -> `|OS_EventFlag_Alt`)}}```;
|
||||
{"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" }
|
||||
}
|
||||
|
||||
//- rjf: binding version remap tables
|
||||
|
||||
@data(String8) df_g_binding_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_binding_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_BindingVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
//- rjf: view hook forward declares
|
||||
|
||||
@gen
|
||||
{
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_SETUP_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_CMD_FUNCTION_DEF($(a.name));`;
|
||||
@expand(DF_GfxViewTable a) `DF_VIEW_UI_FUNCTION_DEF($(a.name));`;
|
||||
}
|
||||
|
||||
//- rjf: gfx view rule function forward declares
|
||||
|
||||
@gen
|
||||
{
|
||||
``;
|
||||
@@ -557,34 +328,266 @@ 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
|
||||
@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 .. ') }')```;
|
||||
}
|
||||
|
||||
@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')") }```;
|
||||
}
|
||||
|
||||
//- rjf: default view spec info table
|
||||
////////////////////////////////
|
||||
//~ rjf: Theme Tables
|
||||
|
||||
@data(DF_ViewSpecInfo) df_g_gfx_view_kind_spec_info_table:
|
||||
@table(name_upper name_lower display_string)
|
||||
DF_ThemePresetTable:
|
||||
{
|
||||
@expand(DF_GfxViewTable a) ```{(0|$(a.parameterized_by_entity)*DF_ViewSpecFlag_ParameterizedByEntity|$(a.can_serialize)*DF_ViewSpecFlag_CanSerialize|$(a.can_serialize_entity_path)*DF_ViewSpecFlag_CanSerializeEntityPath|$(a.can_filter)*DF_ViewSpecFlag_CanFilter|$(a.filter_is_code)*DF_ViewSpecFlag_FilterIsCode|$(a.typing_automatically_filters)*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.display_string)"), DF_NameKind_$(a.name_kind), DF_IconKind_$(a.icon), DF_VIEW_SETUP_FUNCTION_NAME($(a.name)), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME($(a.name)), DF_VIEW_CMD_FUNCTION_NAME($(a.name)), DF_VIEW_UI_FUNCTION_NAME($(a.name))}```;
|
||||
{ DefaultDark default_dark "Default (Dark)" }
|
||||
{ DefaultLight default_light "Default (Light)" }
|
||||
{ VSDark vs_dark "VS (Dark)" }
|
||||
{ VSLight vs_light "VS (Light)" }
|
||||
{ SolarizedDark solarized_dark "Solarized (Dark)" }
|
||||
{ SolarizedLight solarized_light "Solarized (Light)" }
|
||||
{ HandmadeHero handmade_hero "Handmade Hero" }
|
||||
{ FourCoder four_coder "4coder" }
|
||||
{ FarManager far_manager "Far Manager" }
|
||||
}
|
||||
|
||||
//- rjf: theme color tables
|
||||
@table(name display_name name_lower default_dark default_light vs_dark vs_light solarized_dark solarized_light handmade_hero four_coder far_manager desc)
|
||||
DF_ThemeColorTable:
|
||||
{
|
||||
{Null "Null" null 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff 0xff00ffff ""}
|
||||
|
||||
//- rjf: global ui colors
|
||||
{Text "Text" text 0xe5e5e5ff 0x4c4c4cff 0xe5e5e5ff 0x000000ff 0x999999ff 0x333333ff 0xa08462ff 0x90b080ff 0x00fefeff ""}
|
||||
{TextPositive "Text (Positive)" text_positive 0x4dc221ff 0x4d9e2eff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff 0x4dc221ff ""}
|
||||
{TextNegative "Text (Negative)" text_negative 0xc56452ff 0xbd371eff 0xc56452ff 0xc46451ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff 0xc56452ff ""}
|
||||
{TextNeutral "Text (Neutral)" text_neutral 0x307eb2ff 0x0064a7ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff 0x307eb2ff ""}
|
||||
{TextWeak "Text (Weak)" text_weak 0xa4a4a4fe 0x4c4c4cff 0xa4a4a4fe 0x0000007f 0x9999998a 0x818181ff 0x6e512eff 0x566e4bff 0x00a9a9ff ""}
|
||||
{Cursor "Cursor" cursor 0x8aff00ff 0x699830ff 0x8aff00ff 0x000000ff 0x8aff00ff 0x586e75ff 0x8aff00ff 0x8aff00ff 0x8aff00ff ""}
|
||||
{CursorInactive "Cursor (Inactive)" cursor_inactive 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff 0xb23217ff ""}
|
||||
{Focus "Focus" focus 0xfda200ff 0x9c5900ff 0xfda200ff 0x002affff 0xfda200ff 0x92743dff 0xfda200ff 0xfda200ff 0x00fefeff ""}
|
||||
{Hover "Hover" hover 0xffffffff 0xffffffff 0xffffffff 0x000000ff 0xffffffff 0x747474ff 0xffffffff 0xffffffff 0xffffffff ""}
|
||||
{DropShadow "Drop Shadow" drop_shadow 0x0000007f 0x0000004c 0x0000007f 0xa3a3a37e 0x0000007f 0xc9bfa394 0x0000007f 0x0000007f 0x0000007f ""}
|
||||
{DisabledOverlay "Disabled Overlay" disabled_overlay 0x0000003f 0xa6a6a63f 0x0000003f 0x0000003f 0x0000003f 0xe4dac090 0x0000003f 0x0000003f 0x0000003f ""}
|
||||
{DropSiteOverlay "Drop Site Overlay" drop_site_overlay 0xffffff0c 0x4848480c 0xffffff0c 0x0000000c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c 0xffffff0c ""}
|
||||
{InactivePanelOverlay "Inactive Panel Overlay" inactive_panel_overlay 0x0000003f 0xa4a4a43f 0x0000003f 0xfefefe53 0x0000003f 0x0000001c 0x0000003f 0x0000003f 0x0000003f ""}
|
||||
{SelectionOverlay "Selection Overlay" selection_overlay 0x99ccff4c 0x003d7a48 0x99ccff4c 0x3d74ab4b 0x99ccff4c 0x678cb24c 0x99ccff4c 0x99ccff4c 0x99ccff4c ""}
|
||||
{HighlightOverlay "Highlight Overlay" highlight_overlay 0xffffff1e 0xffffff1e 0xffffff1e 0x0000001e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e 0xffffff1e ""}
|
||||
{HighlightOverlayError "Error Highlight Overlay" error_highlight_overlay 0x5f12005f 0xff30005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f 0x5f12005f ""}
|
||||
|
||||
//- rjf: base ui container colors
|
||||
{BaseBackground "Base Background" base_background 0x1b1b1bfe 0xccccccfe 0x1b1b1bfe 0xfefefefe 0x002a35fe 0xfcf5e2fe 0x0c0c0cfe 0x0c0c0cfe 0x000081fe ""}
|
||||
{BaseBackgroundAlt "Base Background (Alternate)" base_background_alt 0x2b2b2bfe 0x2b2b2bfe 0x1b1b1bfe 0xe7e7e7fe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe 0x2b2b2bfe ""}
|
||||
{BaseBorder "Base Border" base_border 0x3f3f3ffe 0xa4a4a4fe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x423525fe 0x3f3f3ffe 0x0000fffe ""}
|
||||
|
||||
//- rjf: menu bar ui container colors
|
||||
{MenuBarBackground "Menu Bar Background" menu_bar_background 0x3e4c577f 0xeaeaea7f 0x1b1b1bfd 0xffffff7f 0x00202bff 0xeee8d5ff 0x0c0c0cfe 0x0c0c0cfe 0x007d7dff ""}
|
||||
{MenuBarBackgroundAlt "Menu Bar Background (Alternate)" menu_bar_background_alt 0x3e4c577f 0x3e4c577f 0x1b1b1bfd 0xffffff7f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x3e4c577f 0x007d7dff ""}
|
||||
{MenuBarBorder "Menu Bar Border" menu_bar_border 0xffffff19 0xa4a4a4fe 0x3f3f3ffe 0xb6b6b6ff 0xffffff19 0xbebaabfe 0xffffff19 0xffffff19 0xfefefe00 ""}
|
||||
|
||||
//- rjf: floating ui container colors
|
||||
{FloatingBackground "Floating Background" floating_background 0x33333333 0xccccccc0 0x33333333 0xfefefec7 0x007fa14e 0xffffff7c 0x0c0c0c32 0x0c0c0c3e 0x007c7c55 ""}
|
||||
{FloatingBackgroundAlt "Floating Background (Alternate)" floating_background_alt 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 0x33333333 ""}
|
||||
{FloatingBorder "Floating Border" floating_border 0x3f3f3ffd 0xa4a4a4fe 0x3f3f3ffd 0xb6b6b6ff 0xfdfdfd3a 0xbebaabfe 0x423425fe 0x3f3f3ffd 0x00ffff55 ""}
|
||||
|
||||
//- rjf: ui element colors
|
||||
{ImplicitButtonBackground "Implicit Button Background" implicit_button_background 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ""}
|
||||
{ImplicitButtonBorder "Implicit Button Border" implicit_button_border 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbdb9aa00 0x00000000 0x00000000 0x00000000 ""}
|
||||
{PlainButtonBackground "Plain Button Background" plain_button_background 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe 0x1b1b1bfe ""}
|
||||
{PlainButtonBorder "Plain Button Border" plain_button_border 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffe 0x3f3f3ffe 0x3f3f3ffe ""}
|
||||
{PositivePopButtonBackground "Positive Pop Button Background" positive_pop_button_background 0x2c5b36ff 0x65f534ff 0x2c5b36ff 0x84ce93ff 0x2c5b36ff 0xb6ddbeff 0x132e19ff 0x152f1bff 0x2c5b36ff ""}
|
||||
{PositivePopButtonBorder "Positive Pop Button Border" positive_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{NegativePopButtonBackground "Negative Pop Button Background" negative_pop_button_background 0x803425ff 0xff694cff 0x803425ff 0xbd3e24ff 0x803425ff 0xf8b0a1ff 0x803425ff 0x43150cff 0x803425ff ""}
|
||||
{NegativePopButtonBorder "Negative Pop Button Border" negative_pop_button_border 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{NeutralPopButtonBackground "Neutral Pop Button Background" neutral_pop_button_background 0x355b6eff 0xa6becaff 0x355b6eff 0x6e9db5ff 0x355b6eff 0xb2d3e3ff 0x15445cff 0x1b323eff 0x933100ff ""}
|
||||
{NeutralPopButtonBorder "Neutral Pop Button Border" neutral_pop_button_border 0x3f3f3ffd 0xa6a6a6fd 0x3f3f3ffd 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0x3f3f3ffd 0x3f3f3ffd 0x3f3f3ffd ""}
|
||||
{ScrollBarButtonBackground "Scroll Bar Button Background" scroll_bar_button_background 0x2b2b2bfe 0xa9a9a9fe 0x2b2b2bfe 0xe8e8e8fe 0x005e77fe 0xe3dbc7fe 0x1f1f27fe 0x212721fe 0x007d7dff ""}
|
||||
{ScrollBarButtonBorder "Scroll Bar Button Border" scroll_bar_button_border 0x3f3f3ffe 0xc0c0c0fe 0x3f3f3ffe 0xb6b6b6ff 0xfefefe3a 0xbebaabfe 0xfefefe4d 0x3f3f3ffe 0x3f3f3ffe ""}
|
||||
{TabBackground "Tab Background" tab_background 0x6f5135fe 0xa98b6fff 0x0079ccff 0xfffffffe 0x005e77fe 0xfdf6e3ff 0x1f1f27fe 0x212721fe 0x007d7dff ""}
|
||||
{TabBorder "Tab Border" tab_border 0xfefefe4d 0xffffff4d 0xfefefe4d 0xb6b6b6ff 0xfefefe4d 0xbebaabfe 0xfefefe4d 0xfefefe4d 0xfefefe4d ""}
|
||||
{TabBackgroundInactive "Tab Background (Inactive)" tab_background_inactive 0x3e4c577f 0x8282827f 0xfefefe14 0xcdd4dc7f 0x3e4c577f 0xd4cfc0fe 0x131315ee 0x3a3a3a7f 0x3e4c577f ""}
|
||||
{TabBorderInactive "Tab Border (Inactive)" tab_border_inactive 0xffffff19 0xffffff19 0xffffff00 0xb6b6b6ff 0xffffff19 0xbebaabfe 0xffffff19 0x00000019 0xfefefe19 ""}
|
||||
|
||||
//- rjf: code colors
|
||||
{CodeDefault "Code (Default)" code_default 0xcbcbcbff 0x4d4d4dff 0xcbcbcbff 0x000000ff 0xcbcbcbff 0x657b83ff 0xa08462ff 0x90b080ff 0x00fefeff ""}
|
||||
{CodeSymbol "Code (Symbol)" code_symbol 0x42a2cffe 0x205670fe 0xdcdcaaff 0x000000ff 0xcb4a15ff 0xcb4a15ff 0xcc5634ff 0x42a2cffe 0x65b1ffff ""}
|
||||
{CodeType "Code (Type)" code_type 0xfec746ff 0x996b00ff 0x4ec9afff 0xa33700ff 0xcb4a15ff 0xcb4a15ff 0xd8a51bff 0xfd7c52ff 0xfec746ff ""}
|
||||
{CodeLocal "Code (Local)" code_local 0x98bc80ff 0x446a2bff 0x9cdbfeff 0x007666ff 0x98bc80ff 0x258ad2ff 0xc04047ff 0x98bc80ff 0x00ff00ff ""}
|
||||
{CodeRegister "Code (Register)" code_register 0xb7afd5ff 0x4c35a1ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff 0x373345ff 0xb7afd5ff 0xb7afd5ff 0xb7afd5ff ""}
|
||||
{CodeKeyword "Code (Keyword)" code_keyword 0xb38d4cff 0x573700ff 0x569cd6ff 0x0000ffff 0x849803ff 0x586e75ff 0xac7a09ff 0xd08f1eff 0x00ffffff ""}
|
||||
{CodeDelimiterOperator "Code (Delimiters/Operators)" code_delimiter_operator 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0x767676ff 0xa08462ff 0x90b080ff 0xffffffff ""}
|
||||
{CodeNumeric "Code (Numeric)" code_numeric 0x98abb1ff 0x3f6e7dff 0xb5cea8ff 0x088658ff 0xd33582ff 0xd33482ef 0x698e21ff 0x4fff2eff 0x00ff00ff ""}
|
||||
{CodeNumericAltDigitGroup "Code (Numeric, Alt. Digit Group)" code_numeric_alt_digit_group 0x738287ff 0x1f4450ff 0x729360ff 0x0c3828ff 0x902559ff 0x8e2659ff 0x3a4e11ff 0x3ccd21ff 0x738287ff ""}
|
||||
{CodeString "Code (String)" code_string 0x98abb1ff 0x3c606bff 0xd59b85ff 0xa31414ff 0x1f9d91ff 0x29a198ff 0x6a8e22ff 0x4fff2eff 0x98abb1ff ""}
|
||||
{CodeMeta "Code (Meta)" code_meta 0xd96759ff 0xad3627ff 0xd59c85ff 0x0000ffff 0x839802ff 0xd96759ff 0xdab98fff 0xa0b8a0ff 0xff0000ff ""}
|
||||
{CodeComment "Code (Comment)" code_comment 0x717171ff 0x4b4b4bff 0x57a54aff 0x008000ff 0x556a6fff 0x93a1a1ff 0x686868ff 0x1e8fefff 0xffffffff ""}
|
||||
{CodeLineNumbers "Code Line Numbers" code_line_numbers 0x7f7f7fff 0x4b4b4bff 0x2a91afff 0x227893ff 0x566c73ff 0x227893ef 0xa08462ff 0x7e7e7ffe 0x007d7dff ""}
|
||||
{CodeLineNumbersSelected "Code Line Numbers (Selected)" code_line_numbers_selected 0xbebebeff 0x000000ff 0x9ddaecff 0x123d4bfe 0xa2aaacff 0x111e22ef 0xc8b399ff 0xbebebeff 0x00fefeff ""}
|
||||
|
||||
//- rjf: debugging colors
|
||||
{LineInfoBackground0 "Line Info Background 0" line_info_background_0 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""}
|
||||
{LineInfoBackground1 "Line Info Background 1" line_info_background_1 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f ""}
|
||||
{LineInfoBackground2 "Line Info Background 2" line_info_background_2 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f ""}
|
||||
{LineInfoBackground3 "Line Info Background 3" line_info_background_3 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f ""}
|
||||
{LineInfoBackground4 "Line Info Background 4" line_info_background_4 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f 0x99503d3f ""}
|
||||
{LineInfoBackground5 "Line Info Background 5" line_info_background_5 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f 0xfe82493f ""}
|
||||
{LineInfoBackground6 "Line Info Background 6" line_info_background_6 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f 0xffba173f ""}
|
||||
{LineInfoBackground7 "Line Info Background 7" line_info_background_7 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f 0xcefd693f ""}
|
||||
{Thread0 "Thread 0" thread_0 0xffcb7fff 0x945800ff 0xffcb7fff 0x945800ff 0xffcb7fff 0x945800ff 0xffcb7fff 0xffcb7fff 0xffcb7fff ""}
|
||||
{Thread1 "Thread 1" thread_1 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0x3f5b23ff 0xb2ff65ff 0xb2ff65ff 0xb2ff65ff ""}
|
||||
{Thread2 "Thread 2" thread_2 0xff99e5ff 0x642a55ff 0xff99e5ff 0x642a55ff 0xff99e5ff 0x642a55ff 0xff99e5ff 0xff99e5ff 0xff99e5ff ""}
|
||||
{Thread3 "Thread 3" thread_3 0x6598ffff 0x30456fff 0x6598ffff 0x30456fff 0x6598ffff 0x30456fff 0x6598ffff 0x6598ffff 0x6598ffff ""}
|
||||
{Thread4 "Thread 4" thread_4 0x65ffcbff 0x264f41ff 0x65ffcbff 0x264f41ff 0x65ffcbff 0x264f41ff 0x65ffcbff 0x65ffcbff 0x65ffcbff ""}
|
||||
{Thread5 "Thread 5" thread_5 0xff9819ff 0x736a5fff 0xff9819ff 0x736a5fff 0xff9819ff 0x736a5fff 0xff9819ff 0xff9819ff 0xff9819ff ""}
|
||||
{Thread6 "Thread 6" thread_6 0x9932ffff 0x472f5eff 0x9932ffff 0x472f5eff 0x9932ffff 0x472f5eff 0x9932ffff 0x9932ffff 0x9932ffff ""}
|
||||
{Thread7 "Thread 7" thread_7 0x65ff4cff 0x405d3bff 0x65ff4cff 0x405d3bff 0x65ff4cff 0x405d3bff 0x65ff4cff 0x65ff4cff 0x65ff4cff ""}
|
||||
{ThreadUnwound "Thread (Unwound)" thread_unwound 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0x49606aff 0xb2ccd8ff 0xb2ccd8ff 0xb2ccd8ff ""}
|
||||
{ThreadError "Thread (Error)" thread_error 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23219ff 0xb23218ff 0xb23219ff 0xb23219ff 0xb23219ff ""}
|
||||
{Breakpoint "Breakpoint" breakpoint 0xa72911ff 0xff2800ff 0xa72911ff 0xa72911ff 0xa72911ff 0xff684bff 0xa72911ff 0xa72911ff 0xff2800ff ""}
|
||||
}
|
||||
|
||||
@table(old_name new_name)
|
||||
DF_ThemeColorVersionRemapTable:
|
||||
{
|
||||
{plain_text text}
|
||||
{plain_background base_background}
|
||||
{plain_border base_border}
|
||||
{plain_overlay drop_site_overlay}
|
||||
{code_function code_symbol}
|
||||
{code_symbol code_delimiter_operator}
|
||||
{code_numeric code_numeric_alt_digit_group}
|
||||
{line_info_0 line_info_background_0}
|
||||
{line_info_1 line_info_background_1}
|
||||
{line_info_2 line_info_background_2}
|
||||
{line_info_3 line_info_background_3}
|
||||
{alt_background menu_bar_background}
|
||||
{alt_border menu_bar_border}
|
||||
{tab_inactive tab_background_inactive}
|
||||
{tab_active tab_background}
|
||||
{weak_text text_weak}
|
||||
{text_selection selection}
|
||||
{cursor cursor}
|
||||
{highlight_0 focus}
|
||||
{success_background positive_pop_button_background}
|
||||
{failure_background negative_pop_button_background}
|
||||
{action_background neutral_pop_button_background}
|
||||
}
|
||||
|
||||
@enum DF_ThemeColor:
|
||||
{
|
||||
@expand(DF_ThemeColorTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum DF_ThemePreset:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.display_string)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_preset_code_string_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `str8_lit_comp("$(a.name_lower)")`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_version_remap_old_name_table:
|
||||
{
|
||||
@expand(DF_ThemeColorVersionRemapTable a) `str8_lit_comp("$(a.old_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_version_remap_new_name_table:
|
||||
{
|
||||
@expand(DF_ThemeColorVersionRemapTable a) `str8_lit_comp("$(a.new_name)")`
|
||||
}
|
||||
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.default_dark))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__default_light: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.default_light))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.vs_dark))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__vs_light: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.vs_light))`}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_dark: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.solarized_dark))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__solarized_light:{@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.solarized_light))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__handmade_hero: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.handmade_hero))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__four_coder: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.four_coder))`,}
|
||||
@data(Vec4F32) df_g_theme_preset_colors__far_manager: {@expand(DF_ThemeColorTable a) `rgba_from_u32_lit_comp($(a.far_manager))`;}
|
||||
@data(`Vec4F32*`) df_g_theme_preset_colors_table:
|
||||
{
|
||||
@expand(DF_ThemePresetTable a) `df_g_theme_preset_colors__$(a.name_lower)`,
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_display_string_table:
|
||||
{
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.display_name)")`
|
||||
@expand(DF_ThemeColorTable a) `str8_lit_comp("$(a.display_name)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_theme_color_cfg_string_table:
|
||||
{
|
||||
@expand(DF_ThemeTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
@expand(DF_ThemeColorTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Settings
|
||||
|
||||
@table(name name_lower display_string default_s32 s32_min s32_max)
|
||||
DF_SettingTable:
|
||||
{
|
||||
{HoverAnimations hover_animations "Hover Animations" 1 0 1 }
|
||||
{PressAnimations press_animations "Press Animations" 1 0 1 }
|
||||
{FocusAnimations focus_animations "Focus Animations" 1 0 1 }
|
||||
{TooltipAnimations tooltip_animations "Tooltip Animations" 1 0 1 }
|
||||
{MenuAnimations menu_animations "Menu Animations" 1 0 1 }
|
||||
{ScrollingAnimations scrolling_animations "Scrolling Animations" 1 0 1 }
|
||||
{BackgroundBlur background_blur "Background Blur" 1 0 1 }
|
||||
{ThreadLines thread_lines "Thread Lines" 1 0 1 }
|
||||
{BreakpointLines breakpoint_lines "Breakpoint Lines" 1 0 1 }
|
||||
{ThreadGlow thread_glow "Thread Glow" 1 0 1 }
|
||||
{BreakpointGlow breakpoint_glow "Breakpoint Glow" 1 0 1 }
|
||||
{OpaqueBackgrounds opaque_backgrounds "Opaque Backgrounds" 0 0 1 }
|
||||
{TabWidth tab_width "Tab Width" 4 1 32 }
|
||||
}
|
||||
|
||||
@enum DF_SettingCode:
|
||||
{
|
||||
@expand(DF_SettingTable a) `$(a.name)`,
|
||||
COUNT
|
||||
}
|
||||
|
||||
@data(String8) df_g_setting_code_display_string_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `str8_lit_comp("$(a.display_string)")`
|
||||
}
|
||||
|
||||
@data(String8) df_g_setting_code_lower_string_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `str8_lit_comp("$(a.name_lower)")`
|
||||
}
|
||||
|
||||
@data(DF_SettingVal) df_g_setting_code_default_val_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `{1, $(a.default_s32)}`
|
||||
}
|
||||
|
||||
@data(Rng1S32) df_g_setting_code_s32_range_table:
|
||||
{
|
||||
@expand(DF_SettingTable a) `{$(a.s32_min), $(a.s32_max)}`
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -645,7 +648,7 @@ raddbg_readme:
|
||||
{
|
||||
@p "`--help` Displays a help menu which documents the possible command line options.";
|
||||
@p "`--user:<path>` Specifies a path to the user file which the debugger should use instead of the default. The default user file is stored at `%appdata%/raddbg/default.raddbg_user`. For more information on user files, read the 'User & Profile Files' section.";
|
||||
@p "`--profile:<path>` Specifies a path to the profile file which the debugger should use instead of the default. The default profile file is stored at `%appdata%/raddbg/default.raddbg_profile`. For more information on profile files, read the 'User & Profile Files' section.";
|
||||
@p "`--project:<path>` Specifies a path to the project file which the debugger should use instead of the default. The default project file is stored at `%appdata%/raddbg/default.raddbg_project`. For more information on project files, read the 'User & Project Files' section.";
|
||||
@p "`--auto_run` Specifies that the debugger should immediately run its selected targets upon launching.";
|
||||
@p "`--auto_step` Specifies that the debugger should immediately step into its selected targets upon launching.";
|
||||
//@p "`--ipc` Specifies that the launched debugger instance is for communicating a command to another instance of the debugger. In this mode, any non-argument command line contents will be used to express a command. For more information on commands, read the 'Commands' section. For more information on driving another debugger instance with this argument, read the 'Driving Another Debugger Instance' section."
|
||||
@@ -684,7 +687,7 @@ raddbg_readme:
|
||||
@subtitle "Targets";
|
||||
@p "A *target* is one executable and configuration for launching that executable, including command line arguments and working directory (the directory from which the executable is launched). Each target may also have a custom label (replaces the executable path when visualizing the target), and the name of a custom entry point function (when the default entry points - `main`, `WinMain`, etc. - are not desired when stepping into the program upon launch). The debugger can have several targets at once. Each target can also be enabled or disabled. Some operations work on all enabled targets - for instance, the `Run` or `Kill All` commands (standardly bound as F5 or Shift + F5). Enabling and disabling targets allows one to filter which targets are currently being worked with.";
|
||||
@p "To add a target, you can run the `Add Target` command. A target is also created automatically from command line arguments - the rules for how this happens can be found in the `Command-Line Usage` section.";
|
||||
@p "Targets created through command line usage are temporary, meaning they are not persistently saved across runs of the debugger. To change this, you can right click the command-line-created target in the `Targets` view, and click `Save To Profile`. After doing so, the target will be restored across runs, and will no longer need to be specified on the command-line.";
|
||||
@p "Targets created through command line usage are temporary, meaning they are not persistently saved across runs of the debugger. To change this, you can right click the command-line-created target in the `Targets` view, and click `Save To Project`. After doing so, the target will be restored across runs, and will no longer need to be specified on the command-line.";
|
||||
|
||||
@subtitle "View Rules";
|
||||
@p "*View Rules* are used to transform the way that evaluations in the debugger are visualized. An evaluation is produced by taking an expression string - for instance, the name of a variable - and using debug info and information from an attached process' live runtime (memory, registers, and so on) to interpret it.";
|
||||
@@ -703,11 +706,11 @@ raddbg_readme:
|
||||
@p "Each breakpoint has a hit count. Every time a breakpoint causes execution to stop, this counter is increased.";
|
||||
@p "Processor breakpoints are not currently supported, but planned to be in the future.";
|
||||
|
||||
@subtitle "User & Profile Files";
|
||||
@p "Applicable state controlling the debugger's appearance, behavior, targets, breakpoints, and other configurations is saved and reloaded across runs of the debugger through both *user files* and *profile files*. These files are auto-saved. These files are written in a textual format which can be hand-edited as necessary, but they're also continuously re-read and re-written by the debugger. By default, the debugger uses `%appdata%/raddbg/default.raddbg_user` for its user file path, and `%appdata%/raddbg/default.raddbg_profile` for its profile file path. These paths can be overridden on the command line (see the 'Command-Line Usage' section).";
|
||||
@subtitle "User & Project Files";
|
||||
@p "Applicable state controlling the debugger's appearance, behavior, targets, breakpoints, and other configurations is saved and reloaded across runs of the debugger through both *user files* and *project files*. These files are auto-saved. These files are written in a textual format which can be hand-edited as necessary, but they're also continuously re-read and re-written by the debugger. By default, the debugger uses `%appdata%/raddbg/default.raddbg_user` for its user file path, and `%appdata%/raddbg/default.raddbg_project` for its project file path. These paths can be overridden on the command line (see the 'Command-Line Usage' section).";
|
||||
@p "The *user file* defaultly stores file path maps, windows (including their preferred monitor, placement, and size), each window's panel layout and tabs, keybindings, theme colors, and fonts.";
|
||||
@p "The *profile file* defaultly stores targets, breakpoints, watch pins, and exception code filters.";
|
||||
@p "Because both can be hand-edited, however, if you want to store something normally stored in a user file in a profile file, or vice versa, this can be done by hand transferring the textual data from one file to another. There is no path in the debugger's UI to support this transfer, currently, although this is planned.";
|
||||
@p "The *project file* defaultly stores targets, breakpoints, watch pins, and exception code filters.";
|
||||
@p "Because both can be hand-edited, however, if you want to store something normally stored in a user file in a project file, or vice versa, this can be done by hand transferring the textual data from one file to another. There is no path in the debugger's UI to support this transfer, currently, although this is planned.";
|
||||
|
||||
//@subtitle "Driving Another Debugger Instance";
|
||||
//@p "When the debugger is launched with the `--ipc` command-line argument, it does not launch another instance of the graphical debugger. Instead, it launches, sends a string encoding a command to a running instance of the graphical debugger, and then terminates. The set of commands which can be sent are identical to those which can be run from the debugger's UI itself, but these commands must be encoded textually (through the other command-line arguments). These commands are described in the 'Commands' section.";
|
||||
|
||||
@@ -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
@@ -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
|
||||
+3682
-3343
File diff suppressed because it is too large
Load Diff
+157
-57
@@ -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;
|
||||
@@ -328,18 +359,30 @@ struct DF_EvalWatchViewState
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Code @view_types
|
||||
//~ rjf: Code, Output @view_types
|
||||
|
||||
typedef U32 DF_CodeViewFlags;
|
||||
enum
|
||||
{
|
||||
DF_CodeViewFlag_StickToBottom = (1<<0),
|
||||
};
|
||||
|
||||
typedef U32 DF_CodeViewBuildFlags;
|
||||
enum
|
||||
{
|
||||
DF_CodeViewBuildFlag_Margins = (1<<0),
|
||||
DF_CodeViewBuildFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
typedef struct DF_CodeViewState DF_CodeViewState;
|
||||
struct DF_CodeViewState
|
||||
{
|
||||
// rjf: stable state
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
B32 drifted_for_search;
|
||||
DF_Handle pick_file_override_target;
|
||||
DF_CodeViewFlags flags;
|
||||
|
||||
// rjf: per-frame command info
|
||||
S64 goto_line_num;
|
||||
@@ -356,24 +399,12 @@ struct DF_CodeViewState
|
||||
typedef struct DF_DisasmViewState DF_DisasmViewState;
|
||||
struct DF_DisasmViewState
|
||||
{
|
||||
// rjf: stable state
|
||||
B32 initialized;
|
||||
DF_Handle process;
|
||||
U64 base_vaddr;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
B32 drifted_for_search;
|
||||
DASM_StyleFlags style_flags;
|
||||
|
||||
// rjf: per-frame command info
|
||||
S64 goto_line_num;
|
||||
U64 goto_vaddr;
|
||||
B32 center_cursor;
|
||||
B32 contain_cursor;
|
||||
Arena *find_text_arena;
|
||||
String8 find_text_fwd;
|
||||
String8 find_text_bwd;
|
||||
DF_CodeViewState cv;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -403,6 +434,56 @@ struct DF_MemoryViewState
|
||||
B32 contain_cursor;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Settings @view_types
|
||||
|
||||
typedef enum DF_SettingsItemKind
|
||||
{
|
||||
DF_SettingsItemKind_CategoryHeader,
|
||||
DF_SettingsItemKind_Setting,
|
||||
DF_SettingsItemKind_ThemeColor,
|
||||
DF_SettingsItemKind_ThemePreset,
|
||||
DF_SettingsItemKind_COUNT
|
||||
}
|
||||
DF_SettingsItemKind;
|
||||
|
||||
typedef struct DF_SettingsItem DF_SettingsItem;
|
||||
struct DF_SettingsItem
|
||||
{
|
||||
DF_SettingsItemKind kind;
|
||||
String8 kind_string;
|
||||
String8 string;
|
||||
FuzzyMatchRangeList kind_string_matches;
|
||||
FuzzyMatchRangeList string_matches;
|
||||
DF_IconKind icon_kind;
|
||||
DF_SettingCode code;
|
||||
DF_ThemeColor color;
|
||||
DF_ThemePreset preset;
|
||||
DF_SettingsItemKind category;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemNode DF_SettingsItemNode;
|
||||
struct DF_SettingsItemNode
|
||||
{
|
||||
DF_SettingsItemNode *next;
|
||||
DF_SettingsItem v;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemList DF_SettingsItemList;
|
||||
struct DF_SettingsItemList
|
||||
{
|
||||
DF_SettingsItemNode *first;
|
||||
DF_SettingsItemNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct DF_SettingsItemArray DF_SettingsItemArray;
|
||||
struct DF_SettingsItemArray
|
||||
{
|
||||
DF_SettingsItem *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Quick Sort Comparisons
|
||||
|
||||
@@ -414,6 +495,7 @@ internal int df_qsort_compare_file_info__size(DF_FileInfo *a, DF_FileInfo *b);
|
||||
internal int df_qsort_compare_process_info(DF_ProcessInfo *a, DF_ProcessInfo *b);
|
||||
internal int df_qsort_compare_cmd_lister__strength(DF_CmdListerItem *a, DF_CmdListerItem *b);
|
||||
internal int df_qsort_compare_entity_lister__strength(DF_EntityListerItem *a, DF_EntityListerItem *b);
|
||||
internal int df_qsort_compare_settings_item(DF_SettingsItem *a, DF_SettingsItem *b);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Command Lister
|
||||
@@ -437,27 +519,45 @@ 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: Code Views
|
||||
|
||||
internal void df_code_view_init(DF_CodeViewState *cv, DF_View *view);
|
||||
internal void df_code_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CmdList *cmds, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
internal void df_code_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_CodeViewState *cv, DF_CodeViewBuildFlags flags, Rng2F32 rect, String8 text_data, TXT_TextInfo *text_info, DASM_InstArray *dasm_insts, Rng1U64 dasm_vaddr_range, DI_Key dasm_dbgi_key);
|
||||
|
||||
////////////////////////////////
|
||||
//~ 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
|
||||
|
||||
+1094
-722
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
@@ -45,55 +38,76 @@ DF_GfxViewKind_Memory,
|
||||
DF_GfxViewKind_Breakpoints,
|
||||
DF_GfxViewKind_WatchPins,
|
||||
DF_GfxViewKind_ExceptionFilters,
|
||||
DF_GfxViewKind_Theme,
|
||||
DF_GfxViewKind_Settings,
|
||||
DF_GfxViewKind_COUNT,
|
||||
} DF_GfxViewKind;
|
||||
|
||||
typedef enum DF_ThemeColor
|
||||
{
|
||||
DF_ThemeColor_Null,
|
||||
DF_ThemeColor_PlainText,
|
||||
DF_ThemeColor_PlainBackground,
|
||||
DF_ThemeColor_PlainBorder,
|
||||
DF_ThemeColor_PlainOverlay,
|
||||
DF_ThemeColor_Text,
|
||||
DF_ThemeColor_TextPositive,
|
||||
DF_ThemeColor_TextNegative,
|
||||
DF_ThemeColor_TextNeutral,
|
||||
DF_ThemeColor_TextWeak,
|
||||
DF_ThemeColor_Cursor,
|
||||
DF_ThemeColor_CursorInactive,
|
||||
DF_ThemeColor_Focus,
|
||||
DF_ThemeColor_Hover,
|
||||
DF_ThemeColor_DropShadow,
|
||||
DF_ThemeColor_DisabledOverlay,
|
||||
DF_ThemeColor_DropSiteOverlay,
|
||||
DF_ThemeColor_InactivePanelOverlay,
|
||||
DF_ThemeColor_SelectionOverlay,
|
||||
DF_ThemeColor_HighlightOverlay,
|
||||
DF_ThemeColor_HighlightOverlayError,
|
||||
DF_ThemeColor_BaseBackground,
|
||||
DF_ThemeColor_BaseBackgroundAlt,
|
||||
DF_ThemeColor_BaseBorder,
|
||||
DF_ThemeColor_MenuBarBackground,
|
||||
DF_ThemeColor_MenuBarBackgroundAlt,
|
||||
DF_ThemeColor_MenuBarBorder,
|
||||
DF_ThemeColor_FloatingBackground,
|
||||
DF_ThemeColor_FloatingBackgroundAlt,
|
||||
DF_ThemeColor_FloatingBorder,
|
||||
DF_ThemeColor_ImplicitButtonBackground,
|
||||
DF_ThemeColor_ImplicitButtonBorder,
|
||||
DF_ThemeColor_PlainButtonBackground,
|
||||
DF_ThemeColor_PlainButtonBorder,
|
||||
DF_ThemeColor_PositivePopButtonBackground,
|
||||
DF_ThemeColor_PositivePopButtonBorder,
|
||||
DF_ThemeColor_NegativePopButtonBackground,
|
||||
DF_ThemeColor_NegativePopButtonBorder,
|
||||
DF_ThemeColor_NeutralPopButtonBackground,
|
||||
DF_ThemeColor_NeutralPopButtonBorder,
|
||||
DF_ThemeColor_ScrollBarButtonBackground,
|
||||
DF_ThemeColor_ScrollBarButtonBorder,
|
||||
DF_ThemeColor_TabBackground,
|
||||
DF_ThemeColor_TabBorder,
|
||||
DF_ThemeColor_TabBackgroundInactive,
|
||||
DF_ThemeColor_TabBorderInactive,
|
||||
DF_ThemeColor_CodeDefault,
|
||||
DF_ThemeColor_CodeFunction,
|
||||
DF_ThemeColor_CodeSymbol,
|
||||
DF_ThemeColor_CodeType,
|
||||
DF_ThemeColor_CodeLocal,
|
||||
DF_ThemeColor_CodeRegister,
|
||||
DF_ThemeColor_CodeKeyword,
|
||||
DF_ThemeColor_CodeSymbol,
|
||||
DF_ThemeColor_CodeDelimiterOperator,
|
||||
DF_ThemeColor_CodeNumeric,
|
||||
DF_ThemeColor_CodeNumericAltDigitGroup,
|
||||
DF_ThemeColor_CodeString,
|
||||
DF_ThemeColor_CodeMeta,
|
||||
DF_ThemeColor_CodeComment,
|
||||
DF_ThemeColor_LineInfo0,
|
||||
DF_ThemeColor_LineInfo1,
|
||||
DF_ThemeColor_LineInfo2,
|
||||
DF_ThemeColor_LineInfo3,
|
||||
DF_ThemeColor_AltText,
|
||||
DF_ThemeColor_AltBackground,
|
||||
DF_ThemeColor_AltBorder,
|
||||
DF_ThemeColor_AltOverlay,
|
||||
DF_ThemeColor_TabInactive,
|
||||
DF_ThemeColor_TabActive,
|
||||
DF_ThemeColor_EntityBackground,
|
||||
DF_ThemeColor_QueryBar,
|
||||
DF_ThemeColor_WeakText,
|
||||
DF_ThemeColor_TextSelection,
|
||||
DF_ThemeColor_Cursor,
|
||||
DF_ThemeColor_Highlight0,
|
||||
DF_ThemeColor_Highlight1,
|
||||
DF_ThemeColor_SuccessText,
|
||||
DF_ThemeColor_SuccessBackground,
|
||||
DF_ThemeColor_SuccessBorder,
|
||||
DF_ThemeColor_FailureText,
|
||||
DF_ThemeColor_FailureBackground,
|
||||
DF_ThemeColor_FailureBorder,
|
||||
DF_ThemeColor_ActionText,
|
||||
DF_ThemeColor_ActionBackground,
|
||||
DF_ThemeColor_ActionBorder,
|
||||
DF_ThemeColor_DropSiteOverlay,
|
||||
DF_ThemeColor_CodeLineNumbers,
|
||||
DF_ThemeColor_CodeLineNumbersSelected,
|
||||
DF_ThemeColor_LineInfoBackground0,
|
||||
DF_ThemeColor_LineInfoBackground1,
|
||||
DF_ThemeColor_LineInfoBackground2,
|
||||
DF_ThemeColor_LineInfoBackground3,
|
||||
DF_ThemeColor_LineInfoBackground4,
|
||||
DF_ThemeColor_LineInfoBackground5,
|
||||
DF_ThemeColor_LineInfoBackground6,
|
||||
DF_ThemeColor_LineInfoBackground7,
|
||||
DF_ThemeColor_Thread0,
|
||||
DF_ThemeColor_Thread1,
|
||||
DF_ThemeColor_Thread2,
|
||||
@@ -103,8 +117,8 @@ DF_ThemeColor_Thread5,
|
||||
DF_ThemeColor_Thread6,
|
||||
DF_ThemeColor_Thread7,
|
||||
DF_ThemeColor_ThreadUnwound,
|
||||
DF_ThemeColor_InactivePanelOverlay,
|
||||
DF_ThemeColor_DropShadow,
|
||||
DF_ThemeColor_ThreadError,
|
||||
DF_ThemeColor_Breakpoint,
|
||||
DF_ThemeColor_COUNT,
|
||||
} DF_ThemeColor;
|
||||
|
||||
@@ -122,8 +136,27 @@ DF_ThemePreset_FarManager,
|
||||
DF_ThemePreset_COUNT,
|
||||
} DF_ThemePreset;
|
||||
|
||||
typedef enum DF_SettingCode
|
||||
{
|
||||
DF_SettingCode_HoverAnimations,
|
||||
DF_SettingCode_PressAnimations,
|
||||
DF_SettingCode_FocusAnimations,
|
||||
DF_SettingCode_TooltipAnimations,
|
||||
DF_SettingCode_MenuAnimations,
|
||||
DF_SettingCode_ScrollingAnimations,
|
||||
DF_SettingCode_BackgroundBlur,
|
||||
DF_SettingCode_ThreadLines,
|
||||
DF_SettingCode_BreakpointLines,
|
||||
DF_SettingCode_ThreadGlow,
|
||||
DF_SettingCode_BreakpointGlow,
|
||||
DF_SettingCode_OpaqueBackgrounds,
|
||||
DF_SettingCode_TabWidth,
|
||||
DF_SettingCode_COUNT,
|
||||
} DF_SettingCode;
|
||||
|
||||
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 +165,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);
|
||||
@@ -151,9 +184,10 @@ DF_VIEW_SETUP_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Settings);
|
||||
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 +196,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);
|
||||
@@ -181,9 +215,10 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Settings);
|
||||
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 +227,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);
|
||||
@@ -211,9 +246,10 @@ DF_VIEW_CMD_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Settings);
|
||||
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 +258,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);
|
||||
@@ -241,7 +277,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Breakpoints);
|
||||
DF_VIEW_UI_FUNCTION_DEF(WatchPins);
|
||||
DF_VIEW_UI_FUNCTION_DEF(ExceptionFilters);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Theme);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Settings);
|
||||
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(list);
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(only);
|
||||
@@ -261,29 +297,50 @@ 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];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_dark[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_light[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__handmade_hero[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__four_coder[54];
|
||||
extern Vec4F32 df_g_theme_preset_colors__far_manager[54];
|
||||
extern Vec4F32* df_g_theme_preset_colors_table[9];
|
||||
extern DF_StringBindingPair df_g_default_binding_table[105];
|
||||
extern String8 df_g_binding_version_remap_old_name_table[5];
|
||||
extern String8 df_g_binding_version_remap_new_name_table[5];
|
||||
extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31];
|
||||
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 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 String8 df_g_theme_color_display_string_table[54];
|
||||
extern String8 df_g_theme_color_cfg_string_table[54];
|
||||
extern String8 df_g_theme_preset_display_string_table[9];
|
||||
extern String8 df_g_theme_preset_code_string_table[9];
|
||||
extern String8 df_g_theme_color_version_remap_old_name_table[22];
|
||||
extern String8 df_g_theme_color_version_remap_new_name_table[22];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__default_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__vs_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_dark[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__solarized_light[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__handmade_hero[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__four_coder[75];
|
||||
extern Vec4F32 df_g_theme_preset_colors__far_manager[75];
|
||||
extern Vec4F32* df_g_theme_preset_colors_table[9];
|
||||
extern String8 df_g_theme_color_display_string_table[75];
|
||||
extern String8 df_g_theme_color_cfg_string_table[75];
|
||||
extern String8 df_g_setting_code_display_string_table[13];
|
||||
extern String8 df_g_setting_code_lower_string_table[13];
|
||||
extern DF_SettingVal df_g_setting_code_default_val_table[13];
|
||||
extern Rng1S32 df_g_setting_code_s32_range_table[13];
|
||||
read_only global U8 df_g_icon_font_bytes__data[] =
|
||||
{
|
||||
0x00,0x01,0x00,0x00,0x00,0x0f,0x00,0x80,0x00,0x03,0x00,0x70,0x47,0x53,0x55,0x42,0x20,0x8b,0x25,0x7a,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x54,0x4f,0x53,0x2f,0x32,0x56,0x44,0x49,0xa0,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x60,0x63,0x6d,0x61,0x70,0x2a,0x09,0xe2,0xc2,0x00,0x00,0x01,0xb0,0x00,0x00,0x05,0xec,0x63,0x76,0x74,0x20,
|
||||
@@ -4864,6 +4921,133 @@ 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
|
||||
|
||||
+48
-14
@@ -54,6 +54,23 @@ d_fancy_string_list_push(Arena *arena, D_FancyStringList *list, D_FancyString *s
|
||||
list->total_size += str->string.size;
|
||||
}
|
||||
|
||||
internal void
|
||||
d_fancy_string_list_concat_in_place(D_FancyStringList *dst, D_FancyStringList *to_push)
|
||||
{
|
||||
if(dst->last != 0 && to_push->first != 0)
|
||||
{
|
||||
dst->last->next = to_push->first;
|
||||
dst->last = to_push->last;
|
||||
dst->node_count += to_push->node_count;
|
||||
dst->total_size += to_push->total_size;
|
||||
}
|
||||
else if(to_push->first != 0)
|
||||
{
|
||||
MemoryCopyStruct(dst, to_push);
|
||||
}
|
||||
MemoryZeroStruct(to_push);
|
||||
}
|
||||
|
||||
internal String8
|
||||
d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list)
|
||||
{
|
||||
@@ -70,14 +87,15 @@ d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list)
|
||||
}
|
||||
|
||||
internal D_FancyRunList
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, D_FancyStringList *strs)
|
||||
d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlags flags, D_FancyStringList *strs)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
D_FancyRunList run_list = {0};
|
||||
F32 base_align_px = 0;
|
||||
for(D_FancyStringNode *n = strs->first; n != 0; n = n->next)
|
||||
{
|
||||
D_FancyRunNode *dst_n = push_array(arena, D_FancyRunNode, 1);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, 0, n->v.string);
|
||||
dst_n->v.run = f_push_run_from_string(arena, n->v.font, n->v.size, base_align_px, tab_size_px, flags, n->v.string);
|
||||
dst_n->v.color = n->v.color;
|
||||
dst_n->v.underline_thickness = n->v.underline_thickness;
|
||||
dst_n->v.strikethrough_thickness = n->v.strikethrough_thickness;
|
||||
@@ -85,6 +103,12 @@ d_fancy_run_list_from_fancy_string_list(Arena *arena, D_FancyStringList *strs)
|
||||
run_list.node_count += 1;
|
||||
run_list.dim.x += dst_n->v.run.dim.x;
|
||||
run_list.dim.y = Max(run_list.dim.y, dst_n->v.run.dim.y);
|
||||
base_align_px += dst_n->v.run.dim.x;
|
||||
if(n->next != 0)
|
||||
{
|
||||
run_list.dim.x -= dst_n->v.run.end_pad;
|
||||
base_align_px -= dst_n->v.run.end_pad;
|
||||
}
|
||||
}
|
||||
ProfEnd();
|
||||
return run_list;
|
||||
@@ -288,6 +312,7 @@ d_blur(Rng2F32 rect, F32 blur_size, F32 corner_radius)
|
||||
R_Pass *pass = r_pass_from_kind(arena, &bucket->passes, R_PassKind_Blur);
|
||||
R_PassParams_Blur *params = pass->params_blur;
|
||||
params->rect = rect;
|
||||
params->clip = d_top_clip();
|
||||
params->blur_size = blur_size;
|
||||
params->corner_radii[Corner_00] = corner_radius;
|
||||
params->corner_radii[Corner_01] = corner_radius;
|
||||
@@ -450,9 +475,15 @@ d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 max_x, F_Run tra
|
||||
for(D_FancyRunNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
D_FancyRun *fr = &n->v;
|
||||
Rng1F32 pixel_range = {0};
|
||||
{
|
||||
pixel_range.min = 100000;
|
||||
pixel_range.max = 0;
|
||||
}
|
||||
F_Piece *piece_first = fr->run.pieces.v;
|
||||
F_Piece *piece_opl = piece_first + fr->run.pieces.count;
|
||||
F32 pre_advance = advance;
|
||||
F32 last_piece_end_pad = 0;
|
||||
last_color = fr->color;
|
||||
for(F_Piece *piece = piece_first;
|
||||
piece < piece_opl;
|
||||
@@ -480,14 +511,17 @@ d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 max_x, F_Run tra
|
||||
//d_rect(dst, v4f32(1, 0, 0, 1), 0, 1.f, 0.f);
|
||||
}
|
||||
advance += piece->advance;
|
||||
last_piece_end_pad = ((F32)piece->offset.x+(F32)dim_2s16(piece->subrect).x) - piece->advance;
|
||||
pixel_range.min = Min(pre_advance, pixel_range.min);
|
||||
pixel_range.max = Max(advance, pixel_range.max);
|
||||
}
|
||||
if(fr->underline_thickness > 0)
|
||||
{
|
||||
d_rect(r2f32p(p.x+pre_advance,
|
||||
d_rect(r2f32p(p.x + pixel_range.min + 1.f,
|
||||
p.y+fr->run.descent+fr->run.descent/8,
|
||||
p.x+advance + (advance-pre_advance)/8,
|
||||
p.x + pixel_range.max + last_piece_end_pad/2,
|
||||
p.y+fr->run.descent+fr->run.descent/8+fr->underline_thickness),
|
||||
fr->color, 0, 0, 1.f);
|
||||
fr->color, 0, 0, 0.8f);
|
||||
}
|
||||
if(fr->strikethrough_thickness > 0)
|
||||
{
|
||||
@@ -703,44 +737,44 @@ d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run
|
||||
}
|
||||
|
||||
internal void
|
||||
d_text(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, flags, string);
|
||||
d_text_run(p, color, run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_textf(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
d_text(font, size, p, color, string);
|
||||
d_text(font, size, base_align_px, tab_size_px, flags, p, color, string);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_text(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, 0, string);
|
||||
F_Run ellipses_run = f_push_run_from_string(scratch.arena, font, size, 0, str8_lit("..."));
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, flags, string);
|
||||
F_Run ellipses_run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, str8_lit("..."));
|
||||
d_truncated_text_run(p, color, max_x, run, ellipses_run);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
d_truncated_textf(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8f(scratch.arena, fmt, args);
|
||||
d_truncated_text(font, size, p, color, max_x, string);
|
||||
d_truncated_text(font, size, base_align_px, tab_size_px, flags, p, color, max_x, string);
|
||||
va_end(args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
+6
-5
@@ -109,8 +109,9 @@ internal U64 d_hash_from_string(String8 string);
|
||||
//~ rjf: Fancy String Type Functions
|
||||
|
||||
internal void d_fancy_string_list_push(Arena *arena, D_FancyStringList *list, D_FancyString *str);
|
||||
internal void d_fancy_string_list_concat_in_place(D_FancyStringList *dst, D_FancyStringList *to_push);
|
||||
internal String8 d_string_from_fancy_string_list(Arena *arena, D_FancyStringList *list);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_from_fancy_string_list(Arena *arena, F32 tab_size_px, F_RunFlags flags, D_FancyStringList *strs);
|
||||
internal D_FancyRunList d_fancy_run_list_copy(Arena *arena, D_FancyRunList *src);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -186,9 +187,9 @@ internal void d_truncated_fancy_run_list(Vec2F32 p, D_FancyRunList *list, F32 ma
|
||||
internal void d_truncated_fancy_run_fuzzy_matches(Vec2F32 p, D_FancyRunList *list, F32 max_x, FuzzyMatchRangeList *ranges, Vec4F32 color);
|
||||
internal void d_text_run(Vec2F32 p, Vec4F32 color, F_Run run);
|
||||
internal void d_truncated_text_run(Vec2F32 p, Vec4F32 color, F32 max_x, F_Run text_run, F_Run trailer_run);
|
||||
internal void d_text(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
internal void d_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, String8 string);
|
||||
internal void d_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, char *fmt, ...);
|
||||
internal void d_truncated_text(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, String8 string);
|
||||
internal void d_truncated_textf(F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, Vec2F32 p, Vec4F32 color, F32 max_x, char *fmt, ...);
|
||||
|
||||
#endif // DRAW_H
|
||||
|
||||
@@ -15,6 +15,3 @@ internal R_Tex2DSampleKind d_top_tex2d_sample_kind(void) {D_StackTopImp
|
||||
internal Mat3x3F32 d_top_xform2d(void) {D_StackTopImpl(XForm2D, xform2d, Mat3x3F32);}
|
||||
internal Rng2F32 d_top_clip(void) {D_StackTopImpl(Clip, clip, Rng2F32);}
|
||||
internal F32 d_top_transparency(void) {D_StackTopImpl(Transparency, transparency, F32);}
|
||||
C_LINKAGE_BEGIN
|
||||
C_LINKAGE_END
|
||||
|
||||
|
||||
@@ -46,7 +46,4 @@ internal F32 d_top_transparency(void);
|
||||
#define D_ClipScope(v) DeferLoop(d_push_clip(v), d_pop_clip())
|
||||
#define D_TransparencyScope(v) DeferLoop(d_push_transparency(v), d_pop_transparency())
|
||||
#endif
|
||||
C_LINKAGE_BEGIN
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // DRAW_META_H
|
||||
|
||||
+17
-10
@@ -23,7 +23,7 @@ eval_bytecode_from_oplist(Arena *arena, EVAL_OpList *list){
|
||||
default:
|
||||
{
|
||||
// compute bytecode advance
|
||||
U8 ctrlbits = rdi_eval_opcode_ctrlbits[opcode];
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U64 extra_byte_count = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
|
||||
U8 *next_ptr = ptr + 1 + extra_byte_count;
|
||||
@@ -63,7 +63,7 @@ eval_bytecode_from_oplist(Arena *arena, EVAL_OpList *list){
|
||||
|
||||
internal void
|
||||
eval_oplist_push_op(Arena *arena, EVAL_OpList *list, RDI_EvalOp opcode, U64 p){
|
||||
U8 ctrlbits = rdi_eval_opcode_ctrlbits[opcode];
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[opcode];
|
||||
U32 p_size = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
|
||||
EVAL_Op *node = push_array_no_zero(arena, EVAL_Op, 1);
|
||||
@@ -336,7 +336,7 @@ eval_type_unwrap_enum(TG_Graph *graph, RDI_Parsed *rdi, TG_Key key)
|
||||
TG_Key result = key;
|
||||
for(B32 good = 1; good;)
|
||||
{
|
||||
TG_Kind kind = tg_kind_from_key(key);
|
||||
TG_Kind kind = tg_kind_from_key(result);
|
||||
if(kind == TG_Kind_Enum)
|
||||
{
|
||||
result = tg_direct_from_graph_rdi_key(graph, rdi, result);
|
||||
@@ -654,7 +654,7 @@ eval_irtree_convert_hi(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, EVAL_IRTr
|
||||
TG_Kind out_kind = tg_kind_from_key(out);
|
||||
U8 in_group = eval_type_group_from_kind(in_kind);
|
||||
U8 out_group = eval_type_group_from_kind(out_kind);
|
||||
U32 conversion_rule = rdi_eval_conversion_rule(in_group, out_group);
|
||||
U32 conversion_rule = rdi_eval_conversion_kind_from_typegroups(in_group, out_group);
|
||||
if(conversion_rule == RDI_EvalConversionKind_Legal)
|
||||
{
|
||||
result = eval_irtree_convert_lo(arena, result, out_group, in_group);
|
||||
@@ -785,6 +785,11 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
TG_Key r_restype = tg_unwrapped_from_graph_rdi_key(graph, rdi, r.type_key);
|
||||
TG_Kind l_restype_kind = tg_kind_from_key(l_restype);
|
||||
TG_Kind r_restype_kind = tg_kind_from_key(r_restype);
|
||||
if(eval_kind_is_basic_or_enum(r_restype_kind))
|
||||
{
|
||||
r_restype = eval_type_unwrap_enum(graph, rdi, r_restype);
|
||||
r_restype_kind = tg_kind_from_key(r_restype);
|
||||
}
|
||||
|
||||
// analyze situation
|
||||
B32 can_generate = 0;
|
||||
@@ -952,8 +957,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 +970,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;
|
||||
}
|
||||
@@ -1078,7 +1085,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
// analyze situation
|
||||
U8 in_group = eval_type_group_from_kind(c_restype_kind);
|
||||
U8 out_group = eval_type_group_from_kind(cast_type_kind);
|
||||
RDI_EvalConversionKind conversion_rule = rdi_eval_conversion_rule(in_group, out_group);
|
||||
RDI_EvalConversionKind conversion_rule = rdi_eval_conversion_kind_from_typegroups(in_group, out_group);
|
||||
|
||||
// generate tree
|
||||
switch(conversion_rule)
|
||||
@@ -1105,7 +1112,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
{
|
||||
String8 text = str8_lit("(internal) unknown conversion rule");
|
||||
if (conversion_rule < RDI_EvalConversionKind_COUNT){
|
||||
text.str = rdi_eval_conversion_message(conversion_rule, &text.size);
|
||||
text.str = rdi_explanation_string_from_eval_conversion_kind(conversion_rule, &text.size);
|
||||
}
|
||||
eval_error(arena, eout, EVAL_ErrorKind_MalformedInput, expr->location, text);
|
||||
}break;
|
||||
@@ -1170,7 +1177,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
B32 can_generate = 0;
|
||||
RDI_EvalOp op = eval_opcode_from_expr_kind(kind);
|
||||
U8 c_group = eval_type_group_from_kind(c_restype_kind);
|
||||
if (!rdi_eval_opcode_type_compatible(op, c_group)){
|
||||
if (!rdi_eval_op_typegroup_are_compatible(op, c_group)){
|
||||
eval_errorf(arena, eout, EVAL_ErrorKind_MalformedInput, expr->location, "Cannot use this operator on this type.");
|
||||
}
|
||||
else{
|
||||
@@ -1299,7 +1306,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
U8 cv_group = eval_type_group_from_kind(cv_type_kind);
|
||||
|
||||
B32 can_generate = 0;
|
||||
if (rdi_eval_opcode_type_compatible(op, cv_group)){
|
||||
if (rdi_eval_op_typegroup_are_compatible(op, cv_group)){
|
||||
can_generate = 1;
|
||||
}
|
||||
else{
|
||||
@@ -1618,7 +1625,7 @@ eval_oplist_from_irtree(Arena *arena, EVAL_IRTree *tree, EVAL_OpList *out){
|
||||
}
|
||||
else{
|
||||
// handle all children
|
||||
U8 ctrlbits = rdi_eval_opcode_ctrlbits[op];
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U64 child_count = RDI_POPN_FROM_CTRLBITS(ctrlbits);
|
||||
EVAL_IRTree**child = tree->children;
|
||||
for (U64 i = 0; i < child_count; i += 1, child += 1){
|
||||
|
||||
@@ -93,6 +93,7 @@ eval_string2num_map_insert(Arena *arena, EVAL_String2NumMap *map, String8 string
|
||||
SLLQueuePush_N(map->first, map->last, node, order_next);
|
||||
node->string = push_str8_copy(arena, string);
|
||||
node->num = num;
|
||||
map->node_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +122,41 @@ eval_num_from_string(EVAL_String2NumMap *map, String8 string)
|
||||
return num;
|
||||
}
|
||||
|
||||
internal EVAL_String2NumMapNodeArray
|
||||
eval_string2num_map_node_array_from_map(Arena *arena, EVAL_String2NumMap *map)
|
||||
{
|
||||
EVAL_String2NumMapNodeArray result = {0};
|
||||
result.count = map->node_count;
|
||||
result.v = push_array(arena, EVAL_String2NumMapNode *, result.count);
|
||||
U64 idx = 0;
|
||||
for(EVAL_String2NumMapNode *n = map->first; n != 0; n = n->order_next, idx += 1)
|
||||
{
|
||||
result.v[idx] = n;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal int
|
||||
eval_string2num_map_node_qsort_compare__num_ascending(EVAL_String2NumMapNode **a, EVAL_String2NumMapNode **b)
|
||||
{
|
||||
int result = 0;
|
||||
if(a[0]->num < b[0]->num)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a[0]->num > b[0]->num)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
eval_string2num_map_node_array_sort__in_place(EVAL_String2NumMapNodeArray *array)
|
||||
{
|
||||
quick_sort(array->v, array->count, sizeof(array->v[0]), eval_string2num_map_node_qsort_compare__num_ascending);
|
||||
}
|
||||
|
||||
//- rjf: string -> expr
|
||||
|
||||
internal EVAL_String2ExprMap
|
||||
|
||||
@@ -144,6 +144,13 @@ struct EVAL_String2NumMapNode
|
||||
U64 num;
|
||||
};
|
||||
|
||||
typedef struct EVAL_String2NumMapNodeArray EVAL_String2NumMapNodeArray;
|
||||
struct EVAL_String2NumMapNodeArray
|
||||
{
|
||||
EVAL_String2NumMapNode **v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct EVAL_String2NumMapSlot EVAL_String2NumMapSlot;
|
||||
struct EVAL_String2NumMapSlot
|
||||
{
|
||||
@@ -155,6 +162,7 @@ typedef struct EVAL_String2NumMap EVAL_String2NumMap;
|
||||
struct EVAL_String2NumMap
|
||||
{
|
||||
U64 slots_count;
|
||||
U64 node_count;
|
||||
EVAL_String2NumMapSlot *slots;
|
||||
EVAL_String2NumMapNode *first;
|
||||
EVAL_String2NumMapNode *last;
|
||||
@@ -210,6 +218,9 @@ internal void eval_error_list_concat_in_place(EVAL_ErrorList *dst, EVAL_ErrorLis
|
||||
internal EVAL_String2NumMap eval_string2num_map_make(Arena *arena, U64 slot_count);
|
||||
internal void eval_string2num_map_insert(Arena *arena, EVAL_String2NumMap *map, String8 string, U64 num);
|
||||
internal U64 eval_num_from_string(EVAL_String2NumMap *map, String8 string);
|
||||
internal EVAL_String2NumMapNodeArray eval_string2num_map_node_array_from_map(Arena *arena, EVAL_String2NumMap *map);
|
||||
internal int eval_string2num_map_node_qsort_compare__num_ascending(EVAL_String2NumMapNode **a, EVAL_String2NumMapNode **b);
|
||||
internal void eval_string2num_map_node_array_sort__in_place(EVAL_String2NumMapNodeArray *array);
|
||||
|
||||
//- rjf: string -> expr
|
||||
internal EVAL_String2ExprMap eval_string2expr_map_make(Arena *arena, U64 slot_count);
|
||||
|
||||
@@ -27,7 +27,7 @@ eval_interpret(EVAL_Machine *machine, String8 bytecode)
|
||||
result.code = EVAL_ResultCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
U8 ctrlbits = rdi_eval_opcode_ctrlbits[op];
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
ptr += 1;
|
||||
|
||||
// decode
|
||||
|
||||
+153
-183
@@ -73,10 +73,9 @@ eval_push_locals_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
||||
|
||||
//- rjf: voff -> tightest scope
|
||||
RDI_Scope *tightest_scope = 0;
|
||||
if(rdi->scope_vmap != 0 && rdi->scopes != 0)
|
||||
{
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, voff);
|
||||
RDI_Scope *scope = &rdi->scopes[scope_idx];
|
||||
U64 scope_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_ScopeVMap, voff);
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, scope_idx);
|
||||
Task *task = push_array(scratch.arena, Task, 1);
|
||||
task->scope = scope;
|
||||
SLLQueuePush(first_task, last_task, task);
|
||||
@@ -84,10 +83,10 @@ eval_push_locals_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
||||
}
|
||||
|
||||
//- rjf: voff-1 -> scope
|
||||
if(voff > 0 && rdi->scope_vmap != 0 && rdi->scopes != 0)
|
||||
if(voff > 0)
|
||||
{
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, voff-1);
|
||||
RDI_Scope *scope = &rdi->scopes[scope_idx];
|
||||
U64 scope_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_ScopeVMap, voff-1);
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, scope_idx);
|
||||
if(scope != tightest_scope)
|
||||
{
|
||||
Task *task = push_array(scratch.arena, Task, 1);
|
||||
@@ -99,9 +98,10 @@ eval_push_locals_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
||||
//- rjf: tightest scope -> walk up the tree & build tasks for each parent scope
|
||||
if(tightest_scope != 0)
|
||||
{
|
||||
for(RDI_Scope *scope = &rdi->scopes[tightest_scope->parent_scope_idx];
|
||||
scope != 0 && scope != &rdi->scopes[0];
|
||||
scope = &rdi->scopes[scope->parent_scope_idx])
|
||||
RDI_Scope *nil_scope = rdi_element_from_name_idx(rdi, Scopes, 0);
|
||||
for(RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, tightest_scope->parent_scope_idx);
|
||||
scope != 0 && scope != nil_scope;
|
||||
scope = rdi_element_from_name_idx(rdi, Scopes, scope->parent_scope_idx))
|
||||
{
|
||||
Task *task = push_array(scratch.arena, Task, 1);
|
||||
task->scope = scope;
|
||||
@@ -122,7 +122,7 @@ eval_push_locals_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
||||
U32 local_opl_idx = scope->local_first + scope->local_count;
|
||||
for(U32 local_idx = scope->local_first; local_idx < local_opl_idx; local_idx += 1)
|
||||
{
|
||||
RDI_Local *local_var = &rdi->locals[local_idx];
|
||||
RDI_Local *local_var = rdi_element_from_name_idx(rdi, Locals, local_idx);
|
||||
U64 local_name_size = 0;
|
||||
U8 *local_name_str = rdi_string_from_idx(rdi, local_var->name_string_idx, &local_name_size);
|
||||
String8 name = push_str8_copy(arena, str8(local_name_str, local_name_size));
|
||||
@@ -139,52 +139,30 @@ internal EVAL_String2NumMap *
|
||||
eval_push_member_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
||||
{
|
||||
//- rjf: voff -> tightest scope
|
||||
RDI_Scope *tightest_scope = 0;
|
||||
if(rdi->scope_vmap != 0 && rdi->scopes != 0)
|
||||
{
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, voff);
|
||||
tightest_scope = &rdi->scopes[scope_idx];
|
||||
}
|
||||
U64 scope_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_ScopeVMap, voff);
|
||||
RDI_Scope *tightest_scope = rdi_element_from_name_idx(rdi, Scopes, scope_idx);
|
||||
|
||||
//- rjf: tightest scope -> procedure
|
||||
RDI_Procedure *procedure = 0;
|
||||
if(tightest_scope != 0 && rdi->procedures != 0)
|
||||
{
|
||||
U32 proc_idx = tightest_scope->proc_idx;
|
||||
if(0 < proc_idx && proc_idx < rdi->procedures_count)
|
||||
{
|
||||
procedure = &rdi->procedures[proc_idx];
|
||||
}
|
||||
}
|
||||
U32 proc_idx = tightest_scope->proc_idx;
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, proc_idx);
|
||||
|
||||
//- rjf: procedure -> udt
|
||||
RDI_UDT *udt = 0;
|
||||
if(procedure != 0 && rdi->udts != 0 && procedure->link_flags & RDI_LinkFlag_TypeScoped)
|
||||
{
|
||||
U32 udt_idx = procedure->container_idx;
|
||||
if(0 < udt_idx && udt_idx < rdi->udts_count)
|
||||
{
|
||||
udt = &rdi->udts[udt_idx];
|
||||
}
|
||||
}
|
||||
U32 udt_idx = procedure->container_idx;
|
||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, udt_idx);
|
||||
|
||||
//- rjf: build blank map
|
||||
EVAL_String2NumMap *map = push_array(arena, EVAL_String2NumMap, 1);
|
||||
*map = eval_string2num_map_make(arena, 64);
|
||||
|
||||
//- rjf: udt -> fill member map
|
||||
if(udt != 0 && !(udt->flags & RDI_UserDefinedTypeFlag_EnumMembers) && rdi->members != 0)
|
||||
if(!(udt->flags & RDI_UDTFlag_EnumMembers))
|
||||
{
|
||||
U64 data_member_num = 1;
|
||||
for(U32 member_idx = udt->member_first;
|
||||
member_idx < udt->member_first+udt->member_count;
|
||||
member_idx += 1)
|
||||
{
|
||||
if(member_idx < 1 || rdi->members_count <= member_idx)
|
||||
{
|
||||
break;
|
||||
}
|
||||
RDI_Member *m = &rdi->members[member_idx];
|
||||
RDI_Member *m = rdi_element_from_name_idx(rdi, Members, member_idx);
|
||||
if(m->kind == RDI_MemberKind_DataField)
|
||||
{
|
||||
String8 name = {0};
|
||||
@@ -414,6 +392,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
|
||||
@@ -468,11 +454,10 @@ eval_leaf_type_from_name(RDI_Parsed *rdi, String8 name)
|
||||
{
|
||||
TG_Key key = zero_struct;
|
||||
B32 found = 0;
|
||||
if(rdi->type_nodes != 0)
|
||||
{
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(rdi, RDI_NameMapKind_Types);
|
||||
RDI_NameMap *name_map = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_Types);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(rdi, name_map, &parsed_name_map);
|
||||
rdi_parsed_from_name_map(rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &parsed_name_map, name.str, name.size);
|
||||
if(node != 0)
|
||||
{
|
||||
@@ -480,7 +465,7 @@ eval_leaf_type_from_name(RDI_Parsed *rdi, String8 name)
|
||||
U32 *matches = rdi_matches_from_map_node(rdi, node, &match_count);
|
||||
if(match_count != 0)
|
||||
{
|
||||
RDI_TypeNode *type_node = rdi_element_from_idx(rdi, type_nodes, matches[0]);
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, matches[0]);
|
||||
found = type_node->kind != RDI_TypeKind_NULL;
|
||||
key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)matches[0]);
|
||||
}
|
||||
@@ -610,7 +595,7 @@ eval_parse_type_from_text_tokens(Arena *arena, EVAL_ParseCtx *ctx, String8 text,
|
||||
if(str8_match(token_string, str8_lit("*"), 0))
|
||||
{
|
||||
token_it += 1;
|
||||
parse.expr = eval_expr(arena, EVAL_ExprKind_Ptr, token_string.str, parse.expr, 0, 0);
|
||||
parse.expr = eval_expr(arena, EVAL_ExprKind_Ptr, token_string.str, parse.expr, &eval_expr_nil, &eval_expr_nil);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -789,8 +774,8 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
it = nested_parse.last_token;
|
||||
|
||||
// rjf: build cast-to-U64*, and dereference operators
|
||||
atom = eval_expr(arena, EVAL_ExprKind_Cast, token_string.str, eval_expr_leaf_type(arena, token_string.str, tg_cons_type_make(ctx->type_graph, TG_Kind_Ptr, tg_key_basic(TG_Kind_U64), 0)), atom, 0);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_Deref, token_string.str, atom, 0, 0);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_Cast, token_string.str, eval_expr_leaf_type(arena, token_string.str, tg_cons_type_make(ctx->type_graph, TG_Kind_Ptr, tg_key_basic(TG_Kind_U64), 0)), atom, &eval_expr_nil);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_Deref, token_string.str, atom, &eval_expr_nil, &eval_expr_nil);
|
||||
|
||||
// rjf: expect ]
|
||||
EVAL_Token close_paren_maybe = eval_token_at_it(it, tokens);
|
||||
@@ -819,23 +804,22 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
B32 mapped_identifier = 0;
|
||||
B32 identifier_type_is_possibly_dynamically_overridden = 0;
|
||||
B32 identifier_looks_like_type_expr = 0;
|
||||
RDI_LocationKind loc_kind = RDI_LocationKind_NULL;
|
||||
RDI_LocationRegister loc_reg = {0};
|
||||
RDI_LocationRegisterPlusU16 loc_reg_u16 = {0};
|
||||
String8 loc_bytecode = {0};
|
||||
REGS_RegCode reg_code = 0;
|
||||
REGS_AliasCode alias_code = 0;
|
||||
TG_Key type_key = zero_struct;
|
||||
String8 local_lookup_string = token_string;
|
||||
RDI_LocationKind loc_kind = RDI_LocationKind_NULL;
|
||||
RDI_LocationReg loc_reg = {0};
|
||||
RDI_LocationRegPlusU16 loc_reg_u16 = {0};
|
||||
String8 loc_bytecode = {0};
|
||||
REGS_RegCode reg_code = 0;
|
||||
REGS_AliasCode alias_code = 0;
|
||||
TG_Key type_key = zero_struct;
|
||||
String8 local_lookup_string = token_string;
|
||||
|
||||
//- rjf: form namespaceified fallback versions of this lookup string
|
||||
String8List namespaceified_token_strings = {0};
|
||||
if(ctx->rdi->procedures != 0 && ctx->rdi->scopes != 0 && ctx->rdi->scope_vmap != 0)
|
||||
{
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(ctx->rdi->scope_vmap, ctx->rdi->scope_vmap_count, ctx->ip_voff);
|
||||
RDI_Scope *scope = &ctx->rdi->scopes[scope_idx];
|
||||
U64 scope_idx = rdi_vmap_idx_from_section_kind_voff(ctx->rdi, RDI_SectionKind_ScopeVMap, ctx->ip_voff);
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(ctx->rdi, Scopes, scope_idx);
|
||||
U64 proc_idx = scope->proc_idx;
|
||||
RDI_Procedure *procedure = &ctx->rdi->procedures[proc_idx];
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(ctx->rdi, Procedures, proc_idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_ptr = rdi_string_from_idx(ctx->rdi, procedure->name_string_idx, &name_size);
|
||||
String8 containing_procedure_name = str8(name_ptr, name_size);
|
||||
@@ -875,8 +859,8 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
{
|
||||
mapped_identifier = 1;
|
||||
identifier_type_is_possibly_dynamically_overridden = 1;
|
||||
RDI_Local *local_var = rdi_element_from_idx(ctx->rdi, locals, local_num-1);
|
||||
RDI_TypeNode *type_node = rdi_element_from_idx(ctx->rdi, type_nodes, local_var->type_idx);
|
||||
RDI_Local *local_var = rdi_element_from_name_idx(ctx->rdi, Locals, local_num-1);
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(ctx->rdi, TypeNodes, local_var->type_idx);
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)local_var->type_idx);
|
||||
|
||||
// rjf: grab location info
|
||||
@@ -884,39 +868,41 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
loc_block_idx < local_var->location_opl;
|
||||
loc_block_idx += 1)
|
||||
{
|
||||
RDI_LocationBlock *block = &ctx->rdi->location_blocks[loc_block_idx];
|
||||
RDI_LocationBlock *block = rdi_element_from_name_idx(ctx->rdi, LocationBlocks, loc_block_idx);
|
||||
if(block->scope_off_first <= ctx->ip_voff && ctx->ip_voff < block->scope_off_opl)
|
||||
{
|
||||
loc_kind = *((RDI_LocationKind *)(ctx->rdi->location_data + block->location_data_off));
|
||||
U64 all_location_data_size = 0;
|
||||
U8 *all_location_data = rdi_table_from_name(ctx->rdi, LocationData, &all_location_data_size);
|
||||
loc_kind = *((RDI_LocationKind *)(all_location_data + block->location_data_off));
|
||||
switch(loc_kind)
|
||||
{
|
||||
default:{mapped_identifier = 0;}break;
|
||||
case RDI_LocationKind_AddrBytecodeStream:
|
||||
case RDI_LocationKind_ValBytecodeStream:
|
||||
{
|
||||
U8 *bytecode_base = ctx->rdi->location_data + block->location_data_off + sizeof(RDI_LocationKind);
|
||||
U8 *bytecode_base = all_location_data + block->location_data_off + sizeof(RDI_LocationKind);
|
||||
U64 bytecode_size = 0;
|
||||
for(U64 idx = 0; idx < ctx->rdi->location_data_size; idx += 1)
|
||||
for(U64 idx = 0; idx < all_location_data_size; idx += 1)
|
||||
{
|
||||
U8 op = bytecode_base[idx];
|
||||
if(op == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
U8 ctrlbits = rdi_eval_opcode_ctrlbits[op];
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
U32 p_size = RDI_DECODEN_FROM_CTRLBITS(ctrlbits);
|
||||
bytecode_size += 1+p_size;
|
||||
}
|
||||
loc_bytecode = str8(bytecode_base, bytecode_size);
|
||||
}break;
|
||||
case RDI_LocationKind_AddrRegisterPlusU16:
|
||||
case RDI_LocationKind_AddrAddrRegisterPlusU16:
|
||||
case RDI_LocationKind_AddrRegPlusU16:
|
||||
case RDI_LocationKind_AddrAddrRegPlusU16:
|
||||
{
|
||||
MemoryCopy(&loc_reg_u16, (ctx->rdi->location_data + block->location_data_off), sizeof(loc_reg_u16));
|
||||
MemoryCopy(&loc_reg_u16, (all_location_data + block->location_data_off), sizeof(loc_reg_u16));
|
||||
}break;
|
||||
case RDI_LocationKind_ValRegister:
|
||||
case RDI_LocationKind_ValReg:
|
||||
{
|
||||
MemoryCopy(&loc_reg, (ctx->rdi->location_data + block->location_data_off), sizeof(loc_reg));
|
||||
MemoryCopy(&loc_reg, (all_location_data + block->location_data_off), sizeof(loc_reg));
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@@ -951,120 +937,102 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
//- rjf: try global variables
|
||||
if(mapped_identifier == 0)
|
||||
{
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(ctx->rdi, RDI_NameMapKind_GlobalVariables);
|
||||
if(name_map != 0 && ctx->rdi->global_variables != 0)
|
||||
RDI_NameMap *name_map = rdi_element_from_name_idx(ctx->rdi, NameMaps, RDI_NameMapKind_GlobalVariables);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_parsed_from_name_map(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
// NOTE(rjf): apparently, PDBs can be produced such that they
|
||||
// also keep stale *GLOBAL VARIABLE SYMBOLS* around too. I
|
||||
// don't know of a magic hash table fixup path in PDBs, so
|
||||
// in this case, I'm going to prefer the latest-added global.
|
||||
U32 match_idx = matches[matches_count-1];
|
||||
RDI_GlobalVariable *global_var = &ctx->rdi->global_variables[match_idx];
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, global_var->voff);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = global_var->type_idx;
|
||||
if(type_idx < ctx->rdi->type_nodes_count)
|
||||
{
|
||||
RDI_TypeNode *type_node = &ctx->rdi->type_nodes[type_idx];
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
}
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
// NOTE(rjf): apparently, PDBs can be produced such that they
|
||||
// also keep stale *GLOBAL VARIABLE SYMBOLS* around too. I
|
||||
// don't know of a magic hash table fixup path in PDBs, so
|
||||
// in this case, I'm going to prefer the latest-added global.
|
||||
U32 match_idx = matches[matches_count-1];
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_name_idx(ctx->rdi, GlobalVariables, match_idx);
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, global_var->voff);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = global_var->type_idx;
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(ctx->rdi, TypeNodes, type_idx);
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: try thread variables
|
||||
if(mapped_identifier == 0)
|
||||
{
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(ctx->rdi, RDI_NameMapKind_ThreadVariables);
|
||||
if(name_map != 0 && ctx->rdi->global_variables != 0)
|
||||
RDI_NameMap *name_map = rdi_element_from_name_idx(ctx->rdi, NameMaps, RDI_NameMapKind_ThreadVariables);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_parsed_from_name_map(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
U32 match_idx = matches[0];
|
||||
RDI_ThreadVariable *thread_var = &ctx->rdi->thread_variables[match_idx];
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_TLSOff, thread_var->tls_off);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = thread_var->type_idx;
|
||||
if(type_idx < ctx->rdi->type_nodes_count)
|
||||
{
|
||||
RDI_TypeNode *type_node = &ctx->rdi->type_nodes[type_idx];
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
}
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
U32 match_idx = matches[0];
|
||||
RDI_ThreadVariable *thread_var = rdi_element_from_name_idx(ctx->rdi, ThreadVariables, match_idx);
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_TLSOff, thread_var->tls_off);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = thread_var->type_idx;
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(ctx->rdi, TypeNodes, type_idx);
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: try procedures
|
||||
if(mapped_identifier == 0)
|
||||
{
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(ctx->rdi, RDI_NameMapKind_Procedures);
|
||||
if(name_map != 0 && ctx->rdi->procedures != 0 && ctx->rdi->scopes != 0 && ctx->rdi->scope_voffs)
|
||||
RDI_NameMap *name_map = rdi_element_from_name_idx(ctx->rdi, NameMaps, RDI_NameMapKind_Procedures);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_parsed_from_name_map(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(ctx->rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, token_string.str, token_string.size);
|
||||
U32 matches_count = 0;
|
||||
U32 *matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
for(String8Node *n = namespaceified_token_strings.first;
|
||||
n != 0 && matches_count == 0;
|
||||
n = n->next)
|
||||
{
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
U32 match_idx = matches[0];
|
||||
RDI_Procedure *procedure = &ctx->rdi->procedures[match_idx];
|
||||
RDI_Scope *scope = &ctx->rdi->scopes[procedure->root_scope_idx];
|
||||
U64 voff = ctx->rdi->scope_voffs[scope->voff_range_first];
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, voff);
|
||||
loc_kind = RDI_LocationKind_ValBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = procedure->type_idx;
|
||||
if(type_idx < ctx->rdi->type_nodes_count)
|
||||
{
|
||||
RDI_TypeNode *type_node = &ctx->rdi->type_nodes[type_idx];
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
}
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
node = rdi_name_map_lookup(ctx->rdi, &parsed_name_map, n->string.str, n->string.size);
|
||||
matches_count = 0;
|
||||
matches = rdi_matches_from_map_node(ctx->rdi, node, &matches_count);
|
||||
}
|
||||
if(matches_count != 0)
|
||||
{
|
||||
U32 match_idx = matches[0];
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(ctx->rdi, Procedures, match_idx);
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(ctx->rdi, Scopes, procedure->root_scope_idx);
|
||||
U64 voff = *rdi_element_from_name_idx(ctx->rdi, ScopeVOffData, scope->voff_range_first);
|
||||
EVAL_OpList oplist = {0};
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, voff);
|
||||
loc_kind = RDI_LocationKind_ValBytecodeStream;
|
||||
loc_bytecode = eval_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = procedure->type_idx;
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(ctx->rdi, TypeNodes, type_idx);
|
||||
type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), (U64)type_idx);
|
||||
mapped_identifier = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1126,35 +1094,35 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
{
|
||||
atom = eval_expr_leaf_bytecode(arena, token_string.str, type_key, loc_bytecode, EVAL_EvalMode_Value);
|
||||
}break;
|
||||
case RDI_LocationKind_AddrRegisterPlusU16:
|
||||
case RDI_LocationKind_AddrRegPlusU16:
|
||||
{
|
||||
EVAL_OpList oplist = {0};
|
||||
U64 byte_size = bit_size_from_arch(ctx->arch)/8;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.register_code, byte_size, 0);
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.reg_code, byte_size, 0);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
atom = eval_expr_leaf_op_list(arena, token_string.str, type_key, &oplist, EVAL_EvalMode_Addr);
|
||||
}break;
|
||||
case RDI_LocationKind_AddrAddrRegisterPlusU16:
|
||||
case RDI_LocationKind_AddrAddrRegPlusU16:
|
||||
{
|
||||
EVAL_OpList oplist = {0};
|
||||
U64 byte_size = bit_size_from_arch(ctx->arch)/8;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.register_code, byte_size, 0);
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.reg_code, byte_size, 0);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_MemRead, bit_size_from_arch(ctx->arch)/8);
|
||||
atom = eval_expr_leaf_op_list(arena, token_string.str, type_key, &oplist, EVAL_EvalMode_Addr);
|
||||
}break;
|
||||
case RDI_LocationKind_ValRegister:
|
||||
case RDI_LocationKind_ValReg:
|
||||
{
|
||||
REGS_RegCode regs_reg_code = regs_reg_code_from_arch_rdi_code(ctx->arch, loc_reg.register_code);
|
||||
REGS_RegCode regs_reg_code = regs_reg_code_from_arch_rdi_code(ctx->arch, loc_reg.reg_code);
|
||||
REGS_Rng reg_rng = regs_reg_code_rng_table_from_architecture(ctx->arch)[regs_reg_code];
|
||||
EVAL_OpList oplist = {0};
|
||||
U64 byte_size = (U64)reg_rng.byte_size;
|
||||
U64 byte_pos = 0;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg.register_code, byte_size, byte_pos);
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg.reg_code, byte_size, byte_pos);
|
||||
eval_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
atom = eval_expr_leaf_op_list(arena, token_string.str, type_key, &oplist, EVAL_EvalMode_Value);
|
||||
}break;
|
||||
@@ -1164,7 +1132,7 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
if(atom_implicit_member_name.size != 0)
|
||||
{
|
||||
EVAL_Expr *member_expr = eval_expr_leaf_member(arena, atom_implicit_member_name.str, atom_implicit_member_name);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_MemberAccess, atom_implicit_member_name.str, atom, member_expr, 0);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_MemberAccess, atom_implicit_member_name.str, atom, member_expr, &eval_expr_nil);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1275,7 +1243,7 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
if(good_member_name)
|
||||
{
|
||||
EVAL_Expr *member_expr = eval_expr_leaf_member(arena, member_name.str, member_name);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_MemberAccess, token_string.str, atom, member_expr, 0);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_MemberAccess, token_string.str, atom, member_expr, &eval_expr_nil);
|
||||
}
|
||||
|
||||
// rjf: increment past good member names
|
||||
@@ -1303,7 +1271,7 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
// rjf: valid indexing expression => produce index expr
|
||||
if(idx_expr_parse.expr != &eval_expr_nil)
|
||||
{
|
||||
atom = eval_expr(arena, EVAL_ExprKind_ArrayIndex, token_string.str, atom, idx_expr_parse.expr, 0);
|
||||
atom = eval_expr(arena, EVAL_ExprKind_ArrayIndex, token_string.str, atom, idx_expr_parse.expr, &eval_expr_nil);
|
||||
}
|
||||
|
||||
// rjf: expect ]
|
||||
@@ -1338,7 +1306,8 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
{
|
||||
atom = eval_expr(arena, prefix_unary->kind, prefix_unary->location,
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? prefix_unary->cast_expr : atom,
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? atom : 0, 0);
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? atom : &eval_expr_nil,
|
||||
&eval_expr_nil);
|
||||
}
|
||||
}
|
||||
else if(atom == 0 && first_prefix_unary != 0)
|
||||
@@ -1351,7 +1320,8 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
{
|
||||
atom = eval_expr(arena, prefix_unary->kind, prefix_unary->location,
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? prefix_unary->cast_expr : atom,
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? atom : 0, 0);
|
||||
prefix_unary->cast_expr != &eval_expr_nil ? atom : &eval_expr_nil,
|
||||
&eval_expr_nil);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1393,7 +1363,7 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8
|
||||
}
|
||||
else
|
||||
{
|
||||
atom = eval_expr(arena, binary_kind, token_string.str, atom, rhs, 0);
|
||||
atom = eval_expr(arena, binary_kind, token_string.str, atom, rhs, &eval_expr_nil);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ extern U8 eval_expr_kind_child_counts[40];
|
||||
extern String8 eval_expr_kind_strings[40];
|
||||
extern String8 eval_result_code_display_strings[11];
|
||||
extern String8 eval_expr_op_strings[40];
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // EVAL_META_H
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+61
-34
@@ -516,16 +516,18 @@ f_piece_array_copy(Arena *arena, F_PieceArray *src)
|
||||
//~ rjf: Rasterization Cache
|
||||
|
||||
internal F_Hash2StyleRasterCacheNode *
|
||||
f_hash2style_from_tag_size(F_Tag tag, F32 size)
|
||||
f_hash2style_from_tag_size_flags(F_Tag tag, F32 size, F_RunFlags flags)
|
||||
{
|
||||
//- rjf: tag * size -> style hash
|
||||
U64 style_hash = {0};
|
||||
{
|
||||
F64 size_f64 = size;
|
||||
U64 buffer[] =
|
||||
{
|
||||
tag.u64[0],
|
||||
tag.u64[1],
|
||||
(U64)round_f32(size),
|
||||
*(U64 *)(&size_f64),
|
||||
(U64)flags,
|
||||
};
|
||||
style_hash = f_little_hash_from_string(str8((U8 *)buffer, sizeof(buffer)));
|
||||
}
|
||||
@@ -565,16 +567,17 @@ f_hash2style_from_tag_size(F_Tag tag, F32 size)
|
||||
}
|
||||
|
||||
internal F_Run
|
||||
f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, String8 string)
|
||||
f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
//- rjf: map tag/size to style node
|
||||
F_Hash2StyleRasterCacheNode *hash2style_node = f_hash2style_from_tag_size(tag, size);
|
||||
F_Hash2StyleRasterCacheNode *hash2style_node = f_hash2style_from_tag_size_flags(tag, size, flags);
|
||||
|
||||
//- rjf: decode string & produce run pieces
|
||||
F_PieceChunkList piece_chunks = {0};
|
||||
Vec2F32 dim = {0};
|
||||
F32 last_piece_end_pad = 0;
|
||||
B32 font_handle_mapped_on_miss = 0;
|
||||
FP_Handle font_handle = {0};
|
||||
U64 piece_substring_start_idx = 0;
|
||||
@@ -682,7 +685,11 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
}
|
||||
|
||||
// rjf: call into font provider to rasterize this substring
|
||||
FP_RasterResult raster = fp_raster(scratch.arena, font_handle, round_f32(size), FP_RasterMode_Sharp, piece_substring);
|
||||
FP_RasterResult raster = {0};
|
||||
if(size > 0)
|
||||
{
|
||||
raster = fp_raster(scratch.arena, font_handle, floor_f32(size), (flags & F_RunFlag_Smooth) ? FP_RasterMode_Smooth : FP_RasterMode_Sharp, piece_substring);
|
||||
}
|
||||
|
||||
// rjf: allocate portion of an atlas to upload the rasterization
|
||||
S16 chosen_atlas_num = 0;
|
||||
@@ -704,7 +711,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
atlas->root->max_free_size[Corner_01] =
|
||||
atlas->root->max_free_size[Corner_10] =
|
||||
atlas->root->max_free_size[Corner_11] = v2s16(atlas->root_dim.x/2, atlas->root_dim.y/2);
|
||||
atlas->texture = r_tex2d_alloc(R_Tex2DKind_Dynamic, v2s32((S32)atlas->root_dim.x, (S32)atlas->root_dim.y), R_Tex2DFormat_RGBA8, 0);
|
||||
atlas->texture = r_tex2d_alloc(R_ResourceKind_Dynamic, v2s32((S32)atlas->root_dim.x, (S32)atlas->root_dim.y), R_Tex2DFormat_RGBA8, 0);
|
||||
}
|
||||
|
||||
// rjf: allocate from atlas
|
||||
@@ -758,6 +765,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
if(info != 0)
|
||||
{
|
||||
info->subrect = chosen_atlas_region;
|
||||
info->bounding_box = raster.bounding_box;
|
||||
info->atlas_num = chosen_atlas_num;
|
||||
info->raster_dim = raster.atlas_dim;
|
||||
info->advance = raster.advance;
|
||||
@@ -788,6 +796,13 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: on tabs -> expand advance
|
||||
F32 advance = info->advance;
|
||||
if(is_tab)
|
||||
{
|
||||
advance = floor_f32(tab_size_px) - mod_f32(floor_f32(base_align_px), floor_f32(tab_size_px));
|
||||
}
|
||||
|
||||
// rjf: push piece
|
||||
{
|
||||
F_Piece *piece = f_piece_chunk_list_push_new(arena, &piece_chunks, string.size);
|
||||
@@ -797,12 +812,15 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
info->subrect.y0,
|
||||
info->subrect.x0 + info->raster_dim.x,
|
||||
info->subrect.y0 + info->raster_dim.y);
|
||||
piece->advance = info->advance;
|
||||
piece->advance = advance;
|
||||
piece->decode_size = piece_substring.size;
|
||||
piece->offset = v2s16(0, -hash2style_node->ascent - 4);
|
||||
}
|
||||
base_align_px += advance;
|
||||
dim.x += piece->advance;
|
||||
dim.y = Max(dim.y, dim_2s16(piece->subrect).y);
|
||||
dim.y = Max(dim.y, info->raster_dim.y);
|
||||
last_piece_end_pad = ((F32)piece->offset.x+(F32)dim_2s16(info->bounding_box).x) - piece->advance;
|
||||
last_piece_end_pad = ClampBot(0, last_piece_end_pad);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -820,6 +838,8 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
run.pieces = f_piece_array_from_chunk_list(arena, &piece_chunks);
|
||||
}
|
||||
run.dim = dim;
|
||||
run.dim.x += last_piece_end_pad;
|
||||
run.end_pad = last_piece_end_pad;
|
||||
run.ascent = hash2style_node->ascent;
|
||||
run.descent = hash2style_node->descent;
|
||||
}
|
||||
@@ -829,12 +849,12 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
}
|
||||
|
||||
internal String8List
|
||||
f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, String8 string, F32 max)
|
||||
f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 max)
|
||||
{
|
||||
String8List list = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, font, size, base_align_px, tab_size_px, 0, string);
|
||||
F32 off_px = 0;
|
||||
U64 off_bytes = 0;
|
||||
U64 line_start_off_bytes = 0;
|
||||
@@ -942,12 +962,12 @@ f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 s
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
f_dim_from_tag_size_string(F_Tag tag, F32 size, String8 string)
|
||||
f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
Vec2F32 result = {0};
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, 0, string);
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, base_align_px, tab_size_px, 0, string);
|
||||
result = run.dim;
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
@@ -955,13 +975,13 @@ f_dim_from_tag_size_string(F_Tag tag, F32 size, String8 string)
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
f_dim_from_tag_size_string_list(F_Tag tag, F32 size, String8List list)
|
||||
f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8List list)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Vec2F32 sum = {0};
|
||||
for(String8Node *n = list.first; n != 0; n = n->next)
|
||||
{
|
||||
Vec2F32 str_dim = f_dim_from_tag_size_string(tag, size, n->string);
|
||||
Vec2F32 str_dim = f_dim_from_tag_size_string(tag, size, base_align_px, tab_size_px, n->string);
|
||||
sum.x += str_dim.x;
|
||||
sum.y = Max(sum.y, str_dim.y);
|
||||
}
|
||||
@@ -969,32 +989,39 @@ f_dim_from_tag_size_string_list(F_Tag tag, F32 size, String8List list)
|
||||
return sum;
|
||||
}
|
||||
|
||||
internal F32
|
||||
f_column_size_from_tag_size(F_Tag tag, F32 size)
|
||||
{
|
||||
F32 result = f_dim_from_tag_size_string(tag, size, 0, 0, str8_lit("H")).x;
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, String8 string, F32 p)
|
||||
f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 p)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
U64 result = 0;
|
||||
U64 best_offset = 0;
|
||||
F32 best_distance = -1.f;
|
||||
F32 x = 0;
|
||||
for(U64 char_idx = 0; char_idx <= string.size; char_idx += 1)
|
||||
U64 best_offset_bytes = 0;
|
||||
F32 best_offset_px = inf32();
|
||||
U64 offset_bytes = 0;
|
||||
F32 offset_px = 0.f;
|
||||
F_Run run = f_push_run_from_string(scratch.arena, tag, size, base_align_px, tab_size_px, 0, string);
|
||||
for(U64 idx = 0; idx <= run.pieces.count; idx += 1)
|
||||
{
|
||||
F32 this_char_distance = fabsf(p - x);
|
||||
if(this_char_distance < best_distance || best_distance < 0.f)
|
||||
F32 this_piece_offset_px = abs_f32(offset_px - p);
|
||||
if(this_piece_offset_px < best_offset_px)
|
||||
{
|
||||
best_offset = char_idx;
|
||||
best_distance = this_char_distance;
|
||||
best_offset_bytes = offset_bytes;
|
||||
best_offset_px = this_piece_offset_px;
|
||||
}
|
||||
if(char_idx < string.size)
|
||||
if(idx < run.pieces.count)
|
||||
{
|
||||
x += f_dim_from_tag_size_string(tag, size, str8_substr(string, r1u64(char_idx, char_idx+1))).x;
|
||||
F_Piece *piece = &run.pieces.v[idx];
|
||||
offset_px += piece->advance;
|
||||
offset_bytes += piece->decode_size;
|
||||
}
|
||||
}
|
||||
result = best_offset;
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
return result;
|
||||
return best_offset_bytes;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1007,10 +1034,10 @@ f_metrics_from_tag_size(F_Tag tag, F32 size)
|
||||
FP_Metrics metrics = f_fp_metrics_from_tag(tag);
|
||||
F_Metrics result = {0};
|
||||
{
|
||||
result.ascent = size * metrics.ascent / metrics.design_units_per_em;
|
||||
result.descent = size * metrics.descent / metrics.design_units_per_em;
|
||||
result.line_gap = size * metrics.line_gap / metrics.design_units_per_em;
|
||||
result.capital_height = size * metrics.capital_height / metrics.design_units_per_em;
|
||||
result.ascent = floor_f32(size) * metrics.ascent / metrics.design_units_per_em;
|
||||
result.descent = floor_f32(size) * metrics.descent / metrics.design_units_per_em;
|
||||
result.line_gap = floor_f32(size) * metrics.line_gap / metrics.design_units_per_em;
|
||||
result.capital_height = floor_f32(size) * metrics.capital_height / metrics.design_units_per_em;
|
||||
}
|
||||
ProfEnd();
|
||||
return result;
|
||||
|
||||
@@ -71,6 +71,7 @@ struct F_Run
|
||||
{
|
||||
F_PieceArray pieces;
|
||||
Vec2F32 dim;
|
||||
F32 end_pad;
|
||||
F32 ascent;
|
||||
F32 descent;
|
||||
};
|
||||
@@ -102,6 +103,7 @@ typedef struct F_RasterCacheInfo F_RasterCacheInfo;
|
||||
struct F_RasterCacheInfo
|
||||
{
|
||||
Rng2S16 subrect;
|
||||
Rng2S16 bounding_box;
|
||||
Vec2S16 raster_dim;
|
||||
S16 atlas_num;
|
||||
F32 advance;
|
||||
@@ -131,6 +133,7 @@ struct F_Hash2StyleRasterCacheNode
|
||||
U64 style_hash;
|
||||
F32 ascent;
|
||||
F32 descent;
|
||||
F32 column_width;
|
||||
F_RasterCacheInfo *utf8_class1_direct_map;
|
||||
U64 utf8_class1_direct_map_mask[4];
|
||||
U64 hash2info_slots_count;
|
||||
@@ -246,12 +249,13 @@ internal F_PieceArray f_piece_array_copy(Arena *arena, F_PieceArray *src);
|
||||
////////////////////////////////
|
||||
//~ rjf: Rasterization Cache
|
||||
|
||||
internal F_Hash2StyleRasterCacheNode *f_hash2style_from_tag_size(F_Tag tag, F32 size);
|
||||
internal F_Run f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, String8 string);
|
||||
internal String8List f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, String8 string, F32 max);
|
||||
internal Vec2F32 f_dim_from_tag_size_string(F_Tag tag, F32 size, String8 string);
|
||||
internal Vec2F32 f_dim_from_tag_size_string_list(F_Tag tag, F32 size, String8List list);
|
||||
internal U64 f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, String8 string, F32 p);
|
||||
internal F_Hash2StyleRasterCacheNode *f_hash2style_from_tag_size_flags(F_Tag tag, F32 size, F_RunFlags flags);
|
||||
internal F_Run f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, F_RunFlags flags, String8 string);
|
||||
internal String8List f_wrapped_string_lines_from_font_size_string_max(Arena *arena, F_Tag font, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 max);
|
||||
internal Vec2F32 f_dim_from_tag_size_string(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string);
|
||||
internal Vec2F32 f_dim_from_tag_size_string_list(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8List list);
|
||||
internal F32 f_column_size_from_tag_size(F_Tag tag, F32 size);
|
||||
internal U64 f_char_pos_from_tag_size_string_p(F_Tag tag, F32 size, F32 base_align_px, F32 tab_size_px, String8 string, F32 p);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Metrics
|
||||
|
||||
+86
-45
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
@@ -169,47 +172,85 @@ fp_init(void)
|
||||
}
|
||||
|
||||
//- rjf: make dwrite factory
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown **)&fp_dwrite_state->factory);
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory2, (void **)&fp_dwrite_state->factory);
|
||||
if(error == S_OK)
|
||||
{
|
||||
fp_dwrite_state->dwrite2_is_supported = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (void **)&fp_dwrite_state->factory);
|
||||
}
|
||||
|
||||
//- rjf: register static data font "loader" interface
|
||||
error = fp_dwrite_state->factory->RegisterFontFileLoader((IDWriteFontFileLoader *)&fp_dwrite_static_data_font_file_loader);
|
||||
error = IDWriteFactory_RegisterFontFileLoader(fp_dwrite_state->factory, (IDWriteFontFileLoader *)&fp_dwrite_static_data_font_file_loader);
|
||||
|
||||
//- rjf: make base rendering params
|
||||
error = fp_dwrite_state->factory->CreateRenderingParams(&fp_dwrite_state->base_rendering_params);
|
||||
error = IDWriteFactory_CreateRenderingParams(fp_dwrite_state->factory, &fp_dwrite_state->base_rendering_params);
|
||||
|
||||
//- rjf: make sharp rendering params
|
||||
{
|
||||
FLOAT gamma = 1.f;
|
||||
FLOAT enhanced_contrast = fp_dwrite_state->base_rendering_params->GetEnhancedContrast();
|
||||
// FLOAT clear_type_level = fp_dwrite_state->base_rendering_params->GetClearTypeLevel();
|
||||
error = fp_dwrite_state->factory->CreateCustomRenderingParams(gamma,
|
||||
enhanced_contrast,
|
||||
2.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
FLOAT gamma = IDWriteRenderingParams_GetGamma(fp_dwrite_state->base_rendering_params);
|
||||
FLOAT enhanced_contrast = IDWriteRenderingParams_GetEnhancedContrast(fp_dwrite_state->base_rendering_params);
|
||||
if(fp_dwrite_state->dwrite2_is_supported)
|
||||
{
|
||||
error = IDWriteFactory2_CreateCustomRenderingParams2((IDWriteFactory2 *)fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED,
|
||||
(IDWriteRenderingParams2 **)&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Sharp]);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: make smooth rendering params
|
||||
{
|
||||
FLOAT gamma = 1.f;
|
||||
FLOAT enhanced_contrast = fp_dwrite_state->base_rendering_params->GetEnhancedContrast();
|
||||
// FLOAT clear_type_level = fp_dwrite_state->base_rendering_params->GetClearTypeLevel();
|
||||
error = fp_dwrite_state->factory->CreateCustomRenderingParams(gamma,
|
||||
enhanced_contrast,
|
||||
2.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
FLOAT enhanced_contrast = 0.f;
|
||||
if(fp_dwrite_state->dwrite2_is_supported)
|
||||
{
|
||||
error = IDWriteFactory2_CreateCustomRenderingParams2((IDWriteFactory2 *)fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
|
||||
DWRITE_GRID_FIT_MODE_DISABLED,
|
||||
(IDWriteRenderingParams2 **)&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = IDWriteFactory_CreateCustomRenderingParams(fp_dwrite_state->factory,
|
||||
gamma,
|
||||
enhanced_contrast,
|
||||
0.f,
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT,
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
|
||||
&fp_dwrite_state->rendering_params[FP_RasterMode_Smooth]);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: make dwrite gdi interop
|
||||
error = fp_dwrite_state->factory->GetGdiInterop(&fp_dwrite_state->gdi_interop);
|
||||
error = IDWriteFactory_GetGdiInterop(fp_dwrite_state->factory, &fp_dwrite_state->gdi_interop);
|
||||
|
||||
//- rjf: build render target for rasterization
|
||||
fp_dwrite_state->bitmap_render_target_dim = v2s32(2048, 256);
|
||||
error = fp_dwrite_state->gdi_interop->CreateBitmapRenderTarget(0, fp_dwrite_state->bitmap_render_target_dim.x, fp_dwrite_state->bitmap_render_target_dim.y, &fp_dwrite_state->bitmap_render_target);
|
||||
fp_dwrite_state->bitmap_render_target->SetPixelsPerDip(1.0);
|
||||
error = IDWriteGdiInterop_CreateBitmapRenderTarget(fp_dwrite_state->gdi_interop, 0, fp_dwrite_state->bitmap_render_target_dim.x, fp_dwrite_state->bitmap_render_target_dim.y, &fp_dwrite_state->bitmap_render_target);
|
||||
IDWriteBitmapRenderTarget_SetPixelsPerDip(fp_dwrite_state->bitmap_render_target, 1.0);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
@@ -223,10 +264,10 @@ fp_font_open(String8 path)
|
||||
HRESULT error = 0;
|
||||
|
||||
//- rjf: open font file reference
|
||||
error = fp_dwrite_state->factory->CreateFontFileReference((WCHAR *)path16.str, 0, &font.file);
|
||||
error = IDWriteFactory_CreateFontFileReference(fp_dwrite_state->factory, (WCHAR *)path16.str, 0, &font.file);
|
||||
|
||||
//- rjf: open font face
|
||||
error = fp_dwrite_state->factory->CreateFontFace(DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
error = IDWriteFactory_CreateFontFace(fp_dwrite_state->factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
|
||||
//- rjf: handlify & return
|
||||
FP_Handle handle = fp_dwrite_handle_from_font(font);
|
||||
@@ -244,10 +285,10 @@ fp_font_open_from_static_data_string(String8 *data_ptr)
|
||||
HRESULT error = 0;
|
||||
|
||||
//- rjf: open font file reference
|
||||
error = fp_dwrite_state->factory->CreateCustomFontFileReference(&data_ptr, sizeof(String8 *), (IDWriteFontFileLoader *)&fp_dwrite_static_data_font_file_loader, &font.file);
|
||||
error = IDWriteFactory_CreateCustomFontFileReference(fp_dwrite_state->factory, &data_ptr, sizeof(String8 *), (IDWriteFontFileLoader *)&fp_dwrite_static_data_font_file_loader, &font.file);
|
||||
|
||||
//- rjf: open font face
|
||||
error = fp_dwrite_state->factory->CreateFontFace(DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
error = IDWriteFactory_CreateFontFace(fp_dwrite_state->factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
|
||||
//- rjf: handlify & return
|
||||
FP_Handle handle = fp_dwrite_handle_from_font(font);
|
||||
@@ -263,11 +304,11 @@ fp_font_close(FP_Handle handle)
|
||||
FP_DWrite_Font font = fp_dwrite_font_from_handle(handle);
|
||||
if(font.face != 0)
|
||||
{
|
||||
font.face->Release();
|
||||
IDWriteFontFace_Release(font.face);
|
||||
}
|
||||
if(font.file != 0)
|
||||
{
|
||||
font.file->Release();
|
||||
IDWriteFontFile_Release(font.file);
|
||||
}
|
||||
ProfEnd();
|
||||
}
|
||||
@@ -280,7 +321,7 @@ fp_metrics_from_font(FP_Handle handle)
|
||||
DWRITE_FONT_METRICS metrics = {0};
|
||||
if(font.face != 0)
|
||||
{
|
||||
font.face->GetMetrics(&metrics);
|
||||
IDWriteFontFace_GetMetrics(font.face, &metrics);
|
||||
}
|
||||
FP_Metrics result = {0};
|
||||
{
|
||||
@@ -309,7 +350,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
DWRITE_FONT_METRICS font_metrics = {0};
|
||||
if(font.face != 0)
|
||||
{
|
||||
font.face->GetMetrics(&font_metrics);
|
||||
IDWriteFontFace_GetMetrics(font.face, &font_metrics);
|
||||
}
|
||||
F32 design_units_per_em = (F32)font_metrics.designUnitsPerEm;
|
||||
|
||||
@@ -317,7 +358,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
U16 *glyph_indices = push_array_no_zero(scratch.arena, U16, string32.size);
|
||||
if(font.face != 0)
|
||||
{
|
||||
error = font.face->GetGlyphIndices(string32.str, string32.size, glyph_indices);
|
||||
error = IDWriteFontFace_GetGlyphIndices(font.face, string32.str, string32.size, glyph_indices);
|
||||
}
|
||||
|
||||
//- rjf: get metrics info
|
||||
@@ -325,7 +366,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
DWRITE_GLYPH_METRICS *glyphs_metrics = push_array_no_zero(scratch.arena, DWRITE_GLYPH_METRICS, glyphs_count);
|
||||
if(font.face != 0)
|
||||
{
|
||||
error = font.face->GetGdiCompatibleGlyphMetrics((96.f/72.f)*size, 1.f, 0, 1, glyph_indices, glyphs_count, glyphs_metrics, 0);
|
||||
error = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(font.face, (96.f/72.f)*size, 1.f, 0, 1, glyph_indices, glyphs_count, glyphs_metrics, 0);
|
||||
}
|
||||
|
||||
//- rjf: derive info from metrics
|
||||
@@ -352,15 +393,15 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
IDWriteBitmapRenderTarget *render_target = 0;
|
||||
if(font.face != 0)
|
||||
{
|
||||
error = fp_dwrite_state->gdi_interop->CreateBitmapRenderTarget(0, atlas_dim.x, atlas_dim.y, &render_target);
|
||||
render_target->SetPixelsPerDip(1.0);
|
||||
error = IDWriteGdiInterop_CreateBitmapRenderTarget(fp_dwrite_state->gdi_interop, 0, atlas_dim.x, atlas_dim.y, &render_target);
|
||||
IDWriteBitmapRenderTarget_SetPixelsPerDip(render_target, 1.f);
|
||||
}
|
||||
|
||||
//- rjf: get bitmap & clear
|
||||
HDC dc = 0;
|
||||
if(font.face != 0)
|
||||
{
|
||||
dc = render_target->GetMemoryDC();
|
||||
dc = IDWriteBitmapRenderTarget_GetMemoryDC(render_target);
|
||||
HGDIOBJ original = SelectObject(dc, GetStockObject(DC_PEN));
|
||||
SetDCPenColor(dc, bg_color);
|
||||
SelectObject(dc, GetStockObject(DC_BRUSH));
|
||||
@@ -388,12 +429,12 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
RECT bounding_box = {0};
|
||||
if(font.face != 0)
|
||||
{
|
||||
error = render_target->DrawGlyphRun(draw_p.x, draw_p.y,
|
||||
DWRITE_MEASURING_MODE_NATURAL,
|
||||
&glyph_run,
|
||||
fp_dwrite_state->rendering_params[mode],
|
||||
fg_color,
|
||||
&bounding_box);
|
||||
error = IDWriteBitmapRenderTarget_DrawGlyphRun(render_target, draw_p.x, draw_p.y,
|
||||
DWRITE_MEASURING_MODE_NATURAL,
|
||||
&glyph_run,
|
||||
fp_dwrite_state->rendering_params[mode],
|
||||
fg_color,
|
||||
&bounding_box);
|
||||
}
|
||||
|
||||
//- rjf: get bitmap
|
||||
@@ -411,8 +452,8 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
// rjf: fill basics
|
||||
result.atlas_dim = atlas_dim;
|
||||
result.atlas = push_array_no_zero(arena, U8, atlas_dim.x*atlas_dim.y*4);
|
||||
result.advance = advance;
|
||||
result.height = bounding_box.bottom + 1.f;
|
||||
result.advance = floor_f32(advance);
|
||||
result.bounding_box = r2s16p(bounding_box.left, bounding_box.top, bounding_box.right, bounding_box.bottom);
|
||||
|
||||
// rjf: fill atlas
|
||||
{
|
||||
@@ -446,7 +487,7 @@ fp_raster(Arena *arena, FP_Handle font_handle, F32 size, FP_RasterMode mode, Str
|
||||
result.atlas_dim = v2s16(0, 0);
|
||||
}
|
||||
}
|
||||
render_target->Release();
|
||||
IDWriteBitmapRenderTarget_Release(render_target);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
@@ -1,21 +1,214 @@
|
||||
/* date = November 2nd 2022 11:31 am */
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef FONT_PROVIDER_DWRITE_H
|
||||
#define FONT_PROVIDER_DWRITE_H
|
||||
|
||||
#include <dwrite.h>
|
||||
|
||||
#pragma comment(lib, "gdi32.lib")
|
||||
#pragma comment(lib, "dwrite.lib")
|
||||
|
||||
// #include <dwrite.h>
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: (C) DirectWrite Definitions
|
||||
//
|
||||
// (courtesy of mmozeiko, Martins Mozeiko, https://github.com/mmozeiko/c_d2d_dwrite)
|
||||
//
|
||||
// This is free and unencumbered software released into the public domain.
|
||||
//
|
||||
// Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
// distribute this software, either in source code form or as a compiled
|
||||
// binary, for any purpose, commercial or non-commercial, and by any
|
||||
// means.
|
||||
//
|
||||
// In jurisdictions that recognize copyright laws, the author or authors
|
||||
// of this software dedicate any and all copyright interest in the
|
||||
// software to the public domain. We make this dedication for the benefit
|
||||
// of the public at large and to the detriment of our heirs and
|
||||
// successors. We intend this dedication to be an overt act of
|
||||
// relinquishment in perpetuity of all present and future rights to this
|
||||
// software under copyright law.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// For more information, please refer to <https://unlicense.org>
|
||||
|
||||
#include <combaseapi.h>
|
||||
#include <dcommon.h>
|
||||
#include <initguid.h>
|
||||
|
||||
//- rjf: enums
|
||||
|
||||
typedef enum DWRITE_FACTORY_TYPE {
|
||||
DWRITE_FACTORY_TYPE_SHARED = 0,
|
||||
DWRITE_FACTORY_TYPE_ISOLATED = 1,
|
||||
} DWRITE_FACTORY_TYPE;
|
||||
|
||||
typedef enum DWRITE_PIXEL_GEOMETRY {
|
||||
DWRITE_PIXEL_GEOMETRY_FLAT = 0,
|
||||
DWRITE_PIXEL_GEOMETRY_RGB = 1,
|
||||
DWRITE_PIXEL_GEOMETRY_BGR = 2,
|
||||
} DWRITE_PIXEL_GEOMETRY;
|
||||
|
||||
typedef enum DWRITE_RENDERING_MODE {
|
||||
DWRITE_RENDERING_MODE_DEFAULT = 0,
|
||||
DWRITE_RENDERING_MODE_ALIASED = 1,
|
||||
DWRITE_RENDERING_MODE_GDI_CLASSIC = 2,
|
||||
DWRITE_RENDERING_MODE_GDI_NATURAL = 3,
|
||||
DWRITE_RENDERING_MODE_NATURAL = 4,
|
||||
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC = 5,
|
||||
DWRITE_RENDERING_MODE_OUTLINE = 6,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC = 2,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL = 3,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL = 4,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC = 5,
|
||||
} DWRITE_RENDERING_MODE;
|
||||
|
||||
typedef enum DWRITE_FONT_SIMULATIONS {
|
||||
DWRITE_FONT_SIMULATIONS_NONE = 0,
|
||||
DWRITE_FONT_SIMULATIONS_BOLD = 1,
|
||||
DWRITE_FONT_SIMULATIONS_OBLIQUE = 2,
|
||||
} DWRITE_FONT_SIMULATIONS;
|
||||
|
||||
typedef enum DWRITE_FONT_FACE_TYPE {
|
||||
DWRITE_FONT_FACE_TYPE_CFF = 0,
|
||||
DWRITE_FONT_FACE_TYPE_TRUETYPE = 1,
|
||||
DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION = 2,
|
||||
DWRITE_FONT_FACE_TYPE_TYPE1 = 3,
|
||||
DWRITE_FONT_FACE_TYPE_VECTOR = 4,
|
||||
DWRITE_FONT_FACE_TYPE_BITMAP = 5,
|
||||
DWRITE_FONT_FACE_TYPE_UNKNOWN = 6,
|
||||
DWRITE_FONT_FACE_TYPE_RAW_CFF = 7,
|
||||
DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = 2,
|
||||
} DWRITE_FONT_FACE_TYPE;
|
||||
|
||||
typedef enum DWRITE_GRID_FIT_MODE {
|
||||
DWRITE_GRID_FIT_MODE_DEFAULT = 0,
|
||||
DWRITE_GRID_FIT_MODE_DISABLED = 1,
|
||||
DWRITE_GRID_FIT_MODE_ENABLED = 2,
|
||||
} DWRITE_GRID_FIT_MODE;
|
||||
|
||||
//- rjf: interfaces
|
||||
|
||||
typedef struct IDWriteFactory { struct { void* tbl[]; }* v; } IDWriteFactory;
|
||||
typedef struct IDWriteFactory1 { struct { void* tbl[]; }* v; } IDWriteFactory1;
|
||||
typedef struct IDWriteFactory2 { struct { void* tbl[]; }* v; } IDWriteFactory2;
|
||||
typedef struct IDWriteRenderingParams { struct { void* tbl[]; }* v; } IDWriteRenderingParams;
|
||||
typedef struct IDWriteRenderingParams1 { struct { void* tbl[]; }* v; } IDWriteRenderingParams1;
|
||||
typedef struct IDWriteRenderingParams2 { struct { void* tbl[]; }* v; } IDWriteRenderingParams2;
|
||||
typedef struct IDWriteFontFileLoader { struct { void* tbl[]; }* v; } IDWriteFontFileLoader;
|
||||
typedef struct IDWriteFontFileStream { struct { void* tbl[]; }* v; } IDWriteFontFileStream;
|
||||
typedef struct IDWriteFontFile { struct { void* tbl[]; }* v; } IDWriteFontFile;
|
||||
typedef struct IDWriteFontFace { struct { void* tbl[]; }* v; } IDWriteFontFace;
|
||||
typedef struct IDWriteFontFace1 { struct { void* tbl[]; }* v; } IDWriteFontFace1;
|
||||
typedef struct IDWriteFontFace2 { struct { void* tbl[]; }* v; } IDWriteFontFace2;
|
||||
typedef struct IDWriteGdiInterop { struct { void* tbl[]; }* v; } IDWriteGdiInterop;
|
||||
typedef struct IDWriteBitmapRenderTarget { struct { void* tbl[]; }* v; } IDWriteBitmapRenderTarget;
|
||||
typedef struct IDWriteBitmapRenderTarget1 { struct { void* tbl[]; }* v; } IDWriteBitmapRenderTarget1;
|
||||
|
||||
//- rjf: structs
|
||||
|
||||
typedef struct DWRITE_GLYPH_METRICS {
|
||||
INT32 leftSideBearing;
|
||||
UINT32 advanceWidth;
|
||||
INT32 rightSideBearing;
|
||||
INT32 topSideBearing;
|
||||
UINT32 advanceHeight;
|
||||
INT32 bottomSideBearing;
|
||||
INT32 verticalOriginY;
|
||||
} DWRITE_GLYPH_METRICS;
|
||||
|
||||
typedef struct DWRITE_GLYPH_OFFSET {
|
||||
FLOAT advanceOffset;
|
||||
FLOAT ascenderOffset;
|
||||
} DWRITE_GLYPH_OFFSET;
|
||||
|
||||
typedef struct DWRITE_GLYPH_RUN {
|
||||
IDWriteFontFace* fontFace;
|
||||
FLOAT fontEmSize;
|
||||
UINT32 glyphCount;
|
||||
UINT16* glyphIndices;
|
||||
FLOAT* glyphAdvances;
|
||||
DWRITE_GLYPH_OFFSET* glyphOffsets;
|
||||
BOOL isSideways;
|
||||
UINT32 bidiLevel;
|
||||
} DWRITE_GLYPH_RUN;
|
||||
|
||||
typedef struct DWRITE_FONT_METRICS {
|
||||
UINT16 designUnitsPerEm;
|
||||
UINT16 ascent;
|
||||
UINT16 descent;
|
||||
INT16 lineGap;
|
||||
UINT16 capHeight;
|
||||
UINT16 xHeight;
|
||||
INT16 underlinePosition;
|
||||
UINT16 underlineThickness;
|
||||
INT16 strikethroughPosition;
|
||||
UINT16 strikethroughThickness;
|
||||
} DWRITE_FONT_METRICS;
|
||||
|
||||
typedef struct DWRITE_MATRIX {
|
||||
FLOAT m11;
|
||||
FLOAT m12;
|
||||
FLOAT m21;
|
||||
FLOAT m22;
|
||||
FLOAT dx;
|
||||
FLOAT dy;
|
||||
} DWRITE_MATRIX;
|
||||
|
||||
//- rjf: GUIDs
|
||||
|
||||
DEFINE_GUID(IID_IDWriteFactory, 0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48);
|
||||
DEFINE_GUID(IID_IDWriteFactory1, 0x30572f99, 0xdac6, 0x41db, 0xa1, 0x6e, 0x04, 0x86, 0x30, 0x7e, 0x60, 0x6a);
|
||||
DEFINE_GUID(IID_IDWriteFactory2, 0x0439fc60, 0xca44, 0x4994, 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec);
|
||||
|
||||
//- rjf: functions
|
||||
|
||||
EXTERN_C HRESULT DECLSPEC_IMPORT WINAPI DWriteCreateFactory (DWRITE_FACTORY_TYPE factoryType, const GUID* iid, void** factory);
|
||||
|
||||
//- rjf: methods
|
||||
|
||||
static inline HRESULT IDWriteFactory_RegisterFontFileLoader (IDWriteFactory* this_, IDWriteFontFileLoader* fontFileLoader) { return ((HRESULT (WINAPI*)(IDWriteFactory*, IDWriteFontFileLoader*))this_->v->tbl[13])(this_, fontFileLoader); }
|
||||
static inline HRESULT IDWriteFactory_CreateRenderingParams (IDWriteFactory* this_, IDWriteRenderingParams** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory*, IDWriteRenderingParams**))this_->v->tbl[10])(this_, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory_CreateCustomRenderingParams (IDWriteFactory* this_, FLOAT gamma, FLOAT enhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, IDWriteRenderingParams** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory*, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, IDWriteRenderingParams**))this_->v->tbl[12])(this_, gamma, enhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, renderingParams); }
|
||||
static inline HRESULT IDWriteFactory_GetGdiInterop (IDWriteFactory* this_, IDWriteGdiInterop** gdiInterop) { return ((HRESULT (WINAPI*)(IDWriteFactory*, IDWriteGdiInterop**))this_->v->tbl[17])(this_, gdiInterop); }
|
||||
static inline HRESULT IDWriteFactory_CreateCustomFontFileReference (IDWriteFactory* this_, const void* fontFileReferenceKey, UINT32 fontFileReferenceKeySize, IDWriteFontFileLoader* fontFileLoader, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteFactory*, const void*, UINT32, IDWriteFontFileLoader*, IDWriteFontFile**))this_->v->tbl[8])(this_, fontFileReferenceKey, fontFileReferenceKeySize, fontFileLoader, fontFile); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFileReference (IDWriteFactory* this_, const WCHAR* filePath, const FILETIME* lastWriteTime, IDWriteFontFile** fontFile) { return ((HRESULT (WINAPI*)(IDWriteFactory*, const WCHAR*, const FILETIME*, IDWriteFontFile**))this_->v->tbl[7])(this_, filePath, lastWriteTime, fontFile); }
|
||||
static inline HRESULT IDWriteFactory_CreateFontFace (IDWriteFactory* this_, DWRITE_FONT_FACE_TYPE fontFaceType, UINT32 numberOfFiles, IDWriteFontFile** fontFiles, UINT32 faceIndex, DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, IDWriteFontFace** fontFace) { return ((HRESULT (WINAPI*)(IDWriteFactory*, DWRITE_FONT_FACE_TYPE, UINT32, IDWriteFontFile**, UINT32, DWRITE_FONT_SIMULATIONS, IDWriteFontFace**))this_->v->tbl[9])(this_, fontFaceType, numberOfFiles, fontFiles, faceIndex, fontFaceSimulationFlags, fontFace); }
|
||||
static inline HRESULT IDWriteFactory2_CreateCustomRenderingParams2 (IDWriteFactory2* this, FLOAT gamma, FLOAT enhancedContrast, FLOAT grayscaleEnhancedContrast, FLOAT clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE renderingMode, DWRITE_GRID_FIT_MODE gridFitMode, IDWriteRenderingParams2** renderingParams) { return ((HRESULT (WINAPI*)(IDWriteFactory2*, FLOAT, FLOAT, FLOAT, FLOAT, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, DWRITE_GRID_FIT_MODE, IDWriteRenderingParams2**))this->v->tbl[29])(this, gamma, enhancedContrast, grayscaleEnhancedContrast, clearTypeLevel, pixelGeometry, renderingMode, gridFitMode, renderingParams); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetEnhancedContrast (IDWriteRenderingParams* this_) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this_->v->tbl[4])(this_); }
|
||||
static inline FLOAT IDWriteRenderingParams_GetGamma (IDWriteRenderingParams* this_) { return ((FLOAT (WINAPI*)(IDWriteRenderingParams*))this_->v->tbl[3])(this_); }
|
||||
static inline HRESULT IDWriteGdiInterop_CreateBitmapRenderTarget (IDWriteGdiInterop* this_, HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget** renderTarget) { return ((HRESULT (WINAPI*)(IDWriteGdiInterop*, HDC, UINT32, UINT32, IDWriteBitmapRenderTarget**))this_->v->tbl[7])(this_, hdc, width, height, renderTarget); }
|
||||
static inline HRESULT IDWriteBitmapRenderTarget_SetPixelsPerDip (IDWriteBitmapRenderTarget* this_, FLOAT pixelsPerDip) { return ((HRESULT (WINAPI*)(IDWriteBitmapRenderTarget*, FLOAT))this_->v->tbl[6])(this_, pixelsPerDip); }
|
||||
static inline HDC IDWriteBitmapRenderTarget_GetMemoryDC (IDWriteBitmapRenderTarget* this_) { return ((HDC (WINAPI*)(IDWriteBitmapRenderTarget*))this_->v->tbl[4])(this_); }
|
||||
static inline HRESULT IDWriteBitmapRenderTarget_DrawGlyphRun (IDWriteBitmapRenderTarget* this_, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE measuringMode, const DWRITE_GLYPH_RUN* glyphRun, IDWriteRenderingParams* renderingParams, COLORREF textColor, RECT* blackBoxRect) { return ((HRESULT (WINAPI*)(IDWriteBitmapRenderTarget*, FLOAT, FLOAT, DWRITE_MEASURING_MODE, const DWRITE_GLYPH_RUN*, IDWriteRenderingParams*, COLORREF, RECT*))this_->v->tbl[3])(this_, baselineOriginX, baselineOriginY, measuringMode, glyphRun, renderingParams, textColor, blackBoxRect); }
|
||||
static inline UINT32 IDWriteFontFace_Release (IDWriteFontFace* this_) { return ((UINT32 (WINAPI*)(IDWriteFontFace*))this_->v->tbl[2])(this_); }
|
||||
static inline void IDWriteFontFace_GetMetrics (IDWriteFontFace* this_, DWRITE_FONT_METRICS* fontFaceMetrics) { ((void (WINAPI*)(IDWriteFontFace*, DWRITE_FONT_METRICS*))this_->v->tbl[8])(this_, fontFaceMetrics); }
|
||||
static inline UINT32 IDWriteFontFile_Release (IDWriteFontFile* this_) { return ((UINT32 (WINAPI*)(IDWriteFontFile*))this_->v->tbl[2])(this_); }
|
||||
static inline HRESULT IDWriteFontFace_GetGlyphIndices (IDWriteFontFace* this_, const UINT32* codePoints, UINT32 codePointCount, UINT16* glyphIndices) { return ((HRESULT (WINAPI*)(IDWriteFontFace*, const UINT32*, UINT32, UINT16*))this_->v->tbl[11])(this_, codePoints, codePointCount, glyphIndices); }
|
||||
static inline HRESULT IDWriteFontFace_GetGdiCompatibleGlyphMetrics (IDWriteFontFace* this_, FLOAT emSize, FLOAT pixelsPerDip, const DWRITE_MATRIX* transform, BOOL useGdiNatural, const UINT16* glyphIndices, UINT32 glyphCount, DWRITE_GLYPH_METRICS* glyphMetrics, BOOL isSideways) { return ((HRESULT (WINAPI*)(IDWriteFontFace*, FLOAT, FLOAT, const DWRITE_MATRIX*, BOOL, const UINT16*, UINT32, DWRITE_GLYPH_METRICS*, BOOL))this_->v->tbl[17])(this_, emSize, pixelsPerDip, transform, useGdiNatural, glyphIndices, glyphCount, glyphMetrics, isSideways); }
|
||||
static inline UINT32 IDWriteBitmapRenderTarget_Release (IDWriteBitmapRenderTarget* this_) { return ((UINT32 (WINAPI*)(IDWriteBitmapRenderTarget*))this_->v->tbl[2])(this_); }
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Font Provider Implementation Types
|
||||
|
||||
//- rjf: font file loader interface types
|
||||
|
||||
typedef struct FP_DWrite_FontFileLoader FP_DWrite_FontFileLoader;
|
||||
typedef struct FP_DWrite_FontFileLoaderVTable FP_DWrite_FontFileLoaderVTable;
|
||||
|
||||
struct FP_DWrite_FontFileLoaderVTable
|
||||
{
|
||||
HRESULT (*QueryInterface)(void *obj, REFIID riid, void *ptr_to_object);
|
||||
ULONG (*AddRef)(void *obj);
|
||||
ULONG (*Release)(void *obj);
|
||||
HRESULT (*CreateStreamFromKey)(struct FP_DWrite_FontFileLoader *loader, void const *font_file_ref_key, UINT32 font_file_ref_key_size, IDWriteFontFileStream **stream_out);
|
||||
HRESULT (*CreateStreamFromKey)(FP_DWrite_FontFileLoader *loader, void const *font_file_ref_key, UINT32 font_file_ref_key_size, IDWriteFontFileStream **stream_out);
|
||||
};
|
||||
|
||||
struct FP_DWrite_FontFileLoader
|
||||
@@ -25,15 +218,19 @@ struct FP_DWrite_FontFileLoader
|
||||
|
||||
//- rjf: font file stream interface types
|
||||
|
||||
typedef struct FP_DWrite_FontFileStream FP_DWrite_FontFileStream;
|
||||
typedef struct FP_DWrite_FontFileStreamVTable FP_DWrite_FontFileStreamVTable;
|
||||
typedef struct FP_DWrite_FontFileStreamNode FP_DWrite_FontFileStreamNode;
|
||||
|
||||
struct FP_DWrite_FontFileStreamVTable
|
||||
{
|
||||
HRESULT (*QueryInterface)(void *obj, REFIID riid, void *ptr_to_object);
|
||||
ULONG (*AddRef)(void *obj);
|
||||
ULONG (*Release)(void *obj);
|
||||
HRESULT (*ReadFileFragment)(struct FP_DWrite_FontFileStream *obj, void const **fragment_start, UINT64 file_offset, UINT64 fragment_size, void **fragment_context);
|
||||
HRESULT (*ReleaseFileFragment)(struct FP_DWrite_FontFileStream *obj, void *fragment_context);
|
||||
HRESULT (*GetFileSize)(struct FP_DWrite_FontFileStream *obj, UINT64 *size_out);
|
||||
HRESULT (*GetLastWriteTime)(struct FP_DWrite_FontFileStream *obj, UINT64 *time_out);
|
||||
HRESULT (*ReadFileFragment)(FP_DWrite_FontFileStream *obj, void const **fragment_start, UINT64 file_offset, UINT64 fragment_size, void **fragment_context);
|
||||
HRESULT (*ReleaseFileFragment)(FP_DWrite_FontFileStream *obj, void *fragment_context);
|
||||
HRESULT (*GetFileSize)(FP_DWrite_FontFileStream *obj, UINT64 *size_out);
|
||||
HRESULT (*GetLastWriteTime)(FP_DWrite_FontFileStream *obj, UINT64 *time_out);
|
||||
};
|
||||
|
||||
struct FP_DWrite_FontFileStream
|
||||
@@ -51,9 +248,11 @@ struct FP_DWrite_FontFileStreamNode
|
||||
|
||||
//- rjf: state & underlying handle types
|
||||
|
||||
typedef struct FP_DWrite_State FP_DWrite_State;
|
||||
struct FP_DWrite_State
|
||||
{
|
||||
Arena *arena;
|
||||
B32 dwrite2_is_supported;
|
||||
IDWriteFactory *factory;
|
||||
IDWriteRenderingParams *base_rendering_params;
|
||||
IDWriteRenderingParams *rendering_params[FP_RasterMode_COUNT];
|
||||
@@ -65,6 +264,7 @@ struct FP_DWrite_State
|
||||
FP_DWrite_FontFileStreamNode *free_stream_node;
|
||||
};
|
||||
|
||||
typedef struct FP_DWrite_Font FP_DWrite_Font;
|
||||
struct FP_DWrite_Font
|
||||
{
|
||||
IDWriteFontFile *file;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#define BUILD_SUPPLEMENTARY_UNIT 1
|
||||
|
||||
#include "base/base_inc.h"
|
||||
#include "os/os_inc.h"
|
||||
#include "font_provider/font_provider.h"
|
||||
|
||||
#include "font_provider_dwrite.h"
|
||||
#include "font_provider_dwrite.cpp"
|
||||
|
||||
#include "base/base_inc.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "font_provider/font_provider.c"
|
||||
@@ -39,7 +39,7 @@ struct FP_RasterResult
|
||||
Vec2S16 atlas_dim;
|
||||
void *atlas;
|
||||
F32 advance;
|
||||
S16 height;
|
||||
Rng2S16 bounding_box;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
|
||||
#include "font_provider.c"
|
||||
|
||||
#if LANG_CPP
|
||||
# if FP_BACKEND == FP_BACKEND_DWRITE
|
||||
# include "dwrite/font_provider_dwrite.cpp"
|
||||
# else
|
||||
# error Font provider backend not specified.
|
||||
# endif
|
||||
#if FP_BACKEND == FP_BACKEND_DWRITE
|
||||
# include "dwrite/font_provider_dwrite.c"
|
||||
#else
|
||||
# error Font provider backend not specified.
|
||||
#endif
|
||||
|
||||
@@ -24,12 +24,10 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Backend Includes
|
||||
|
||||
#if LANG_CPP
|
||||
# if FP_BACKEND == FP_BACKEND_DWRITE
|
||||
# include "dwrite/font_provider_dwrite.h"
|
||||
# else
|
||||
# error Font provider backend not specified.
|
||||
# endif
|
||||
#if FP_BACKEND == FP_BACKEND_DWRITE
|
||||
# include "dwrite/font_provider_dwrite.h"
|
||||
#else
|
||||
# error Font provider backend not specified.
|
||||
#endif
|
||||
|
||||
#endif // FONT_PROVIDER_INC_H
|
||||
|
||||
@@ -0,0 +1,553 @@
|
||||
// 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(¶ms->target));
|
||||
for(U64 idx = 0; idx < params->dbgi_keys.count; idx += 1)
|
||||
{
|
||||
hash = fzy_hash_from_string(hash, str8_struct(¶ms->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_name_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_name_idx(rdi, GlobalVariables, 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_name_idx(rdi, ThreadVariables, 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_name_idx(rdi, UDTs, element_idx);
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, 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, ¶ms.dbgi_keys.v[idx], max_U64);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: search target -> info about search space
|
||||
//
|
||||
RDI_SectionKind section_kind = RDI_SectionKind_NULL;
|
||||
U64 element_name_idx_off = 0;
|
||||
if(task_is_good)
|
||||
{
|
||||
switch(params.target)
|
||||
{
|
||||
// NOTE(rjf): no default!
|
||||
case FZY_Target_COUNT:{}break;
|
||||
case FZY_Target_Procedures:
|
||||
{
|
||||
section_kind = RDI_SectionKind_Procedures;
|
||||
element_name_idx_off = OffsetOf(RDI_Procedure, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_GlobalVariables:
|
||||
{
|
||||
section_kind = RDI_SectionKind_GlobalVariables;
|
||||
element_name_idx_off = OffsetOf(RDI_GlobalVariable, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_ThreadVariables:
|
||||
{
|
||||
section_kind = RDI_SectionKind_ThreadVariables;
|
||||
element_name_idx_off = OffsetOf(RDI_ThreadVariable, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_UDTs:
|
||||
{
|
||||
section_kind = RDI_SectionKind_UDTs;
|
||||
}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];
|
||||
U64 element_count = 0;
|
||||
void *table_base = rdi_section_raw_table_from_kind(rdi, section_kind, &element_count);
|
||||
U64 element_size = rdi_section_element_size_table[section_kind];
|
||||
for(U64 idx = 1; task_is_good && idx < element_count; idx += 1)
|
||||
{
|
||||
void *element = (U8 *)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_name_idx(rdi, TypeNodes, 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)
|
||||
{
|
||||
quick_sort(items.v, items.count, sizeof(FZY_Item), 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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -301,7 +301,7 @@ geo_xfer_thread__entry_point(void *p)
|
||||
R_Handle buffer = {0};
|
||||
if(got_task && data.size != 0)
|
||||
{
|
||||
buffer = r_buffer_alloc(R_BufferKind_Static, data.size, data.str);
|
||||
buffer = r_buffer_alloc(R_ResourceKind_Static, data.size, data.str);
|
||||
}
|
||||
|
||||
//- rjf: commit results to cache
|
||||
|
||||
@@ -14,7 +14,10 @@ internal U128
|
||||
hs_hash_from_data(String8 data)
|
||||
{
|
||||
U128 u128 = {0};
|
||||
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
||||
if(data.size != 0)
|
||||
{
|
||||
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
||||
}
|
||||
return u128;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
// Functions
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_hash(RDI_U8 *ptr, RDI_U64 size){
|
||||
RDI_U64 result = 5381;
|
||||
RDI_U8 *opl = ptr + size;
|
||||
for (; ptr < opl; ptr += 1){
|
||||
result = ((result << 5) + result) + *ptr;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdi_size_from_basic_type_kind(RDI_TypeKind kind){
|
||||
RDI_U32 result = 0;
|
||||
switch (kind){
|
||||
#define X(N,C)
|
||||
#define XZ(N,C,Z) case C: result = Z; break;
|
||||
#define Y(A,N)
|
||||
RDI_TypeKindXList(X,XZ,Y)
|
||||
#undef X
|
||||
#undef XZ
|
||||
#undef Y
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdi_addr_size_from_arch(RDI_Arch arch){
|
||||
RDI_U32 result = 0;
|
||||
switch (arch){
|
||||
#define X(N,C,Z) case C: result = Z; break;
|
||||
RDI_ArchXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
//- eval helpers
|
||||
|
||||
RDI_PROC RDI_EvalConversionKind
|
||||
rdi_eval_conversion_rule(RDI_EvalTypeGroup in, RDI_EvalTypeGroup out){
|
||||
RDI_EvalConversionKind result = 0;
|
||||
switch (in + (out << 8)){
|
||||
#define Y(i,o) case ((RDI_EvalTypeGroup_##i) + ((RDI_EvalTypeGroup_##o) << 8)):
|
||||
#define Xb(c)
|
||||
#define Xe(c) result = RDI_EvalConversionKind_##c; break;
|
||||
RDI_EvalConversionKindFromTypeGroupPairMap(Y,Xb,Xe)
|
||||
#undef Xe
|
||||
#undef Xb
|
||||
#undef Y
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8*
|
||||
rdi_eval_conversion_message(RDI_EvalConversionKind conversion_kind, RDI_U64 *lenout){
|
||||
RDI_U8 *result = 0;
|
||||
switch (conversion_kind){
|
||||
#define X(N,msg) \
|
||||
case RDI_EvalConversionKind_##N: result = (RDI_U8*)msg; *lenout = sizeof(msg) - 1; break;
|
||||
RDI_EvalConversionKindXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_S32
|
||||
rdi_eval_opcode_type_compatible(RDI_EvalOp op, RDI_EvalTypeGroup group){
|
||||
RDI_S32 result = 0;
|
||||
switch (op){
|
||||
case RDI_EvalOp_Neg: case RDI_EvalOp_Add: case RDI_EvalOp_Sub:
|
||||
case RDI_EvalOp_Mul: case RDI_EvalOp_Div:
|
||||
case RDI_EvalOp_EqEq:case RDI_EvalOp_NtEq:
|
||||
case RDI_EvalOp_LsEq:case RDI_EvalOp_GrEq:
|
||||
case RDI_EvalOp_Less:case RDI_EvalOp_Grtr:
|
||||
{
|
||||
if (group != RDI_EvalTypeGroup_Other){
|
||||
result = 1;
|
||||
}
|
||||
}break;
|
||||
case RDI_EvalOp_Mod:case RDI_EvalOp_LShift:case RDI_EvalOp_RShift:
|
||||
case RDI_EvalOp_BitNot:case RDI_EvalOp_BitAnd:case RDI_EvalOp_BitXor:
|
||||
case RDI_EvalOp_BitOr:case RDI_EvalOp_LogNot:case RDI_EvalOp_LogAnd:
|
||||
case RDI_EvalOp_LogOr:
|
||||
{
|
||||
if (group == RDI_EvalTypeGroup_S || group == RDI_EvalTypeGroup_U){
|
||||
result = 1;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
@@ -1,926 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// RAD Debug Info, (R)AD(D)BG(I) Format Library
|
||||
//
|
||||
// Defines standard RADDBGI debug information format types and
|
||||
// functions.
|
||||
|
||||
#ifndef RADDBGI_FORMAT_H
|
||||
#define RADDBGI_FORMAT_H
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Overridable procedure decoration
|
||||
|
||||
#if !defined(RDI_PROC)
|
||||
# define RDI_PROC static
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Overridable integer types
|
||||
|
||||
#if !defined(RDI_U8)
|
||||
# define RDI_U8 RDI_U8
|
||||
# define RDI_U16 RDI_U16
|
||||
# define RDI_U32 RDI_U32
|
||||
# define RDI_U64 RDI_U64
|
||||
# define RDI_S8 RDI_S8
|
||||
# define RDI_S16 RDI_S16
|
||||
# define RDI_S32 RDI_S32
|
||||
# define RDI_S64 RDI_S64
|
||||
|
||||
#include <stdint.h>
|
||||
typedef uint8_t RDI_U8;
|
||||
typedef uint16_t RDI_U16;
|
||||
typedef uint32_t RDI_U32;
|
||||
typedef uint64_t RDI_U64;
|
||||
typedef int8_t RDI_S8;
|
||||
typedef int16_t RDI_S16;
|
||||
typedef int32_t RDI_S32;
|
||||
typedef int64_t RDI_S64;
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Architecture Constants
|
||||
|
||||
#define RDI_ArchXList(X)\
|
||||
X(NULL, 0, 0)\
|
||||
X(X86, 1, 4)\
|
||||
X(X64, 2, 8)
|
||||
|
||||
typedef RDI_U32 RDI_Arch;
|
||||
typedef enum RDI_ArchEnum{
|
||||
#define X(N,C,Z) RDI_Arch_##N = C,
|
||||
RDI_ArchXList(X)
|
||||
#undef X
|
||||
} RDI_ArchEnum;
|
||||
|
||||
|
||||
typedef RDI_U8 RDI_RegisterCode;
|
||||
|
||||
// x86 registers
|
||||
#define RDI_RegisterCode_X86_XList(X) \
|
||||
X(nil, 0) \
|
||||
X(eax, 1) \
|
||||
X(ecx, 2) \
|
||||
X(edx, 3) \
|
||||
X(ebx, 4) \
|
||||
X(esp, 5) \
|
||||
X(ebp, 6) \
|
||||
X(esi, 7) \
|
||||
X(edi, 8) \
|
||||
X(fsbase, 9) \
|
||||
X(gsbase, 10) \
|
||||
X(eflags, 11) \
|
||||
X(eip, 12) \
|
||||
X(dr0, 13) \
|
||||
X(dr1, 14) \
|
||||
X(dr2, 15) \
|
||||
X(dr3, 16) \
|
||||
X(dr4, 17) \
|
||||
X(dr5, 18) \
|
||||
X(dr6, 19) \
|
||||
X(dr7, 20) \
|
||||
X(fpr0, 21) \
|
||||
X(fpr1, 22) \
|
||||
X(fpr2, 23) \
|
||||
X(fpr3, 24) \
|
||||
X(fpr4, 25) \
|
||||
X(fpr5, 26) \
|
||||
X(fpr6, 27) \
|
||||
X(fpr7, 28) \
|
||||
X(st0, 29) \
|
||||
X(st1, 30) \
|
||||
X(st2, 31) \
|
||||
X(st3, 32) \
|
||||
X(st4, 33) \
|
||||
X(st5, 34) \
|
||||
X(st6, 35) \
|
||||
X(st7, 36) \
|
||||
X(fcw, 37) \
|
||||
X(fsw, 38) \
|
||||
X(ftw, 39) \
|
||||
X(fop, 40) \
|
||||
X(fcs, 41) \
|
||||
X(fds, 42) \
|
||||
X(fip, 43) \
|
||||
X(fdp, 44) \
|
||||
X(mxcsr, 45) \
|
||||
X(mxcsr_mask, 46) \
|
||||
X(ss, 47) \
|
||||
X(cs, 48) \
|
||||
X(ds, 49) \
|
||||
X(es, 50) \
|
||||
X(fs, 51) \
|
||||
X(gs, 52) \
|
||||
X(ymm0, 53) \
|
||||
X(ymm1, 54) \
|
||||
X(ymm2, 55) \
|
||||
X(ymm3, 56) \
|
||||
X(ymm4, 57) \
|
||||
X(ymm5, 58) \
|
||||
X(ymm6, 59) \
|
||||
X(ymm7, 60) \
|
||||
X(COUNT, 61)
|
||||
|
||||
typedef enum RDI_RegisterCode_X86_Enum{
|
||||
#define X(N,C) RDI_RegisterCode_X86_##N = C,
|
||||
RDI_RegisterCode_X86_XList(X)
|
||||
#undef X
|
||||
} RDI_RegisterCode_X86_Enum;
|
||||
|
||||
// x64 registers
|
||||
#define RDI_RegisterCode_X64_XList(X) \
|
||||
X(nil, 0) \
|
||||
X(rax, 1) \
|
||||
X(rcx, 2) \
|
||||
X(rdx, 3) \
|
||||
X(rbx, 4) \
|
||||
X(rsp, 5) \
|
||||
X(rbp, 6) \
|
||||
X(rsi, 7) \
|
||||
X(rdi, 8) \
|
||||
X(r8, 9) \
|
||||
X(r9, 10) \
|
||||
X(r10, 11) \
|
||||
X(r11, 12) \
|
||||
X(r12, 13) \
|
||||
X(r13, 14) \
|
||||
X(r14, 15) \
|
||||
X(r15, 16) \
|
||||
X(es, 17) \
|
||||
X(cs, 18) \
|
||||
X(ss, 19) \
|
||||
X(ds, 20) \
|
||||
X(fs, 21) \
|
||||
X(gs, 22) \
|
||||
X(rip, 23) \
|
||||
X(rflags, 24) \
|
||||
X(dr0, 25) \
|
||||
X(dr1, 26) \
|
||||
X(dr2, 27) \
|
||||
X(dr3, 28) \
|
||||
X(dr4, 29) \
|
||||
X(dr5, 30) \
|
||||
X(dr6, 31) \
|
||||
X(dr7, 32) \
|
||||
X(st0, 33) \
|
||||
X(st1, 34) \
|
||||
X(st2, 35) \
|
||||
X(st3, 36) \
|
||||
X(st4, 37) \
|
||||
X(st5, 38) \
|
||||
X(st6, 39) \
|
||||
X(st7, 40) \
|
||||
X(fpr0, 41) \
|
||||
X(fpr1, 42) \
|
||||
X(fpr2, 43) \
|
||||
X(fpr3, 44) \
|
||||
X(fpr4, 45) \
|
||||
X(fpr5, 46) \
|
||||
X(fpr6, 47) \
|
||||
X(fpr7, 48) \
|
||||
X(ymm0, 49) \
|
||||
X(ymm1, 50) \
|
||||
X(ymm2, 51) \
|
||||
X(ymm3, 52) \
|
||||
X(ymm4, 53) \
|
||||
X(ymm5, 54) \
|
||||
X(ymm6, 55) \
|
||||
X(ymm7, 56) \
|
||||
X(ymm8, 57) \
|
||||
X(ymm9, 58) \
|
||||
X(ymm10, 59) \
|
||||
X(ymm11, 60) \
|
||||
X(ymm12, 61) \
|
||||
X(ymm13, 62) \
|
||||
X(ymm14, 63) \
|
||||
X(ymm15, 64) \
|
||||
X(mxcsr, 65) \
|
||||
X(fsbase, 66) \
|
||||
X(gsbase, 67) \
|
||||
X(fcw, 68) \
|
||||
X(fsw, 69) \
|
||||
X(ftw, 70) \
|
||||
X(fop, 71) \
|
||||
X(fcs, 72) \
|
||||
X(fds, 73) \
|
||||
X(fip, 74) \
|
||||
X(fdp, 75) \
|
||||
X(mxcsr_mask, 76) \
|
||||
X(COUNT, 77)
|
||||
|
||||
typedef enum RDI_RegisterCode_X64_Enum{
|
||||
#define X(N,C) RDI_RegisterCode_X64_##N = C,
|
||||
RDI_RegisterCode_X64_XList(X)
|
||||
#undef X
|
||||
} RDI_RegisterCode_X64_Enum;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Format types
|
||||
|
||||
// "raddbg\0\0"
|
||||
#define RDI_MAGIC_CONSTANT 0x0000676264646172
|
||||
#define RDI_ENCODING_VERSION 1
|
||||
|
||||
#define RDI_LanguageXList(X) \
|
||||
X(NULL, 0) \
|
||||
X(C, 1) \
|
||||
X(CPlusPlus, 2)
|
||||
|
||||
typedef RDI_U32 RDI_Language;
|
||||
typedef enum RDI_LanguageEnum{
|
||||
#define X(N,C) RDI_Language_##N = C,
|
||||
RDI_LanguageXList(X)
|
||||
#undef X
|
||||
} RDI_LanguageEnum;
|
||||
|
||||
typedef struct RDI_Header{
|
||||
// identification
|
||||
RDI_U64 magic;
|
||||
RDI_U32 encoding_version;
|
||||
|
||||
// data sections
|
||||
RDI_U32 data_section_off;
|
||||
RDI_U32 data_section_count;
|
||||
} RDI_Header;
|
||||
|
||||
|
||||
//- data sections
|
||||
|
||||
#define RDI_DataSectionTag_SECONDARY 0x80000000
|
||||
|
||||
#define RDI_DataSectionTagXList(X,Y) \
|
||||
X(NULL, 0x0000)\
|
||||
X(TopLevelInfo, 0x0001)\
|
||||
X(StringData, 0x0002)\
|
||||
X(StringTable, 0x0003)\
|
||||
X(IndexRuns, 0x0004)\
|
||||
X(BinarySections, 0x0005)\
|
||||
X(FilePathNodes, 0x0006)\
|
||||
X(SourceFiles, 0x0007)\
|
||||
X(Units, 0x0008)\
|
||||
X(UnitVmap, 0x0009)\
|
||||
X(TypeNodes, 0x000A)\
|
||||
X(UDTs, 0x000B)\
|
||||
X(Members, 0x000C)\
|
||||
X(EnumMembers, 0x000D)\
|
||||
X(GlobalVariables, 0x000E)\
|
||||
X(GlobalVmap, 0x000F)\
|
||||
X(ThreadVariables, 0x0010)\
|
||||
X(Procedures, 0x0011)\
|
||||
X(Scopes, 0x0012)\
|
||||
X(ScopeVoffData, 0x0013)\
|
||||
X(ScopeVmap, 0x0014)\
|
||||
X(Locals, 0x0015)\
|
||||
X(LocationBlocks, 0x0016)\
|
||||
X(LocationData, 0x0017)\
|
||||
X(NameMaps, 0x0018)\
|
||||
Y(PRIMARY_COUNT)\
|
||||
X(SKIP, RDI_DataSectionTag_SECONDARY|0x0000)\
|
||||
X(LineInfoVoffs, RDI_DataSectionTag_SECONDARY|0x0001)\
|
||||
X(LineInfoData, RDI_DataSectionTag_SECONDARY|0x0002)\
|
||||
X(LineInfoColumns, RDI_DataSectionTag_SECONDARY|0x0003)\
|
||||
X(LineMapNumbers, RDI_DataSectionTag_SECONDARY|0x0004)\
|
||||
X(LineMapRanges, RDI_DataSectionTag_SECONDARY|0x0005)\
|
||||
X(LineMapVoffs, RDI_DataSectionTag_SECONDARY|0x0006)\
|
||||
X(NameMapBuckets, RDI_DataSectionTag_SECONDARY|0x0007)\
|
||||
X(NameMapNodes, RDI_DataSectionTag_SECONDARY|0x0008)
|
||||
|
||||
typedef RDI_U32 RDI_DataSectionTag;
|
||||
typedef enum RDI_DataSectionTagEnum{
|
||||
#define X(N,C) RDI_DataSectionTag_##N = C,
|
||||
#define Y(N) RDI_DataSectionTag_##N,
|
||||
RDI_DataSectionTagXList(X,Y)
|
||||
#undef X
|
||||
#undef Y
|
||||
} RDI_DataSectionTagEnum;
|
||||
|
||||
|
||||
#define RDI_DataSectionEncodingXList(X) \
|
||||
X(Unpacked, 0)
|
||||
|
||||
typedef RDI_U32 RDI_DataSectionEncoding;
|
||||
typedef enum RDI_DataSectionEncodingEnum{
|
||||
#define X(N,C) RDI_DataSectionEncoding_##N = C,
|
||||
RDI_DataSectionEncodingXList(X)
|
||||
#undef X
|
||||
} RDI_DataSectionEncodingEnum;
|
||||
|
||||
typedef struct RDI_DataSection{
|
||||
RDI_DataSectionTag tag;
|
||||
RDI_DataSectionEncoding encoding;
|
||||
RDI_U64 off;
|
||||
RDI_U64 encoded_size;
|
||||
RDI_U64 unpacked_size;
|
||||
} RDI_DataSection;
|
||||
|
||||
|
||||
//- common types
|
||||
typedef struct RDI_VMapEntry{
|
||||
RDI_U64 voff;
|
||||
RDI_U64 idx;
|
||||
} RDI_VMapEntry;
|
||||
|
||||
//- top level info
|
||||
typedef struct RDI_TopLevelInfo{
|
||||
RDI_Arch architecture;
|
||||
RDI_U32 exe_name_string_idx;
|
||||
RDI_U64 exe_hash;
|
||||
RDI_U64 voff_max;
|
||||
} RDI_TopLevelInfo;
|
||||
|
||||
//- binary sections
|
||||
typedef RDI_U32 RDI_BinarySectionFlags;
|
||||
typedef enum RDI_BinarySectionFlagsEnum{
|
||||
RDI_BinarySectionFlag_Read = (1 << 0),
|
||||
RDI_BinarySectionFlag_Write = (1 << 1),
|
||||
RDI_BinarySectionFlag_Execute = (1 << 2)
|
||||
} RDI_BinarySectionFlagsEnum;
|
||||
|
||||
typedef struct RDI_BinarySection{
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_BinarySectionFlags flags;
|
||||
RDI_U64 voff_first;
|
||||
RDI_U64 voff_opl;
|
||||
RDI_U64 foff_first;
|
||||
RDI_U64 foff_opl;
|
||||
} RDI_BinarySection;
|
||||
|
||||
//- file & file system info
|
||||
typedef struct RDI_FilePathNode{
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U32 parent_path_node;
|
||||
RDI_U32 first_child;
|
||||
RDI_U32 next_sibling;
|
||||
RDI_U32 source_file_idx;
|
||||
} RDI_FilePathNode;
|
||||
|
||||
typedef struct RDI_SourceFile{
|
||||
RDI_U32 file_path_node_idx;
|
||||
|
||||
RDI_U32 normal_full_path_string_idx;
|
||||
|
||||
// usage of line map to go from a line number to an array of voffs
|
||||
// (line_map_nums * line_number) -> (nil | index)
|
||||
// (line_map_data * index) -> (range)
|
||||
// (line_map_voff_data * range) -> (array(voff))
|
||||
|
||||
RDI_U32 line_map_count;
|
||||
RDI_U32 line_map_nums_data_idx; // U32[line_map_count] (sorted - not closed ranges)
|
||||
RDI_U32 line_map_range_data_idx; // U32[line_map_count + 1] (pairs form ranges)
|
||||
RDI_U32 line_map_voff_data_idx; // U64[...] (idx by line_map_range_data)
|
||||
} RDI_SourceFile;
|
||||
|
||||
|
||||
//- units & line info
|
||||
typedef struct RDI_Unit{
|
||||
RDI_U32 unit_name_string_idx;
|
||||
RDI_U32 compiler_name_string_idx;
|
||||
RDI_U32 source_file_path_node;
|
||||
RDI_U32 object_file_path_node;
|
||||
RDI_U32 archive_file_path_node;
|
||||
RDI_U32 build_path_node;
|
||||
RDI_Language language;
|
||||
|
||||
// usage of line info to go from voff to file & line number:
|
||||
// (line_info_voffs * voff) -> (nil + index)
|
||||
// (line_info_data * index) -> (RDI_Line = (file_idx * line_number))
|
||||
|
||||
RDI_U32 line_info_voffs_data_idx; // U64[line_info_count + 1] (sorted ranges)
|
||||
RDI_U32 line_info_data_idx; // RDI_Line[line_info_count]
|
||||
RDI_U32 line_info_col_data_idx; // RDI_Col[line_info_count]
|
||||
RDI_U32 line_info_count;
|
||||
} RDI_Unit;
|
||||
|
||||
typedef struct RDI_Line{
|
||||
RDI_U32 file_idx;
|
||||
RDI_U32 line_num;
|
||||
} RDI_Line;
|
||||
|
||||
typedef struct RDI_Column{
|
||||
RDI_U16 col_first;
|
||||
RDI_U16 col_opl;
|
||||
} RDI_Column;
|
||||
|
||||
|
||||
//- type info
|
||||
|
||||
// X(name,code) - defines a primary code
|
||||
// XZ(name,code size) - defines a primary code & associates a size
|
||||
// Y(alias_name,name) - defines an alias for bookends
|
||||
#define RDI_TypeKindXList(X,XZ,Y)\
|
||||
X(NULL, 0x0000) \
|
||||
\
|
||||
XZ(Void, 0x0001, 0) Y(FirstBuiltIn, Void) \
|
||||
XZ(Handle, 0x0002, 0xFFFFFFFF) \
|
||||
XZ(Char8, 0x0003, 1)\
|
||||
XZ(Char16, 0x0004, 2) \
|
||||
XZ(Char32, 0x0005, 4) \
|
||||
XZ(UChar8, 0x0006, 1) \
|
||||
XZ(UChar16, 0x0007, 2) \
|
||||
XZ(UChar32, 0x0008, 4) \
|
||||
XZ(U8, 0x0009, 1) \
|
||||
XZ(U16, 0x000A, 2) \
|
||||
XZ(U32, 0x000B, 4) \
|
||||
XZ(U64, 0x000C, 8) \
|
||||
XZ(U128, 0x000D, 16) \
|
||||
XZ(U256, 0x000E, 32) \
|
||||
XZ(U512, 0x000F, 64) \
|
||||
XZ(S8, 0x0010, 1) \
|
||||
XZ(S16, 0x0011, 2) \
|
||||
XZ(S32, 0x0012, 4) \
|
||||
XZ(S64, 0x0013, 8) \
|
||||
XZ(S128, 0x0014, 16) \
|
||||
XZ(S256, 0x0015, 32) \
|
||||
XZ(S512, 0x0016, 64) \
|
||||
XZ(Bool, 0x0017, 1) \
|
||||
XZ(F16, 0x0018, 2) \
|
||||
XZ(F32, 0x0019, 4) \
|
||||
XZ(F32PP, 0x001A, 4) \
|
||||
XZ(F48, 0x001B, 6) \
|
||||
XZ(F64, 0x001C, 8) \
|
||||
XZ(F80, 0x001D, 10) \
|
||||
XZ(F128, 0x001E, 16) \
|
||||
XZ(ComplexF32, 0x001F, 8) \
|
||||
XZ(ComplexF64, 0x0020, 16) \
|
||||
XZ(ComplexF80, 0x0021, 20) \
|
||||
XZ(ComplexF128, 0x0022, 32) Y(LastBuiltIn, ComplexF128) \
|
||||
\
|
||||
X(Modifier, 0x1000) Y(FirstConstructed, Modifier) \
|
||||
X(Ptr, 0x1001) \
|
||||
X(LRef, 0x1002) \
|
||||
X(RRef, 0x1003) \
|
||||
X(Array, 0x1004) \
|
||||
X(Function, 0x1005) \
|
||||
X(Method, 0x1006) \
|
||||
X(MemberPtr, 0x1007) Y(LastConstructed, MemberPtr) \
|
||||
\
|
||||
X(Struct, 0x2000) Y(FirstUserDefined, Struct) Y(FirstRecord, Struct) \
|
||||
X(Class, 0x2001) \
|
||||
X(Union, 0x2002) Y(LastRecord, Union) \
|
||||
X(Enum, 0x2003) \
|
||||
X(Alias, 0x2004) \
|
||||
X(IncompleteStruct, 0x2005) Y(FirstIncomplete, IncompleteStruct) \
|
||||
X(IncompleteUnion, 0x2006) \
|
||||
X(IncompleteClass, 0x2007) \
|
||||
X(IncompleteEnum, 0x2008) Y(LastIncomplete, IncompleteEnum) \
|
||||
Y(LastUserDefined, IncompleteEnum) \
|
||||
\
|
||||
X(Bitfield, 0xF000) \
|
||||
X(Variadic, 0xF001)
|
||||
|
||||
typedef RDI_U16 RDI_TypeKind;
|
||||
typedef enum RDI_TypeKindEnum{
|
||||
|
||||
#define X(name,code) RDI_TypeKind_##name = code,
|
||||
#define XZ(name,code,size) X(name,code)
|
||||
#define Y(alias_name,name) RDI_TypeKind_##alias_name = RDI_TypeKind_##name,
|
||||
RDI_TypeKindXList(X,XZ,Y)
|
||||
#undef X
|
||||
#undef XZ
|
||||
#undef Y
|
||||
|
||||
} RDI_TypeKindEnum;
|
||||
|
||||
typedef RDI_U16 RDI_TypeModifierFlags;
|
||||
enum{
|
||||
RDI_TypeModifierFlag_Const = (1 << 0),
|
||||
RDI_TypeModifierFlag_Volatile = (1 << 1),
|
||||
};
|
||||
|
||||
// IMPORTANT NOTE: All type nodes in a valid raddbg are *topologically sorted*.
|
||||
// That means any time a type node refers to another type node, the type node
|
||||
// it refers to has an index less than or equal to the index of the node that
|
||||
// is doing the referring. It is never the case that a type node depends on a
|
||||
// node that comes later in the type node array.
|
||||
// This restriction does not apply to the members of a type that are
|
||||
// attached through a "UDT" though.
|
||||
|
||||
typedef struct RDI_TypeNode{
|
||||
RDI_TypeKind kind;
|
||||
// when kind is 'Modifier' -> RDI_TypeModifierFlags
|
||||
RDI_U16 flags;
|
||||
|
||||
RDI_U32 byte_size;
|
||||
|
||||
union{
|
||||
// kind is 'built-in'
|
||||
struct{
|
||||
RDI_U32 name_string_idx;
|
||||
} built_in;
|
||||
|
||||
// kind is 'constructed'
|
||||
struct{
|
||||
RDI_U32 direct_type_idx;
|
||||
RDI_U32 count;
|
||||
union{
|
||||
// when kind is 'Function' or 'Method'
|
||||
RDI_U32 param_idx_run_first;
|
||||
// when kind is 'MemberPtr'
|
||||
RDI_U32 owner_type_idx;
|
||||
};
|
||||
} constructed;
|
||||
|
||||
// kind is 'user defined'
|
||||
struct{
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U32 direct_type_idx;
|
||||
RDI_U32 udt_idx;
|
||||
} user_defined;
|
||||
|
||||
// (kind = Bitfield)
|
||||
struct{
|
||||
RDI_U32 direct_type_idx;
|
||||
RDI_U32 off;
|
||||
RDI_U32 size;
|
||||
} bitfield;
|
||||
};
|
||||
} RDI_TypeNode;
|
||||
|
||||
typedef RDI_U32 RDI_UserDefinedTypeFlags;
|
||||
enum{
|
||||
RDI_UserDefinedTypeFlag_EnumMembers = (1 << 0),
|
||||
};
|
||||
|
||||
typedef struct RDI_UDT{
|
||||
RDI_U32 self_type_idx;
|
||||
RDI_UserDefinedTypeFlags flags;
|
||||
|
||||
// when EnumMembers flag is set, indexes into enum "enum_members" instead of "members"
|
||||
RDI_U32 member_first;
|
||||
RDI_U32 member_count;
|
||||
|
||||
RDI_U32 file_idx;
|
||||
RDI_U32 line;
|
||||
RDI_U32 col;
|
||||
} RDI_UDT;
|
||||
|
||||
#define RDI_MemberKindXList(X) \
|
||||
X(NULL, 0x0000) \
|
||||
X(DataField, 0x0001) \
|
||||
X(StaticData, 0x0002) \
|
||||
X(Method, 0x0100) \
|
||||
X(StaticMethod, 0x0101) \
|
||||
X(VirtualMethod, 0x0102) \
|
||||
X(VTablePtr, 0x0200) \
|
||||
X(Base, 0x0201) \
|
||||
X(VirtualBase, 0x0202) \
|
||||
X(NestedType, 0x0300)
|
||||
|
||||
typedef RDI_U16 RDI_MemberKind;
|
||||
typedef enum RDI_MemberKindEnum{
|
||||
#define X(N,C) RDI_MemberKind_##N = C,
|
||||
RDI_MemberKindXList(X)
|
||||
#undef X
|
||||
} RDI_MemberKindEnum;
|
||||
|
||||
// TODO(allen): need a way to equip methods and some virtual methods
|
||||
// with procedure symbol information. I'm thinking a seperate data
|
||||
// array of (MemberIdx,ProcSymbolIdx) sorted by MemberIdx. Or just a
|
||||
// parallel array. Putting them right into this struct looks like it
|
||||
// would complicate the converters because we tend to want an API
|
||||
// like 'associate_method_to_proc' that can be used *after* both the
|
||||
// method and proc are known, rather than one that forces us to know
|
||||
// the association when constructing the member data.
|
||||
typedef struct RDI_Member{
|
||||
RDI_MemberKind kind;
|
||||
RDI_U16 __unused__;
|
||||
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U32 type_idx;
|
||||
RDI_U32 off;
|
||||
} RDI_Member;
|
||||
|
||||
typedef struct RDI_EnumMember{
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U32 __unused__;
|
||||
RDI_U64 val;
|
||||
} RDI_EnumMember;
|
||||
|
||||
|
||||
//- symbol info
|
||||
typedef RDI_U32 RDI_LinkFlags;
|
||||
enum{
|
||||
RDI_LinkFlag_External = (1 << 0),
|
||||
// NOTE: Scope flags are mutually exclusive.
|
||||
// A symbol is either global scoped, type scoped, or procedure scoped.
|
||||
RDI_LinkFlag_TypeScoped = (1 << 1),
|
||||
RDI_LinkFlag_ProcScoped = (1 << 2),
|
||||
};
|
||||
|
||||
typedef struct RDI_GlobalVariable{
|
||||
RDI_U32 name_string_idx;
|
||||
// NOTE: "global variables" can be scoped in *any* way. The scope flags here refer to
|
||||
// *namespace* scoping. "global variables" are all in the data section of the
|
||||
// final exe/dll type file, so they are "global" in the life-time sense of the
|
||||
// word. In the namespace sense of the word, they can be scoped globally, by type,
|
||||
// or by procedure.
|
||||
RDI_LinkFlags link_flags;
|
||||
RDI_U64 voff;
|
||||
RDI_U32 type_idx;
|
||||
|
||||
// container_idx: UDT for "TypeScoped", Procedure for "ProcScoped"
|
||||
RDI_U32 container_idx;
|
||||
} RDI_GlobalVariable;
|
||||
|
||||
typedef struct RDI_ThreadVariable{
|
||||
RDI_U32 name_string_idx;
|
||||
// NOTE: See the note in GlobalVariable regarding scoping. The same concept applies here.
|
||||
RDI_LinkFlags link_flags;
|
||||
RDI_U32 tls_off;
|
||||
RDI_U32 type_idx;
|
||||
|
||||
// container_idx: UDT for "TypeScoped", Procedure for "ProcScoped"
|
||||
RDI_U32 container_idx;
|
||||
} RDI_ThreadVariable;
|
||||
|
||||
typedef struct RDI_Procedure{
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U32 link_name_string_idx;
|
||||
// NOTE: See the note in GlobalVariable regarding scoping. The same concept applies here.
|
||||
RDI_LinkFlags link_flags;
|
||||
RDI_U32 type_idx;
|
||||
RDI_U32 root_scope_idx;
|
||||
|
||||
// container_idx: UDT for "TypeScoped", Procedure for "ProcScoped"
|
||||
RDI_U32 container_idx;
|
||||
} RDI_Procedure;
|
||||
|
||||
typedef struct RDI_Scope{
|
||||
RDI_U32 proc_idx;
|
||||
RDI_U32 parent_scope_idx;
|
||||
RDI_U32 first_child_scope_idx;
|
||||
RDI_U32 next_sibling_scope_idx;
|
||||
|
||||
RDI_U32 voff_range_first;
|
||||
RDI_U32 voff_range_opl;
|
||||
|
||||
// indexes into "locals"
|
||||
RDI_U32 local_first;
|
||||
RDI_U32 local_count;
|
||||
|
||||
RDI_U32 static_local_idx_run_first;
|
||||
RDI_U32 static_local_count;
|
||||
|
||||
// TODO(allen): attach less common scope-relevant info
|
||||
} RDI_Scope;
|
||||
|
||||
typedef RDI_U32 RDI_LocalKind;
|
||||
typedef enum{
|
||||
RDI_LocalKind_NULL,
|
||||
RDI_LocalKind_Parameter,
|
||||
RDI_LocalKind_Variable,
|
||||
RDI_LocalKind_COUNT
|
||||
} RDI_LocalKindEnum;
|
||||
|
||||
typedef struct RDI_Local{
|
||||
RDI_LocalKind kind;
|
||||
RDI_U32 name_string_idx;
|
||||
RDI_U64 type_idx;
|
||||
// indexes into "location_blocks"
|
||||
RDI_U32 location_first;
|
||||
RDI_U32 location_opl;
|
||||
} RDI_Local;
|
||||
|
||||
typedef struct RDI_LocationBlock{
|
||||
RDI_U32 scope_off_first;
|
||||
RDI_U32 scope_off_opl;
|
||||
RDI_U32 location_data_off;
|
||||
} RDI_LocationBlock;
|
||||
|
||||
typedef RDI_U8 RDI_LocationKind;
|
||||
typedef enum{
|
||||
RDI_LocationKind_NULL,
|
||||
RDI_LocationKind_AddrBytecodeStream,
|
||||
RDI_LocationKind_ValBytecodeStream,
|
||||
RDI_LocationKind_AddrRegisterPlusU16,
|
||||
RDI_LocationKind_AddrAddrRegisterPlusU16,
|
||||
RDI_LocationKind_ValRegister,
|
||||
RDI_LocationKind_COUNT
|
||||
} RDI_LocationKindEnum;
|
||||
|
||||
typedef struct RDI_LocationBytecodeStream{
|
||||
RDI_LocationKind kind;
|
||||
// [... 0] null terminated byte sequence RDI_EvalBytecodeStream
|
||||
} RDI_LocationBytecodeStream;
|
||||
|
||||
typedef struct RDI_LocationRegisterPlusU16{
|
||||
RDI_LocationKind kind;
|
||||
RDI_RegisterCode register_code;
|
||||
RDI_U16 offset;
|
||||
} RDI_LocationRegisterPlusU16;
|
||||
|
||||
typedef struct RDI_LocationRegister{
|
||||
RDI_LocationKind kind;
|
||||
RDI_RegisterCode register_code;
|
||||
} RDI_LocationRegister;
|
||||
|
||||
//- name map types
|
||||
#define RDI_NameMapXList(X)\
|
||||
X(NULL, 0)\
|
||||
X(GlobalVariables, 1)\
|
||||
X(ThreadVariables, 2)\
|
||||
X(Procedures, 3)\
|
||||
X(Types, 4)\
|
||||
X(LinkNameProcedures, 5)\
|
||||
X(NormalSourcePaths, 6)
|
||||
|
||||
typedef RDI_U32 RDI_NameMapKind;
|
||||
typedef enum RDI_NameMapKindEnum{
|
||||
#define X(N,C) RDI_NameMapKind_##N = C,
|
||||
RDI_NameMapXList(X)
|
||||
#undef X
|
||||
|
||||
RDI_NameMapKind_COUNT
|
||||
} RDI_NameMapKindEnum;
|
||||
|
||||
// TODO(allen): documentation here for the hashing and probing strategy for this table
|
||||
|
||||
typedef struct RDI_NameMap{
|
||||
RDI_NameMapKind kind;
|
||||
RDI_U32 bucket_data_idx;
|
||||
RDI_U32 node_data_idx;
|
||||
} RDI_NameMap;
|
||||
|
||||
typedef struct RDI_NameMapBucket{
|
||||
RDI_U32 first_node;
|
||||
RDI_U32 node_count;
|
||||
} RDI_NameMapBucket;
|
||||
|
||||
typedef struct RDI_NameMapNode{
|
||||
RDI_U32 string_idx;
|
||||
RDI_U32 match_count;
|
||||
// NOTE: if (match_count == 1) then this is the index of the matching item
|
||||
// if (match_count > 1) then this is the first for an index run of all the matches
|
||||
RDI_U32 match_idx_or_idx_run_first;
|
||||
} RDI_NameMapNode;
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// Eval Bytecode
|
||||
|
||||
// (Name, decodeN, popN, pushN)
|
||||
#define RDI_EvalOpXList(X)\
|
||||
X(Stop, 0, 0, 0)\
|
||||
X(Noop, 0, 0, 0)\
|
||||
X(Cond, 1, 1, 0)\
|
||||
X(Skip, 1, 0, 0)\
|
||||
X(MemRead, 1, 1, 1)\
|
||||
X(RegRead, 4, 0, 1)\
|
||||
X(RegReadDyn, 0, 1, 1)\
|
||||
X(FrameOff, 1, 0, 1)\
|
||||
X(ModuleOff, 4, 0, 1)\
|
||||
X(TLSOff, 4, 0, 1)\
|
||||
X(ObjectOff, 0, 0, 0)\
|
||||
X(CFA, 0, 0, 0)\
|
||||
X(ConstU8, 1, 0, 1)\
|
||||
X(ConstU16, 2, 0, 1)\
|
||||
X(ConstU32, 4, 0, 1)\
|
||||
X(ConstU64, 8, 0, 1)\
|
||||
X(Abs, 1, 1, 1)\
|
||||
X(Neg, 1, 1, 1)\
|
||||
X(Add, 1, 2, 1)\
|
||||
X(Sub, 1, 2, 1)\
|
||||
X(Mul, 1, 2, 1)\
|
||||
X(Div, 1, 2, 1)\
|
||||
X(Mod, 1, 2, 1)\
|
||||
X(LShift, 1, 2, 1)\
|
||||
X(RShift, 1, 2, 1)\
|
||||
X(BitAnd, 1, 2, 1)\
|
||||
X(BitOr, 1, 2, 1)\
|
||||
X(BitXor, 1, 2, 1)\
|
||||
X(BitNot, 1, 1, 1)\
|
||||
X(LogAnd, 1, 2, 1)\
|
||||
X(LogOr, 1, 2, 1)\
|
||||
X(LogNot, 1, 1, 1)\
|
||||
X(EqEq, 1, 2, 1)\
|
||||
X(NtEq, 1, 2, 1)\
|
||||
X(LsEq, 1, 2, 1)\
|
||||
X(GrEq, 1, 2, 1)\
|
||||
X(Less, 1, 2, 1)\
|
||||
X(Grtr, 1, 2, 1)\
|
||||
X(Trunc, 1, 1, 1)\
|
||||
X(TruncSigned, 1, 1, 1)\
|
||||
X(Convert, 2, 1, 1)\
|
||||
X(Pick, 1, 0, 1)\
|
||||
X(Pop, 0, 1, 0)\
|
||||
X(Insert, 1, 0, 0)
|
||||
|
||||
// (Name)
|
||||
#define RDI_EvalTypeGroupXList(X)\
|
||||
X(Other)\
|
||||
X(U)\
|
||||
X(S)\
|
||||
X(F32)\
|
||||
X(F64)
|
||||
|
||||
// (Name, error-message)
|
||||
#define RDI_EvalConversionKindXList(X)\
|
||||
X(Noop, "")\
|
||||
X(Legal, "")\
|
||||
X(OtherToOther, "cannot convert between these types")\
|
||||
X(ToOther, "cannot convert to this type")\
|
||||
X(FromOther, "cannot convert this type")
|
||||
|
||||
// Xb(EvalTypeGroup) Y(TypeKind) Xe(EvalTypeGroup)
|
||||
#define RDI_EvalTypeGroupFromKindMap(Y,Xb,Xe)\
|
||||
\
|
||||
Xb(U) Y(U8) Y(U16) Y(U32) Y(U64) Y(Bool) Y(Ptr) Y(Enum)\
|
||||
Xe(U)\
|
||||
\
|
||||
Xb(S) Y(S8) Y(S16) Y(S32) Y(S64)\
|
||||
Xe(S)\
|
||||
\
|
||||
Xb(F32) Y(F32)\
|
||||
Xe(F32)\
|
||||
\
|
||||
Xb(F64) Y(F64)\
|
||||
Xe(F64)
|
||||
|
||||
// Xb(EvalConversionKind) Y(EvalTypeGroup, EvalTypeGroup) Xe(EvalConversionKind)
|
||||
#define RDI_EvalConversionKindFromTypeGroupPairMap(Y,Xb,Xe)\
|
||||
\
|
||||
Xb(Noop) Y(U, U) Y(S, S) Y(F32, F32) Y(F64, F64) Y(U, S) Y(S, U)\
|
||||
Xe(Noop)\
|
||||
\
|
||||
Xb(Legal)\
|
||||
Y(U, F32) Y(S, F32) Y(F32, U) Y(F32, S)\
|
||||
Y(U, F64) Y(S, F64) Y(F64, U) Y(F64, S)\
|
||||
Y(F32, F64) Y(F64, F32)\
|
||||
Xe(Legal)\
|
||||
\
|
||||
Xb(OtherToOther) Y(Other, Other)\
|
||||
Xe(OtherToOther)\
|
||||
\
|
||||
Xb(ToOther) Y(U, Other) Y(S, Other) Y(F32, Other) Y(F64, Other)\
|
||||
Xe(ToOther)\
|
||||
\
|
||||
Xb(FromOther) Y(Other, U) Y(Other, S) Y(Other, F32) Y(Other, F64)\
|
||||
Xe(FromOther)
|
||||
|
||||
// eval interpretation macros
|
||||
#define RDI_EncodeRegReadParam(reg,bytesize,bytepos) ((reg)|((bytesize)<<8)|((bytepos)<<16))
|
||||
|
||||
|
||||
// eval enums
|
||||
typedef RDI_U8 RDI_EvalOp;
|
||||
|
||||
typedef enum RDI_EvalOpEnum{
|
||||
#define X(N,dec,pop,push) RDI_EvalOp_##N,
|
||||
RDI_EvalOpXList(X)
|
||||
#undef X
|
||||
|
||||
RDI_EvalOp_COUNT
|
||||
} RDI_EvalOpEnum;
|
||||
|
||||
|
||||
typedef RDI_U8 RDI_EvalTypeGroup;
|
||||
|
||||
typedef enum RDI_EvalTypeGroupEnum{
|
||||
#define X(N) RDI_EvalTypeGroup_##N,
|
||||
RDI_EvalTypeGroupXList(X)
|
||||
#undef X
|
||||
RDI_EvalTypeGroup_COUNT,
|
||||
} RDI_EvalTypeGroupEnum;
|
||||
|
||||
|
||||
typedef RDI_U8 RDI_EvalConversionKind;
|
||||
|
||||
typedef enum RDI_EvalConversionKindEnum{
|
||||
#define X(N,msg) RDI_EvalConversionKind_##N,
|
||||
RDI_EvalConversionKindXList(X)
|
||||
#undef X
|
||||
RDI_EvalConversionKind_COUNT,
|
||||
} RDI_EvalConversionKindEnum;
|
||||
|
||||
|
||||
//- eval data tables
|
||||
|
||||
#define RDI_EVAL_CTRLBITS(decodeN,popN,pushN) ((decodeN) | ((popN) << 4) | ((pushN) << 6))
|
||||
#define RDI_DECODEN_FROM_CTRLBITS(ctrlbits) ((ctrlbits) & 0xf)
|
||||
#define RDI_POPN_FROM_CTRLBITS(ctrlbits) (((ctrlbits) >> 4) & 0x3)
|
||||
#define RDI_PUSHN_FROM_CTRLBITS(ctrlbits) (((ctrlbits) >> 6) & 0x3)
|
||||
|
||||
static RDI_U8 rdi_eval_opcode_ctrlbits[] = {
|
||||
#define X(Name, decodeN, popN, pushN) RDI_EVAL_CTRLBITS(decodeN,popN,pushN),
|
||||
RDI_EvalOpXList(X)
|
||||
#undef X
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
// Functions
|
||||
|
||||
RDI_PROC RDI_U64 rdi_hash(RDI_U8 *ptr, RDI_U64 size);
|
||||
RDI_PROC RDI_U32 rdi_size_from_basic_type_kind(RDI_TypeKind kind);
|
||||
RDI_PROC RDI_U32 rdi_addr_size_from_arch(RDI_Arch arch);
|
||||
|
||||
//- eval helpers
|
||||
|
||||
RDI_PROC RDI_EvalConversionKind rdi_eval_conversion_rule(RDI_EvalTypeGroup in, RDI_EvalTypeGroup out);
|
||||
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
|
||||
@@ -1,559 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ RADDBG Parse API
|
||||
|
||||
RDI_PROC RDI_ParseStatus
|
||||
rdi_parse(RDI_U8 *data, RDI_U64 size, RDI_Parsed *out)
|
||||
{
|
||||
RDI_ParseStatus result = RDI_ParseStatus_Good;
|
||||
|
||||
// out header
|
||||
RDI_Header *hdr = 0;
|
||||
{
|
||||
if (sizeof(*hdr) <= size){
|
||||
hdr = (RDI_Header*)data;
|
||||
}
|
||||
|
||||
// (errors)
|
||||
if (hdr == 0 || hdr->magic != RDI_MAGIC_CONSTANT){
|
||||
hdr = 0;
|
||||
result = RDI_ParseStatus_HeaderDoesNotMatch;
|
||||
}
|
||||
if (hdr != 0 && hdr->encoding_version != 1){
|
||||
hdr = 0;
|
||||
result = RDI_ParseStatus_UnsupportedVersionNumber;
|
||||
}
|
||||
}
|
||||
|
||||
// out data sections
|
||||
RDI_DataSection *dsecs = 0;
|
||||
RDI_U32 dsec_count = 0;
|
||||
if (hdr != 0){
|
||||
RDI_U64 opl = (RDI_U64)hdr->data_section_off + (RDI_U64)hdr->data_section_count*sizeof(*dsecs);
|
||||
if (opl <= size){
|
||||
dsecs = (RDI_DataSection*)(data + hdr->data_section_off);
|
||||
dsec_count = hdr->data_section_count;
|
||||
}
|
||||
|
||||
// (errors)
|
||||
if (dsecs == 0){
|
||||
result = RDI_ParseStatus_InvalidDataSecionLayout;
|
||||
}
|
||||
}
|
||||
|
||||
// extract primary data section indexes
|
||||
RDI_U32 dsec_idx[RDI_DataSectionTag_PRIMARY_COUNT] = {0};
|
||||
if (result == RDI_ParseStatus_Good){
|
||||
RDI_DataSection *sec_ptr = dsecs;
|
||||
for (RDI_U32 i = 0; i < dsec_count; i += 1, sec_ptr += 1){
|
||||
if (sec_ptr->tag < RDI_DataSectionTag_PRIMARY_COUNT){
|
||||
dsec_idx[sec_ptr->tag] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fill out data block (part 1)
|
||||
if (result == RDI_ParseStatus_Good){
|
||||
out->raw_data = data;
|
||||
out->raw_data_size = size;
|
||||
out->dsecs = dsecs;
|
||||
out->dsec_count = dsec_count;
|
||||
for (RDI_U32 i = 0; i < RDI_DataSectionTag_PRIMARY_COUNT; i += 1){
|
||||
out->dsec_idx[i] = dsec_idx[i];
|
||||
}
|
||||
}
|
||||
|
||||
// out string table
|
||||
RDI_U8 *string_data = 0;
|
||||
RDI_U64 string_opl = 0;
|
||||
RDI_U32 *string_offs = 0;
|
||||
RDI_U64 string_count = 0;
|
||||
if (result == RDI_ParseStatus_Good){
|
||||
rdi_parse__extract_primary(out, string_data, &string_opl,
|
||||
RDI_DataSectionTag_StringData);
|
||||
|
||||
RDI_U64 table_entry_count = 0;
|
||||
rdi_parse__extract_primary(out, string_offs, &table_entry_count,
|
||||
RDI_DataSectionTag_StringTable);
|
||||
if (table_entry_count > 0){
|
||||
string_count = table_entry_count - 1;
|
||||
}
|
||||
|
||||
// (errors)
|
||||
if (string_data == 0){
|
||||
result = RDI_ParseStatus_MissingStringDataSection;
|
||||
}
|
||||
else if (string_offs == 0){
|
||||
result = RDI_ParseStatus_MissingStringTableSection;
|
||||
}
|
||||
}
|
||||
|
||||
// out index runs
|
||||
RDI_U32 *idx_run_data = 0;
|
||||
RDI_U64 idx_run_count = 0;
|
||||
if (result == RDI_ParseStatus_Good){
|
||||
rdi_parse__extract_primary(out, idx_run_data, &idx_run_count,
|
||||
RDI_DataSectionTag_IndexRuns);
|
||||
|
||||
// (errors)
|
||||
if (idx_run_data == 0){
|
||||
result = RDI_ParseStatus_MissingIndexRunSection;
|
||||
}
|
||||
}
|
||||
|
||||
if (result == RDI_ParseStatus_Good){
|
||||
// fill out primary data structures (part 2)
|
||||
out->string_data = string_data;
|
||||
out->string_offs = string_offs;
|
||||
out->string_data_size = string_opl;
|
||||
out->string_count = string_count;
|
||||
out->idx_run_data = idx_run_data;
|
||||
out->idx_run_count = idx_run_count;
|
||||
|
||||
{
|
||||
RDI_TopLevelInfo *tli = 0;
|
||||
RDI_U64 dummy = 0;
|
||||
rdi_parse__extract_primary(out, tli, &dummy, RDI_DataSectionTag_TopLevelInfo);
|
||||
if (dummy != 1){
|
||||
tli = 0;
|
||||
}
|
||||
out->top_level_info = tli;
|
||||
}
|
||||
|
||||
rdi_parse__extract_primary(out, out->binary_sections, &out->binary_sections_count,
|
||||
RDI_DataSectionTag_BinarySections);
|
||||
|
||||
rdi_parse__extract_primary(out, out->file_paths, &out->file_paths_count,
|
||||
RDI_DataSectionTag_FilePathNodes);
|
||||
|
||||
rdi_parse__extract_primary(out, out->source_files, &out->source_files_count,
|
||||
RDI_DataSectionTag_SourceFiles);
|
||||
|
||||
rdi_parse__extract_primary(out, out->units, &out->units_count,
|
||||
RDI_DataSectionTag_Units);
|
||||
|
||||
rdi_parse__extract_primary(out, out->unit_vmap, &out->unit_vmap_count,
|
||||
RDI_DataSectionTag_UnitVmap);
|
||||
|
||||
rdi_parse__extract_primary(out, out->unit_vmap, &out->unit_vmap_count,
|
||||
RDI_DataSectionTag_UnitVmap);
|
||||
|
||||
rdi_parse__extract_primary(out, out->type_nodes, &out->type_nodes_count,
|
||||
RDI_DataSectionTag_TypeNodes);
|
||||
|
||||
rdi_parse__extract_primary(out, out->udts, &out->udts_count,
|
||||
RDI_DataSectionTag_UDTs);
|
||||
|
||||
rdi_parse__extract_primary(out, out->members, &out->members_count,
|
||||
RDI_DataSectionTag_Members);
|
||||
|
||||
rdi_parse__extract_primary(out, out->enum_members, &out->enum_members_count,
|
||||
RDI_DataSectionTag_EnumMembers);
|
||||
|
||||
rdi_parse__extract_primary(out, out->global_variables, &out->global_variables_count,
|
||||
RDI_DataSectionTag_GlobalVariables);
|
||||
|
||||
rdi_parse__extract_primary(out, out->global_vmap, &out->global_vmap_count,
|
||||
RDI_DataSectionTag_GlobalVmap);
|
||||
|
||||
rdi_parse__extract_primary(out, out->thread_variables, &out->thread_variables_count,
|
||||
RDI_DataSectionTag_ThreadVariables);
|
||||
|
||||
rdi_parse__extract_primary(out, out->procedures, &out->procedures_count,
|
||||
RDI_DataSectionTag_Procedures);
|
||||
|
||||
rdi_parse__extract_primary(out, out->scopes, &out->scopes_count,
|
||||
RDI_DataSectionTag_Scopes);
|
||||
|
||||
rdi_parse__extract_primary(out, out->scope_voffs, &out->scope_voffs_count,
|
||||
RDI_DataSectionTag_ScopeVoffData);
|
||||
|
||||
rdi_parse__extract_primary(out, out->scope_vmap, &out->scope_vmap_count,
|
||||
RDI_DataSectionTag_ScopeVmap);
|
||||
|
||||
rdi_parse__extract_primary(out, out->locals, &out->locals_count,
|
||||
RDI_DataSectionTag_Locals);
|
||||
|
||||
rdi_parse__extract_primary(out, out->location_blocks, &out->location_blocks_count,
|
||||
RDI_DataSectionTag_LocationBlocks);
|
||||
|
||||
rdi_parse__extract_primary(out, out->location_data, &out->location_data_size,
|
||||
RDI_DataSectionTag_LocationData);
|
||||
|
||||
{
|
||||
rdi_parse__extract_primary(out, out->name_maps, &out->name_maps_count,
|
||||
RDI_DataSectionTag_NameMaps);
|
||||
|
||||
RDI_NameMap *name_map_ptr = out->name_maps;
|
||||
RDI_NameMap *name_map_opl = out->name_maps + out->name_maps_count;
|
||||
for (; name_map_ptr < name_map_opl; name_map_ptr += 1){
|
||||
if (out->name_maps_by_kind[name_map_ptr->kind] == 0){
|
||||
out->name_maps_by_kind[name_map_ptr->kind] = name_map_ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(RDI_DISABLE_NILS)
|
||||
if(out->top_level_info == 0) { out->top_level_info = &rdi_top_level_info_nil; }
|
||||
if(out->binary_sections == 0) { out->binary_sections = &rdi_binary_section_nil; out->binary_sections_count = 1; }
|
||||
if(out->file_paths == 0) { out->file_paths = &rdi_file_path_node_nil; out->file_paths_count = 1; }
|
||||
if(out->source_files == 0) { out->source_files = &rdi_source_file_nil; out->source_files_count = 1; }
|
||||
if(out->units == 0) { out->units = &rdi_unit_nil; out->units_count = 1; }
|
||||
if(out->unit_vmap == 0) { out->unit_vmap = &rdi_vmap_entry_nil; out->unit_vmap_count = 1; }
|
||||
if(out->type_nodes == 0) { out->type_nodes = &rdi_type_node_nil; out->type_nodes_count = 1; }
|
||||
if(out->udts == 0) { out->udts = &rdi_udt_nil; out->udts_count = 1; }
|
||||
if(out->members == 0) { out->members = &rdi_member_nil; out->members_count = 1; }
|
||||
if(out->enum_members == 0) { out->enum_members = &rdi_enum_member_nil; out->enum_members_count = 1; }
|
||||
if(out->global_variables == 0) { out->global_variables = &rdi_global_variable_nil; out->global_variables_count = 1; }
|
||||
if(out->global_vmap == 0) { out->global_vmap = &rdi_vmap_entry_nil; out->global_vmap_count = 1; }
|
||||
if(out->thread_variables == 0) { out->thread_variables = &rdi_thread_variable_nil; out->thread_variables_count = 1; }
|
||||
if(out->procedures == 0) { out->procedures = &rdi_procedure_nil; out->procedures_count = 1; }
|
||||
if(out->scopes == 0) { out->scopes = &rdi_scope_nil; out->scopes_count = 1; }
|
||||
if(out->scope_voffs == 0) { out->scope_voffs = &rdi_voff_nil; out->scope_voffs_count = 1; }
|
||||
if(out->scope_vmap == 0) { out->scope_vmap = &rdi_vmap_entry_nil; out->scope_vmap_count = 1; }
|
||||
if(out->locals == 0) { out->locals = &rdi_local_nil; out->locals_count = 1; }
|
||||
if(out->location_blocks == 0) { out->location_blocks = &rdi_location_block_nil; out->location_blocks_count = 1; }
|
||||
#endif
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8*
|
||||
rdi_string_from_idx(RDI_Parsed *parsed, RDI_U32 idx, RDI_U64 *len_out){
|
||||
RDI_U8 *result = 0;
|
||||
RDI_U64 len_result = 0;
|
||||
if (idx < parsed->string_count){
|
||||
RDI_U32 off_raw = parsed->string_offs[idx];
|
||||
RDI_U32 opl_raw = parsed->string_offs[idx + 1];
|
||||
RDI_U32 opl = rdi_parse__min(opl_raw, parsed->string_data_size);
|
||||
RDI_U32 off = rdi_parse__min(off_raw, opl);
|
||||
result = parsed->string_data + off;
|
||||
len_result = opl - off;
|
||||
}
|
||||
*len_out = len_result;
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_idx_run_from_first_count(RDI_Parsed *parsed,
|
||||
RDI_U32 raw_first, RDI_U32 raw_count,
|
||||
RDI_U32 *n_out){
|
||||
RDI_U32 raw_opl = raw_first + raw_count;
|
||||
RDI_U32 opl = rdi_parse__min(raw_opl, parsed->idx_run_count);
|
||||
RDI_U32 first = rdi_parse__min(raw_first, opl);
|
||||
|
||||
RDI_U32 *result = 0;
|
||||
if (first < parsed->idx_run_count){
|
||||
result = parsed->idx_run_data + first;
|
||||
}
|
||||
*n_out = opl - first;
|
||||
return(result);
|
||||
}
|
||||
|
||||
//- line info
|
||||
|
||||
RDI_PROC void
|
||||
rdi_line_info_from_unit(RDI_Parsed *p, RDI_Unit *unit, RDI_ParsedLineInfo *out){
|
||||
RDI_U64 line_info_voff_count = 0;
|
||||
RDI_U64 *voffs = (RDI_U64*)
|
||||
rdi_data_from_dsec(p, unit->line_info_voffs_data_idx, sizeof(RDI_U64),
|
||||
RDI_DataSectionTag_LineInfoVoffs,
|
||||
&line_info_voff_count);
|
||||
|
||||
RDI_U64 line_info_count_raw = 0;
|
||||
RDI_Line *lines = (RDI_Line*)
|
||||
rdi_data_from_dsec(p, unit->line_info_data_idx, sizeof(RDI_Line),
|
||||
RDI_DataSectionTag_LineInfoData,
|
||||
&line_info_count_raw);
|
||||
|
||||
RDI_U64 column_info_count_raw = 0;
|
||||
RDI_Column *cols = (RDI_Column*)
|
||||
rdi_data_from_dsec(p, unit->line_info_col_data_idx, sizeof(RDI_Column),
|
||||
RDI_DataSectionTag_LineInfoColumns,
|
||||
&column_info_count_raw);
|
||||
|
||||
RDI_U32 line_info_count_a = (line_info_voff_count > 0)?line_info_voff_count - 1:0;
|
||||
RDI_U32 line_info_count = rdi_parse__min(line_info_count_a, line_info_count_raw);
|
||||
RDI_U32 column_info_count = rdi_parse__min(column_info_count_raw, line_info_count);
|
||||
|
||||
out->voffs = voffs;
|
||||
out->lines = lines;
|
||||
out->cols = cols;
|
||||
out->count = line_info_count;
|
||||
out->col_count = column_info_count;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_line_info_idx_from_voff(RDI_ParsedLineInfo *line_info, RDI_U64 voff)
|
||||
{
|
||||
RDI_U64 result = 0;
|
||||
if (line_info->count > 0 && line_info->voffs[0] <= voff && voff < line_info->voffs[line_info->count - 1]){
|
||||
// assuming: (i < j) -> (vmap[i].voff < vmap[j].voff)
|
||||
// find i such that: (vmap[i].voff <= voff) && (voff < vmap[i + 1].voff)
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = line_info->count;
|
||||
for (;;){
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if (line_info->voffs[mid] < voff){
|
||||
first = mid;
|
||||
}
|
||||
else if (line_info->voffs[mid] > voff){
|
||||
opl = mid;
|
||||
}
|
||||
else{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if (opl - first <= 1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = (RDI_U64)first;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdi_line_map_from_source_file(RDI_Parsed *p, RDI_SourceFile *srcfile,
|
||||
RDI_ParsedLineMap *out){
|
||||
RDI_U64 num_count = 0;
|
||||
RDI_U32 *nums = (RDI_U32*)
|
||||
rdi_data_from_dsec(p, srcfile->line_map_nums_data_idx, sizeof(RDI_U32),
|
||||
RDI_DataSectionTag_LineMapNumbers,
|
||||
&num_count);
|
||||
|
||||
RDI_U64 range_count = 0;
|
||||
RDI_U32 *ranges = (RDI_U32*)
|
||||
rdi_data_from_dsec(p, srcfile->line_map_range_data_idx, sizeof(RDI_U32),
|
||||
RDI_DataSectionTag_LineMapRanges,
|
||||
&range_count);
|
||||
|
||||
RDI_U64 voff_count = 0;
|
||||
RDI_U64 *voffs = (RDI_U64*)
|
||||
rdi_data_from_dsec(p, srcfile->line_map_voff_data_idx, sizeof(RDI_U64),
|
||||
RDI_DataSectionTag_LineMapVoffs,
|
||||
&voff_count);
|
||||
|
||||
RDI_U32 count_a = (range_count > 0)?(range_count - 1):0;
|
||||
RDI_U32 count_b = rdi_parse__min(count_a, num_count);
|
||||
RDI_U32 count = rdi_parse__min(count_b, srcfile->line_map_count);
|
||||
|
||||
out->nums = nums;
|
||||
out->ranges = ranges;
|
||||
out->voffs = voffs;
|
||||
out->count = count;
|
||||
out->voff_count = voff_count;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64*
|
||||
rdi_line_voffs_from_num(RDI_ParsedLineMap *map, RDI_U32 linenum, RDI_U32 *n_out){
|
||||
RDI_U64 *result = 0;
|
||||
*n_out = 0;
|
||||
|
||||
RDI_U32 closest_i = 0;
|
||||
if (map->count > 0 && map->nums[0] <= linenum){
|
||||
// assuming: (i < j) -> (nums[i] < nums[j])
|
||||
// find i such that: (nums[i] <= linenum) && (linenum < nums[i + 1])
|
||||
RDI_U32 *nums = map->nums;
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = map->count;
|
||||
for (;;){
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if (nums[mid] < linenum){
|
||||
first = mid;
|
||||
}
|
||||
else if (nums[mid] > linenum){
|
||||
opl = mid;
|
||||
}
|
||||
else{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if (opl - first <= 1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
closest_i = first;
|
||||
}
|
||||
|
||||
// round up instead of down if possible
|
||||
if (closest_i + 1 < map->count &&
|
||||
map->nums[closest_i] < linenum){
|
||||
closest_i += 1;
|
||||
}
|
||||
|
||||
// set result if possible
|
||||
if (closest_i < map->count){
|
||||
RDI_U32 first = map->ranges[closest_i];
|
||||
RDI_U32 opl = map->ranges[closest_i + 1];
|
||||
if (opl < map->voff_count){
|
||||
result = map->voffs + first;
|
||||
*n_out = opl - first;
|
||||
}
|
||||
}
|
||||
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
//- vmaps
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_vmap_idx_from_voff(RDI_VMapEntry *vmap, RDI_U32 vmap_count, RDI_U64 voff){
|
||||
RDI_U64 result = 0;
|
||||
if (vmap_count > 0 && vmap[0].voff <= voff && voff < vmap[vmap_count - 1].voff){
|
||||
// assuming: (i < j) -> (vmap[i].voff < vmap[j].voff)
|
||||
// find i such that: (vmap[i].voff <= voff) && (voff < vmap[i + 1].voff)
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = vmap_count;
|
||||
for (;;){
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if (vmap[mid].voff < voff){
|
||||
first = mid;
|
||||
}
|
||||
else if (vmap[mid].voff > voff){
|
||||
opl = mid;
|
||||
}
|
||||
else{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if (opl - first <= 1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = (RDI_U64)vmap[first].idx;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
//- name maps
|
||||
|
||||
RDI_PROC RDI_NameMap*
|
||||
rdi_name_map_from_kind(RDI_Parsed *p, RDI_NameMapKind kind){
|
||||
RDI_NameMap *result = 0;
|
||||
if (0 < kind && kind < RDI_NameMapKind_COUNT){
|
||||
result = p->name_maps_by_kind[kind];
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdi_name_map_parse(RDI_Parsed *p, RDI_NameMap *mapptr, RDI_ParsedNameMap *out){
|
||||
out->buckets = 0;
|
||||
out->bucket_count = 0;
|
||||
if (mapptr != 0){
|
||||
out->buckets = (RDI_NameMapBucket*)
|
||||
rdi_data_from_dsec(p, mapptr->bucket_data_idx, sizeof(RDI_NameMapBucket),
|
||||
RDI_DataSectionTag_NameMapBuckets, &out->bucket_count);
|
||||
out->nodes = (RDI_NameMapNode*)
|
||||
rdi_data_from_dsec(p, mapptr->node_data_idx, sizeof(RDI_NameMapNode),
|
||||
RDI_DataSectionTag_NameMapNodes, &out->node_count);
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC RDI_NameMapNode*
|
||||
rdi_name_map_lookup(RDI_Parsed *p, RDI_ParsedNameMap *map,
|
||||
RDI_U8 *str, RDI_U64 len){
|
||||
RDI_NameMapNode *result = 0;
|
||||
if (map->bucket_count > 0){
|
||||
RDI_NameMapBucket *buckets = map->buckets;
|
||||
RDI_U64 bucket_count = map->bucket_count;
|
||||
RDI_U64 hash = rdi_hash(str, len);
|
||||
RDI_U64 bucket_index = hash%bucket_count;
|
||||
RDI_NameMapBucket *bucket = map->buckets + bucket_index;
|
||||
|
||||
RDI_NameMapNode *node = map->nodes + bucket->first_node;
|
||||
RDI_NameMapNode *node_opl = node + bucket->node_count;
|
||||
for (;node < node_opl; node += 1){
|
||||
// extract a string from this node
|
||||
RDI_U64 nlen = 0;
|
||||
RDI_U8 *nstr = rdi_string_from_idx(p, node->string_idx, &nlen);
|
||||
|
||||
// compare this to the needle string
|
||||
RDI_S32 match = 0;
|
||||
if (nlen == len){
|
||||
RDI_U8 *a = str;
|
||||
RDI_U8 *aopl = str + len;
|
||||
RDI_U8 *b = nstr;
|
||||
for (;a < aopl && *a == *b; a += 1, b += 1);
|
||||
match = (a == aopl);
|
||||
}
|
||||
|
||||
// stop with a matching node in result
|
||||
if (match){
|
||||
result = node;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_matches_from_map_node(RDI_Parsed *p, RDI_NameMapNode *node,
|
||||
RDI_U32 *n_out){
|
||||
RDI_U32 *result = 0;
|
||||
*n_out = 0;
|
||||
if (node != 0){
|
||||
if (node->match_count == 1){
|
||||
result = &node->match_idx_or_idx_run_first;
|
||||
*n_out = 1;
|
||||
}
|
||||
else{
|
||||
result = rdi_idx_run_from_first_count(p, node->match_idx_or_idx_run_first,
|
||||
node->match_count, n_out);
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
//- common helpers
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_proc(RDI_Parsed *p, RDI_U32 proc_id){
|
||||
RDI_U64 result = 0;
|
||||
if (0 < proc_id && proc_id < p->procedures_count){
|
||||
RDI_Procedure *proc = p->procedures + proc_id;
|
||||
RDI_U32 scope_id = proc->root_scope_idx;
|
||||
if (0 < scope_id && scope_id < p->scopes_count){
|
||||
RDI_Scope *scope = p->scopes + scope_id;
|
||||
if (scope->voff_range_first < scope->voff_range_opl &&
|
||||
scope->voff_range_first < p->scope_voffs_count){
|
||||
result = p->scope_voffs[scope->voff_range_first];
|
||||
}
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ RADDBG Parsing Helpers
|
||||
|
||||
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){
|
||||
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){
|
||||
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;
|
||||
result = (parsed->raw_data + ds->off);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*count_out = count_result;
|
||||
return(result);
|
||||
}
|
||||
@@ -1,220 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RDI_PARSE_H
|
||||
#define RDI_PARSE_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ RADDBG Parsing Helpers
|
||||
|
||||
typedef struct RDI_Parsed{
|
||||
// raw data & data sections (part 1)
|
||||
RDI_U8 *raw_data;
|
||||
RDI_U64 raw_data_size;
|
||||
RDI_DataSection *dsecs;
|
||||
RDI_U64 dsec_count;
|
||||
RDI_U32 dsec_idx[RDI_DataSectionTag_PRIMARY_COUNT];
|
||||
|
||||
// primary data structures (part 2)
|
||||
|
||||
// handled by helper APIs
|
||||
RDI_U8* string_data;
|
||||
RDI_U64 string_data_size;
|
||||
RDI_U32* string_offs;
|
||||
RDI_U64 string_count;
|
||||
RDI_U32* idx_run_data;
|
||||
RDI_U32 idx_run_count;
|
||||
|
||||
// directly readable by users
|
||||
// (any of these may be empty and null even in a successful parse)
|
||||
RDI_TopLevelInfo* top_level_info;
|
||||
|
||||
RDI_BinarySection* binary_sections;
|
||||
RDI_U64 binary_sections_count;
|
||||
RDI_FilePathNode* file_paths;
|
||||
RDI_U64 file_paths_count;
|
||||
RDI_SourceFile* source_files;
|
||||
RDI_U64 source_files_count;
|
||||
RDI_Unit* units;
|
||||
RDI_U64 units_count;
|
||||
RDI_VMapEntry* unit_vmap;
|
||||
RDI_U64 unit_vmap_count;
|
||||
RDI_TypeNode* type_nodes;
|
||||
RDI_U64 type_nodes_count;
|
||||
RDI_UDT* udts;
|
||||
RDI_U64 udts_count;
|
||||
RDI_Member* members;
|
||||
RDI_U64 members_count;
|
||||
RDI_EnumMember* enum_members;
|
||||
RDI_U64 enum_members_count;
|
||||
RDI_GlobalVariable* global_variables;
|
||||
RDI_U64 global_variables_count;
|
||||
RDI_VMapEntry* global_vmap;
|
||||
RDI_U64 global_vmap_count;
|
||||
RDI_ThreadVariable* thread_variables;
|
||||
RDI_U64 thread_variables_count;
|
||||
RDI_Procedure* procedures;
|
||||
RDI_U64 procedures_count;
|
||||
RDI_Scope* scopes;
|
||||
RDI_U64 scopes_count;
|
||||
RDI_U64* scope_voffs;
|
||||
RDI_U64 scope_voffs_count;
|
||||
RDI_VMapEntry* scope_vmap;
|
||||
RDI_U64 scope_vmap_count;
|
||||
RDI_Local* locals;
|
||||
RDI_U64 locals_count;
|
||||
RDI_LocationBlock* location_blocks;
|
||||
RDI_U64 location_blocks_count;
|
||||
RDI_U8* location_data;
|
||||
RDI_U64 location_data_size;
|
||||
RDI_NameMap* name_maps;
|
||||
RDI_U64 name_maps_count;
|
||||
|
||||
// other helpers
|
||||
|
||||
RDI_NameMap* name_maps_by_kind[RDI_NameMapKind_COUNT];
|
||||
|
||||
} RDI_Parsed;
|
||||
|
||||
typedef enum{
|
||||
RDI_ParseStatus_Good = 0,
|
||||
RDI_ParseStatus_HeaderDoesNotMatch = 1,
|
||||
RDI_ParseStatus_UnsupportedVersionNumber = 2,
|
||||
RDI_ParseStatus_InvalidDataSecionLayout = 3,
|
||||
RDI_ParseStatus_MissingStringDataSection = 4,
|
||||
RDI_ParseStatus_MissingStringTableSection = 5,
|
||||
RDI_ParseStatus_MissingIndexRunSection = 6,
|
||||
} RDI_ParseStatus;
|
||||
|
||||
typedef struct RDI_ParsedLineInfo{
|
||||
// NOTE: Mapping VOFF -> LINE_INFO
|
||||
//
|
||||
// * [ voff[i], voff[i + 1] ) forms the voff range
|
||||
// * for the line info at lines[i] (and cols[i] if i < col_count)
|
||||
|
||||
RDI_U64* voffs; // [count + 1] sorted
|
||||
RDI_Line* lines; // [count]
|
||||
RDI_Column* cols; // [col_count]
|
||||
RDI_U64 count;
|
||||
RDI_U64 col_count;
|
||||
} RDI_ParsedLineInfo;
|
||||
|
||||
typedef struct RDI_ParsedLineMap{
|
||||
// NOTE: Mapping LINE_NUMBER -> VOFFs
|
||||
//
|
||||
// * nums[i] gives a line number
|
||||
// * that line number has one or more associated voffs
|
||||
//
|
||||
// * to find all associated voffs for the line number nums[i] :
|
||||
// * let k span over the range [ ranges[i], ranges[i + 1] )
|
||||
// * voffs[k] gives the associated voffs
|
||||
|
||||
RDI_U32* nums; // [count] sorted
|
||||
RDI_U32* ranges; // [count + 1]
|
||||
RDI_U64* voffs; // [voff_count]
|
||||
RDI_U64 count;
|
||||
RDI_U64 voff_count;
|
||||
} RDI_ParsedLineMap;
|
||||
|
||||
|
||||
typedef struct RDI_ParsedNameMap{
|
||||
RDI_NameMapBucket *buckets;
|
||||
RDI_NameMapNode *nodes;
|
||||
RDI_U64 bucket_count;
|
||||
RDI_U64 node_count;
|
||||
} RDI_ParsedNameMap;
|
||||
|
||||
////////////////////////////////
|
||||
//~ Global Nils
|
||||
|
||||
#if !defined(RDI_DISABLE_NILS)
|
||||
static RDI_TopLevelInfo rdi_top_level_info_nil = {0};
|
||||
static RDI_BinarySection rdi_binary_section_nil = {0};
|
||||
static RDI_FilePathNode rdi_file_path_node_nil = {0};
|
||||
static RDI_SourceFile rdi_source_file_nil = {0};
|
||||
static RDI_Unit rdi_unit_nil = {0};
|
||||
static RDI_VMapEntry rdi_vmap_entry_nil = {0};
|
||||
static RDI_TypeNode rdi_type_node_nil = {0};
|
||||
static RDI_UDT rdi_udt_nil = {0};
|
||||
static RDI_Member rdi_member_nil = {0};
|
||||
static RDI_EnumMember rdi_enum_member_nil = {0};
|
||||
static RDI_GlobalVariable rdi_global_variable_nil = {0};
|
||||
static RDI_ThreadVariable rdi_thread_variable_nil = {0};
|
||||
static RDI_Procedure rdi_procedure_nil = {0};
|
||||
static RDI_Scope rdi_scope_nil = {0};
|
||||
static RDI_U64 rdi_voff_nil = 0;
|
||||
static RDI_LocationBlock rdi_location_block_nil = {0};
|
||||
static RDI_Local rdi_local_nil = {0};
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
//~ RADDBG Parse API
|
||||
|
||||
RDI_PROC RDI_ParseStatus
|
||||
rdi_parse(RDI_U8 *data, RDI_U64 size, RDI_Parsed *out);
|
||||
|
||||
RDI_PROC RDI_U8*
|
||||
rdi_string_from_idx(RDI_Parsed *parsed, RDI_U32 idx, RDI_U64 *len_out);
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_idx_run_from_first_count(RDI_Parsed *parsed, RDI_U32 first, RDI_U32 raw_count,
|
||||
RDI_U32 *n_out);
|
||||
|
||||
//- table lookups
|
||||
#define rdi_element_from_idx(parsed, name, idx) ((0 <= (idx) && (idx) < (parsed)->name##_count) ? &(parsed)->name[idx] : (parsed)->name ? &(parsed)->name[0] : 0)
|
||||
|
||||
//- line info
|
||||
RDI_PROC void
|
||||
rdi_line_info_from_unit(RDI_Parsed *p, RDI_Unit *unit, RDI_ParsedLineInfo *out);
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_line_info_idx_from_voff(RDI_ParsedLineInfo *line_info, RDI_U64 voff);
|
||||
|
||||
RDI_PROC void
|
||||
rdi_line_map_from_source_file(RDI_Parsed *p, RDI_SourceFile *srcfile,
|
||||
RDI_ParsedLineMap *out);
|
||||
|
||||
RDI_PROC RDI_U64*
|
||||
rdi_line_voffs_from_num(RDI_ParsedLineMap *map, RDI_U32 linenum, RDI_U32 *n_out);
|
||||
|
||||
|
||||
//- vmaps
|
||||
RDI_PROC RDI_U64
|
||||
rdi_vmap_idx_from_voff(RDI_VMapEntry *vmap, RDI_U32 vmap_count, RDI_U64 voff);
|
||||
|
||||
|
||||
//- name maps
|
||||
RDI_PROC RDI_NameMap*
|
||||
rdi_name_map_from_kind(RDI_Parsed *p, RDI_NameMapKind kind);
|
||||
|
||||
RDI_PROC void
|
||||
rdi_name_map_parse(RDI_Parsed* p, RDI_NameMap *mapptr, RDI_ParsedNameMap *out);
|
||||
|
||||
RDI_PROC RDI_NameMapNode*
|
||||
rdi_name_map_lookup(RDI_Parsed *p, RDI_ParsedNameMap *map,
|
||||
RDI_U8 *str, RDI_U64 len);
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_matches_from_map_node(RDI_Parsed *p, RDI_NameMapNode *node, RDI_U32 *n_out);
|
||||
|
||||
|
||||
//- common helpers
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_proc(RDI_Parsed *p, RDI_U32 proc_id);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
//~ RADDBG Parsing Helpers
|
||||
|
||||
#define rdi_parse__extract_primary(p,outptr,outn,pritag) \
|
||||
( (*(void**)&(outptr)) = \
|
||||
rdi_data_from_dsec((p),(p)->dsec_idx[pritag],sizeof(*(outptr)),(pritag),(outn)) )
|
||||
|
||||
RDI_PROC void*
|
||||
rdi_data_from_dsec(RDI_Parsed *p, RDI_U32 idx, RDI_U32 item_size,
|
||||
RDI_DataSectionTag expected_tag, RDI_U64 *n_out);
|
||||
|
||||
#define rdi_parse__min(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
#endif // RDI_PARSE_H
|
||||
@@ -0,0 +1,278 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//~ RAD Debug Info, (R)AD(D)BG(I) Format Library
|
||||
//
|
||||
// Defines standard RDI debug information format types and
|
||||
// functions.
|
||||
|
||||
#ifndef RDI_FORMAT_C
|
||||
#define RDI_FORMAT_C
|
||||
|
||||
RDI_U16 rdi_section_element_size_table[37] =
|
||||
{
|
||||
sizeof(RDI_U8),
|
||||
sizeof(RDI_TopLevelInfo),
|
||||
sizeof(RDI_U8),
|
||||
sizeof(RDI_U32),
|
||||
sizeof(RDI_U32),
|
||||
sizeof(RDI_BinarySection),
|
||||
sizeof(RDI_FilePathNode),
|
||||
sizeof(RDI_SourceFile),
|
||||
sizeof(RDI_LineTable),
|
||||
sizeof(RDI_U64),
|
||||
sizeof(RDI_Line),
|
||||
sizeof(RDI_Column),
|
||||
sizeof(RDI_SourceLineMap),
|
||||
sizeof(RDI_U32),
|
||||
sizeof(RDI_U32),
|
||||
sizeof(RDI_U64),
|
||||
sizeof(RDI_Unit),
|
||||
sizeof(RDI_VMapEntry),
|
||||
sizeof(RDI_TypeNode),
|
||||
sizeof(RDI_UDT),
|
||||
sizeof(RDI_Member),
|
||||
sizeof(RDI_EnumMember),
|
||||
sizeof(RDI_GlobalVariable),
|
||||
sizeof(RDI_VMapEntry),
|
||||
sizeof(RDI_ThreadVariable),
|
||||
sizeof(RDI_Procedure),
|
||||
sizeof(RDI_Scope),
|
||||
sizeof(RDI_U64),
|
||||
sizeof(RDI_VMapEntry),
|
||||
sizeof(RDI_InlineSite),
|
||||
sizeof(RDI_Local),
|
||||
sizeof(RDI_LocationBlock),
|
||||
sizeof(RDI_U8),
|
||||
sizeof(RDI_NameMap),
|
||||
sizeof(RDI_NameMapBucket),
|
||||
sizeof(RDI_NameMapNode),
|
||||
sizeof(RDI_U8),
|
||||
};
|
||||
|
||||
RDI_U8 rdi_section_is_required_table[37] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
RDI_U8 rdi_eval_op_ctrlbits_table[45] =
|
||||
{
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(4, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(0, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(4, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(4, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(2, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(4, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(8, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(2, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 1),
|
||||
RDI_EVAL_CTRLBITS(0, 1, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
};
|
||||
|
||||
struct {RDI_EvalConversionKind dst_typegroups[RDI_EvalTypeGroup_COUNT];} rdi_eval_typegroup_conversion_kind_matrix[6] =
|
||||
{
|
||||
{{RDI_EvalConversionKind_OtherToOther, RDI_EvalConversionKind_FromOther, RDI_EvalConversionKind_FromOther, RDI_EvalConversionKind_FromOther, RDI_EvalConversionKind_FromOther}},
|
||||
{{RDI_EvalConversionKind_ToOther, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Legal}},
|
||||
{{RDI_EvalConversionKind_ToOther, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Legal}},
|
||||
{{RDI_EvalConversionKind_ToOther, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Legal}},
|
||||
{{RDI_EvalConversionKind_ToOther, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Legal, RDI_EvalConversionKind_Noop}},
|
||||
{{RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop, RDI_EvalConversionKind_Noop}},
|
||||
};
|
||||
|
||||
struct {RDI_U8 *str; RDI_U64 size;} rdi_eval_conversion_kind_message_string_table[6] =
|
||||
{
|
||||
{(RDI_U8 *)"Other", sizeof("Other")},
|
||||
{(RDI_U8 *)"U", sizeof("U")},
|
||||
{(RDI_U8 *)"S", sizeof("S")},
|
||||
{(RDI_U8 *)"F32", sizeof("F32")},
|
||||
{(RDI_U8 *)"F64", sizeof("F64")},
|
||||
{(RDI_U8 *)"COUNT", sizeof("COUNT")},
|
||||
};
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_hash(RDI_U8 *ptr, RDI_U64 size)
|
||||
{
|
||||
RDI_U64 result = 5381;
|
||||
RDI_U8 *opl = ptr + size;
|
||||
for(;ptr < opl; ptr += 1)
|
||||
{
|
||||
result = ((result << 5) + result) + *ptr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdi_size_from_basic_type_kind(RDI_TypeKind kind)
|
||||
{
|
||||
RDI_U32 result = 0;
|
||||
switch(kind)
|
||||
{
|
||||
default:{}break;
|
||||
case RDI_TypeKind_Handle:{result = 0xFFFFFFFF;}break;
|
||||
case RDI_TypeKind_Char8:{result = 1;}break;
|
||||
case RDI_TypeKind_Char16:{result = 2;}break;
|
||||
case RDI_TypeKind_Char32:{result = 4;}break;
|
||||
case RDI_TypeKind_UChar8:{result = 1;}break;
|
||||
case RDI_TypeKind_UChar16:{result = 2;}break;
|
||||
case RDI_TypeKind_UChar32:{result = 4;}break;
|
||||
case RDI_TypeKind_U8:{result = 1;}break;
|
||||
case RDI_TypeKind_U16:{result = 2;}break;
|
||||
case RDI_TypeKind_U32:{result = 4;}break;
|
||||
case RDI_TypeKind_U64:{result = 8;}break;
|
||||
case RDI_TypeKind_U128:{result = 16;}break;
|
||||
case RDI_TypeKind_U256:{result = 32;}break;
|
||||
case RDI_TypeKind_U512:{result = 64;}break;
|
||||
case RDI_TypeKind_S8:{result = 1;}break;
|
||||
case RDI_TypeKind_S16:{result = 2;}break;
|
||||
case RDI_TypeKind_S32:{result = 4;}break;
|
||||
case RDI_TypeKind_S64:{result = 8;}break;
|
||||
case RDI_TypeKind_S128:{result = 16;}break;
|
||||
case RDI_TypeKind_S256:{result = 32;}break;
|
||||
case RDI_TypeKind_S512:{result = 64;}break;
|
||||
case RDI_TypeKind_Bool:{result = 1;}break;
|
||||
case RDI_TypeKind_F16:{result = 2;}break;
|
||||
case RDI_TypeKind_F32:{result = 4;}break;
|
||||
case RDI_TypeKind_F32PP:{result = 4;}break;
|
||||
case RDI_TypeKind_F48:{result = 6;}break;
|
||||
case RDI_TypeKind_F64:{result = 8;}break;
|
||||
case RDI_TypeKind_F80:{result = 10;}break;
|
||||
case RDI_TypeKind_F128:{result = 16;}break;
|
||||
case RDI_TypeKind_ComplexF32:{result = 8;}break;
|
||||
case RDI_TypeKind_ComplexF64:{result = 16;}break;
|
||||
case RDI_TypeKind_ComplexF80:{result = 20;}break;
|
||||
case RDI_TypeKind_ComplexF128:{result = 32;}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdi_addr_size_from_arch(RDI_Arch arch)
|
||||
{
|
||||
RDI_U32 result = 0;
|
||||
switch(arch)
|
||||
{
|
||||
default:{}break;
|
||||
case RDI_Arch_X86:{result = 4;}break;
|
||||
case RDI_Arch_X64:{result = 8;}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_EvalConversionKind
|
||||
rdi_eval_conversion_kind_from_typegroups(RDI_EvalTypeGroup in, RDI_EvalTypeGroup out)
|
||||
{
|
||||
RDI_EvalConversionKind k = rdi_eval_typegroup_conversion_kind_matrix[in].dst_typegroups[out];
|
||||
return k;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_S32
|
||||
rdi_eval_op_typegroup_are_compatible(RDI_EvalOp op, RDI_EvalTypeGroup group)
|
||||
{
|
||||
RDI_S32 result = 0;
|
||||
switch(op)
|
||||
{
|
||||
case RDI_EvalOp_Neg: case RDI_EvalOp_Add: case RDI_EvalOp_Sub:
|
||||
case RDI_EvalOp_Mul: case RDI_EvalOp_Div:
|
||||
case RDI_EvalOp_EqEq:case RDI_EvalOp_NtEq:
|
||||
case RDI_EvalOp_LsEq:case RDI_EvalOp_GrEq:
|
||||
case RDI_EvalOp_Less:case RDI_EvalOp_Grtr:
|
||||
{
|
||||
if(group != RDI_EvalTypeGroup_Other)
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
}break;
|
||||
case RDI_EvalOp_Mod:case RDI_EvalOp_LShift:case RDI_EvalOp_RShift:
|
||||
case RDI_EvalOp_BitNot:case RDI_EvalOp_BitAnd:case RDI_EvalOp_BitXor:
|
||||
case RDI_EvalOp_BitOr:case RDI_EvalOp_LogNot:case RDI_EvalOp_LogAnd:
|
||||
case RDI_EvalOp_LogOr:
|
||||
{
|
||||
if(group == RDI_EvalTypeGroup_S || group == RDI_EvalTypeGroup_U)
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8 *
|
||||
rdi_explanation_string_from_eval_conversion_kind(RDI_EvalConversionKind kind, RDI_U64 *size_out)
|
||||
{
|
||||
*size_out = rdi_eval_conversion_kind_message_string_table[kind].size;
|
||||
return rdi_eval_conversion_kind_message_string_table[kind].str;
|
||||
}
|
||||
|
||||
#endif // RDI_FORMAT_C
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,790 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ Top-Level Parsing API
|
||||
|
||||
RDI_PROC RDI_ParseStatus
|
||||
rdi_parse(RDI_U8 *data, RDI_U64 size, RDI_Parsed *out)
|
||||
{
|
||||
RDI_ParseStatus result = RDI_ParseStatus_Good;
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: extract header
|
||||
//
|
||||
RDI_Header *hdr = 0;
|
||||
if(result == RDI_ParseStatus_Good)
|
||||
{
|
||||
if(sizeof(*hdr) <= size)
|
||||
{
|
||||
hdr = (RDI_Header*)data;
|
||||
}
|
||||
if(hdr == 0 || hdr->magic != RDI_MAGIC_CONSTANT)
|
||||
{
|
||||
hdr = 0;
|
||||
result = RDI_ParseStatus_HeaderDoesNotMatch;
|
||||
}
|
||||
if(hdr != 0 && hdr->encoding_version != RDI_ENCODING_VERSION)
|
||||
{
|
||||
hdr = 0;
|
||||
result = RDI_ParseStatus_UnsupportedVersionNumber;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: extract data sections
|
||||
//
|
||||
RDI_Section *dsecs = 0;
|
||||
RDI_U32 dsec_count = 0;
|
||||
if(result == RDI_ParseStatus_Good)
|
||||
{
|
||||
RDI_U64 opl = (RDI_U64)hdr->data_section_off + (RDI_U64)hdr->data_section_count*sizeof(*dsecs);
|
||||
if(opl <= size)
|
||||
{
|
||||
dsecs = (RDI_Section*)(data + hdr->data_section_off);
|
||||
dsec_count = hdr->data_section_count;
|
||||
}
|
||||
if(dsecs == 0)
|
||||
{
|
||||
result = RDI_ParseStatus_InvalidDataSecionLayout;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: fill result
|
||||
//
|
||||
if(result == RDI_ParseStatus_Good)
|
||||
{
|
||||
out->raw_data = data;
|
||||
out->raw_data_size = size;
|
||||
out->sections = dsecs;
|
||||
out->sections_count = dsec_count;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: validate results
|
||||
//
|
||||
if(result == RDI_ParseStatus_Good)
|
||||
{
|
||||
for(RDI_SectionKind k = (RDI_SectionKind)(RDI_SectionKind_NULL+1); k < RDI_SectionKind_COUNT; k = (RDI_SectionKind)(k+1))
|
||||
{
|
||||
if(rdi_section_is_required_table[k])
|
||||
{
|
||||
RDI_U64 data_size = 0;
|
||||
RDI_SectionEncoding encoding = 0;
|
||||
void *data = rdi_section_raw_data_from_kind(out, k, &encoding, &data_size);
|
||||
if(data == 0 || data == &rdi_nil_element_union || data_size == 0)
|
||||
{
|
||||
result = RDI_ParseStatus_MissingRequiredSection;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ Base Parsed Info Extraction Helpers
|
||||
|
||||
//- section table/element raw data extraction
|
||||
|
||||
RDI_PROC void *
|
||||
rdi_section_raw_data_from_kind(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_SectionEncoding *encoding_out, RDI_U64 *size_out)
|
||||
{
|
||||
void *result = 0;
|
||||
#if !defined(RDI_DISABLE_NILS)
|
||||
result = &rdi_nil_element_union;
|
||||
*size_out = rdi_section_element_size_table[kind];
|
||||
#endif
|
||||
if(0 <= kind && kind < rdi->sections_count)
|
||||
{
|
||||
result = rdi->raw_data+rdi->sections[kind].off;
|
||||
*size_out = rdi->sections[kind].encoded_size;
|
||||
*encoding_out = rdi->sections[kind].encoding;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC void *
|
||||
rdi_section_raw_table_from_kind(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_U64 *count_out)
|
||||
{
|
||||
void *result = 0;
|
||||
RDI_U64 all_elements_size = 0;
|
||||
RDI_SectionEncoding all_elements_encoding = 0;
|
||||
void *all_elements = rdi_section_raw_data_from_kind(rdi, kind, &all_elements_encoding, &all_elements_size);
|
||||
if(all_elements_encoding == RDI_SectionEncoding_Unpacked)
|
||||
{
|
||||
RDI_U64 element_size = (RDI_U64)rdi_section_element_size_table[kind];
|
||||
RDI_U64 all_elements_count = all_elements_size/element_size;
|
||||
result = all_elements;
|
||||
*count_out = all_elements_count;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC void *
|
||||
rdi_section_raw_element_from_kind_idx(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_U64 idx)
|
||||
{
|
||||
RDI_U64 count = 0;
|
||||
void *table = rdi_section_raw_table_from_kind(rdi, kind, &count);
|
||||
void *result = table;
|
||||
if(idx < count)
|
||||
{
|
||||
RDI_U64 element_size = (RDI_U64)rdi_section_element_size_table[kind];
|
||||
result = (RDI_U8 *)table + element_size*idx;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//- info about whole parse
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_decompressed_size_from_parsed(RDI_Parsed *rdi)
|
||||
{
|
||||
RDI_U64 decompressed_size = rdi->raw_data_size;
|
||||
for(RDI_U64 section_idx = 0; section_idx < rdi->sections_count; section_idx += 1)
|
||||
{
|
||||
decompressed_size += (rdi->sections[section_idx].unpacked_size - rdi->sections[section_idx].encoded_size);
|
||||
}
|
||||
return decompressed_size;
|
||||
}
|
||||
|
||||
//- strings
|
||||
|
||||
RDI_PROC RDI_U8 *
|
||||
rdi_string_from_idx(RDI_Parsed *rdi, RDI_U32 idx, RDI_U64 *len_out)
|
||||
{
|
||||
RDI_U8 *result_base = 0;
|
||||
RDI_U64 result_size = 0;
|
||||
{
|
||||
RDI_U64 string_offs_count = 0;
|
||||
RDI_U32 *string_offs = rdi_table_from_name(rdi, StringTable, &string_offs_count);
|
||||
if(idx < string_offs_count)
|
||||
{
|
||||
RDI_U64 string_data_size = 0;
|
||||
RDI_U8 *string_data = rdi_table_from_name(rdi, StringData, &string_data_size);
|
||||
RDI_U32 off_raw = string_offs[idx];
|
||||
RDI_U32 opl_raw = string_offs[idx + 1];
|
||||
RDI_U32 opl = rdi_parse__min(opl_raw, string_data_size);
|
||||
RDI_U32 off = rdi_parse__min(off_raw, opl);
|
||||
result_base = string_data + off;
|
||||
result_size = opl - off;
|
||||
}
|
||||
}
|
||||
*len_out = result_size;
|
||||
return result_base;
|
||||
}
|
||||
|
||||
//- index runs
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_idx_run_from_first_count(RDI_Parsed *rdi, RDI_U32 raw_first, RDI_U32 raw_count, RDI_U32 *n_out)
|
||||
{
|
||||
RDI_U64 idx_run_count = 0;
|
||||
RDI_U32 *idx_run_data = rdi_table_from_name(rdi, IndexRuns, &idx_run_count);
|
||||
RDI_U32 raw_opl = raw_first + raw_count;
|
||||
RDI_U32 opl = rdi_parse__min(raw_opl, idx_run_count);
|
||||
RDI_U32 first = rdi_parse__min(raw_first, opl);
|
||||
RDI_U32 *result = 0;
|
||||
if(first < idx_run_count)
|
||||
{
|
||||
result = idx_run_data + first;
|
||||
}
|
||||
*n_out = opl - first;
|
||||
return result;
|
||||
}
|
||||
|
||||
//- line info
|
||||
|
||||
RDI_PROC void
|
||||
rdi_parsed_from_line_table(RDI_Parsed *rdi, RDI_LineTable *line_table, RDI_ParsedLineTable *out)
|
||||
{
|
||||
//- rjf: extract top-level line info tables
|
||||
RDI_U64 all_voffs_count = 0;
|
||||
RDI_U64 *all_voffs = rdi_table_from_name(rdi, LineInfoVOffs, &all_voffs_count);
|
||||
RDI_U64 *all_voffs_opl = all_voffs + all_voffs_count;
|
||||
RDI_U64 all_lines_count = 0;
|
||||
RDI_Line *all_lines = rdi_table_from_name(rdi, LineInfoLines, &all_lines_count);
|
||||
RDI_Line *all_lines_opl = all_lines + all_lines_count;
|
||||
RDI_U64 all_cols_count = 0;
|
||||
RDI_Column *all_cols = rdi_table_from_name(rdi, LineInfoColumns, &all_cols_count);
|
||||
RDI_Column *all_cols_opl = all_cols + all_cols_count;
|
||||
|
||||
//- rjf: extract ranges of top-level tables belonging to this line table
|
||||
RDI_U64 *lt_voffs = all_voffs + line_table->voffs_base_idx;
|
||||
RDI_Line *lt_lines = all_lines + line_table->lines_base_idx;
|
||||
RDI_Column *lt_cols = all_cols + line_table->cols_base_idx;
|
||||
RDI_U64 lines_count = line_table->lines_count;
|
||||
RDI_U64 cols_count = line_table->cols_count;
|
||||
if(lt_voffs >= all_voffs_opl) {lt_voffs = all_voffs; lines_count = 0;}
|
||||
if(lt_lines >= all_lines_opl) {lt_lines = all_lines; lines_count = 0;}
|
||||
if(lt_cols >= all_cols_opl) {lt_cols = all_cols; cols_count = 0;}
|
||||
|
||||
//- rjf: fill result
|
||||
out->voffs = lt_voffs;
|
||||
out->lines = lt_lines;
|
||||
out->cols = lt_cols;
|
||||
out->count = lines_count;
|
||||
out->col_count = cols_count;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_line_info_idx_range_from_voff(RDI_ParsedLineTable *line_info, RDI_U64 voff, RDI_U64 *n_out)
|
||||
{
|
||||
RDI_U64 result = 0;
|
||||
RDI_U64 n = 0;
|
||||
if(line_info->count > 0 && line_info->voffs[0] <= voff && voff < line_info->voffs[line_info->count - 1])
|
||||
{
|
||||
//- rjf: find i such that: (vmap[i].voff <= voff) && (voff < vmap[i + 1].voff)
|
||||
// assuming: (i < j) -> (vmap[i].voff < vmap[j].voff)
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = line_info->count;
|
||||
for(;;)
|
||||
{
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if(line_info->voffs[mid] < voff)
|
||||
{
|
||||
first = mid;
|
||||
}
|
||||
else if(line_info->voffs[mid] > voff)
|
||||
{
|
||||
opl = mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if(opl - first <= 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = (RDI_U64)first;
|
||||
|
||||
//- rjf: scan leftward, to find shallowest line info matching this voff
|
||||
for(;result != 0;)
|
||||
{
|
||||
if(line_info->voffs[result-1] == voff)
|
||||
{
|
||||
result -= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: scan rightward, to count # of line info with this voff
|
||||
for(RDI_U64 idx = result; idx < line_info->count; idx += 1)
|
||||
{
|
||||
if(line_info->voffs[idx] == voff)
|
||||
{
|
||||
n += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(n_out)
|
||||
{
|
||||
*n_out = n;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_line_info_idx_from_voff(RDI_ParsedLineTable *line_info, RDI_U64 voff)
|
||||
{
|
||||
RDI_U64 count = 0;
|
||||
RDI_U64 result = rdi_line_info_idx_range_from_voff(line_info, voff, &count);
|
||||
for(RDI_U64 idx = 0; idx < count && result+idx < line_info->count; idx += 1)
|
||||
{
|
||||
if(line_info->lines[result+idx].file_idx != 0)
|
||||
{
|
||||
result += idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdi_parsed_from_source_line_map(RDI_Parsed *rdi, RDI_SourceLineMap *map, RDI_ParsedSourceLineMap *out)
|
||||
{
|
||||
//- rjf: extract top-level line info tables
|
||||
RDI_U64 all_nums_count = 0;
|
||||
RDI_U32 *all_nums = rdi_table_from_name(rdi, SourceLineMapNumbers, &all_nums_count);
|
||||
RDI_U32 *all_nums_opl = all_nums + all_nums_count;
|
||||
RDI_U64 all_rngs_count = 0;
|
||||
RDI_U32 *all_rngs = rdi_table_from_name(rdi, SourceLineMapRanges, &all_rngs_count);
|
||||
RDI_U32 *all_rngs_opl = all_rngs + all_rngs_count;
|
||||
RDI_U64 all_voffs_count = 0;
|
||||
RDI_U64 *all_voffs = rdi_table_from_name(rdi, SourceLineMapVOffs, &all_voffs_count);
|
||||
RDI_U64 *all_voffs_opl = all_voffs + all_voffs_count;
|
||||
|
||||
//- rjf: extract ranges of top-level tables belonging to this line map
|
||||
RDI_U32 *map_nums = all_nums + map->line_map_nums_base_idx;
|
||||
RDI_U32 *map_rngs = all_rngs + map->line_map_range_base_idx;
|
||||
RDI_U64 *map_voffs= all_voffs+ map->line_map_voff_base_idx;
|
||||
RDI_U64 lines_count = (RDI_U64)map->line_count;
|
||||
RDI_U64 voffs_count = (RDI_U64)map->voff_count;
|
||||
if(map_nums >= all_nums_opl) {map_nums = all_nums; lines_count = 0;}
|
||||
if(map_rngs >= all_rngs_opl) {map_rngs = all_rngs; lines_count = 0;}
|
||||
if(map_voffs>= all_voffs_opl){map_voffs= all_voffs;voffs_count = 0;}
|
||||
|
||||
//- rjf: fill result
|
||||
out->nums = map_nums;
|
||||
out->ranges = map_rngs;
|
||||
out->voffs = map_voffs;
|
||||
out->count = lines_count;
|
||||
out->voff_count = voffs_count;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64 *
|
||||
rdi_line_voffs_from_num(RDI_ParsedSourceLineMap *map, RDI_U32 linenum, RDI_U32 *n_out)
|
||||
{
|
||||
RDI_U64 *result = 0;
|
||||
*n_out = 0;
|
||||
RDI_U32 closest_i = 0;
|
||||
if(map->count > 0 && map->nums[0] <= linenum)
|
||||
{
|
||||
// assuming: (i < j) -> (nums[i] < nums[j])
|
||||
// find i such that: (nums[i] <= linenum) && (linenum < nums[i + 1])
|
||||
RDI_U32 *nums = map->nums;
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = map->count;
|
||||
for(;;)
|
||||
{
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if(nums[mid] < linenum)
|
||||
{
|
||||
first = mid;
|
||||
}
|
||||
else if(nums[mid] > linenum)
|
||||
{
|
||||
opl = mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if(opl - first <= 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
closest_i = first;
|
||||
}
|
||||
|
||||
// round up instead of down if possible
|
||||
if(closest_i + 1 < map->count && map->nums[closest_i] < linenum)
|
||||
{
|
||||
closest_i += 1;
|
||||
}
|
||||
|
||||
// set result if possible
|
||||
if(closest_i < map->count)
|
||||
{
|
||||
RDI_U32 first = map->ranges[closest_i];
|
||||
RDI_U32 opl = map->ranges[closest_i + 1];
|
||||
if(opl < map->voff_count)
|
||||
{
|
||||
result = map->voffs + first;
|
||||
*n_out = opl - first;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//- vmap lookups
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_vmap_idx_from_voff(RDI_VMapEntry *vmap, RDI_U64 vmap_count, RDI_U64 voff)
|
||||
{
|
||||
RDI_U64 result = 0;
|
||||
if(vmap_count > 0 && vmap[0].voff <= voff && voff < vmap[vmap_count - 1].voff)
|
||||
{
|
||||
// assuming: (i < j) -> (vmap[i].voff < vmap[j].voff)
|
||||
// find i such that: (vmap[i].voff <= voff) && (voff < vmap[i + 1].voff)
|
||||
RDI_U32 first = 0;
|
||||
RDI_U32 opl = vmap_count;
|
||||
for(;;)
|
||||
{
|
||||
RDI_U32 mid = (first + opl)/2;
|
||||
if(vmap[mid].voff < voff)
|
||||
{
|
||||
first = mid;
|
||||
}
|
||||
else if(vmap[mid].voff > voff)
|
||||
{
|
||||
opl = mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
first = mid;
|
||||
break;
|
||||
}
|
||||
if(opl - first <= 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = (RDI_U64)vmap[first].idx;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_vmap_idx_from_section_kind_voff(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_U64 voff)
|
||||
{
|
||||
RDI_U64 vmaps_count = 0;
|
||||
RDI_VMapEntry *vmaps = rdi_section_raw_table_from_kind(rdi, kind, &vmaps_count);
|
||||
RDI_U64 result = rdi_vmap_idx_from_voff(vmaps, vmaps_count, voff);
|
||||
return result;
|
||||
}
|
||||
|
||||
//- name maps
|
||||
|
||||
RDI_PROC void
|
||||
rdi_parsed_from_name_map(RDI_Parsed *rdi, RDI_NameMap *mapptr, RDI_ParsedNameMap *out)
|
||||
{
|
||||
out->buckets = 0;
|
||||
out->bucket_count = 0;
|
||||
if(mapptr != 0)
|
||||
{
|
||||
RDI_U64 all_buckets_count = 0;
|
||||
RDI_NameMapBucket *all_buckets = rdi_table_from_name(rdi, NameMapBuckets, &all_buckets_count);
|
||||
RDI_U64 all_nodes_count = 0;
|
||||
RDI_NameMapNode *all_nodes = rdi_table_from_name(rdi, NameMapNodes, &all_nodes_count);
|
||||
out->buckets = all_buckets+mapptr->bucket_base_idx;
|
||||
out->nodes = all_nodes+mapptr->node_base_idx;
|
||||
out->bucket_count = mapptr->bucket_count;
|
||||
out->node_count = mapptr->node_count;
|
||||
if(mapptr->bucket_base_idx > all_buckets_count)
|
||||
{
|
||||
out->buckets = 0;
|
||||
out->bucket_count = 0;
|
||||
}
|
||||
if(mapptr->node_base_idx > all_nodes_count)
|
||||
{
|
||||
out->nodes = 0;
|
||||
out->node_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RDI_PROC RDI_NameMapNode*
|
||||
rdi_name_map_lookup(RDI_Parsed *p, RDI_ParsedNameMap *map, RDI_U8 *str, RDI_U64 len)
|
||||
{
|
||||
RDI_NameMapNode *result = 0;
|
||||
if(map->bucket_count > 0)
|
||||
{
|
||||
RDI_NameMapBucket *buckets = map->buckets;
|
||||
RDI_U64 bucket_count = map->bucket_count;
|
||||
RDI_U64 hash = rdi_hash(str, len);
|
||||
RDI_U64 bucket_index = hash%bucket_count;
|
||||
RDI_NameMapBucket *bucket = map->buckets + bucket_index;
|
||||
RDI_NameMapNode *node = map->nodes + bucket->first_node;
|
||||
RDI_NameMapNode *node_opl = node + bucket->node_count;
|
||||
for(;node < node_opl; node += 1)
|
||||
{
|
||||
// extract a string from this node
|
||||
RDI_U64 nlen = 0;
|
||||
RDI_U8 *nstr = rdi_string_from_idx(p, node->string_idx, &nlen);
|
||||
|
||||
// compare this to the needle string
|
||||
RDI_S32 match = 0;
|
||||
if(nlen == len)
|
||||
{
|
||||
RDI_U8 *a = str;
|
||||
RDI_U8 *aopl = str + len;
|
||||
RDI_U8 *b = nstr;
|
||||
for (;a < aopl && *a == *b; a += 1, b += 1);
|
||||
match = (a == aopl);
|
||||
}
|
||||
|
||||
// stop with a matching node in result
|
||||
if(match)
|
||||
{
|
||||
result = node;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32*
|
||||
rdi_matches_from_map_node(RDI_Parsed *p, RDI_NameMapNode *node, RDI_U32 *n_out)
|
||||
{
|
||||
RDI_U32 *result = 0;
|
||||
*n_out = 0;
|
||||
if(node != 0)
|
||||
{
|
||||
if(node->match_count == 1)
|
||||
{
|
||||
result = &node->match_idx_or_idx_run_first;
|
||||
*n_out = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = rdi_idx_run_from_first_count(p, node->match_idx_or_idx_run_first, node->match_count, n_out);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ High-Level Composite Lookup Functions
|
||||
|
||||
//- procedures
|
||||
|
||||
RDI_PROC RDI_Procedure *
|
||||
rdi_procedure_from_name(RDI_Parsed *rdi, RDI_U8 *name, RDI_U64 name_size)
|
||||
{
|
||||
RDI_NameMap *map = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_Procedures);
|
||||
RDI_ParsedNameMap map_parsed = {0};
|
||||
rdi_parsed_from_name_map(rdi, map, &map_parsed);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map_parsed, name, name_size);
|
||||
RDI_U32 id_count = 0;
|
||||
RDI_U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count);
|
||||
RDI_U32 procedure_idx = 0;
|
||||
if(id_count > 0)
|
||||
{
|
||||
procedure_idx = ids[0];
|
||||
}
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, procedure_idx);
|
||||
return procedure;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Procedure *
|
||||
rdi_procedure_from_name_cstr(RDI_Parsed *rdi, char *cstr)
|
||||
{
|
||||
RDI_Procedure *result = rdi_procedure_from_name(rdi, (RDI_U8 *)cstr, rdi_cstring_length(cstr));
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8 *
|
||||
rdi_name_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure, RDI_U64 *len_out)
|
||||
{
|
||||
return rdi_string_from_idx(rdi, procedure->name_string_idx, len_out);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Scope *
|
||||
rdi_root_scope_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure)
|
||||
{
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, procedure->root_scope_idx);
|
||||
return scope;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure)
|
||||
{
|
||||
RDI_Scope *scope = rdi_root_scope_from_procedure(rdi, procedure);
|
||||
RDI_U64 result = rdi_first_voff_from_scope(rdi, scope);
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_opl_voff_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure)
|
||||
{
|
||||
RDI_Scope *scope = rdi_root_scope_from_procedure(rdi, procedure);
|
||||
RDI_U64 result = rdi_opl_voff_from_scope(rdi, scope);
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Procedure *
|
||||
rdi_procedure_from_voff(RDI_Parsed *rdi, RDI_U64 voff)
|
||||
{
|
||||
RDI_Scope *scope = rdi_scope_from_voff(rdi, voff);
|
||||
RDI_Procedure *procedure = rdi_procedure_from_scope(rdi, scope);
|
||||
return procedure;
|
||||
}
|
||||
|
||||
//- scopes
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_scope(RDI_Parsed *rdi, RDI_Scope *scope)
|
||||
{
|
||||
RDI_U64 *voffs = rdi_element_from_name_idx(rdi, ScopeVOffData, scope->voff_range_first);
|
||||
RDI_U64 result = *voffs;
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_opl_voff_from_scope(RDI_Parsed *rdi, RDI_Scope *scope)
|
||||
{
|
||||
RDI_U64 *voffs = rdi_element_from_name_idx(rdi, ScopeVOffData, scope->voff_range_opl);
|
||||
RDI_U64 result = *voffs;
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Scope *
|
||||
rdi_scope_from_voff(RDI_Parsed *rdi, RDI_U64 voff)
|
||||
{
|
||||
RDI_U32 idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_ScopeVMap, voff);
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, idx);
|
||||
return scope;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Procedure *
|
||||
rdi_procedure_from_scope(RDI_Parsed *rdi, RDI_Scope *scope)
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, scope->proc_idx);
|
||||
return procedure;
|
||||
}
|
||||
|
||||
//- units
|
||||
|
||||
RDI_PROC RDI_Unit *
|
||||
rdi_unit_from_voff(RDI_Parsed *rdi, RDI_U64 voff)
|
||||
{
|
||||
RDI_U32 unit_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_UnitVMap, voff);
|
||||
RDI_Unit *unit = rdi_element_from_name_idx(rdi, Units, unit_idx);
|
||||
return unit;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_LineTable *
|
||||
rdi_line_table_from_unit(RDI_Parsed *rdi, RDI_Unit *unit)
|
||||
{
|
||||
RDI_LineTable *line_table = rdi_element_from_name_idx(rdi, LineTables, unit->line_table_idx);
|
||||
return line_table;
|
||||
}
|
||||
|
||||
//- line info
|
||||
|
||||
RDI_PROC RDI_Line
|
||||
rdi_line_from_voff(RDI_Parsed *rdi, RDI_U64 voff)
|
||||
{
|
||||
RDI_Unit *unit = rdi_unit_from_voff(rdi, voff);
|
||||
RDI_LineTable *line_table = rdi_line_table_from_unit(rdi, unit);
|
||||
RDI_Line line = rdi_line_from_line_table_voff(rdi, line_table, voff);
|
||||
return line;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_Line
|
||||
rdi_line_from_line_table_voff(RDI_Parsed *rdi, RDI_LineTable *line_table, RDI_U64 voff)
|
||||
{
|
||||
RDI_ParsedLineTable parsed = {0};
|
||||
rdi_parsed_from_line_table(rdi, line_table, &parsed);
|
||||
RDI_U64 line_info_idx = rdi_line_info_idx_from_voff(&parsed, voff);
|
||||
RDI_Line result = {0};
|
||||
if(line_info_idx < parsed.count)
|
||||
{
|
||||
result = parsed.lines[line_info_idx];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_SourceFile *
|
||||
rdi_source_file_from_line(RDI_Parsed *rdi, RDI_Line *line)
|
||||
{
|
||||
RDI_SourceFile *result = rdi_element_from_name_idx(rdi, SourceFiles, line->file_idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
//- source files
|
||||
|
||||
RDI_PROC RDI_SourceFile *
|
||||
rdi_source_file_from_normal_path(RDI_Parsed *rdi, RDI_U8 *name, RDI_U64 name_size)
|
||||
{
|
||||
RDI_NameMap *map = rdi_element_from_name_idx(rdi, NameMaps, RDI_NameMapKind_NormalSourcePaths);
|
||||
RDI_ParsedNameMap map_parsed = {0};
|
||||
rdi_parsed_from_name_map(rdi, map, &map_parsed);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map_parsed, name, name_size);
|
||||
RDI_U32 id_count = 0;
|
||||
RDI_U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count);
|
||||
RDI_U32 file_idx = 0;
|
||||
if(id_count > 0)
|
||||
{
|
||||
file_idx = ids[0];
|
||||
}
|
||||
RDI_SourceFile *file = rdi_element_from_name_idx(rdi, SourceFiles, file_idx);
|
||||
return file;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_SourceFile *
|
||||
rdi_source_file_from_normal_path_cstr(RDI_Parsed *rdi, char *cstr)
|
||||
{
|
||||
RDI_SourceFile *result = rdi_source_file_from_normal_path(rdi, (RDI_U8 *)cstr, rdi_cstring_length(cstr));
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8 *
|
||||
rdi_normal_path_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file, RDI_U64 *len_out)
|
||||
{
|
||||
return rdi_string_from_idx(rdi, src_file->normal_full_path_string_idx, len_out);
|
||||
}
|
||||
|
||||
RDI_PROC RDI_FilePathNode *
|
||||
rdi_file_path_node_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file)
|
||||
{
|
||||
RDI_FilePathNode *result = rdi_element_from_name_idx(rdi, FilePathNodes, src_file->file_path_node_idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_SourceLineMap *
|
||||
rdi_source_line_map_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file)
|
||||
{
|
||||
RDI_SourceLineMap *result = rdi_element_from_name_idx(rdi, SourceLineMaps, src_file->source_line_map_idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_source_file_line_num(RDI_Parsed *rdi, RDI_SourceFile *src_file, RDI_U32 line_num)
|
||||
{
|
||||
RDI_SourceLineMap *source_line_map = rdi_source_line_map_from_source_file(rdi, src_file);
|
||||
RDI_U64 voff = rdi_first_voff_from_source_line_map_num(rdi, source_line_map, line_num);
|
||||
return voff;
|
||||
}
|
||||
|
||||
//- source line maps
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_first_voff_from_source_line_map_num(RDI_Parsed *rdi, RDI_SourceLineMap *map, RDI_U32 line_num)
|
||||
{
|
||||
RDI_ParsedSourceLineMap parsed = {0};
|
||||
rdi_parsed_from_source_line_map(rdi, map, &parsed);
|
||||
RDI_U32 all_voffs_count = 0;
|
||||
RDI_U64 *all_voffs = rdi_line_voffs_from_num(&parsed, line_num, &all_voffs_count);
|
||||
RDI_U64 voff = 0;
|
||||
if(all_voffs_count != 0)
|
||||
{
|
||||
voff = all_voffs[0];
|
||||
}
|
||||
return voff;
|
||||
}
|
||||
|
||||
//- file path nodes
|
||||
|
||||
RDI_PROC RDI_FilePathNode *
|
||||
rdi_parent_from_file_path_node(RDI_Parsed *rdi, RDI_FilePathNode *node)
|
||||
{
|
||||
RDI_FilePathNode *result = rdi_element_from_name_idx(rdi, FilePathNodes, node->parent_path_node);
|
||||
return result;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U8 *
|
||||
rdi_name_from_file_path_node(RDI_Parsed *rdi, RDI_FilePathNode *node, RDI_U64 *len_out)
|
||||
{
|
||||
return rdi_string_from_idx(rdi, node->name_string_idx, len_out);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ Parser Helpers
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdi_cstring_length(char *cstr)
|
||||
{
|
||||
RDI_U64 result = 0;
|
||||
for(;cstr[result] != 0; result += 1){}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//~ RAD Debug Info, (R)AD(D)BG(I) Format Parsing Library
|
||||
//
|
||||
// Defines helper types and functions for extracting data from
|
||||
// RDI files.
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//~ Usage Samples
|
||||
//
|
||||
#if 0
|
||||
// Procedure Name -> Line
|
||||
{
|
||||
RDI_Parsed *rdi = ...;
|
||||
char *name = "mule_main";
|
||||
RDI_Procedure *procedure = rdi_procedure_from_name_cstr(rdi, name); // 1. name -> procedure
|
||||
RDI_U64 procedure_first_voff = rdi_first_voff_from_procedure(rdi, procedure); // 2. procedure -> virtual offset
|
||||
RDI_Line line = rdi_line_from_voff(rdi, procedure_first_voff); // 3. virtual offset -> line
|
||||
RDI_SourceFile *file = rdi_source_file_from_line(rdi, &line); // 4. line -> source file
|
||||
RDI_U64 file_path_size = 0; // 5. source file -> path
|
||||
RDI_U8 *file_path = rdi_normal_path_from_source_file(rdi, file, &file_path_size);
|
||||
printf("%s is at %.*s:%u\n", name, (int)file_path_size, file_path, line.line_num);
|
||||
}
|
||||
|
||||
// Line -> Procedure Name
|
||||
{
|
||||
RDI_Parsed *rdi = ...;
|
||||
char *path = "c:/devel/raddebugger/src/mule/mule_main.cpp";
|
||||
RDI_U32 line_num = 2557;
|
||||
RDI_SourceFile *file = rdi_source_file_from_normal_path_cstr(rdi, path); // 1. path -> source file
|
||||
RDI_U64 voff = rdi_first_voff_from_source_file_line_num(rdi, file, line_num); // 2. (source file, line) -> virtual offset
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, voff); // 3. virtual offset -> procedure
|
||||
RDI_U64 name_size = 0; // 4. procedure -> name
|
||||
RDI_U8 *name = rdi_name_from_procedure(rdi, procedure, &name_size);
|
||||
printf("%s:%u is inside %.*s\n", path, line_num, (int)name_size, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef RDI_FORMAT_PARSE_H
|
||||
#define RDI_FORMAT_PARSE_H
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//~ Parsed Information Types
|
||||
|
||||
typedef enum RDI_ParseStatus
|
||||
{
|
||||
RDI_ParseStatus_Good = 0,
|
||||
RDI_ParseStatus_HeaderDoesNotMatch = 1,
|
||||
RDI_ParseStatus_UnsupportedVersionNumber = 2,
|
||||
RDI_ParseStatus_InvalidDataSecionLayout = 3,
|
||||
RDI_ParseStatus_MissingRequiredSection = 4,
|
||||
}
|
||||
RDI_ParseStatus;
|
||||
|
||||
typedef struct RDI_Parsed RDI_Parsed;
|
||||
struct RDI_Parsed
|
||||
{
|
||||
RDI_U8 *raw_data;
|
||||
RDI_U64 raw_data_size;
|
||||
RDI_Section *sections;
|
||||
RDI_U64 sections_count;
|
||||
};
|
||||
|
||||
typedef struct RDI_ParsedLineTable RDI_ParsedLineTable;
|
||||
struct RDI_ParsedLineTable
|
||||
{
|
||||
// NOTE: Mapping VOFF -> LINE_INFO
|
||||
//
|
||||
// * [ voff[i], voff[i + 1] ) forms the voff range
|
||||
// * for the line info at lines[i] (and cols[i] if i < col_count)
|
||||
RDI_U64* voffs; // [count + 1] sorted
|
||||
RDI_Line* lines; // [count]
|
||||
RDI_Column* cols; // [col_count]
|
||||
RDI_U64 count;
|
||||
RDI_U64 col_count;
|
||||
};
|
||||
|
||||
typedef struct RDI_ParsedSourceLineMap RDI_ParsedSourceLineMap;
|
||||
struct RDI_ParsedSourceLineMap
|
||||
{
|
||||
// NOTE: Mapping LINE_NUMBER -> VOFFs
|
||||
//
|
||||
// * nums[i] gives a line number
|
||||
// * that line number has one or more associated voffs
|
||||
//
|
||||
// * to find all associated voffs for the line number nums[i] :
|
||||
// * let k span over the range [ ranges[i], ranges[i + 1] )
|
||||
// * voffs[k] gives the associated voffs
|
||||
RDI_U32* nums; // [count] sorted
|
||||
RDI_U32* ranges; // [count + 1]
|
||||
RDI_U64* voffs; // [voff_count]
|
||||
RDI_U64 count;
|
||||
RDI_U64 voff_count;
|
||||
};
|
||||
|
||||
typedef struct RDI_ParsedNameMap RDI_ParsedNameMap;
|
||||
struct RDI_ParsedNameMap
|
||||
{
|
||||
RDI_NameMapBucket *buckets;
|
||||
RDI_NameMapNode *nodes;
|
||||
RDI_U64 bucket_count;
|
||||
RDI_U64 node_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ Global Nils
|
||||
|
||||
static union
|
||||
{
|
||||
RDI_TopLevelInfo top_level_info;
|
||||
RDI_BinarySection binary_section;
|
||||
RDI_FilePathNode file_path_node;
|
||||
RDI_SourceFile source_file;
|
||||
RDI_LineTable line_table;
|
||||
RDI_SourceLineMap source_line_map;
|
||||
RDI_Line line;
|
||||
RDI_Column column;
|
||||
RDI_Unit unit;
|
||||
RDI_VMapEntry vmap_entry;
|
||||
RDI_TypeNode type_node;
|
||||
RDI_UDT udt;
|
||||
RDI_Member member;
|
||||
RDI_EnumMember enum_member;
|
||||
RDI_GlobalVariable global_variable;
|
||||
RDI_ThreadVariable thread_variable;
|
||||
RDI_Procedure procedure;
|
||||
RDI_Scope scope;
|
||||
RDI_U64 voff;
|
||||
RDI_LocationBlock location_block;
|
||||
RDI_Local local;
|
||||
}
|
||||
rdi_nil_element_union = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ Top-Level Parsing API
|
||||
|
||||
RDI_PROC RDI_ParseStatus rdi_parse(RDI_U8 *data, RDI_U64 size, RDI_Parsed *out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ Base Parsed Info Extraction Helpers
|
||||
|
||||
//- section table/element raw data extraction
|
||||
RDI_PROC void *rdi_section_raw_data_from_kind(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_SectionEncoding *encoding_out, RDI_U64 *size_out);
|
||||
RDI_PROC void *rdi_section_raw_table_from_kind(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_U64 *count_out);
|
||||
RDI_PROC void *rdi_section_raw_element_from_kind_idx(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_U64 idx);
|
||||
#define rdi_table_from_name(rdi, name, count_out) (RDI_SectionElementType_##name *)rdi_section_raw_table_from_kind((rdi), RDI_SectionKind_##name, (count_out))
|
||||
#define rdi_element_from_name_idx(rdi, name, idx) (RDI_SectionElementType_##name *)rdi_section_raw_element_from_kind_idx((rdi), RDI_SectionKind_##name, (idx))
|
||||
|
||||
//- info about whole parse
|
||||
RDI_PROC RDI_U64 rdi_decompressed_size_from_parsed(RDI_Parsed *rdi);
|
||||
|
||||
//- strings
|
||||
RDI_PROC RDI_U8 *rdi_string_from_idx(RDI_Parsed *rdi, RDI_U32 idx, RDI_U64 *len_out);
|
||||
|
||||
//- index runs
|
||||
RDI_PROC RDI_U32 *rdi_idx_run_from_first_count(RDI_Parsed *rdi, RDI_U32 raw_first, RDI_U32 raw_count, RDI_U32 *n_out);
|
||||
|
||||
//- line info
|
||||
RDI_PROC void rdi_parsed_from_line_table(RDI_Parsed *rdi, RDI_LineTable *line_table, RDI_ParsedLineTable *out);
|
||||
RDI_PROC RDI_U64 rdi_line_info_idx_range_from_voff(RDI_ParsedLineTable *line_info, RDI_U64 voff, RDI_U64 *n_out);
|
||||
RDI_PROC RDI_U64 rdi_line_info_idx_from_voff(RDI_ParsedLineTable *line_info, RDI_U64 voff);
|
||||
RDI_PROC void rdi_parsed_from_source_line_map(RDI_Parsed *rdi, RDI_SourceLineMap *map, RDI_ParsedSourceLineMap *out);
|
||||
RDI_PROC RDI_U64 *rdi_line_voffs_from_num(RDI_ParsedSourceLineMap *map, RDI_U32 linenum, RDI_U32 *n_out);
|
||||
|
||||
//- vmap lookups
|
||||
RDI_PROC RDI_U64 rdi_vmap_idx_from_voff(RDI_VMapEntry *vmap, RDI_U64 vmap_count, RDI_U64 voff);
|
||||
|
||||
//- name maps
|
||||
RDI_PROC RDI_NameMap *rdi_name_map_from_kind(RDI_Parsed *p, RDI_NameMapKind kind);
|
||||
RDI_PROC void rdi_name_map_parse(RDI_Parsed* p, RDI_NameMap *mapptr, RDI_ParsedNameMap *out);
|
||||
RDI_PROC RDI_NameMapNode *rdi_name_map_lookup(RDI_Parsed *p, RDI_ParsedNameMap *map, RDI_U8 *str, RDI_U64 len);
|
||||
RDI_PROC RDI_U32 *rdi_matches_from_map_node(RDI_Parsed *p, RDI_NameMapNode *node, RDI_U32 *n_out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ High-Level Composite Lookup Functions
|
||||
|
||||
//- procedures
|
||||
RDI_PROC RDI_Procedure *rdi_procedure_from_name(RDI_Parsed *rdi, RDI_U8 *name, RDI_U64 name_size);
|
||||
RDI_PROC RDI_Procedure *rdi_procedure_from_name_cstr(RDI_Parsed *rdi, char *cstr);
|
||||
RDI_PROC RDI_U8 *rdi_name_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure, RDI_U64 *len_out);
|
||||
RDI_PROC RDI_Scope *rdi_root_scope_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure);
|
||||
RDI_PROC RDI_U64 rdi_first_voff_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure);
|
||||
RDI_PROC RDI_U64 rdi_opl_voff_from_procedure(RDI_Parsed *rdi, RDI_Procedure *procedure);
|
||||
RDI_PROC RDI_Procedure *rdi_procedure_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
|
||||
//- scopes
|
||||
RDI_PROC RDI_U64 rdi_first_voff_from_scope(RDI_Parsed *rdi, RDI_Scope *scope);
|
||||
RDI_PROC RDI_U64 rdi_opl_voff_from_scope(RDI_Parsed *rdi, RDI_Scope *scope);
|
||||
RDI_PROC RDI_Scope *rdi_scope_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
RDI_PROC RDI_Procedure *rdi_procedure_from_scope(RDI_Parsed *rdi, RDI_Scope *scope);
|
||||
|
||||
//- units
|
||||
RDI_PROC RDI_Unit *rdi_unit_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
RDI_PROC RDI_LineTable *rdi_line_table_from_unit(RDI_Parsed *rdi, RDI_Unit *unit);
|
||||
|
||||
//- line tables
|
||||
RDI_PROC RDI_Line rdi_line_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
RDI_PROC RDI_Line rdi_line_from_line_table_voff(RDI_Parsed *rdi, RDI_LineTable *line_table, RDI_U64 voff);
|
||||
RDI_PROC RDI_SourceFile *rdi_source_file_from_line(RDI_Parsed *rdi, RDI_Line *line);
|
||||
|
||||
//- source files
|
||||
RDI_PROC RDI_SourceFile *rdi_source_file_from_normal_path(RDI_Parsed *rdi, RDI_U8 *name, RDI_U64 name_size);
|
||||
RDI_PROC RDI_SourceFile *rdi_source_file_from_normal_path_cstr(RDI_Parsed *rdi, char *cstr);
|
||||
RDI_PROC RDI_U8 *rdi_normal_path_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file, RDI_U64 *len_out);
|
||||
RDI_PROC RDI_FilePathNode *rdi_file_path_node_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file);
|
||||
RDI_PROC RDI_SourceLineMap *rdi_source_line_map_from_source_file(RDI_Parsed *rdi, RDI_SourceFile *src_file);
|
||||
RDI_PROC RDI_U64 rdi_first_voff_from_source_file_line_num(RDI_Parsed *rdi, RDI_SourceFile *src_file, RDI_U32 line_num);
|
||||
|
||||
//- source line maps
|
||||
RDI_PROC RDI_U64 rdi_first_voff_from_source_line_map_num(RDI_Parsed *rdi, RDI_SourceLineMap *map, RDI_U32 line_num);
|
||||
|
||||
//- file path nodes
|
||||
RDI_PROC RDI_FilePathNode *rdi_parent_from_file_path_node(RDI_Parsed *rdi, RDI_FilePathNode *node);
|
||||
RDI_PROC RDI_U8 *rdi_name_from_file_path_node(RDI_Parsed *rdi, RDI_FilePathNode *node, RDI_U64 *len_out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ Parser Helpers
|
||||
|
||||
#define rdi_parse__min(a,b) (((a)<(b))?(a):(b))
|
||||
RDI_PROC RDI_U64 rdi_cstring_length(char *cstr);
|
||||
|
||||
#endif // RDI_FORMAT_PARSE_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
@@ -417,6 +417,7 @@ struct RDIM_TopLevelInfo
|
||||
RDIM_String8 exe_name;
|
||||
RDI_U64 exe_hash;
|
||||
RDI_U64 voff_max;
|
||||
RDIM_String8 producer_name;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -484,10 +485,12 @@ struct RDIM_SrcFileChunkList
|
||||
RDIM_SrcFileChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
RDI_U64 source_line_map_count;
|
||||
RDI_U64 total_line_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Compilation-Unit Info Types
|
||||
//~ rjf: Line Info Types
|
||||
|
||||
typedef struct RDIM_LineSequence RDIM_LineSequence;
|
||||
struct RDIM_LineSequence
|
||||
@@ -506,14 +509,42 @@ struct RDIM_LineSequenceNode
|
||||
RDIM_LineSequence v;
|
||||
};
|
||||
|
||||
typedef struct RDIM_LineSequenceList RDIM_LineSequenceList;
|
||||
struct RDIM_LineSequenceList
|
||||
typedef struct RDIM_LineTable RDIM_LineTable;
|
||||
struct RDIM_LineTable
|
||||
{
|
||||
RDIM_LineSequenceNode *first;
|
||||
RDIM_LineSequenceNode *last;
|
||||
RDI_U64 count;
|
||||
struct RDIM_LineTableChunkNode *chunk;
|
||||
RDIM_LineSequenceNode *first_seq;
|
||||
RDIM_LineSequenceNode *last_seq;
|
||||
RDI_U64 seq_count;
|
||||
RDI_U64 line_count;
|
||||
RDI_U64 col_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_LineTableChunkNode RDIM_LineTableChunkNode;
|
||||
struct RDIM_LineTableChunkNode
|
||||
{
|
||||
RDIM_LineTableChunkNode *next;
|
||||
RDIM_LineTable *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_LineTableChunkList RDIM_LineTableChunkList;
|
||||
struct RDIM_LineTableChunkList
|
||||
{
|
||||
RDIM_LineTableChunkNode *first;
|
||||
RDIM_LineTableChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
RDI_U64 total_seq_count;
|
||||
RDI_U64 total_line_count;
|
||||
RDI_U64 total_col_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Compilation-Unit Info Types
|
||||
|
||||
typedef struct RDIM_Unit RDIM_Unit;
|
||||
struct RDIM_Unit
|
||||
{
|
||||
@@ -525,7 +556,7 @@ struct RDIM_Unit
|
||||
RDIM_String8 archive_file;
|
||||
RDIM_String8 build_path;
|
||||
RDI_Language language;
|
||||
RDIM_LineSequenceList line_sequences;
|
||||
RDIM_LineTable *line_table;
|
||||
RDIM_Rng1U64List voff_ranges;
|
||||
};
|
||||
|
||||
@@ -668,7 +699,7 @@ typedef struct RDIM_Location RDIM_Location;
|
||||
struct RDIM_Location
|
||||
{
|
||||
RDI_LocationKind kind;
|
||||
RDI_U8 register_code;
|
||||
RDI_U8 reg_code;
|
||||
RDI_U16 offset;
|
||||
RDIM_EvalBytecode bytecode;
|
||||
};
|
||||
@@ -735,6 +766,38 @@ struct RDIM_SymbolChunkList
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Inline Site Info Types
|
||||
|
||||
typedef struct RDIM_InlineSite RDIM_InlineSite;
|
||||
struct RDIM_InlineSite
|
||||
{
|
||||
struct RDIM_InlineSiteChunkNode *chunk;
|
||||
RDIM_String8 name;
|
||||
RDIM_Type *type;
|
||||
RDIM_Type *owner;
|
||||
RDIM_LineTable *line_table;
|
||||
};
|
||||
|
||||
typedef struct RDIM_InlineSiteChunkNode RDIM_InlineSiteChunkNode;
|
||||
struct RDIM_InlineSiteChunkNode
|
||||
{
|
||||
RDIM_InlineSiteChunkNode *next;
|
||||
RDIM_InlineSite *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_InlineSiteChunkList RDIM_InlineSiteChunkList;
|
||||
struct RDIM_InlineSiteChunkList
|
||||
{
|
||||
RDIM_InlineSiteChunkNode *first;
|
||||
RDIM_InlineSiteChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scope Info Types
|
||||
|
||||
@@ -761,6 +824,7 @@ struct RDIM_Scope
|
||||
RDIM_Local *first_local;
|
||||
RDIM_Local *last_local;
|
||||
RDI_U32 local_count;
|
||||
RDIM_InlineSite *inline_site;
|
||||
};
|
||||
|
||||
typedef struct RDIM_ScopeChunkNode RDIM_ScopeChunkNode;
|
||||
@@ -799,10 +863,12 @@ struct RDIM_BakeParams
|
||||
RDIM_TypeChunkList types;
|
||||
RDIM_UDTChunkList udts;
|
||||
RDIM_SrcFileChunkList src_files;
|
||||
RDIM_LineTableChunkList line_tables;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
RDIM_ScopeChunkList scopes;
|
||||
RDIM_InlineSiteChunkList inline_sites;
|
||||
};
|
||||
|
||||
//- rjf: data sections
|
||||
@@ -811,8 +877,10 @@ typedef struct RDIM_BakeSection RDIM_BakeSection;
|
||||
struct RDIM_BakeSection
|
||||
{
|
||||
void *data;
|
||||
RDI_U64 size;
|
||||
RDI_DataSectionTag tag;
|
||||
RDI_SectionEncoding encoding;
|
||||
RDI_U64 encoded_size;
|
||||
RDI_U64 unpacked_size;
|
||||
RDI_SectionKind tag;
|
||||
RDI_U64 tag_idx;
|
||||
};
|
||||
|
||||
@@ -989,6 +1057,217 @@ struct RDIM_VMapMarker
|
||||
RDI_U32 begin_range;
|
||||
};
|
||||
|
||||
//- rjf: baking results
|
||||
|
||||
typedef struct RDIM_TopLevelInfoBakeResult RDIM_TopLevelInfoBakeResult;
|
||||
struct RDIM_TopLevelInfoBakeResult
|
||||
{
|
||||
RDI_TopLevelInfo *top_level_info;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BinarySectionBakeResult RDIM_BinarySectionBakeResult;
|
||||
struct RDIM_BinarySectionBakeResult
|
||||
{
|
||||
RDI_BinarySection *binary_sections;
|
||||
RDI_U64 binary_sections_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitBakeResult RDIM_UnitBakeResult;
|
||||
struct RDIM_UnitBakeResult
|
||||
{
|
||||
RDI_Unit *units;
|
||||
RDI_U64 units_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitVMapBakeResult RDIM_UnitVMapBakeResult;
|
||||
struct RDIM_UnitVMapBakeResult
|
||||
{
|
||||
RDIM_BakeVMap vmap;
|
||||
};
|
||||
|
||||
typedef struct RDIM_SrcFileBakeResult RDIM_SrcFileBakeResult;
|
||||
struct RDIM_SrcFileBakeResult
|
||||
{
|
||||
RDI_SourceFile *source_files;
|
||||
RDI_U64 source_files_count;
|
||||
RDI_SourceLineMap *source_line_maps;
|
||||
RDI_U64 source_line_maps_count;
|
||||
RDI_U32 *source_line_map_nums;
|
||||
RDI_U32 *source_line_map_rngs;
|
||||
RDI_U64 *source_line_map_voffs;
|
||||
RDI_U64 source_line_map_nums_count;
|
||||
RDI_U64 source_line_map_rngs_count;
|
||||
RDI_U64 source_line_map_voffs_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_LineTableBakeResult RDIM_LineTableBakeResult;
|
||||
struct RDIM_LineTableBakeResult
|
||||
{
|
||||
RDI_LineTable *line_tables;
|
||||
RDI_U64 line_tables_count;
|
||||
RDI_U64 *line_table_voffs;
|
||||
RDI_U64 line_table_voffs_count;
|
||||
RDI_Line *line_table_lines;
|
||||
RDI_U64 line_table_lines_count;
|
||||
RDI_Column *line_table_columns;
|
||||
RDI_U64 line_table_columns_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_TypeNodeBakeResult RDIM_TypeNodeBakeResult;
|
||||
struct RDIM_TypeNodeBakeResult
|
||||
{
|
||||
RDI_TypeNode *type_nodes;
|
||||
RDI_U64 type_nodes_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UDTBakeResult RDIM_UDTBakeResult;
|
||||
struct RDIM_UDTBakeResult
|
||||
{
|
||||
RDI_UDT *udts;
|
||||
RDI_U64 udts_count;
|
||||
RDI_Member *members;
|
||||
RDI_U64 members_count;
|
||||
RDI_EnumMember *enum_members;
|
||||
RDI_U64 enum_members_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_GlobalVariableBakeResult RDIM_GlobalVariableBakeResult;
|
||||
struct RDIM_GlobalVariableBakeResult
|
||||
{
|
||||
RDI_GlobalVariable *global_variables;
|
||||
RDI_U64 global_variables_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_GlobalVMapBakeResult RDIM_GlobalVMapBakeResult;
|
||||
struct RDIM_GlobalVMapBakeResult
|
||||
{
|
||||
RDIM_BakeVMap vmap;
|
||||
};
|
||||
|
||||
typedef struct RDIM_ThreadVariableBakeResult RDIM_ThreadVariableBakeResult;
|
||||
struct RDIM_ThreadVariableBakeResult
|
||||
{
|
||||
RDI_ThreadVariable *thread_variables;
|
||||
RDI_U64 thread_variables_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_ProcedureBakeResult RDIM_ProcedureBakeResult;
|
||||
struct RDIM_ProcedureBakeResult
|
||||
{
|
||||
RDI_Procedure *procedures;
|
||||
RDI_U64 procedures_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_ScopeBakeResult RDIM_ScopeBakeResult;
|
||||
struct RDIM_ScopeBakeResult
|
||||
{
|
||||
RDI_Scope *scopes;
|
||||
RDI_U64 scopes_count;
|
||||
RDI_U64 *scope_voffs;
|
||||
RDI_U64 scope_voffs_count;
|
||||
RDI_Local *locals;
|
||||
RDI_U64 locals_count;
|
||||
RDI_LocationBlock *location_blocks;
|
||||
RDI_U64 location_blocks_count;
|
||||
RDI_U8 *location_data;
|
||||
RDI_U64 location_data_size;
|
||||
};
|
||||
|
||||
typedef struct RDIM_ScopeVMapBakeResult RDIM_ScopeVMapBakeResult;
|
||||
struct RDIM_ScopeVMapBakeResult
|
||||
{
|
||||
RDIM_BakeVMap vmap;
|
||||
};
|
||||
|
||||
typedef struct RDIM_InlineSiteBakeResult RDIM_InlineSiteBakeResult;
|
||||
struct RDIM_InlineSiteBakeResult
|
||||
{
|
||||
RDI_InlineSite *inline_sites;
|
||||
RDI_U64 inline_sites_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_TopLevelNameMapBakeResult RDIM_TopLevelNameMapBakeResult;
|
||||
struct RDIM_TopLevelNameMapBakeResult
|
||||
{
|
||||
RDI_NameMap *name_maps;
|
||||
RDI_U64 name_maps_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_NameMapBakeResult RDIM_NameMapBakeResult;
|
||||
struct RDIM_NameMapBakeResult
|
||||
{
|
||||
RDI_NameMapBucket *buckets;
|
||||
RDI_U64 buckets_count;
|
||||
RDI_NameMapNode *nodes;
|
||||
RDI_U64 nodes_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_FilePathBakeResult RDIM_FilePathBakeResult;
|
||||
struct RDIM_FilePathBakeResult
|
||||
{
|
||||
RDI_FilePathNode *nodes;
|
||||
RDI_U64 nodes_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_StringBakeResult RDIM_StringBakeResult;
|
||||
struct RDIM_StringBakeResult
|
||||
{
|
||||
RDI_U32 *string_offs;
|
||||
RDI_U64 string_offs_count;
|
||||
RDI_U8 *string_data;
|
||||
RDI_U64 string_data_size;
|
||||
};
|
||||
|
||||
typedef struct RDIM_IndexRunBakeResult RDIM_IndexRunBakeResult;
|
||||
struct RDIM_IndexRunBakeResult
|
||||
{
|
||||
RDI_U32 *idx_runs;
|
||||
RDI_U64 idx_count;
|
||||
};
|
||||
|
||||
typedef struct RDIM_BakeResults RDIM_BakeResults;
|
||||
struct RDIM_BakeResults
|
||||
{
|
||||
RDIM_TopLevelInfoBakeResult top_level_info;
|
||||
RDIM_BinarySectionBakeResult binary_sections;
|
||||
RDIM_UnitBakeResult units;
|
||||
RDIM_UnitVMapBakeResult unit_vmap;
|
||||
RDIM_SrcFileBakeResult src_files;
|
||||
RDIM_LineTableBakeResult line_tables;
|
||||
RDIM_TypeNodeBakeResult type_nodes;
|
||||
RDIM_UDTBakeResult udts;
|
||||
RDIM_GlobalVariableBakeResult global_variables;
|
||||
RDIM_GlobalVMapBakeResult global_vmap;
|
||||
RDIM_ThreadVariableBakeResult thread_variables;
|
||||
RDIM_ProcedureBakeResult procedures;
|
||||
RDIM_ScopeBakeResult scopes;
|
||||
RDIM_InlineSiteBakeResult inline_sites;
|
||||
RDIM_ScopeVMapBakeResult scope_vmap;
|
||||
RDIM_TopLevelNameMapBakeResult top_level_name_maps;
|
||||
RDIM_NameMapBakeResult name_maps;
|
||||
RDIM_FilePathBakeResult file_paths;
|
||||
RDIM_StringBakeResult strings;
|
||||
RDIM_IndexRunBakeResult idx_runs;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Serialization Types
|
||||
|
||||
typedef struct RDIM_SerializedSection RDIM_SerializedSection;
|
||||
struct RDIM_SerializedSection
|
||||
{
|
||||
void *data;
|
||||
RDI_U64 encoded_size;
|
||||
RDI_U64 unpacked_size;
|
||||
RDI_SectionEncoding encoding;
|
||||
};
|
||||
|
||||
typedef struct RDIM_SerializedSectionBundle RDIM_SerializedSectionBundle;
|
||||
struct RDIM_SerializedSectionBundle
|
||||
{
|
||||
RDIM_SerializedSection sections[RDI_SectionKind_COUNT];
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Helpers
|
||||
|
||||
@@ -1026,8 +1305,9 @@ RDI_PROC RDIM_String8 rdim_str8_copy(RDIM_Arena *arena, RDIM_String8 src);
|
||||
RDI_PROC RDIM_String8 rdim_str8f(RDIM_Arena *arena, char *fmt, ...);
|
||||
RDI_PROC RDIM_String8 rdim_str8fv(RDIM_Arena *arena, char *fmt, va_list args);
|
||||
RDI_PROC RDI_S32 rdim_str8_match(RDIM_String8 a, RDIM_String8 b, RDIM_StringMatchFlags flags);
|
||||
#define rdim_str8_lit(S) rdim_str8((RDI_U8*)(S), sizeof(S) - 1)
|
||||
#define rdim_str8_struct(S) rdim_str8((RDI_U8*)(S), sizeof(*(S)))
|
||||
#define rdim_str8_lit(S) rdim_str8((RDI_U8*)(S), sizeof(S) - 1)
|
||||
#define rdim_str8_struct(S) rdim_str8((RDI_U8*)(S), sizeof(*(S)))
|
||||
#define rdim_str8_struct_array(S, C) rdim_str8((RDI_U8*)(S), sizeof(*(S)) * (C))
|
||||
|
||||
//- rjf: string lists
|
||||
RDI_PROC void rdim_str8_list_push(RDIM_Arena *arena, RDIM_String8List *list, RDIM_String8 string);
|
||||
@@ -1054,13 +1334,20 @@ RDI_PROC RDI_U64 rdim_idx_from_src_file(RDIM_SrcFile *src_file);
|
||||
RDI_PROC void rdim_src_file_chunk_list_concat_in_place(RDIM_SrcFileChunkList *dst, RDIM_SrcFileChunkList *to_push);
|
||||
RDI_PROC void rdim_src_file_push_line_sequence(RDIM_Arena *arena, RDIM_SrcFileChunkList *src_files, RDIM_SrcFile *src_file, RDIM_LineSequence *seq);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Line Info Building
|
||||
|
||||
RDI_PROC RDIM_LineTable *rdim_line_table_chunk_list_push(RDIM_Arena *arena, RDIM_LineTableChunkList *list, RDI_U64 cap);
|
||||
RDI_PROC RDI_U64 rdim_idx_from_line_table(RDIM_LineTable *line_table);
|
||||
RDI_PROC void rdim_line_table_chunk_list_concat_in_place(RDIM_LineTableChunkList *dst, RDIM_LineTableChunkList *to_push);
|
||||
RDI_PROC RDIM_LineSequence *rdim_line_table_push_sequence(RDIM_Arena *arena, RDIM_LineTableChunkList *line_tables, RDIM_LineTable *line_table, RDIM_SrcFile *src_file, RDI_U64 *voffs, RDI_U32 *line_nums, RDI_U16 *col_nums, RDI_U64 line_count);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Unit Info Building
|
||||
|
||||
RDI_PROC RDIM_Unit *rdim_unit_chunk_list_push(RDIM_Arena *arena, RDIM_UnitChunkList *list, RDI_U64 cap);
|
||||
RDI_PROC RDI_U64 rdim_idx_from_unit(RDIM_Unit *unit);
|
||||
RDI_PROC void rdim_unit_chunk_list_concat_in_place(RDIM_UnitChunkList *dst, RDIM_UnitChunkList *to_push);
|
||||
RDI_PROC RDIM_LineSequence *rdim_line_sequence_list_push(RDIM_Arena *arena, RDIM_LineSequenceList *list);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Type Info & UDT Building
|
||||
@@ -1081,6 +1368,13 @@ RDI_PROC RDIM_Symbol *rdim_symbol_chunk_list_push(RDIM_Arena *arena, RDIM_Symbol
|
||||
RDI_PROC RDI_U64 rdim_idx_from_symbol(RDIM_Symbol *symbol);
|
||||
RDI_PROC void rdim_symbol_chunk_list_concat_in_place(RDIM_SymbolChunkList *dst, RDIM_SymbolChunkList *to_push);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Inline Site Info Building
|
||||
|
||||
RDI_PROC RDIM_InlineSite *rdim_inline_site_chunk_list_push(RDIM_Arena *arena, RDIM_InlineSiteChunkList *list, RDI_U64 cap);
|
||||
RDI_PROC RDI_U64 rdim_idx_from_inline_site(RDIM_InlineSite *inline_site);
|
||||
RDI_PROC void rdim_inline_site_chunk_list_concat_in_place(RDIM_InlineSiteChunkList *dst, RDIM_InlineSiteChunkList *to_push);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Scope Info Building
|
||||
|
||||
@@ -1107,12 +1401,6 @@ RDI_PROC RDIM_Location *rdim_push_location_val_reg(RDIM_Arena *arena, RDI_U8 reg
|
||||
//- rjf: location sets
|
||||
RDI_PROC void rdim_location_set_push_case(RDIM_Arena *arena, RDIM_ScopeChunkList *scopes, RDIM_LocationSet *locset, RDIM_Rng1U64 voff_range, RDIM_Location *location);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Baking Helpers] Baked File Layout Calculations
|
||||
|
||||
RDI_PROC RDI_U64 rdim_bake_section_count_from_params(RDIM_BakeParams *params);
|
||||
RDI_PROC RDI_U64 rdim_bake_section_idx_from_params_tag_idx(RDIM_BakeParams *params, RDI_DataSectionTag tag, RDI_U64 idx);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Baking Helpers] Baked VMap Building
|
||||
|
||||
@@ -1134,7 +1422,7 @@ RDI_PROC RDIM_BakeStringMapBaseIndices rdim_bake_string_map_base_indices_from_ma
|
||||
|
||||
//- rjf: finalized bake string map
|
||||
RDI_PROC RDIM_BakeStringMapTight rdim_bake_string_map_tight_from_loose(RDIM_Arena *arena, RDIM_BakeStringMapTopology *map_topology, RDIM_BakeStringMapBaseIndices *map_base_indices, RDIM_BakeStringMapLoose *map);
|
||||
RDI_PROC RDI_U64 rdim_bake_idx_from_string(RDIM_BakeStringMapTight *map, RDIM_String8 string);
|
||||
RDI_PROC RDI_U32 rdim_bake_idx_from_string(RDIM_BakeStringMapTight *map, RDIM_String8 string);
|
||||
|
||||
//- rjf: bake idx run map reading/writing
|
||||
RDI_PROC RDI_U64 rdim_hash_from_idx_run(RDI_U32 *idx_run, RDI_U32 count);
|
||||
@@ -1153,7 +1441,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_SectionKind tag, RDI_U64 tag_idx);
|
||||
RDI_PROC void rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst, RDIM_BakeSectionList *to_push);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1190,64 +1478,42 @@ RDI_PROC RDIM_BakeIdxRunMap *rdim_bake_idx_run_map_from_params(RDIM_Arena *arena
|
||||
RDI_PROC RDIM_BakePathTree *rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Baking] Build Artifacts -> Data Section Lists
|
||||
//~ rjf: [Baking] Build Artifacts -> Baked Versions
|
||||
|
||||
//- rjf: top-level info
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
//- rjf: partial/joinable baking functions
|
||||
RDI_PROC RDIM_NameMapBakeResult rdim_bake_name_map(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeNameMap *src);
|
||||
|
||||
//- rjf: binary sections
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
//- rjf: partial bakes -> final bake functions
|
||||
RDI_PROC RDIM_NameMapBakeResult rdim_name_map_bake_results_combine(RDIM_Arena *arena, RDIM_NameMapBakeResult *results, RDI_U64 results_count);
|
||||
|
||||
//- rjf: units
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_section_list_from_unit(RDIM_Arena *arena, RDIM_Unit *unit);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: unit vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_unit_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: source files
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: type nodes
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: UDTs
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: global variables
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: global vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: thread variables
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: procedures
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: scopes
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: scope vmap
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
|
||||
|
||||
//- rjf: name maps
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT]);
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDI_NameMapKind k, RDIM_BakeNameMap *map);
|
||||
|
||||
//- rjf: file paths
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree);
|
||||
|
||||
//- rjf: strings
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings);
|
||||
|
||||
//- rjf: index runs
|
||||
RDI_PROC RDIM_BakeSectionList rdim_bake_idx_run_section_list_from_idx_run_map(RDIM_Arena *arena, RDIM_BakeIdxRunMap *idx_runs);
|
||||
//- rjf: independent (top-level, global) baking functions
|
||||
RDI_PROC RDIM_TopLevelInfoBakeResult rdim_bake_top_level_info(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_TopLevelInfo *src);
|
||||
RDI_PROC RDIM_BinarySectionBakeResult rdim_bake_binary_sections(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BinarySectionList *src);
|
||||
RDI_PROC RDIM_UnitBakeResult rdim_bake_units(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree, RDIM_UnitChunkList *src);
|
||||
RDI_PROC RDIM_UnitVMapBakeResult rdim_bake_unit_vmap(RDIM_Arena *arena, RDIM_UnitChunkList *units);
|
||||
RDI_PROC RDIM_SrcFileBakeResult rdim_bake_src_files(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree, RDIM_SrcFileChunkList *src);
|
||||
RDI_PROC RDIM_LineTableBakeResult rdim_bake_line_tables(RDIM_Arena *arena, RDIM_LineTableChunkList *src);
|
||||
RDI_PROC RDIM_TypeNodeBakeResult rdim_bake_types(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_TypeChunkList *src);
|
||||
RDI_PROC RDIM_UDTBakeResult rdim_bake_udts(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_UDTChunkList *src);
|
||||
RDI_PROC RDIM_GlobalVariableBakeResult rdim_bake_global_variables(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_SymbolChunkList *src);
|
||||
RDI_PROC RDIM_GlobalVMapBakeResult rdim_bake_global_vmap(RDIM_Arena *arena, RDIM_SymbolChunkList *src);
|
||||
RDI_PROC RDIM_ThreadVariableBakeResult rdim_bake_thread_variables(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_SymbolChunkList *src);
|
||||
RDI_PROC RDIM_ProcedureBakeResult rdim_bake_procedures(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_SymbolChunkList *src);
|
||||
RDI_PROC RDIM_ScopeBakeResult rdim_bake_scopes(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_ScopeChunkList *src);
|
||||
RDI_PROC RDIM_ScopeVMapBakeResult rdim_bake_scope_vmap(RDIM_Arena *arena, RDIM_ScopeChunkList *src);
|
||||
RDI_PROC RDIM_InlineSiteBakeResult rdim_bake_inline_sites(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_InlineSiteChunkList *src);
|
||||
RDI_PROC RDIM_TopLevelNameMapBakeResult rdim_bake_name_maps_top_level(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT]);
|
||||
RDI_PROC RDIM_FilePathBakeResult rdim_bake_file_paths(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings, RDIM_BakePathTree *path_tree);
|
||||
RDI_PROC RDIM_StringBakeResult rdim_bake_strings(RDIM_Arena *arena, RDIM_BakeStringMapTight *strings);
|
||||
RDI_PROC RDIM_IndexRunBakeResult rdim_bake_index_runs(RDIM_Arena *arena, RDIM_BakeIdxRunMap *idx_runs);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Serializing] Baked Data Section List -> Serialized Binary Strings
|
||||
//~ rjf: [Serializing] Bake Results -> String Blobs
|
||||
|
||||
RDI_PROC RDIM_String8List rdim_serialized_strings_from_params_bake_section_list(RDIM_Arena *arena, RDIM_BakeParams *params, RDIM_BakeSectionList *sections);
|
||||
RDI_PROC RDIM_SerializedSection rdim_serialized_section_make_unpacked(void *data, RDI_U64 size);
|
||||
#define rdim_serialized_section_make_unpacked_struct(ptr) rdim_serialized_section_make_unpacked((ptr), sizeof(*(ptr)))
|
||||
#define rdim_serialized_section_make_unpacked_array(ptr, count) rdim_serialized_section_make_unpacked((ptr), sizeof(*(ptr))*(count))
|
||||
RDI_PROC RDIM_SerializedSectionBundle rdim_serialized_section_bundle_from_bake_results(RDIM_BakeResults *results);
|
||||
RDI_PROC RDIM_String8List rdim_file_blobs_from_section_bundle(RDIM_Arena *arena, RDIM_SerializedSectionBundle *bundle);
|
||||
|
||||
#endif // RADDBGI_MAKE_H
|
||||
#endif // RDI_MAKE_H
|
||||
@@ -137,7 +137,7 @@ mg_escaped_from_str8(Arena *arena, String8 string)
|
||||
U64 start = 0;
|
||||
for(U64 idx = 0; idx <= string.size; idx += 1)
|
||||
{
|
||||
if(idx == string.size || string.str[idx] == '\\')
|
||||
if(idx == string.size || string.str[idx] == '\\' || string.str[idx] == '\r')
|
||||
{
|
||||
String8 str = str8_substr(string, r1u64(start, idx));
|
||||
if(str.size != 0)
|
||||
@@ -1026,7 +1026,12 @@ mg_string_list_from_table_gen(Arena *arena, MG_Map grid_name_map, MG_Map grid_co
|
||||
{
|
||||
String8List result = {0};
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
for(MD_EachNode(strexpr_node, gen->first))
|
||||
if(md_node_is_nil(gen->first) && gen->string.size != 0)
|
||||
{
|
||||
str8_list_push(arena, &result, gen->string);
|
||||
str8_list_push(arena, &result, str8_lit("\n"));
|
||||
}
|
||||
else for(MD_EachNode(strexpr_node, gen->first))
|
||||
{
|
||||
// rjf: build task list
|
||||
MG_TableExpandTask *first_task = 0;
|
||||
|
||||
@@ -212,14 +212,22 @@ typedef struct MG_Layer MG_Layer;
|
||||
struct MG_Layer
|
||||
{
|
||||
String8 key;
|
||||
B32 is_library;
|
||||
String8 gen_folder_name;
|
||||
String8 h_name_override;
|
||||
String8 c_name_override;
|
||||
String8List enums;
|
||||
String8List structs;
|
||||
String8List h_functions;
|
||||
String8List h_tables;
|
||||
String8List h_catchall;
|
||||
String8List h_header;
|
||||
String8List h_footer;
|
||||
String8List c_functions;
|
||||
String8List c_tables;
|
||||
String8List c_catchall;
|
||||
String8List c_header;
|
||||
String8List c_footer;
|
||||
};
|
||||
|
||||
typedef struct MG_LayerNode MG_LayerNode;
|
||||
|
||||
@@ -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
|
||||
|
||||
+185
-20
@@ -149,6 +149,74 @@ int main(int argument_count, char **arguments)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: gather layer options
|
||||
//
|
||||
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
|
||||
{
|
||||
MD_Node *file = n->v.root;
|
||||
String8 layer_key = mg_layer_key_from_path(file->string);
|
||||
MG_Layer *layer = mg_layer_from_key(layer_key);
|
||||
for(MD_EachNode(node, file->first))
|
||||
{
|
||||
if(md_node_has_tag(node, str8_lit("option"), 0))
|
||||
{
|
||||
if(str8_match(node->string, str8_lit("library"), 0))
|
||||
{
|
||||
layer->is_library = 1;
|
||||
}
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("gen_folder"), 0))
|
||||
{
|
||||
layer->gen_folder_name = node->string;
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("h_name"), 0))
|
||||
{
|
||||
layer->h_name_override = node->string;
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("c_name"), 0))
|
||||
{
|
||||
layer->c_name_override = node->string;
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("h_header"), 0))
|
||||
{
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(mg_arena, &layer->h_header, n->string);
|
||||
str8_list_push(mg_arena, &layer->h_header, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("h_footer"), 0))
|
||||
{
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(mg_arena, &layer->h_footer, n->string);
|
||||
str8_list_push(mg_arena, &layer->h_footer, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("c_header"), 0))
|
||||
{
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(mg_arena, &layer->c_header, n->string);
|
||||
str8_list_push(mg_arena, &layer->c_header, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
if(md_node_has_tag(node, str8_lit("c_footer"), 0))
|
||||
{
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
str8_list_push(mg_arena, &layer->c_footer, n->string);
|
||||
str8_list_push(mg_arena, &layer->c_footer, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: generate enums
|
||||
//
|
||||
@@ -160,36 +228,67 @@ int main(int argument_count, char **arguments)
|
||||
MD_Node *tag = md_tag_from_string(node, str8_lit("enum"), 0);
|
||||
if(!md_node_is_nil(tag))
|
||||
{
|
||||
String8 enum_name = node->string;
|
||||
String8 enum_member_prefix = enum_name;
|
||||
if(str8_match(str8_postfix(enum_name, 5), str8_lit("Flags"), 0))
|
||||
{
|
||||
enum_member_prefix = str8_chop(enum_name, 1);
|
||||
}
|
||||
String8 enum_base_type_name = tag->first->string;
|
||||
String8 layer_key = mg_layer_key_from_path(file->string);
|
||||
MG_Layer *layer = mg_layer_from_key(layer_key);
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
if(enum_base_type_name.size == 0)
|
||||
{
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef enum %S\n{\n", node->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef enum %S\n{\n", enum_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef %S %S;\n", enum_base_type_name, node->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef enum %SEnum\n{\n", node->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef %S %S;\n", enum_base_type_name, enum_name);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "typedef enum %SEnum\n{\n", enum_name);
|
||||
}
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 escaped = mg_escaped_from_str8(mg_arena, n->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "%S_%S,\n", node->string, escaped);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "%S_%S,\n", enum_member_prefix, escaped);
|
||||
}
|
||||
if(enum_base_type_name.size == 0)
|
||||
{
|
||||
str8_list_pushf(mg_arena, &layer->enums, "} %S;\n\n", node->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "} %S;\n\n", enum_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
str8_list_pushf(mg_arena, &layer->enums, "} %SEnum;\n\n", node->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "} %SEnum;\n\n", enum_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: generate xlists
|
||||
//
|
||||
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
|
||||
{
|
||||
MD_Node *file = n->v.root;
|
||||
for(MD_EachNode(node, file->first))
|
||||
{
|
||||
MD_Node *tag = md_tag_from_string(node, str8_lit("xlist"), 0);
|
||||
if(!md_node_is_nil(tag))
|
||||
{
|
||||
String8 layer_key = mg_layer_key_from_path(file->string);
|
||||
MG_Layer *layer = mg_layer_from_key(layer_key);
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "#define %S \\\n", node->string);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 escaped = mg_escaped_from_str8(mg_arena, n->string);
|
||||
str8_list_pushf(mg_arena, &layer->enums, "X(%S)\\\n", escaped);
|
||||
}
|
||||
str8_list_push(mg_arena, &layer->enums, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: generate structs
|
||||
//
|
||||
@@ -301,7 +400,8 @@ int main(int argument_count, char **arguments)
|
||||
String8List gen_strings = mg_string_list_from_table_gen(mg_arena, table_grid_map, table_col_map, str8_lit(""), node);
|
||||
for(String8Node *n = gen_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 escaped = mg_escaped_from_str8(mg_arena, n->string);
|
||||
String8 trimmed = str8_skip_chop_whitespace(n->string);
|
||||
String8 escaped = mg_escaped_from_str8(mg_arena, trimmed);
|
||||
str8_list_push(mg_arena, out, escaped);
|
||||
str8_list_push(mg_arena, out, str8_lit("\n"));
|
||||
}
|
||||
@@ -415,7 +515,17 @@ int main(int argument_count, char **arguments)
|
||||
for(MG_LayerNode *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
MG_Layer *layer = &n->v;
|
||||
String8 layer_generated_folder = push_str8f(mg_arena, "%S/%S/generated", code_dir_path, layer->key);
|
||||
String8 layer_generated_folder = {0};
|
||||
if(layer->gen_folder_name.size != 0)
|
||||
{
|
||||
String8 gen_folder = layer->gen_folder_name;
|
||||
layer_generated_folder = push_str8f(mg_arena, "%S/%S", code_dir_path, gen_folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
String8 gen_folder = str8_lit("generated");
|
||||
layer_generated_folder = push_str8f(mg_arena, "%S/%S/%S", code_dir_path, layer->key, gen_folder);
|
||||
}
|
||||
if(os_make_directory(layer_generated_folder))
|
||||
{
|
||||
String8List layer_key_parts = str8_split_path(mg_arena, layer->key);
|
||||
@@ -425,13 +535,28 @@ int main(int argument_count, char **arguments)
|
||||
String8 layer_key_filename_upper = upper_from_str8(mg_arena, layer_key_filename);
|
||||
String8 h_path = push_str8f(mg_arena, "%S/%S.meta.h", layer_generated_folder, layer_key_filename);
|
||||
String8 c_path = push_str8f(mg_arena, "%S/%S.meta.c", layer_generated_folder, layer_key_filename);
|
||||
if(layer->h_name_override.size != 0)
|
||||
{
|
||||
h_path = push_str8f(mg_arena, "%S/%S", layer_generated_folder, str8_skip_last_slash(layer->h_name_override));
|
||||
}
|
||||
if(layer->c_name_override.size != 0)
|
||||
{
|
||||
c_path = push_str8f(mg_arena, "%S/%S", layer_generated_folder, str8_skip_last_slash(layer->c_name_override));
|
||||
}
|
||||
{
|
||||
FILE *h = fopen((char *)h_path.str, "w");
|
||||
fprintf(h, "// Copyright (c) 2024 Epic Games Tools\n");
|
||||
fprintf(h, "// Licensed under the MIT license (https://opensource.org/license/mit/)\n\n");
|
||||
fprintf(h, "//- GENERATED CODE\n\n");
|
||||
fprintf(h, "#ifndef %.*s_META_H\n", str8_varg(layer_key_filename_upper));
|
||||
fprintf(h, "#define %.*s_META_H\n\n", str8_varg(layer_key_filename_upper));
|
||||
if(layer->h_header.first == 0)
|
||||
{
|
||||
fprintf(h, "//- GENERATED CODE\n\n");
|
||||
fprintf(h, "#ifndef %.*s_META_H\n", str8_varg(layer_key_filename_upper));
|
||||
fprintf(h, "#define %.*s_META_H\n\n", str8_varg(layer_key_filename_upper));
|
||||
}
|
||||
else for(String8Node *n = layer->h_header.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, h);
|
||||
}
|
||||
for(String8Node *n = layer->enums.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, h);
|
||||
@@ -448,34 +573,74 @@ int main(int argument_count, char **arguments)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, h);
|
||||
}
|
||||
fprintf(h, "C_LINKAGE_BEGIN\n");
|
||||
for(String8Node *n = layer->h_tables.first; n != 0; n = n->next)
|
||||
if(layer->h_tables.first != 0)
|
||||
{
|
||||
if(!layer->is_library)
|
||||
{
|
||||
fprintf(h, "C_LINKAGE_BEGIN\n");
|
||||
}
|
||||
for(String8Node *n = layer->h_tables.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, h);
|
||||
}
|
||||
fprintf(h, "\n");
|
||||
if(!layer->is_library)
|
||||
{
|
||||
fprintf(h, "C_LINKAGE_END\n\n");
|
||||
}
|
||||
}
|
||||
if(layer->h_footer.first == 0)
|
||||
{
|
||||
fprintf(h, "#endif // %.*s_META_H\n", str8_varg(layer_key_filename_upper));
|
||||
}
|
||||
else for(String8Node *n = layer->h_footer.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, h);
|
||||
}
|
||||
fprintf(h, "C_LINKAGE_END\n\n");
|
||||
fprintf(h, "#endif // %.*s_META_H\n", str8_varg(layer_key_filename_upper));
|
||||
fclose(h);
|
||||
}
|
||||
{
|
||||
FILE *c = fopen((char *)c_path.str, "w");
|
||||
fprintf(c, "// Copyright (c) 2024 Epic Games Tools\n");
|
||||
fprintf(c, "// Licensed under the MIT license (https://opensource.org/license/mit/)\n\n");
|
||||
fprintf(c, "//- GENERATED CODE\n\n");
|
||||
if(layer->c_header.first == 0)
|
||||
{
|
||||
fprintf(c, "//- GENERATED CODE\n\n");
|
||||
}
|
||||
else for(String8Node *n = layer->c_header.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
}
|
||||
for(String8Node *n = layer->c_catchall.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
}
|
||||
if(layer->c_tables.first != 0)
|
||||
{
|
||||
if(!layer->is_library)
|
||||
{
|
||||
fprintf(c, "C_LINKAGE_BEGIN\n");
|
||||
}
|
||||
for(String8Node *n = layer->c_tables.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
}
|
||||
if(!layer->is_library)
|
||||
{
|
||||
fprintf(c, "C_LINKAGE_END\n\n");
|
||||
}
|
||||
}
|
||||
for(String8Node *n = layer->c_functions.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
}
|
||||
fprintf(c, "C_LINKAGE_BEGIN\n");
|
||||
for(String8Node *n = layer->c_tables.first; n != 0; n = n->next)
|
||||
if(layer->c_footer.first != 0)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
for(String8Node *n = layer->c_footer.first; n != 0; n = n->next)
|
||||
{
|
||||
fwrite(n->string.str, n->string.size, 1, c);
|
||||
}
|
||||
}
|
||||
fprintf(c, "C_LINKAGE_END\n\n");
|
||||
fclose(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -1511,6 +1514,34 @@ extern "C"{
|
||||
#include "mule_c.h"
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Inline Line Info Tests
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define FORCE_INLINE __forceinline
|
||||
#elif defined(__clang__)
|
||||
# define FORCE_INLINE __attribute__((always_inline))
|
||||
#else
|
||||
# error need force inline for this compiler
|
||||
#endif
|
||||
|
||||
static FORCE_INLINE void
|
||||
basic_inlinee(int inlinee_param_x, int inlinee_param_y, int inlinee_param_z)
|
||||
{
|
||||
OutputDebugStringA("A\n");
|
||||
OutputDebugStringA("B\n");
|
||||
OutputDebugStringA("C\n");
|
||||
OutputDebugStringA("D\n");
|
||||
}
|
||||
|
||||
static void
|
||||
basic_inline_tests(void)
|
||||
{
|
||||
OutputDebugStringA("{\n");
|
||||
basic_inlinee(12, 34, 56);
|
||||
OutputDebugStringA("}\n");
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Fancy Visualization Eval Tests
|
||||
|
||||
@@ -2266,6 +2297,14 @@ debug_string_tests(void)
|
||||
{
|
||||
OutputDebugStringA("Hello, World!\n");
|
||||
}
|
||||
char message[65409+1];
|
||||
memset(&message[0], '=', sizeof(message));
|
||||
for(int i = 1; i < sizeof(message); i += 128)
|
||||
{
|
||||
message[i] = '\n';
|
||||
}
|
||||
message[sizeof(message) - 1] = 0;
|
||||
OutputDebugStringA(message);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2277,6 +2316,10 @@ debug_string_tests(void)
|
||||
static void
|
||||
interrupt_stepping_tests(void)
|
||||
{
|
||||
__debugbreak();
|
||||
__debugbreak();
|
||||
__debugbreak();
|
||||
__debugbreak();
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
if(i == 999)
|
||||
@@ -2294,6 +2337,19 @@ interrupt_stepping_tests(void)
|
||||
int x = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: JIT Stepping Tests
|
||||
|
||||
static void
|
||||
jit_stepping_tests(void)
|
||||
{
|
||||
OutputDebugString("A\n");
|
||||
VOID *code = VirtualAlloc(0, 0x1000, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
*((uint32_t*)code) = 0xC39090CC;
|
||||
((void (__fastcall *)()) code)();
|
||||
OutputDebugString("B\n");
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
// NOTE(allen): Exception Stepping
|
||||
|
||||
@@ -2575,6 +2631,8 @@ mule_main(int argc, char** argv){
|
||||
|
||||
alloca_stepping_tests();
|
||||
|
||||
basic_inline_tests();
|
||||
|
||||
inline_stepping_tests();
|
||||
|
||||
overloaded_line_stepping_tests();
|
||||
@@ -2589,6 +2647,8 @@ mule_main(int argc, char** argv){
|
||||
|
||||
debug_string_tests();
|
||||
|
||||
jit_stepping_tests();
|
||||
|
||||
interrupt_stepping_tests();
|
||||
|
||||
exception_stepping_tests();
|
||||
|
||||
@@ -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, ¤t_filetime);
|
||||
CloseHandle(current_exe_file);
|
||||
if(it != 0 && CompareFileTime(&last_filetime, ¤t_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;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
__declspec(dllexport) int
|
||||
loop_iteration(int it)
|
||||
{
|
||||
//return 111;
|
||||
#if 1
|
||||
int sum = 0;
|
||||
for(int i = 0; i < 1000; i += 1)
|
||||
{
|
||||
sum += it*i;
|
||||
}
|
||||
return sum;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void
|
||||
mtx_init(void)
|
||||
{
|
||||
Arena *arena = arena_alloc();
|
||||
mtx_shared = push_array(arena, MTX_Shared, 1);
|
||||
mtx_shared->arena = arena;
|
||||
mtx_shared->slots_count = 256;
|
||||
mtx_shared->stripes_count = Min(mtx_shared->slots_count, os_logical_core_count());
|
||||
mtx_shared->slots = push_array(arena, MTX_Slot, mtx_shared->slots_count);
|
||||
mtx_shared->stripes = push_array(arena, MTX_Stripe, mtx_shared->stripes_count);
|
||||
for(U64 idx = 0; idx < mtx_shared->stripes_count; idx += 1)
|
||||
{
|
||||
mtx_shared->stripes[idx].arena = arena_alloc();
|
||||
mtx_shared->stripes[idx].rw_mutex = os_rw_mutex_alloc();
|
||||
}
|
||||
mtx_shared->mut_threads_count = Min(os_logical_core_count(), 4);
|
||||
mtx_shared->mut_threads = push_array(arena, MTX_MutThread, mtx_shared->mut_threads_count);
|
||||
for(U64 idx = 0; idx < mtx_shared->mut_threads_count; idx += 1)
|
||||
{
|
||||
mtx_shared->mut_threads[idx].ring_size = KB(64);
|
||||
mtx_shared->mut_threads[idx].ring_base = push_array_no_zero(arena, U8, mtx_shared->mut_threads[idx].ring_size);
|
||||
mtx_shared->mut_threads[idx].cv = os_condition_variable_alloc();
|
||||
mtx_shared->mut_threads[idx].mutex = os_mutex_alloc();
|
||||
mtx_shared->mut_threads[idx].thread = os_launch_thread(mtx_mut_thread__entry_point, &mtx_shared->mut_threads[idx], 0);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Buffer Operations
|
||||
|
||||
internal void
|
||||
mtx_push_op(U128 buffer_key, MTX_Op op)
|
||||
{
|
||||
MTX_MutThread *thread = &mtx_shared->mut_threads[buffer_key.u64[1]%mtx_shared->mut_threads_count];
|
||||
mtx_enqueue_op(thread, buffer_key, op);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Threads
|
||||
|
||||
internal void
|
||||
mtx_enqueue_op(MTX_MutThread *thread, U128 buffer_key, MTX_Op op)
|
||||
{
|
||||
// TODO(rjf): if op.replace is too big, need to split into multiple edits
|
||||
OS_MutexScope(thread->mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = thread->ring_write_pos - thread->ring_read_pos;
|
||||
U64 available_size = thread->ring_size - unconsumed_size;
|
||||
if(available_size >= sizeof(buffer_key) + sizeof(op.range) + sizeof(op.replace.size) + op.replace.size)
|
||||
{
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &buffer_key);
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &op.range);
|
||||
thread->ring_write_pos += ring_write_struct(thread->ring_base, thread->ring_size, thread->ring_write_pos, &op.replace.size);
|
||||
thread->ring_write_pos += ring_write(thread->ring_base, thread->ring_size, thread->ring_write_pos, op.replace.str, op.replace.size);
|
||||
thread->ring_write_pos += 7;
|
||||
thread->ring_write_pos -= thread->ring_write_pos%8;
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(thread->cv, thread->mutex, max_U64);
|
||||
}
|
||||
os_condition_variable_broadcast(thread->cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
mtx_dequeue_op(Arena *arena, MTX_MutThread *thread, U128 *buffer_key_out, MTX_Op *op_out)
|
||||
{
|
||||
OS_MutexScope(thread->mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = thread->ring_write_pos - thread->ring_read_pos;
|
||||
if(unconsumed_size >= sizeof(*buffer_key_out) + sizeof(op_out->range) + sizeof(op_out->replace.size))
|
||||
{
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, buffer_key_out);
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, &op_out->range);
|
||||
thread->ring_read_pos += ring_read_struct(thread->ring_base, thread->ring_size, thread->ring_read_pos, &op_out->replace.size);
|
||||
op_out->replace.str = push_array_no_zero(arena, U8, op_out->replace.size);
|
||||
thread->ring_read_pos += ring_read(thread->ring_base, thread->ring_size, thread->ring_read_pos, op_out->replace.str, op_out->replace.size);
|
||||
thread->ring_read_pos += 7;
|
||||
thread->ring_read_pos -= thread->ring_read_pos%8;
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(thread->cv, thread->mutex, max_U64);
|
||||
}
|
||||
os_condition_variable_broadcast(thread->cv);
|
||||
}
|
||||
|
||||
internal void
|
||||
mtx_mut_thread__entry_point(void *p)
|
||||
{
|
||||
MTX_MutThread *mut_thread = (MTX_MutThread *)p;
|
||||
ThreadNameF("[mtx] mut thread #%I64u", (U64)(mut_thread - mtx_shared->mut_threads));
|
||||
for(;;)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
|
||||
//- rjf: get next op
|
||||
U128 buffer_key = {0};
|
||||
MTX_Op op = {0};
|
||||
mtx_dequeue_op(scratch.arena, mut_thread, &buffer_key, &op);
|
||||
|
||||
//- rjf: get buffer's current data
|
||||
U128 hash = hs_hash_from_key(buffer_key, 0);
|
||||
String8 data = hs_data_from_hash(hs_scope, hash);
|
||||
|
||||
//- rjf: clamp op by data
|
||||
op.range.min = Min(op.range.min, data.size);
|
||||
op.range.max = Min(op.range.max, data.size);
|
||||
|
||||
//- rjf: construct new buffer
|
||||
if(op.range.max != op.range.min || op.replace.size != 0)
|
||||
{
|
||||
U64 new_data_size = data.size + op.replace.size - dim_1u64(op.range);
|
||||
Arena *arena = arena_alloc__sized(new_data_size + ARENA_HEADER_SIZE, new_data_size + ARENA_HEADER_SIZE);
|
||||
U8 *new_data_base = push_array_no_zero(arena, U8, new_data_size);
|
||||
String8 pre_replace_data = str8_substr(data, r1u64(0, op.range.min));
|
||||
String8 post_replace_data = str8_substr(data, r1u64(op.range.max, data.size));
|
||||
if(pre_replace_data.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+0, pre_replace_data.str, pre_replace_data.size);
|
||||
}
|
||||
if(op.replace.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+pre_replace_data.size, op.replace.str, op.replace.size);
|
||||
}
|
||||
if(post_replace_data.size != 0)
|
||||
{
|
||||
MemoryCopy(new_data_base+pre_replace_data.size+op.replace.size, post_replace_data.str, post_replace_data.size);
|
||||
}
|
||||
String8 new_data = str8(new_data_base, new_data_size);
|
||||
hs_submit_data(buffer_key, &arena, new_data);
|
||||
}
|
||||
|
||||
hs_scope_close(hs_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef MUTABLE_TEXT_H
|
||||
#define MUTABLE_TEXT_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Types
|
||||
|
||||
typedef struct MTX_Node MTX_Node;
|
||||
struct MTX_Node
|
||||
{
|
||||
MTX_Node *next;
|
||||
MTX_Node *prev;
|
||||
U128 key;
|
||||
};
|
||||
|
||||
typedef struct MTX_Slot MTX_Slot;
|
||||
struct MTX_Slot
|
||||
{
|
||||
MTX_Node *first;
|
||||
MTX_Node *last;
|
||||
};
|
||||
|
||||
typedef struct MTX_Stripe MTX_Stripe;
|
||||
struct MTX_Stripe
|
||||
{
|
||||
Arena *arena;
|
||||
MTX_Node *free_node;
|
||||
OS_Handle rw_mutex;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Thread Types
|
||||
|
||||
typedef struct MTX_Op MTX_Op;
|
||||
struct MTX_Op
|
||||
{
|
||||
Rng1U64 range;
|
||||
String8 replace;
|
||||
};
|
||||
|
||||
typedef struct MTX_MutThread MTX_MutThread;
|
||||
struct MTX_MutThread
|
||||
{
|
||||
U64 ring_size;
|
||||
U8 *ring_base;
|
||||
U64 ring_read_pos;
|
||||
U64 ring_write_pos;
|
||||
OS_Handle cv;
|
||||
OS_Handle mutex;
|
||||
OS_Handle thread;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Shared State
|
||||
|
||||
typedef struct MTX_Shared MTX_Shared;
|
||||
struct MTX_Shared
|
||||
{
|
||||
Arena *arena;
|
||||
|
||||
// rjf: buffer cache
|
||||
U64 slots_count;
|
||||
U64 stripes_count;
|
||||
MTX_Slot *slots;
|
||||
MTX_Stripe *stripes;
|
||||
|
||||
// rjf: mut threads
|
||||
U64 mut_threads_count;
|
||||
MTX_MutThread *mut_threads;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global MTX_Shared *mtx_shared = 0;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Layer Initialization
|
||||
|
||||
internal void mtx_init(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Buffer Operations
|
||||
|
||||
internal void mtx_push_op(U128 buffer_key, MTX_Op op);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Mutation Threads
|
||||
|
||||
internal void mtx_enqueue_op(MTX_MutThread *thread, U128 buffer_key, MTX_Op op);
|
||||
internal void mtx_dequeue_op(Arena *arena, MTX_MutThread *thread, U128 *buffer_key_out, MTX_Op *op_out);
|
||||
internal void mtx_mut_thread__entry_point(void *p);
|
||||
|
||||
#endif // MUTABLE_TEXT_H
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user