Commit Graph

19319 Commits

Author SHA1 Message Date
Gunnar Beutner
eb798d5538 Kernel+Profiler: Improve profiling subsystem
This turns the perfcore format into more a log than it was before,
which lets us properly log process, thread and region
creation/destruction. This also makes it unnecessary to dump the
process' regions every time it is scheduled like we did before.

Incidentally this also fixes 'profile -c' because we previously ended
up incorrectly dumping the parent's region map into the profile data.

Log-based mmap support enables profiling shared libraries which
are loaded at runtime, e.g. via dlopen().

This enables profiling both the parent and child process for
programs which use execve(). Previously we'd discard the profiling
data for the old process.

The Profiler tool has been updated to not treat thread IDs as
process IDs anymore. This enables support for processes with more
than one thread. Also, there's a new widget to filter which
process should be displayed.
2021-04-26 17:13:55 +02:00
Gunnar Beutner
f57c57966b AK: Fix argument type for JsonArray::at and JsonArray::operator[] 2021-04-26 17:13:55 +02:00
Gunnar Beutner
ff8c664931 Kernel: Increase max frame count to 64
Even just profiling Piano hits the previous limit.
2021-04-26 17:13:55 +02:00
Gunnar Beutner
64639de4d2 Kernel: Stop walking the stack when we encounter return address 0 2021-04-26 17:13:55 +02:00
sppmacd
d164da7d19
Browser: Add basic support for search engines
If you start a URL with a '?' character, the Browser will use the
user-selected search engine (none by default).

For now, there are several engines hardcoded and there is no support
for custom search engines.
2021-04-26 11:52:19 +02:00
dhirsbrunner
cd9e352460 LibC: Fix typo in signal.h: ol_dset -> old_set 2021-04-26 11:27:13 +02:00
Sahan Fernando
b4e125cf86 Userland: Make rmdir take multiple paths 2021-04-26 09:32:42 +02:00
Panagiotis Vasilopoulos
43956c9611 LibC: Add additional data types
- Reorganized some variables (alphabetically and based on their function) so that the new ones don't stick out.
- See: https://github.com/SerenityOS/serenity/issues/6068

Co-authored-by: Linus Groh <mail@linusgroh.de>
2021-04-26 09:24:21 +02:00
Brian Gianforcaro
1399048662 Toolchain: Update QEMU to 6.0-rc4 2021-04-26 09:10:53 +02:00
Idan Horowitz
6f6f30e55a Meta: Lint commits for unix-style linebreaks
This ensures serenity commits only contain unix-style LF linebreaks
2021-04-26 00:29:22 +02:00
Rudolf Adamkovič
8b06d6d9e8 Documentation: Fix "GUI interface" wording
"GUI" = graphical user interface
"GUI interface" = graphical user interface interface :^)
2021-04-26 00:04:53 +02:00
Rudolf Adamkovič
525fad42f5
Base: Make test(1) summary line match other man pages
Other `man` pages use the imperative form.
2021-04-25 23:57:32 +02:00
Linus Groh
653a60cd13 Ports: Add missing SHA256 hashes to dash and zstd
We don't support hashes from external files (anymore), downloading
another file for integrity validation is pointless. As as result, these
two ports would refuse to build as their hashes were missing.

Fixes #6645.
2021-04-25 23:30:38 +02:00
Linus Groh
7b1ba4bd5c LibJS: Fallback to undefined if last value in eval() is empty
For something like eval(""), the VM's 'last value' is an empty value,
which we must not leak.

Fixes #6643.
2021-04-25 22:52:19 +02:00
Idan Horowitz
2b4c2301a9 LibJS: Stop rolling back parser state that is immediately replaced
This showed up on a profile (barely), so should help a tiny bit with
perf in parsing arrow functions.
2021-04-25 22:46:34 +02:00
Linus Groh
aef502e8e0 LibJS: Change PropertyName::as_number() return type to u32
This is how it's stored internally - even though we still only construct
from i32. I had the compiler yell at me while trying something with this
and didn't want to add yet another cast, so let's quickly fix this.
2021-04-25 22:42:48 +02:00
Linus Groh
c61de8e4be LibJS: Use Object::get_own_properties() for getOwnPropertyNames() 2021-04-25 22:40:21 +02:00
Linus Groh
af62678c31 LibJS: Don't assume call_frame->current_node in Exception constructor
It's a nullptr in promise reaction job functions, for example. Regressed
in 97d49cb.

