Commit graph

62 commits

Author SHA1 Message Date
bruvzg f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Fabio Alessandrelli 6583797305 [Debugger] Move servers-related behaviours to ServersDebugger.
Forcing draw during debug break is now handled by ServersDebugger, and
only happens when the proper message is sent from the EditorDebugger
("servers:draw").
In a similar way, briging the window in foreground is now also handled
by ServersDebugger upon receiving "servers:foreground" which is sent by
the EditorDebugger when resuming from a break ("continue").
2022-02-06 17:36:48 +01:00
Fabio Alessandrelli 87f4bbd668 [Debugger] Move most profilers to ServersDebugger.
Also splits bandwidth/rpc profiler (RPCProfiler is now in
SceneDebugger).
2022-02-06 17:36:48 +01:00
Fabio Alessandrelli 789e648f4d [Debugger] New extensible EngineProfiler class.
Uses GDExtension, replaces old Callable system for profilers, and is
also used internally.
2022-02-06 17:33:45 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
Rémi Verschelde 050908626f
Merge pull request #57526 from tavurth/bugfix/high-macos-cpu-usage 2022-02-02 10:16:24 +01:00
Will Whitty c37bd41c79 Increase RemoteDebuggerPeerTCP poll to 6.9ms
Fix high CPU usage on MacOS by reverting the polling for Network
debugging to match 144hz refresh rate.
2022-02-01 23:35:30 +03:00
Anilforextra fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
bruvzg ba9d737363 Fix incorrect encoding (Latin-1 instead of UTF-8) used in _error_handler functions. 2021-11-08 23:45:08 +02:00
Max Hilbrunner 5dc02eb8b0 Save all 64 bits of get_ticks_msec() in more cases 2021-10-26 13:58:58 +02:00
Gilles Roudière 0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Lightning_A c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Fabio Alessandrelli 80fc90e82a
Merge pull request #50454 from Ev1lbl0w/gsoc21-dap
Implemented initial DAP support
2021-08-03 17:12:37 +02:00
Ev1lbl0w 7bccd5487e
Implemented initial DAP support
Implemented "output" event

Refactored "seq" field generation

Prevent debugging when editor and client are in different projects

Removed unneeded references to peer on the parser

Refactored way to detect project path

Implemented "setBreakpoints" request

Fix double events when terminating from client

Refactored "stopped" event

Implemented "stopped" with breakpoint event

Implemented "stackTrace", "scopes" and "variables" request

Report incoming number of stack dump variables

Implemented proper reporting of scopes and variables from stack frames

Prevent editor from grabbing focus when a DAP session is active

Implemented "next" and "stepIn" requests

Implemented "Source" checksum computing

Switched expected errors from macros to silent guards

Refactored message_id

Respect client settings regarding lines/columns behavior

Refactored nested DAP fields

Implement reporting of "Members" and "Globals" scopes as well

Fix error messages not being shown, and improved wrong path message
2021-08-02 10:43:35 +01:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Pedro J. Estébanez 04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
Tomasz Chabora b1859510ab Change behavior of String.right 2021-05-20 23:07:57 +02:00
Hugo Locurcio 3f078c99f6
Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
Fabio Alessandrelli 87353c90fa [Net] Make debugger peer less CPU intensive.
Make sure that RemoteDebuggerPeer wait at least 100us between polls
(effectively forcing a min tick of 100 microseconds).

This greatly improve performances (the call to poll was useless since
during low traffic, writes would always be available, and during high
traffic, reads would always be available, effectively making it a
busy-waiting loop). We could further improve this, by separating the two
polls, and adjust the min tick based on load, but this is most likely
more than enough already without sacrificing too much on high loads.
2021-03-16 21:48:15 +01:00
Anshul7sp1 91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
Rémi Verschelde 614566ddb5 RemoteDebugger: Fix possible division by zero 2021-03-04 12:55:53 +01:00
Pedro J. Estébanez 99fe462452 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-01-29 12:02:13 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde e4c0572385
Merge pull request #44593 from madmiraal/rename-mainloop-methods
Rename MainLoop methods to match Node methods
2020-12-28 14:44:28 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Rémi Verschelde 32b31a5fa4
Merge pull request #43730 from qarmin/core_drivers_default_values
Initialize class/struct variables with default values in core/ and drivers/
2020-11-24 13:00:27 +01:00
Rafał Mikrut 7bd03b7188 Initialize class/struct variables with default values in core/ and drivers/ 2020-11-23 17:38:46 +01:00
PouleyKetchoupp d346c30269 Fix DebuggerMarshalls errors while profiling
Fixed check for array size before func_size: when func_size is 0 there's
only 1 entry left and not 3.
2020-11-23 07:59:56 -07:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz ee06a70ea6 Refactor MethodBind to use variadic templates
Removed make_binders and the old style generated binders.
2020-10-18 12:28:44 +02:00
Stijn Hinlopen 929b98d24b Remove String::find_last (same as rfind) 2020-07-03 15:26:22 +02:00
simpu bfadb882b1 Added Custom Performance Monitor and feature to read intermediate values of Monitor
Custom monitors can be added/removed/checked using `Performance.add_custom_monitor`/`Performance.remove_custom_monitor`/`Performance.has_custom_monitor`

The value can be viewed in the `Monitor` tab of Debugger.

Text before `/` is used to categorize the custom monitor.

`EditorPerformanceProfiler` class is created to separate logic from `ScriptEditorDebugger`

User can click on the graph of monitors to read the value at that point.

Graph includes intermediate base lines.
2020-06-29 17:20:29 +05:30
Rémi Verschelde 85220fec01 Style: Remove unnecessary semicolons from core
Semicolons are not necessary after function definitions or control flow
blocks, and having some code use them makes things inconsistent (and
occasionally can mess up `clang-format`'s formatting).

Removing them is tedious work though, I had to do this manually (regex
+ manual review) as I couldn't find a tool for that. All other code
folders would need to get the same treatment.
2020-05-19 15:57:56 +02:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Fabio Alessandrelli ed225faf31 Add support for multiple RemoteDebuggerPeer(s).
It is now possible to register protocol handlers (default tcp://) to
support additional debugging communication layers (e.g. websocket).
2020-05-12 15:09:13 +02:00
Rémi Verschelde 77e19d116e
Merge pull request #38522 from ThakeeNathees/printing-empty-string-fix
Fix: printing empty string does nothing in editor output pannel
2020-05-07 18:05:36 +02:00
Thakee Nathees 5640cad1e1 Fix: printing empty string does nothing in editor output pannel
Fix: #38490
2020-05-07 05:56:29 +05:30
PouleyKetchoupp aacf69bad2 Format remote printerr properly in script debugger output 2020-05-01 18:23:51 +02:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Rémi Verschelde 0826b63c7e
Merge pull request #37450 from SkyLucilfer/profilerBug
Fix profiler frame number stops updating when window is minimized
2020-04-10 17:56:28 +02:00