Commit graph

357 commits

Author SHA1 Message Date
Magnus Norddahl
3fdd22ef91 Merge remote-tracking branch 'gzdoom/master' into big_beautiful_merge 2025-08-06 21:06:53 +02:00
Marcus Minhorst
649ddd7774 Replaced uint with unsigned int 2025-07-19 11:37:24 -03:00
Marcus Minhorst
9b0f5d9b0d Fixes sign-compare warnings 2025-07-18 21:11:50 -03:00
Nikita
45ac7c1d9e
ZScript DAP Debug server (#3009)
* Add STL-standard type traits and functions to TMap to enable for loop iteration

* add third-party range-map library

I have e-mailed the author for clarifcation on the license, will update this when they respond

* vcpkg: Add cppdap and eventpp libraries, update baseline

* DAP implementation

* Add `FileSystem::FileHash()` to get the CRC32 hash

* add `starting_offset` param to `VMDisasm()` for debugger disassembly view

Defaults to `0`, should not change output if it's not set

* Add `VMFrameStack::HasFrames()` to prevent assertions when inspecting in the debugger

* Add `PC` field to VMFrame, ensure that it is updated whenever vm increments/decrements the pc

Does not change alignment, the offsets used in VMFrame still work
We need this for the debugger because we otherwise have no way to get the pc; it was a local in `ExecScriptFunc()`

* `ZCCCompiler::CreateClassTypes()`: ensure SourceLumpName is set for classes derived from non-native classes

* start debug server in d_main, add `vm_debug` cvars and `-debug` CLI arg

* Add documentation for `vm_debug` cvars

* vm_exec: Add debugger hooks for instruction execution events

* c_console: Add debugger hooks for logging events in `PrintString`

* add `.cache/` to gitignore

* vendor cppdap on main @ 6464cd7

Patches:
removed .gitmodules (submodules were thirdparty/json, thirdparty/googletest)
removed thirdparty/googletest, not needed
removed thirdparty/json/docs, thirdparty/json/test, thirdparty/json/benchmarks to prevent massive bloat

* vendor eventpp on master @ 1224dd6

* build: use internal cppdap and eventpp by default

* dap: fix Binary::GetFunctionLineRange()

* fix bug in range_map::find_ranges

* make Binary dap::Source dynamic

* cache source code upon retrieval

* refactor Binary into a class, cleanup PexCache

* fix ending session gracefully

* d_main: Stop debug server in D_Cleanup()

* Fix connecting to debugger when session already started

* cleanup unused stuff in ZScriptDebugger

* always send TerminateEvents on disconnect if initialized

* tweak color display

* Don't cache disassembly lines when scanning scripts

* Cache nodes when getting runtime state

* WIP display locals

* Fix display of static arrays

* Ensure names display in proper order

* dap: Fix struct locals display, add args display

* Support `start` parameter

* Support `filter` parameter

* remove struct unbound native data display

Practically useless for debugging zscript and didn't work properly anyway

* d_main: fix vm_jit and vm_jit not being disabled soon enough

* support breaking on abort exceptions

* dap: refactor game event emitter functions into seperate header

* dap: show native functions on stack

* dap: Remove "Native" from exception handling, simplify exception event emit

* dap: add instruction breakpoints

* dap: fix display of locals not in scope yet

* dap: Make disassembly view display invalid instructions for non-code addresses

* dap: remove dot initializers

* dap: fix local structs in scope

* dap: don't parse the non-used options in the launch/attach requests

* dap: fix local struct view

* dap: Fix displaying objects that aren't their actual types

* dap: Fix action and state handling

* dap: stack display view

* dap: fix object display view

* d_dehacked: set qualified name in addition to the printable name

* dap: fix displaying breakpoint errors when script isn't loaded

* dap: remove debug print

* dap: Display parameter names

* dap: Turn down verbosity of logging

* dap: fix disassembly view

* dap: fix performance problems with arrays

* c_console: emit event only if not PRINT_NODAPEVENT

* dap: improve logging

* dap: update upstream cppdap library to fix deadlocks on no bind

* dap: Fix ending session on client socket closed

* dap: prevent DebugServer.h from pulling in `dap` and `ZScriptDebugger.h`

* dap: fix pause event not being emitted on pause

* dap: remove eventpp emitters, way too slow

* Remove eventpp dependency

* dap: Display correct register names

* dap: Show special inits in registers

* dap: Add stack offset to VMLocalVariable

* dap: fix display of static arrays and local variables on stack vs. registers

* dap: fix displaying function pointers

* dap: tweak color display

* dap: fix scalar display < 4

* dap: add Globals display to debugger

* dap: unify methods to get vmvalue

* dap: rename free method to freeValue to avoid running afoul of macro defs

* fix windows builds

* fix compile on linux

* cleanup

* Fix display of function breakpoints

* dap: Don't send back binary files

* dap: include sbarinfo in script types (no debug support for anything but zscript yet, this is just for returning source info)

* dap: don't show ending session message unless initialized

* fix erroneous commit

* dap: handle evaluate requests

* Fix getting bitfield values

* Add CVars Scope and evaluation

* add running console commands from repl

* dap: disable commands via repl for now

* fix loading functions DECORATE scripts

* Add source information to Dehacked VM functions, add debugging support

* dap: cleanup

* fix resolving archive paths

* don't send source back on native stack frames

* handle `modules` request

* cleanup

* allow evaluating cvars on hover

* fix oob bpinfos

* fix restarting the game blowing out the debug server

* dap: process input events while paused to prevent deadlocks

* fix getting local state

* dap: fix LocalState alignment

* dap: fix DumpStateHelper

* update cppdap protocol version to 1.68.0

* remove cppdap from vcpkg deps

We can't use the upstream version anyway because the maintainers are not merging our patches

* dap: make named variable nodes derive from the same class

* dap: make cvar scope available in native stack frames

* handle local variables with conflicting names

* add I_GetWindowEvent() to win32 to only process window events when debugging is paused

* dap: fix evaluate

* dap: fix display of `out` variables
2025-07-18 00:01:18 -03:00
Boondorl
a44632f41b Fixed EFX enum 2025-07-17 03:19:52 -03:00
Boondorl
73445f6f6a Fixed arithmetic state jumps going out-of-bounds 2025-07-17 03:19:52 -03:00
Ricardo Luís Vaz Silva
99ffd8727b rewrite array codegen for field access
fixes major codegen bug
2025-07-17 03:19:12 -03:00
Ricardo Luís Vaz Silva
f4eebd1ced CallVM API, plus multi-return and vector support 2025-06-18 03:52:23 -03:00
DyNaM1Kk
62d258a689 Exported DoubleBindings 2025-06-04 08:48:16 -03:00
Boondorl
e7d0991798 Fixed JIT error with Conjugate/Inverse
These need to be compiler intrinsics since faux types aren't supported with self.
2025-05-30 10:58:10 -03:00
Ricardo Luís Vaz Silva
706d1b6978 Scriptified scoreboard drawing 2025-05-21 10:50:34 -03:00
Ricardo Luís Vaz Silva
9aa44fa13b Merge branch '4.14.2' into gz_merge 2025-05-02 17:15:41 -03:00
Magnus Norddahl
1471eea6e5 Fix compile error and the backtrace (sorta, still sucks) for Linux 2025-04-21 00:01:42 +02:00
Ricardo Luís Vaz Silva
c72888dcf8 fix bad cherry pick 2025-04-09 14:47:17 -03:00
MajorCooke
72f9c0f9b7 Exported:
* GetLumpContainer
* GetContainerName
* GetLumpFullPath
for WADS struct, useful for debugging custom-made parsers and identifying where problems may arise.

All credit goes to Jay for the code.
2025-04-09 14:31:56 -03:00
Magnus Norddahl
34cbe3d8a0 Fix memory leak in mixins 2025-04-09 14:31:56 -03:00
Ricardo Luís Vaz Silva
9d45ee15b7 fix function-pointer cast parsing 2025-04-09 14:29:05 -03:00
Ricardo Luís Vaz Silva
dd92a972f5 rename vm internal structs to make room for compilation-unit-internal structs/classes 2025-04-09 14:26:40 -03:00
Ricardo Luís Vaz Silva
b3333e0a51 Allow >> in parser for aggregate types
makes stuff like Array<Class<X>> parse properly (bit hacky but can't do much better without restructuring the scanner/lexer)
2025-04-09 14:21:36 -03:00
Ricardo Luís Vaz Silva
cb1edbde01 restrict internal structs to gzdoom.pk3 2025-04-09 14:21:36 -03:00
Ricardo Luís Vaz Silva
a0592816cd don't allow backing types of string/array/map/etc to be referenced as actual types 2025-04-09 14:21:36 -03:00
Ricardo Luís Vaz Silva
3a24dfcd2e add better descriptive name for vectors/quats 2025-04-09 14:21:36 -03:00
Ricardo Luís Vaz Silva
96a3e8d405 rework how vector local type restrictions are managed 2025-04-09 14:21:36 -03:00
Ricardo Luís Vaz Silva
8019b56823 fix comment 2025-04-01 17:19:03 -03:00
Ricardo Luís Vaz Silva
d8651420cc fix parameter/return checking 2025-04-01 17:19:03 -03:00
Ricardo Luís Vaz Silva
278bd0fb7d finish implementing VMCallSingle 2025-04-01 17:19:03 -03:00
Ricardo Luís Vaz Silva
1f1c271883 VMCallScript -> VMCallSingle 2025-04-01 17:19:03 -03:00
MajorCooke
6f3032dc54 Exported:
* GetLumpContainer
* GetContainerName
* GetLumpFullPath
for WADS struct, useful for debugging custom-made parsers and identifying where problems may arise.

All credit goes to Jay for the code.
2025-03-30 20:36:13 -03:00
Magnus Norddahl
92cc96a672 Add VMCallScript template for calling ZScript functions with type checking 2025-03-20 00:10:50 -03:00
Magnus Norddahl
b4c3d2331e Fix memory leak in mixins 2025-03-20 00:10:50 -03:00
Magnus Norddahl
4e78ba469c Add VMCallScript template for calling ZScript functions with type checking 2025-03-19 22:15:29 +01:00
Magnus Norddahl
cc8681a9aa Fix memory leak in mixins 2025-03-16 18:54:35 +01:00
nashmuhandes
799011d327 Merge branch '4.14.1' of https://github.com/ZDoom/gzdoom 2025-03-13 03:00:11 +08:00
Ricardo Luís Vaz Silva
c82c6bff16 fix function-pointer cast parsing 2025-03-07 17:22:24 -03:00
Ricardo Luís Vaz Silva
b0889b9814 Fix deprecation version checks on class fields/pointers 2025-03-06 08:59:02 -03:00
Ricardo Luís Vaz Silva
909d211137 rename vm internal structs to make room for compilation-unit-internal structs/classes 2025-03-05 12:07:19 -03:00
Ricardo Luís Vaz Silva
0d963166f1 Allow >> in parser for aggregate types
makes stuff like Array<Class<X>> parse properly (bit hacky but can't do much better without restructuring the scanner/lexer)
2025-03-05 12:07:19 -03:00
Ricardo Luís Vaz Silva
7685553af8 4.14.1 accepts 4.15, bump version to 4.15.1 2025-03-03 08:28:59 -03:00
Ricardo Luís Vaz Silva
02523b1f90 restrict internal structs to gzdoom.pk3 2025-03-02 17:48:03 -03:00
Ricardo Luís Vaz Silva
93c8af32ca allow deprecation of classes/structs, deprecate Dictionary 2025-03-02 17:48:03 -03:00
Ricardo Luís Vaz Silva
35c44c7e21 don't allow backing types of string/array/map/etc to be referenced as actual types 2025-03-02 17:48:03 -03:00
Ricardo Luís Vaz Silva
e8b7a30a79 add better descriptive name for vectors/quats 2025-03-02 17:48:03 -03:00
Ricardo Luís Vaz Silva
6b8736fb30 rework how vector local type restrictions are managed 2025-03-02 17:48:03 -03:00
marrub
dcbd66a528
add default cvar getters 2025-02-21 07:18:03 -05:00
Boondorl
5a5bed5c31
Added FindClass
Allows for classes to be looked up during run time without having to use string casting.
2025-02-21 07:17:49 -05:00
Ricardo Luís Vaz Silva
ad579a8e43 add unsafe clearscope, to allow declaring clearscope fields outside of gzdoom.pk3 2025-02-20 04:18:29 -03:00
Ricardo Luís Vaz Silva
7e86116ab1 make const actually work, and add unsafe(const) for old behavior 2025-02-20 04:18:29 -03:00
Boondorl
236c9b4224 Added FindClass
Allows for classes to be looked up during run time without having to use string casting.
2025-02-20 04:14:18 -03:00
marrub
9f6c1d65c5 add default cvar getters 2025-02-20 04:14:07 -03:00
Chronos Ouroboros
7d180069e3 Fix FxExpression::EmitCompare not properly handling constant registers. 2025-02-17 07:53:27 -03:00