Fixes #6641.
2021-04-25 21:45:23 +02:00
Linus Groh
dbe72fd962 Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
Rafał
2d6be48c6f
LibGUI: Select last word when double clicking at the end of a line
Fixes #6565.
2021-04-25 19:51:03 +02:00
Linus Groh
c2f936b14c LibWeb: Use full source URL as script filename
Just the basename is not enough in most cases, as it's usually not
immediately obvious where scripts are loaded from.
2021-04-25 19:28:25 +02:00
DexesTTP
71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP
22413ef729 LibWeb: Add WebSocket bindings
The WebSocket bindings match the original specification from the
WHATWG living standard, but do not match the later update of the
standard that involves FETCH. The FETCH update will be handled later
since the changes would also affect XMLHttpRequest.
2021-04-25 19:04:34 +02:00
DexesTTP
68bfb46a6f LibWeb: Add exception support in IDL constructors 2021-04-25 19:04:34 +02:00
DexesTTP
d398943c37 Utilities: Update telws to use the isolated WebSocket service 2021-04-25 19:04:34 +02:00
DexesTTP
62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
DexesTTP
c11ca9df33 LibWebSocket+telws: Use my own copyright headers :^)
Since I guess I'll start attributing my own code, might as well change
it for the previously written WebSocket code too !
2021-04-25 19:04:34 +02:00
FalseHonesty
d8409c0e29 HackStudio: Display variable type name in expression evaluator 2021-04-25 19:03:57 +02:00
FalseHonesty
4f2c0e9968 HackStudio: Implement custom JS -> C++ "proxy" objects
This patch adds a custom JS Object type that will convert written
properties to their C++ equivalents, reflecting JS writes back
to the debugging session. This is better than a simple proxy because
printing this custom object works as expected because properties
still exist on the object as existing handlers expect.
2021-04-25 19:03:57 +02:00
FalseHonesty
60d329a186 HackStudio: Add evaluate expression popup to debugger
This implements a dialog that can be used to evaluate a JS expression
in the HackStudio's Debugger context. It also implements simple
C++ Variable <-> JS Value conversion, allowing for JS expressions
to read/write variables in the debugger scope.

Currently, C++ structs are mapped to JS objects by way of a JS proxy,
however this leads to issues when printing, so this will be changed
in a later commit.
2021-04-25 19:03:57 +02:00
FalseHonesty
bee16bb83a LibJS: Don't suppress GlobalObject variable lookup exceptions
In HackStudio's Debugger a custom GlobalObject is used to reflect
debugger variables into the JS scope by overriding GlobalObject's
get method. However, when throwing a custom error during that lookup
it was replaced with the generic "not found" js exception. This patch
makes it instead pass along the custom error.
2021-04-25 19:03:57 +02:00
Andreas Kling
6c2ec4c1a4 Userland+Base: Add "ladyball" logo for the system :^)
Thanks to Katalin Kult for the artwork!
2021-04-25 18:57:10 +02:00
TheGeopard
2b78d90d04 FileManager: Unzip from context Menu
This adds a new context menu entry allowing you to extract ZIP archives
by invoking /bin/unzip
2021-04-25 18:40:42 +02:00
TheGeopard
6a4ea4bf55 unzip: Add output directory option
This allows setting the output directory for unzip by adding a new
optional argument
2021-04-25 18:40:42 +02:00
Linus Groh
15cccdba7b Ports: Add readline 2021-04-25 17:29:28 +02:00
sin-ack
62af6cd4f9 IPCCompiler: Remove hardcoded endpoint magic, attempt deux
This patch removes the IPC endpoint numbers that needed to be specified
in the IPC files.  Since the string hash is a (hopefully) collision free
number that depends on the name of the endpoint, we now use that
instead. :^)

Additionally, endpoint magic is now treated as a u32, because endpoint
numbers were never negative anyway.

For cases where the endpoint number does have to be hardcoded (a current
case is LookupServer because the endpoint number must be known in LibC),
the syntax has been made more explicit to avoid confusing those
unfamiliar.  To hardcode the endpoint magic, the following syntax is now
used:

