Commit graph

19308 commits

Author SHA1 Message Date
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
Hendiadyoin1 acd65a5f86 UserspaceEmulator: Add more Instructions
Adds:
* CMC
* POPA
* POPAD
* POPF
* PUSHA
* PUSHAD
* PUSHF
* PUSH_RM16
* SAHF
* FPU:
  * FNOP
  * FPREM
  * FSINCOS
  * FCMOVxx
  * FISTTP
2021-04-25 09:56:29 +02:00
Gunnar Beutner cfa095b44a Port: Add port for tcl 2021-04-25 09:54:39 +02:00
Gunnar Beutner 2447dcd1ea LibC: Implement the rewinddir() function 2021-04-25 09:54:39 +02:00
Brian Gianforcaro 8d6e9fad40 Kernel: Remove the now defunct LOCKER(..) macro. 2021-04-25 09:38:27 +02:00
Brian Gianforcaro 0d5827f865 Kernel: Remove the now defunct RESTORE_LOCK(..) macro. 2021-04-25 09:38:27 +02:00
Brian Gianforcaro 04156d53ca Kernel: Utilize AK::SourceLocation for LOCK_DEBUG instrumentation.
The previous `LOCKER(..)` instrumentation only covered some of the
cases where a lock is actually acquired. By utilizing the new
`AK::SourceLocation` functionality we can now reliably instrument
all calls to lock automatically.

Other changes:
- Tweak the message in `Thread::finalize()` which dumps leaked lock
  so it's more readable and includes the function information that is
  now available.

- Make the `LOCKER(..)` define a no-op, it will be cleaned up in a
  follow up change.
2021-04-25 09:38:27 +02:00
Brian Gianforcaro 87724b3d09 AK: Add default constructor to SourceLocation 2021-04-25 09:38:27 +02:00
Brian Gianforcaro c248bbc7fd Kernel: Add lock_count to procfs$all when LOCK_DEBUG is enabled. 2021-04-25 09:38:27 +02:00
Brian Gianforcaro 7481789eac Kernel: Fix LOCK_DEBUG feature to work again
- UBSAN detected cases where we were calling thread->holding_lock(..)
  but current_thread was nullptr.

- Fix Lock::force_unlock_if_locked to not pass the correct ref delta to
  holding_lock(..).
2021-04-25 09:38:27 +02:00
Andrew Kaster 35c0a6c54d AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMake
As many macros as possible are moved to Macros.h, while the
macros to create a test case are moved to TestCase.h. TestCase is now
the only user-facing header for creating a test case. TestSuite and its
helpers have moved into a .cpp file. Instead of requiring a TEST_MAIN
macro to be instantiated into the test file, a TestMain.cpp file is
provided instead that will be linked against each test. This has the
side effect that, if we wanted to have test cases split across multiple
files, it's as simple as adding them all to the same executable.

The test main should be portable to kernel mode as well, so if
there's a set of tests that should be run in self-test mode in kernel
space, we can accomodate that.

A new serenity_test CMake function streamlines adding a new test with
arguments for the test source file, subdirectory under /usr/Tests to
install the test application and an optional list of libraries to link
against the test application. To accomodate future test where the
provided TestMain.cpp is not suitable (e.g. test-js), a CUSTOM_MAIN
parameter can be passed to the function to not link against the
boilerplate main function.
2021-04-25 09:36:49 +02:00
Andrew Kaster 89ee38fe5c Tests: Add environment variable for tests only
This is useful for CI where we don't want to spend a minute and a half
benchmarking Vector::append, and we don't have a good way to pass
test-specific arguments yet. :)
2021-04-25 09:36:49 +02:00