summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-23AK: Add outf, warnf and dbgf.asynts
2020-09-23AK: Resolve format related circular dependencies properly.asynts
With this commit, <AK/Format.h> has a more supportive role and isn't used directly. Essentially, there now is a public 'vformat' function ('v' for vector) which takes already type erased parameters. The name is choosen to indicate that this function behaves similar to C-style functions taking a va_list equivalent. The interface for frontend users are now 'String::formatted' and 'StringBuilder::appendff'.
2020-09-23AK: Allow calling format without arguments.asynts
2020-09-23js: Use VM::exception() instead of Interpreter::exception()Andreas Kling
The VM is always there, but we only have an Interpreter while we are running code.
2020-09-23UserspaceEmulator+LibX86: Clean up some obnoxious template spamAndreas Kling
Don't require clients to templatize modrm().read{8,16,32,64}() with the ValueWithShadow type when we can figure it out automatically. The main complication here is that ValueWithShadow is a UE concept while the MemoryOrRegisterReference inlines exist at the lower LibX86 layer and so doesn't have direct access to those types. But that's nothing we can't solve with some simple template trickery. :^)
2020-09-23UserspaceEmulator: Fix off-by-one in code cache accessNico Weber
m_cached_code_end points at the first invalid byte, so we need to update the cache if the last byte we want to read points at the end or past it. Previously we updated the cache 1 byte prematurely in read16, read32, read64 (but not in read8). Noticed by reading the code (the code looked different from read8() and the other 3). I didn't find anything that actually hit this case.
2020-09-23Base: Fixup forgotten 'example' heading name in Shell man pageAnotherTest
As noticed in #3578.
2020-09-23UserspaceEmulator+LibX86: Add support for 64-bit memory reads and writes (#3584)Nico Weber
This is useful for reading and writing doubles for #3329. It is also useful for emulating 64-bit binaries. MemoryOrRegisterReference assumes that 64-bit values are always memory references since that's enough for fpu support. If we ever want to emulate 64-bit binaries, that part will need minor updating.
2020-09-23LibGUI: Use on_up_pressed/on_down_pressed events in SpinBoxTibor Nagy
Fixes keyboard increment/decrement of SpinBox values. After PR #2412 the TextBox class started not propagating arrow key events to the parent widgets because it handles them itself now. It also added two new events for these arrow keys, so use them instead in SpinBox.
2020-09-22Themes: Set the ruler color in "Sunshine" to cold grayTibor Nagy
2020-09-22LibWeb: Disallow cross-origin access to <iframe>.contentDocumentAndreas Kling
With this patch, we now enforce basic same-origin policy for this one <iframe> attribute. To make it easier to add more attributes like this, I've added an extended IDL attribute ("[ReturnNullIfCrossOrigin]") that does exactly what it sounds like. :^)
2020-09-22LibWeb: Add Origin::is_same(const Origin&)Andreas Kling
Getting ready for some extremely basic same-origin policy stuff, this initial implementation simply checks that two origins have identical protocol, host and port.
2020-09-22LibWeb: Add WindowObject::origin()Andreas Kling
This is a convenience getter to retrieve the security origin of a DOM window's document.
2020-09-22LibWeb: Dispatch DOM "load" event on <iframe> elementsAndreas Kling
2020-09-22LibWeb: Rename HTMLIFrameElement::hosted_frame() => content_frame()Andreas Kling
This matches the standard API names contentWindow and contentDocument.
2020-09-22LibJS: Let the VM cache an empty ("") PrimitiveStringAndreas Kling
Empty string is extremely common and we can avoid a lot of heap churn by simply caching one in the VM. Primitive strings are immutable anyway so there is no observable behavior change outside of fewer collections.
2020-09-22LibJS: Move well-known symbols to the VMAndreas Kling
No need to instantiate unique symbols for each Interpreter; they can be VM-global. This reduces the memory cost and startup time anyway.
2020-09-22LibJS: Use VM::exception() instead of Interpreter::exception() a bunchAndreas Kling
There's a lot more of these things to fix. We'll also want to move from passing Interpreter& around to VM& instead wherever that is enough.
2020-09-22LibJS: Add a way to get from a Cell to the VMAndreas Kling
2020-09-22LibJS: Move the current exception from Interpreter to VMAndreas Kling
This will allow us to throw exceptions even when there is no active interpreter in the VM.
2020-09-22AK: Add missing overload to format.asynts
I had this in #3580 but I must have lost it during rebasing.
2020-09-22SystemMonitor: Wrap file descriptor and unveiled paths model into a ↵Tibor Nagy
SortingProxyModel
2020-09-22SystemMonitor: Fix assert when sorting by the "Page map" columnTibor Nagy
2020-09-22SystemMonitor: Wrap adapters and sockets model into a SortingProxyModelTibor Nagy
2020-09-22SystemMonitor: Add sorting key to the devices modelTibor Nagy
2020-09-22AK: Use format in String::number.asynts
2020-09-22AK: Consider long and unsigned long as integral types.asynts
Two things I hate about C++: 1. 'int', 'signed int' and 'unsigned int' are two distinct types while 'char, 'signed char' and 'unsigned char' are *three* distinct types. This is because 'signed int' is an alias for 'int' but 'signed char' can't be an alias for 'char' because on some weird systems 'char' is unsigned. One might think why not do it the other way around, make 'int' an alias for 'signed int' and 'char' an alias for whatever that is on the platform, or make 'char' signed on all platforms. But who am I to ask? 2. 'unsigned long' and 'unsigned long long' are always different types, even if both are 64 bit numbers. This commit fixes a few bugs that coming from this. See Also: 1b3169f405ac9250b65ee3608e2962f51d2d8e3c.
2020-09-22AK: Add StringBuilder::appendff using the new format.asynts
StringBuilder::appendf was already used, thus this name. If we some day replace all usages of printf, we could rename this method.
2020-09-22AK: Remove strtoull dependency from format.asynts
This function is not avaliable in the kernel. In the future it would be nice to have some sort of <charconv> header that does this for all integer types and then call it in strtoull and et cetera. The difference would be that this function say 'from_chars' would return an Optional and not just interpret anything invalid as zero.
2020-09-21Userland: Convert passwd(1) to use Core::AccountPeter Elliott
this fixes the passwd issues discovered in #3296
2020-09-21Userland: Switch su over to Core::AccountPeter Elliott
2020-09-21LibCore: Add Core::Account for login management.Peter Elliott
Core::Account abstracts login semantics like password checking and switching uid/gid.
2020-09-21AK: Add format function like std::format or fmt::format.asynts
2020-09-21AK: Add template deduction guides for Array.asynts
2020-09-21AK: Add StringView::substring_view(size_t) overload.asynts
2020-09-21HackStudio: Add auto-complete capability to the EditorItamar
2020-09-21HackStudio: Add AutoCompleteBoxItamar
Can be used to display the list of autocomplete suggestions and apply a suggestion that was chosen by the user.
2020-09-21HackStudio: Basic C++ autocomplete logicItamar
CppAutoComplete gets a string of code and a position within it, and returns a Vector of auto-complete suggestions that are relevant for the given position. Currently, it's very naive - it uses our CppLexer to find identifiers in the code which the auto-complete target is a prefix of.
2020-09-21Base: Add the PlaceholderText attribute to themesPeter Elliott
2020-09-21Applications: Use placeholders in TextBoxes where applicablePeter Elliott
2020-09-21LibGUI: Add optional placeholder to TextEditorPeter Elliott
This lets you show some disabled text when no text is entered, and the editor is not focused.
2020-09-21LibJS: VM::interpreter() should just assert when no active interpreterAndreas Kling
I accidentally committed some code here to force a crash, but this should just assert.
2020-09-21LibJS: Assert if garbage collection is restarted while ongoingAndreas Kling
We can't GC while we're already in GC. Assert if this happens.
2020-09-21LibJS: Rename InterpreterScope => InterpreterExecutionScopeAndreas Kling
To make it a little clearer what this is for. (This is an RAII helper class for adding and removing an Interpreter to a VM's list of the currently active (executing code) Interpreters.)
2020-09-21test-web: Keep the Interpreter on the VM interpreter stack during testAndreas Kling
2020-09-21LibJS: GC should gather roots from all active interpretersAndreas Kling
If we are in a nested execution context, we shouldn't only mark things used by the active interpreter.
2020-09-21AK: Remove BufferStream class.asynts
There are three classes avaliable that share the functionality of BufferStream: 1. InputMemoryStream is for reading from static buffers. Example: Bytes input = /* ... */; InputMemoryStream stream { input }; LittleEndian<u32> little_endian_value; input >> little_endian_value; u32 host_endian_value; input >> host_endian_value; SomeComplexStruct complex_struct; input >> Bytes { &complex_struct, sizeof(complex_struct) }; 2. OutputMemoryStream is for writing to static buffers. Example: Array<u8, 4096> buffer; OutputMemoryStream stream; stream << LittleEndian<u32> { 42 }; stream << ReadonlyBytes { &complex_struct, sizeof(complex_struct) }; foo(stream.bytes()); 3. DuplexMemoryStream for writing to dynamic buffers, can also be used as an intermediate buffer by reading from it directly. Example: DuplexMemoryStream stream; stream << NetworkOrdered<u32> { 13 }; stream << NetowkrOrdered<u64> { 22 }; NetworkOrdered<u32> value; stream >> value; ASSERT(value == 13); foo(stream.copy_into_contiguous_buffer()); Unlike BufferStream these streams do not use a fixed endianness (BufferStream used little endian) these have to be explicitly specified. There are helper types in <AK/Endian.h>.
2020-09-21LibIPC: Use InputMemoryStream instead of BufferStream.asynts
2020-09-21LibGfx+JPGLoader: Use InputMemoryStream instead of BufferStream.asynts
2020-09-21TelnetServer: Use OutputMemoryStream instead of BufferStream.asynts
I could not test these changes because I could not get my telnet client (on Linux) to connect to the telnet server running in Serenity. I tried the follwing: # Serenity su TelnetServer # Linux telnet localhost 8823 The server then immediatelly closes the connection: Connection closed by foreign host. In the debug logs the following message appears: [NetworkTask(5:5)]: handle_tcp: unexpected flags in FinWait2 state [NetworkTask(5:5)]: handle_tcp: unexpected flags in Closed state [NetworkTask(5:5)]: handle_tcp: unexpected flags in Closed state This seems to be an unrelated bug in the TCP implementation.