endpoint EndpointName [magic=1234]
2021-04-25 14:06:56 +02:00
Gunnar Beutner
64d05152f7 Ports: Try to download files again when verification fails 2021-04-25 13:30:18 +02:00
Gunnar Beutner
5a3f63ea00 Ports: Remove support for algos other than sha256 and sig 2021-04-25 13:30:18 +02:00
Gunnar Beutner
4aaf6386ae Meta: Only allow sha256 and sig for auth_type in ports 2021-04-25 13:30:18 +02:00
Gunnar Beutner
5911d379a6 Ports: Update checksums to use the SHA256 algorithm 2021-04-25 13:30:18 +02:00
kleines Filmröllchen
d77e7e99e4 Piano: Add track Volume and improve QOL
This patch implements a couple of enhancements to the synthesizer
engine:

* Each track has a volume control.
* The input and tooltips for all controls are improved.
* The noise channel is pitched, which allows for basic drum synthesis.
2021-04-25 11:30:41 +02:00
Andreas Kling
418bc484e4 Revert "IPCCompiler: Use string hashes for IPC endpoint magic"
This reverts commit 59218007a3.
2021-04-25 11:24:12 +02:00
sin-ack
53aec3e06d LibGUI: Implement Vim motion system
This patch implements Vim motions.  The VimMotion class will accept
keycodes from the editing engine to build up a motion, and will
signal when a motion is complete via VimMotion::is_complete().  The
editing engine can then call VimMotion::get_range() to obtain a
TextRange object which can be used to perform operations on the text,
or VimMotion::get_position() to obtain a TextPosition which is the
new position of the cursor after the motion.

Currently, the following motions are supported:

- h/j/k/l, regular Vim line and character movements
- 0/^/$, start/end of line and start of non-blank
- w/e/b/ge, word-related movements
- W/E/B/gE, WORD (anything non-blank) versions of the above motions
- gg/G, document related movements
- t/f, to/find character

All motions except gg/G accept a number prefix to repeat the motion that
many times.

This patch updates insert, normal and visual modes to use this motion
system for movement.
2021-04-25 10:41:16 +02:00
sin-ack
bb096429ad Tests: Remove 4chan catalog JSON from tree
According to kling, it was "an early stress test for the JSON decoder"
and can be removed now.
2021-04-25 10:15:15 +02:00
Gunnar Beutner
5b69e8d2c6 Ports: Build shared libraries with -Wl,-soname
Without a SONAME gcc will put the whole library path into executables
which link against these libraries:

$ readelf -d Root/usr/local/games/openttd

Dynamic section at offset 0xf0747c contains 32 entries:
 Tag        Type     Name/Value
0x00000001 (NEEDED) [libgcc_s.so]
0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/libpng.so]
0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/libz.so]
0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/liblzma.so]
0x00000001 (NEEDED) [libSDL2-2.0.so.1]
0x00000001 (NEEDED) [libicui18n.so.69]
0x00000001 (NEEDED) [libicuuc.so.69]
0x00000001 (NEEDED) [libicudata.so.69]
0x00000001 (NEEDED) [libpthread.so]
0x00000001 (NEEDED) [libm.so]
0x00000001 (NEEDED) [libc.so]

This causes the executable to fail because the dynamic linker
tries to find the library in the incorrect path.
2021-04-25 10:14:50 +02:00
Gunnar Beutner
e6953d14d8 Toolchain: Update cmake platform definition
This fixes building cmake and other ports which use cmake
to detect whether we have -ldl.
2021-04-25 10:14:50 +02:00
Gunnar Beutner
6a825510a0 Ports: Fix detection for -ldl 2021-04-25 10:14:50 +02:00
Gunnar Beutner
adaf2b347c Ports: Remove obsolete patches for Python
This enables shared library support for Python and removes
a few patches which are not necessary anymore now that
we have dlfcn support.
2021-04-25 10:14:50 +02:00
Gunnar Beutner
f40ee1b03f LibC+LibELF: Implement more fully-features dlfcn functionality
This implements more of the dlfcn functionality. Most notably:

* It's now possible to dlopen() libraries which were already
  loaded at program startup time. This does not cause those
  libraries to be loaded twice.
* Errors are reported via dlerror() rather than by crashing
  the program.
* Calls to the dl*() functions are thread-safe.
2021-04-25 10:14:50 +02:00
Gunnar Beutner
549d9bd3ea LibC: Move the __pthread_mutex_trylock function to LibC
Let's move this to LibC because the dynamic loader depends
on this function.
2021-04-25 10:14:50 +02:00