summaryrefslogtreecommitdiff
path: root/Userland/DevTools
AgeCommit message (Collapse)Author
2021-06-09LibCpp: Support non-field class membersItamar
Previously, we had a special ASTNode for class members, "MemberDeclaration", which only represented fields. This commit removes MemberDeclaration and instead uses regular Declaration nodes for representing the members of a class. This means that we can now also parse methods, inner-classes, and other declarations that appear inside of a class.
2021-06-08Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&>Ali Mohammad Pur
2021-06-08UserspaceEmulator: Stop parsing options on first non-optionJelle Raaijmakers
2021-06-06AK+Everywhere: Disallow constructing Functions from incompatible typesAli Mohammad Pur
Previously, AK::Function would accept _any_ callable type, and try to call it when called, first with the given set of arguments, then with zero arguments, and if all of those failed, it would simply not call the function and **return a value-constructed Out type**. This lead to many, many, many hard to debug situations when someone forgot a `const` in their lambda argument types, and many cases of people taking zero arguments in their lambdas to ignore them. This commit reworks the Function interface to not include any such surprising behaviour, if your function instance is not callable with the declared argument set of the Function, it can simply not be assigned to that Function instance, end of story.
2021-06-05LibGUI: Fix off-by-one error in Lexer tokensMax Wipfli
This changes the INI and GML lexers to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor. The other user of GMLToken::m_end, GMLAutocompleteProvider, has been modified to take into account that end position columns have been incremented by one.
2021-06-04HackStudio: Add comment about lexicographical insertion to ClassViewItamar
2021-06-04HackStudio: Use Node's name when inserting to the ClassView treeItamar
Previously, when traversing the ClassView tree to find the parent of a new node, we used the name of the node's declaration to find the path to the parent in the tree. However, some nodes in the tree do not have a matching declaration, which caused a VERIFY failure. To fix this, we now use the node's name when walking the tree. We can do this because the node's name should be identical to the name of its declaration. Closes #7702.
2021-06-04Profiler: Show the duration of the time interval chosenDhruvMaroo
2021-06-03Profiler: Remove m_deepest_stack_depthGunnar Beutner
This isn't used anymore so let's remove it entirely.
2021-06-03Profiler: Use sequential serial numbers for profiling eventsGunnar Beutner
Previously Profiler was using timestamps to distinguish processes. However it is possible that separate processes with the same PID exist at the exact same timestamp (e.g. for execve). This changes Profiler to use unique serial numbers for each event instead.
2021-06-02HackStudio: Make locator lose focus on closeMarcus Nilsson
Make locator lose focus when pressing escape or by clicking in the editor area.
2021-06-02HackStudio: Remove unused includesMarcus Nilsson
2021-06-02HackStudio: Close locator on exitMarcus Nilsson
2021-06-02TextEditor/GMLPlayground: Don't close app if user aborts save on exitMatthew Jones
2021-06-02Inspector: Check if RemoteProcess `is_inspectable`Matthew Jones
The previous check of looking at `/proc/PID` was not working, it would always fail even if the process was indeed inspectable. Commit 70117781 introduced a new IPC for asking InspectorServer whether or not a given `pid` is actually inspectable. If a process is not inspectable, the `GUI::ProcessChooser` is redisplayed if it was previously displayed, otherwise it exits.
2021-06-02Profiler: Fix loading profiles which previously would crash the profilerGunnar Beutner
The profiler tried to be clever when handling process_exit events by subtracting one from the timestamp. This was supposed to ensure that events after a process' death would be attributed to the new process in case the old process used execve(). However, if there was another event (e.g. a CPU sample) at the exact same time the process_exit event was recorded the profile would fail to load because we didn't find the process anymore. This changes introduces a new problem where samples would be attributed to the incorrect process if a CPU sample for the old process, a process_exit as well as a process_create event plus another CPU sample event for the new process happened at the exact same time. I think it's a reasonable compromise though.
2021-06-01CppLanguageServer: Work with a HashMap of Symbols in each documentItamar
This is a pretty fundamental refactor of the way CppComprehensionEngine works. Previously, in order to answer queries such as "goto definition" or "autocomplete", we would do ad-hoc logic of walking the AST, collecting available declaration nodes, computing scopes, and so on. This commit introduces an architectural change where each Document builds a hashmap of symbols on creation. With these hashmaps, it's easier to iterate over all of the available symbols, and to answer a query such as "which symbols are defined in this scope".
2021-05-29Everywhere: Sort out superfluous QuickSort.h importsBen Wiederhake
They were sorta unneeded. :^)
2021-05-28Profiler: Use a more reasonable default event maskGunnar Beutner
Previously Profiler (e.g. when started via the context menu in SystemMonitor) would request logging _all_ event types. While this might be useful at a later point in time the lack of event type filtering in the profile viewer makes this less useful because showing different event types in the same timeline shows an inaccurate picture of what was really going on. Some event types (like kmalloc) happen more frequently than others (e.g. CPU samples) and while they don't carry the same weight they would still dominate the samples graph. This changes the Profiler app to just do CPU sampling for now.
2021-05-28UE: Make sure signal_trampoline_dummy is not optimized away with -fltoGunnar Beutner
This adds __attribute__((used)) to the function declaration so the compiler doesn't discard it. It also makes the function NEVER_INLINE so that we don't end up with multiple copies of the function. This is necessary because the function uses inline assembly to define some unique labels.
2021-05-27Profiler: Don't try to create a DisassemblyModel for invalid indicesAndreas Kling
This fixes a null dereference when toggling the "top functions" mode while a top-level process node was selected.
2021-05-26Playground: Start out with a GUI::Frame on the right hand sideAndreas Kling
This looks a lot nicer than starting with a plain GUI::Widget.
2021-05-26LibGUI/AbstractView: Remove `on_selection`Jelle Raaijmakers
Since the introduction of multi-select, we have had both `on_selection` and `on_selection_change`, the latter of which was only invoked when a change in selection came in through the model. This removes `AbstractView::on_selection` and replaces it usage with the more explicit `on_selection_change` everywhere.
2021-05-25Profiler: Hide timeline scrollbars if we don't need them :^)Andreas Kling
2021-05-24AK+Everywhere: Consolidate String::index_of() and String::find()Andreas Kling
We had two functions for doing mostly the same thing. Combine both of them into String::find() and use that everywhere. Also add some tests to cover basic behavior.
2021-05-23LibC+UE: Keep more unused chunked blocks aroundGunnar Beutner
Previously each malloc size class would keep around a limited number of unused blocks which were marked with MADV_SET_VOLATILE which could then be reinitialized when additional blocks were needed. This changes malloc() so that it also keeps around a number of blocks without marking them with MADV_SET_VOLATILE. I termed these "hot" blocks whereas blocks which were marked as MADV_SET_VOLATILE are called "cold" blocks because they're more expensive to reinitialize. In the worst case this could increase memory usage per process by 1MB when a program requests a bunch of memory and frees all of it. Also, in order to make more efficient use of these unused blocks they're now shared between size classes.
2021-05-23LibCore: Make ProcessStatisticsReader return results in a VectorAndreas Kling
The HashMap API was overkill and made using this less ergonomic than it should be.
2021-05-23Userland: Mark subclasses of IPC::{Client,Server}Connection finalAndreas Kling
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-23HackStudio: Greet language servers asynchronouslyAndreas Kling
There's no need to wait for a response after we've sent the project path to a newly connected language server.
2021-05-23InspectorServer: Remove unnecessary greet() messageAndreas Kling
2021-05-22Profiler: Allow scaling the timeline with Ctrl+MouseWheel :^)Andreas Kling
2021-05-22Profiler: Allow scrolling through full range of profile timelineAndreas Kling
We were not taking the width of the process headers into account when computing the scrollable content size of the timeline. Fix this by passing the header width to AbstractScrollableWidget's set_size_occupied_by_fixed_elements().
2021-05-22Profiler: Add a "Show Disassembly" action (and hide it by default)Andreas Kling
2021-05-22Profiler: Add some helpful debug output if a process is missingAndreas Kling
I've had a couple of instances where a profile was missing process creation events for a PID. I don't know how to reproduce it yet, so this patch merely adds a helpful debug message so you know why Profiler is failing to load the file.
2021-05-22Profiler: Split the call tree into one subtree per processAndreas Kling
This patch adds an additional level of hierarchy to the call tree: Every process gets its own top-level node. :^) Before this, selecting multiple processes would get quite confusing as all the call stacks from different processes were combined together into one big tree.
2021-05-22Userland: Rename LibThread => LibThreadingAndreas Kling
Also rename the "LibThread" namespace to "Threading"
2021-05-22CppLanguageServer: Add test case for auto-completing include pathsItamar
2021-05-22CppLanguageServer+LibGUI: Autocomplete #include pathsItamar
The C++ language-server can now autocomplete include paths. Paths that start with '<' will be searched in /usr/include, and paths that start with '"' will be searched in the project's root directory.
2021-05-22LanguageServers: Add FileDB::project_root() getterItamar
2021-05-22CppLanguageServer: Rename Optional<> autocomplete* to try_autocomplete*Itamar
autocomplete_property => try_autocomplete_property autocomplete_name => try_autocomplete_name This makes it more clear that these variants may fail because e.g the node is not a property / not a name.
2021-05-22CppLanguageServer: Rename all_definitions=>preprocessor_definitionsItamar
2021-05-22CppLanguageServer: remove no-op move()Itamar
2021-05-21DevTools: Remove redundant default destructor and forward declarationsLenny Maiorani
Problem: - Default destructors (and constructors) are in `.cpp` files. This prevents the compiler's optimizer from inlining them when it thinks inlining is appropriate (unless LTO is used). - Forward declarations can prevent some optimizations, such as inlining of constructors and destructors. Solution: - Remove them or set them to `= default` and let the compiler handle the generation of them. - Remove unneeded forward declarations.
2021-05-21Applications: Use titlecase and distinct underlined characters in menusMax Wipfli
This changes (context) menus across the system to conform to titlecase capitalization and to not underline the same character twice (for accessing actions with Alt).
2021-05-21Userland: Change typedef to using directiveLenny Maiorani
Problem: - `typedef`s are read backwards making it confusing. - `using` statements can be used in template aliases. - `using` provides similarity to most other C++ syntax. - C++ core guidelines say to prefer `using` over `typedef`: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using Solution: - Switch these where appropriate.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-20Inspector: Throw an error when inspecting a process it has no access toAnand
2021-05-19LibCpp: Generalize ASTNode::dump() to support redirecting its outputItamar
Previously, ASTNode::dump() used outln() for output, which meant it always wrote its output to stdout. After this commit, ASTNode::dump() receives an 'output' argument (which is stdout by default). This enables writing the output to somewhere else. This will be useful for testing the LibCpp Parser with the output of ASTNode::dump.
2021-05-19CppLanguageServer: Put cpp test files in /home/anon/cpp-tests/Itamar
This is similar to the LibJS test data that resides in /home/anon/js-tests. It's more convenient than storing the test programs as raw strings in the code.