Commit graph

1454 commits

Author SHA1 Message Date
Timothy Flynn
e92bffb2e3 LibSQL: Parse DROP TABLE statement 2021-04-20 18:28:34 +02:00
Timothy Flynn
d41d1d2035 LibSQL: Add unit testing of the SQL parser 2021-04-20 18:28:34 +02:00
Timothy Flynn
377992d33e LibSQL: Create a very barebones SQL parser
This parser builds on the LibSQL lexer and currently only allows users
to parse 'CREATE TABLE' statements.
2021-04-20 18:28:34 +02:00
Timothy Flynn
90517da9ca LibSQL: Introduce a SQL library with a tokenizer
LibSQL aims to be a SQLite clone for SerenityOS. Step 1 is creating a
tokenizer to lex SQL tokens. This lexer is heavily influenced by the
LibJS lexer.
2021-04-20 18:28:34 +02:00
Idan Horowitz
63af67ea01 LibJS: Throw on a regex searchString in String.startsWith
As is required by the specification:
"Let isRegExp be ? IsRegExp(searchString). If isRegExp is true,
throw a TypeError exception."
2021-04-20 14:38:54 +02:00
Idan Horowitz
b1e5330e64 LibJS: Stop early-returning on missing searchString in String.startsWith
A missing searchString is allowed by the specification and is treated
as js_undefined. ("undefined test".startsWith() => true)
2021-04-20 14:38:54 +02:00
Idan Horowitz
81d7d68416 LibWeb: Use correct event name for the onmousemove global event handler
The current event name was accidentally set for the onmousedown event.
2021-04-20 14:38:54 +02:00
Andreas Kling
b092353e4d LibWeb: Add basic support for HTMLInputElement.form
HTMLInputElement now inherits from FormAssociatedElement, which will
be a common base for the handful of elements that need to track their
owner form (and register with it for the form.elements collection.)

At the moment, the owner form is assigned during DOM insertion/removal
of an HTMLInputElement. I didn't implement any of the legacy behaviors
defined by the HTML parsing spec yet.
2021-04-20 12:05:56 +02:00
Andreas Kling
00d8e3b02b LibWeb: Don't include "Wrapper" suffix in JS wrapper class_name()
The "Wrapper" suffix is not useful information to someone using the
JS console, so let's just drop it from the string returned when calling
class_name() on a JS binding wrapper.
2021-04-20 12:05:56 +02:00
Andreas Kling
4d35ffdf3c LibJS: Include the class name of objects in MarkupGenerator output
Add a little label before the "{ }" so you can see what kind of object
it is. This makes Browser's JS console significantly nicer to use. :^)
2021-04-20 12:05:56 +02:00
Idan Horowitz
28b8a2ec7a LibIPC: Make Connection::send_sync return a NonnullOwnPtr
Since we VERIFY that we received a response, the response pointer is
always non-null.
2021-04-20 10:10:15 +02:00
Idan Horowitz
a2b34b7e6b LibDesktop: Fail gracefully on allowlist failures instead of asserting
IPC::Connection::send_sync asserts that a response was received, so the
current gracefull fail check was useless, as LibIPC would always assert
before reaching it.
2021-04-20 10:10:15 +02:00
Linus Groh
ac3e7ef791 LibJS: Fix crash in Object.{freeze,seal}() with indexed properties
This was failing to take two things into account:

- When constructing a PropertyName from a value, it won't automatically
  convert to Type::Number for something like string "0", even though
  that's how things work internally, since indexed properties are stored
  separately. This will be improved in a future patch, it's a footgun
  and should happen automatically.
- Those can't be looked up on the shape, we have to go through the
  indexed properties instead.

Additionally it now operates on the shape or indexed properties directly
as define_property() was overly strict and would throw if a property was
already non-configurable.

Fixes #6469.
2021-04-20 09:38:22 +02:00
Linus Groh
085816645f LibJS: Take PropertyName in Object::set_integrity_level() internal lambda
At least for IntegrityLevel::Frozen we already construct a PropertyName
from the key value, let's reuse that.
2021-04-20 09:38:22 +02:00
Leandro Pereira
29fd75f22f LibGUI: Make statusbar label flat when displaying override_text
Changing the statusbar appearance when overriding text makes it less
confusing as it's supposed to be something temporary, e.g.  only when
hovering over a toolbar or menu item.

This behavior is present on old Windows systems, although things work
slightly differently there (where only the overridden text is displayed
rather than all the segments).
2021-04-20 09:24:52 +02:00
Andreas Kling
955eef83b0 LibWeb: Add basic support for HTMLCanvasElement.toDataURL() :^)
This allows you to serialize a <canvas> element's bitmap into a
data: URI. Pretty neat! :^)
2021-04-19 23:49:16 +02:00
Andreas Kling
6793574003 LibGfx: Improve PNG encoder API somewhat
This is still far from ideal, but let's at least make it take a
Gfx::Bitmap const&.
2021-04-19 23:49:16 +02:00
Gunnar Beutner
ddcd149224 LibC: Avoid division by zero in fread()/fwrite() 2021-04-19 22:13:52 +02:00
Itamar
4831dc0e30 LibCpp: Support parsing class declarations 2021-04-19 21:48:42 +02:00
Gunnar Beutner
cd432860d8 LibC: Additional functionality for getaddrinfo()
When node is NULL and AI_PASSIVE is specified we are supposed to use
the "any" address, otherwise we should use the loopback address.
2021-04-19 21:00:23 +02:00
Gunnar Beutner
38619a9f24 LibELF: Ignore DT_SYMBOLIC entries
The shared library libicudata.so has a DT_SYMBOLIC entry:

Dynamic Section:
  NEEDED               libgcc_s.so
  SONAME               libicudata.so.69
  SYMBOLIC             0x00000000
  HASH                 0x00000094
  STRTAB               0x000000c8
  SYMTAB               0x000000a8
  STRSZ                0x0000002a
  SYMENT               0x00000010

According to the ELF spec DT_SYMBOLIC has no special meaning
for the dynamic loader.
2021-04-19 20:39:22 +02:00
Gunnar Beutner
6c729993a8 LibELF: Allow shared objects which don't have a text segment
Shared objects without a text segment are perfectly OK. For
example libicudata.so has only data segments:

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .hash         00000014  00000094  00000094  00000094  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .dynsym       00000020  000000a8  000000a8  000000a8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynstr       0000002a  000000c8  000000c8  000000c8  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rodata       01b562d0  00000100  00000100  00000100  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .eh_frame     00000000  01b563d0  01b563d0  01b563d0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynamic      00000070  01b573d0  01b573d0  01b563d0  2**2
2021-04-19 20:39:22 +02:00
Conor Byrne
88ecfa164a LibGUI+WindowServer: Add WM_SuperKeyPressed event
This commit adds an event called WM_SuperKeyPressed which is sent to all
windows via WindowManagerServerConnection.
The event is fired from WindowManager when the super key is pressed,
which is the windows key on most keyboards :)
2021-04-19 20:03:25 +02:00
Brian Gianforcaro
3e87e43f9d LibC: Expose new profiling_free_buffer(..) syscall.
Expose the new `profiling_free_buffer` syscall to user space.
2021-04-19 18:30:37 +02:00
Panagiotis Vasilopoulos
9de58a2d89 LibC: Added sysexits.h 2021-04-19 18:27:55 +02:00
Gunnar Beutner
a5be8d8976 LibC: Improve error logging for execvp() 2021-04-19 18:27:09 +02:00
Gunnar Beutner
bd08f9188a Pthread: Add stubs for pthread_cleanup_{push,pop}
The stubs are necessary to make the xz port properly detect pthread
support. The two functions are only used in the configure script and
nowhere else.
2021-04-19 17:55:35 +02:00
Ali Mohammad Pur
74f0fdab98 LibLine: Avoid trying to restore() if the editor isn't initialized
Fixes #6472.
2021-04-19 16:28:33 +02:00
Ali Mohammad Pur
e1e84fe0fe LibLine: Redraw the suggestions when terminal size changes 2021-04-19 16:28:33 +02:00
Adam Hodgen
b9c6059984 LibWeb: Correctly calculate height of TableRowGroupBox
As well as correctly calculating the height of TableRowBox, this change
calculates the heights of TableRowGroupBoxs also.

As before, this does not correctly take into consideration the 'height'
attribute.

Now the horizontal layout is approximately correct for the
TableRowGroupBoxs we can now see that the `layout_row` method will need
updating to correctly calculate cell width across all rows, not just the
current TableRowGroupBox.
2021-04-19 12:26:05 +02:00
Adam Hodgen
ae02acb8e1 LibWeb: Properly handle thead and tfooter HTML tags
As the spec for the table fixup algorythm says:

> Treat table-row-groups in this spec also encompass the specialized
> table-header-groups and table-footer-groups.
2021-04-19 12:26:05 +02:00
Gunnar Beutner
c32b58873a LibELF: Fix calculation for TLS relocations
The calculation for TLS relocations was incorrect which would
result in overlapping TLS variables when more than one shared
object used TLS variables.

This bug can be reproduced with a shared library and a program
like this:

    $ cat tlstest.c
    #include <string.h>
    __thread char tls_val[1024];
    void set_val() { memset(tls_val, 0, sizeof(tls_val)); }

    $ gcc -g -shared -o usr/lib/libtlstest.so tlstest.c

    $ cat test.c
    void set_val();
    int main() { set_val(); }
    $ gcc -g -o tls test.c -ltlstest

Due to the way the TLS relocations are done this program would
clobber libc's TLS variables (e.g. errno).
2021-04-19 12:14:43 +02:00
Gunnar Beutner
0cca23def5 LibELF: Improve error message for missing symbols 2021-04-19 12:00:40 +02:00
Gunnar Beutner
1dab5ca5fd LibELF: Fix support for relocating weak symbols
Having unresolved weak symbols is allowed and we should initialize
them to zero.
2021-04-19 12:00:40 +02:00
Gunnar Beutner
97d7450571 LibELF: Remove VERIFY() calls and let control flow return to the caller
This way we get better error messages for unresolved symbols because
the caller logs the file and symbol names.
2021-04-19 12:00:40 +02:00
DexesTTP
d3a89ce737 LibWebSocket: Add a new websocket library
This library currently contains a basic WebSocket client that can
handle both standard TCP websockets and TLS websockets.
2021-04-18 22:42:10 +02:00
DexesTTP
b30f5dc8b5 LibCore: Add ArgsParser::add_option(String&)
The API existed for add_positional_argument, but not for named arguments.
2021-04-18 22:42:10 +02:00
Idan Horowitz
397269d21e LibGfx: Report font glyph presence based on glyph's specific width
This uses the per glyph width to determine if the glyph is actually
present in the font, and not just inside the range the font can covers

This means that characters that are in the font's range but that are
missing a glyph will show up as the missing character glyph instead of
being invisible.
2021-04-18 22:10:25 +02:00
Idan Horowitz
18ae37439a FontEditor+LibGfx: Allow user to specify if a specific glyph is present
This replaces the glyph width spinbox in the font editor with a
checkbox when editing fixed width fonts that indicates if the
currently selected character's glyph is present in the edited font
(For variable width fonts a non zero width implies presence)

This commit also changes the background color of glyphs in the glyph
map based on the presence of each specific glyph in the font.
2021-04-18 22:10:25 +02:00
Idan Horowitz
08d1b16a8d LibGfx: Always load font widths array and use it for glyph presence
Since we were always saving the glyph widths array to the font file, we
now also always load it, even on (which also simplifies the logic a bit)
fixed width fonts. We also set it initially to 0 instead of the default
fixed width, which allows us to use it to check for glyph presence in
both fixed width and variable width fonts.
2021-04-18 22:10:25 +02:00
Idan Horowitz
3c894d1e6f LibGfx: Use size_t instead of int for glyph count
The count is always non-negative
2021-04-18 22:10:25 +02:00
Idan Horowitz
f461ee7d01 LibGfx: Add support for fonts that include the Hebrew Unicode Block 2021-04-18 18:57:35 +02:00
Linus Groh
8d490aba76 LibJS: Implement console.assert() 2021-04-18 18:28:17 +02:00
Linus Groh
a178255a8b LibJS: Use 'if constexpr' / dbgln_if() instead of '#if LEXER_DEBUG' 2021-04-18 18:14:50 +02:00
Linus Groh
87a43fa87c LibJS: Use 'if constexpr' instead of '#if HEAP_DEBUG' 2021-04-18 18:14:44 +02:00
Linus Groh
51676d7c33 LibJS: Use dbgln_if() instead of '#if OBJECT_DEBUG' 2021-04-18 18:10:42 +02:00
FalseHonesty
7a1396f509 LibDebug: Implement ability to set watchpoints
Now we can set hardware watchpoints for our variables! :^)
These watchpoints will be automatically removed when
they go out of scope.
2021-04-18 17:02:40 +02:00
FalseHonesty
3123ffb19d Kernel: Add ptrace commands for reading/writing the debug registers
This adds PT_PEEKDEBUG and PT_POKEDEBUG to allow for reading/writing
the debug registers, and updates the Kernel's debug handler to read the
new information from the debug status register.
2021-04-18 17:02:40 +02:00
Andreas Kling
12546259ff Everywhere: Rename title_bar => titlebar 2021-04-18 16:35:18 +02:00
Gunnar Beutner
81daca5dd7 LibC: Implement assignment suppression for vsscanf
The vsscanf library function lets the user skip assigning
parsed values to the arguments, e.g. with %*c - even though
a character is scanned it is not assigned to one of the
arguments.

The figlet port uses this. With this patch the port is actually
usable.
2021-04-18 16:35:00 +02:00
Hendiadyoin1
f682c9f100 LibC: Add netinet/in_systm.h 2021-04-18 15:52:07 +02:00
Gunnar Beutner
07adbf19c4 LibDebug: Implement support for AttributeDataForm::Data8
I came across this while analyzing a crash dump for openttd.
2021-04-18 15:51:13 +02:00
AnotherTest
ae49171755 LibCrypto: Avoid creating bools from anything except bools 2021-04-18 14:18:16 +02:00
AnotherTest
db8f0a2fa6 LibCore: Remove the no-longer-used Core::DateTime::is_before() function 2021-04-18 14:18:16 +02:00
AnotherTest
38f4441103 LibTLS: Parse X.509 certificates with the new ASN.1 parser
As a nice side effect, also correctly test for certificate validity :^)
2021-04-18 14:18:16 +02:00
AnotherTest
13abbc5ea8 LibCrypto: Implement UTCTime and GeneralizedTime parsers 2021-04-18 14:18:16 +02:00
AnotherTest
39997e2ab1 LibCore: Implement operator less-than for Core::DateTime
that just compares their timestamps.
2021-04-18 14:18:16 +02:00
AnotherTest
ed28008d78 LibCrypo: Add an ASN.1/DER pretty-printer
It's much easier to debug things when we can actually *see* them :P
2021-04-18 14:18:16 +02:00
AnotherTest
65de2d236d LibCrypto: Allow the user to override the DER read kind and class
This is useful for parsing non-universal types.
2021-04-18 14:18:16 +02:00
AnotherTest
581f9ff6bb LibCrypto: Add the GeneralizedTime ASN.1 type 2021-04-18 14:18:16 +02:00
Gunnar Beutner
f033416893 Kernel+LibC: Clean up how assertions work in the kernel and LibC
This also brings LibC's abort() function closer to the spec.
2021-04-18 11:11:15 +02:00
Andreas Kling
7ceb4f5330 LibGUI: Add some more status tips to common actions 2021-04-18 10:58:22 +02:00
Andreas Kling
a2086ad56e LibGUI: Rename Action::long_text to Action::status_tip
This feels a bit more descriptive.
2021-04-18 10:58:22 +02:00
Gunnar Beutner
407b066ba4 Ports: Update the gcc port with the patches from the toolchain 2021-04-18 10:55:25 +02:00
Gunnar Beutner
6cb28ecee8 LibC+LibELF: Implement support for the dl_iterate_phdr helper
This helper is used by libgcc_s to figure out where the .eh_frame sections
are located for all loaded shared objects.
2021-04-18 10:55:25 +02:00
Gunnar Beutner
8dc375da96 LibElf: Allow PT_GNU_EH_FRAME program headers
These are built when compiling an executable with exception support.
2021-04-18 10:55:25 +02:00
Gunnar Beutner
ebca6aabc0 LibC: Make atexit handlers thread-safe 2021-04-18 10:52:05 +02:00
Gunnar Beutner
4075b306f8 LibC+LibPthread: Make sure TLS keys are destroyed after everything else
This ensures that __thread variables can be used when global destructors
are being invoked.
2021-04-18 10:52:05 +02:00
Linus Groh
2b0c361d04 Everywhere: Fix a bunch of typos 2021-04-18 10:30:03 +02:00
Andreas Kling
d6c6880674 LibCore: Use is<T> in Object::find_*_of_type helpers
This allows us to add fast-paths for commonly used types.
2021-04-17 23:01:24 +02:00
AnotherTest
fb80d5adda LibLine: Check the terminal size at the start of get_line()
There are cases where the line editor could miss the WINCH signal
(e.g. in the shell, while another program is in the foreground),
This patch makes it so that LibLine notices the change in terminal size
in such cases.
2021-04-17 22:10:35 +02:00
AnotherTest
b58dbc29fc LibLine: Add support for ^X^E
This keybind opens the current buffer in an editor (determined by
EDITOR from the env, or the default_text_editor key in the config file,
and set to /bin/TextEditor by default), and later reads the file back
into the buffer.
Pretty handy :^)
2021-04-17 22:10:35 +02:00
Andreas Kling
5e945c5169 LibWeb: Don't load anything for <iframe> without src attribute
Completing an empty URL string from the document base URL will just
return the document URL, so any document that had an "<iframe>"
would endlessly load itself in recursive iframes.
2021-04-17 21:38:38 +02:00
Andreas Kling
22ed6a70eb LibGUI: Add "override text" to GUI::Statusbar
Each statusbar segment now has an optional "override text" which can
be set, and if non-null will be displayed instead of the regular text.

This allows programs to display contextual information in the statusbar
temporarily without losing whatever text was already on there.
2021-04-17 20:49:53 +02:00
Andreas Kling
3bf2f7a329 LibGUI: Make GUI::Toolbar buttons generate ActionEnter and ActionLeave
Now you'll get the same event whether you hover an action in a menu
or in a toolbar. :^)
2021-04-17 20:49:53 +02:00
Andreas Kling
7d0b59cb05 LibGUI: Add action enter/leave hooks on GUI::Application
Apps can now hook into these events by assigning a callback to the
on_action_enter and on_action_leave hooks on GUI::Application. :^)
2021-04-17 20:49:53 +02:00
Andreas Kling
4c6f541d5b LibGUI: Add Action* accessors on GUI::Button 2021-04-17 20:49:53 +02:00
Andreas Kling
e7263a7e75 LibGUI: Add a "long text" string to GUI::Action
Actions can now have a longer text description, in addition to its
regular UI string. The longer text will soon be used to display
a more detailed description of hovered actions in statusbars.
2021-04-17 20:49:53 +02:00
Andreas Kling
ba7e1ca2fb WindowServer+LibGUI: Notify GUI clients about menu item enter/leave
We now send out MenuItemEntered and MenuItemLeft messages to the client
when the user hovers/unhovers menu items.

On the client side, these become GUI::ActionEvent, with one of two
types: ActionEnter or ActionLeave. They are sent to the Application.

This will allow GUI applications to react to these events.
2021-04-17 20:49:53 +02:00
Linus Groh
eedde500eb LibJS: Replace MAX_U32 with NumericLimits<u32>::max() 2021-04-17 19:35:32 +02:00
Idan Horowitz
4a2c0d721f LibTextCodec: Implement a Windows-1255 decoder.
This is a superset of ascii that adds in the hebrew alphabet.
(Google currently assumes we are running windows due to not
recognizing Serenity as the OS in the user agent, resulting
in this encoding instead of UTF8 in google search results)
2021-04-17 18:13:20 +02:00
Idan Horowitz
79b1270711 LibJS: Take reference instead of pointer in prepare_arguments_list
This argument is always non-null (and the function assumes so), so
theres no point to taking a pointer instead of a reference.
2021-04-17 17:38:50 +02:00
Idan Horowitz
6cd318d784 LibJS: Convert matched regex result to string in Symbol.replace
This would crash on an undefined match (no match), since the matched
result was assumed to be a string (such as on discord.com). The spec
suggests converting it to a string as well:
https://tc39.es/ecma262/#sec-regexp.prototype-@@replace (14#c)
2021-04-17 16:10:45 +02:00
Andreas Kling
358697a32f LibGUI: Make sure we depend on the WindowManager IPC endpoints 2021-04-17 15:58:34 +02:00
sin-ack
aa56f9a1e0 LibGUI+WindowServer: Separate window manager IPC from regular IPC
With this patch the window manager related functionality is split out
onto a new endpoint pair named WindowManagerServer/Client.  This allows
window manager functionality to be potentially privilege separated in
the future.  To this end, a new client named WMConnectionClient
is used to maintain a window manager connection.  When a process
connects to the endpoint and greets the WindowServer as a window manager
(via Window::make_window_manager(int)), they're subscribed to the events
they requested via the WM event mask.

This patch also removes the hardcoding of the Taskbar WindowType to
receive WM events automatically.  However, being a window manager still
requires having an active window, at the moment.
2021-04-17 13:06:25 +02:00
Gunnar Beutner
c33592d28c Kernel+LibC: Update struct stat to use struct timespec instead of time_t
Some programs unconditionally expect struct stat to have nanosecond support.
2021-04-17 11:12:42 +02:00
Sahan Fernando
e6b396c248 LibGfx: Fix sse enabled builds by removing implicit float conversion 2021-04-17 11:00:04 +02:00
Luke
dfb23babbb LibGfx: Make top highlight of classic buttons fit to the top left corner 2021-04-17 09:56:22 +02:00
Egor Ananyin
1d343116a9 LibWeb: Fix height calculation for absolutely positioned boxes
This commit fixes algorithm for computing auto height (CSS 2.2 10.6.7)
by including floating boxes into computation and implements one of the cases
for computing the height of absolutely positioned, non-replaced elements (10.6.4 rule 3)
2021-04-17 09:48:27 +02:00
Andreas Kling
94b247c5a9 LibELF: Make get_library_name() take String instead of StringView 2021-04-17 01:27:31 +02:00
Andreas Kling
a1a6d30b54 LibCore: Make File take String instead of StringView 2021-04-17 01:27:31 +02:00
Andreas Kling
510aad6515 LibCore: Make DirIterator take String instead of StringView 2021-04-17 01:27:30 +02:00
Andreas Kling
0e4eb62dd8 LibGUI: Make some API's take String instead of StringView 2021-04-17 01:27:30 +02:00
Andreas Kling
36f27094d0 LibTTF: Make load_from_file() take String instead of StringView 2021-04-17 01:27:30 +02:00
Andreas Kling
e873d27ab1 LibGfx: Switch a bunch of API's from taking StringView to String
These were all getting converted into String internally anyway.
2021-04-17 01:27:30 +02:00
Andreas Kling
050648b270 LibGUI: Make Window::set_title() take a String 2021-04-17 01:27:29 +02:00
Andreas Kling
942a5afd23 LibCore: Don't needlessly use StringView in Core::Object APIs
Taking a StringView parameter that gets immediately converted to
a String anyway is silly. Just take a String directly instead.

This pattern is the main reason we have the "StringView internal
StringImpl pointer" optimization, and I suspect that we can throw
that whole thing out if we make a couple more patches like this.
2021-04-17 01:27:29 +02:00
Andreas Kling
d33fdc925b LibGUI: Make GUI::Widget::set_tooltip() take a String
There was no reason for this to take a StringView.
2021-04-17 01:27:29 +02:00
Idan Horowitz
586f10b6e1 LibJS: Accept symbol property in the in operator
This is used by discord.com and allowed by the specification:
https://tc39.es/ecma262/#sec-relational-operators-runtime-semantics-evaluation
2021-04-17 00:59:36 +02:00
Tobias Christiansen
7744048d0f LibWeb: Fix misplaced bullet points on list items
The bullet point should not be centered in the height of the list item,
but rather stay in front of the first line.
So, instead of giving the marker the full height of the ListItemBox,
it gets the height of a single line.

This closes #6384
2021-04-17 00:28:55 +02:00
Idan Horowitz
e3c634fdd0 LibJS: Implement initializing a TypedArray from an iterable object
Based on these specifications (which required IterableToList as well):
https://tc39.es/ecma262/#sec-typedarray
https://tc39.es/ecma262/#sec-initializetypedarrayfromlist
2021-04-17 00:24:09 +02:00
Idan Horowitz
06a2173586 LibJS: Implement initializing a TypedArray from an array-like object
Used by twitch.tv and based on the following specification:
https://tc39.es/ecma262/#sec-initializetypedarrayfromarraylike
2021-04-17 00:24:09 +02:00
James Triantafylos
c9196995be LibGUI: Allow arbitrary font size in FontPicker
This commit adds a SpinBox to the FontPicker dialog to allow users to
set arbitrary font sizes (1 to 255 inclusive) for TTF fonts.
The SpinBox is only visible when the user is selecting a TTF font.
2021-04-16 23:54:03 +02:00
AnotherTest
e4412f1f59 AK+Kernel: Make IntrusiveList capable of holding non-raw pointers
This should allow creating intrusive lists that have smart pointers,
while remaining free (compared to the impl before this commit) when
holding raw pointers :^)
As a sidenote, this also adds a `RawPtr<T>` type, which is just
equivalent to `T*`.
Note that this does not actually use such functionality, but is only
expected to pave the way for #6369, to replace NonnullRefPtrVector<T>
with intrusive lists.

As it is with zero-cost things, this makes the interface a bit less nice
by requiring the type name of what an `IntrusiveListNode` holds (and
optionally its container, if not RawPtr), and also requiring the type of
the container (normally `RawPtr`) on the `IntrusiveList` instance.
2021-04-16 22:26:52 +02:00
Linus Groh
ba3bc6fef2 LibGUI+WindowServer: Fix some misaligned CMakeLists.txt SOURCES entries 2021-04-16 21:30:53 +02:00
Idan Horowitz
223472c57f LibJS: Dont try to serialize symbol-keyed properties
As per the specification: "All Symbol-keyed properties will be
completely ignored, even when using the replacer function."
2021-04-16 19:22:29 +02:00
Idan Horowitz
fff7aceb9d LibJS: Accept symbol property in ObjectPrototype::hasOwnProperty
This is used by discord.com and allowed by the specification
(https://tc39.es/ecma262/#sec-topropertykey)
2021-04-16 19:22:29 +02:00
Timothy Flynn
2381b19719 Browser+LibWeb+WebContent: Parse cookies in the OOP tab
To protect the main Browser process against nefarious cookies, parse the
cookies out-of-process and then send the parsed result over IPC to the
main process. This way, if the cookie parser blows up, only that tab
will be affected.
2021-04-16 19:19:31 +02:00
Timothy Flynn
6e10c2cdb7 LibCore+LibIPC: Add IPC coder for Core::DateTime
Since LibCore cannot depend on LibIPC, the coders are defined in LibIPC
just like they are for Core::AnonymousBuffer.
2021-04-16 19:19:31 +02:00
Timothy Flynn
67884f6747 LibWeb: Impose a sane max cookie size
Drop cookies larger than 4KiB. This value is the RFC's recommendation:
https://tools.ietf.org/html/rfc6265#section-6.1
2021-04-16 19:19:31 +02:00
Gunnar Beutner
960079b020 LibELF: Add support for loading libraries from /usr/local 2021-04-16 19:04:24 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
AnotherTest
6606d70826 LibDebug/Dwarf: Use dbgln_if() instead of '#if DWARF_DEBUG' 2021-04-16 19:00:30 +02:00
Gunnar Beutner
b731db6691 LibDebug: Add support for StandardOpcodes::FixAdvancePc 2021-04-16 19:00:30 +02:00
Gunnar Beutner
4f6914a0c0 LibDebug: Add array bounds check for m_source_files 2021-04-16 19:00:30 +02:00
Linus Groh
a5d4ef462c LibJS: Remove #if !defined(KERNEL)
AK::JsonValue::{is,as}_double() is not available in the kernel, but that
doesn't affect LibJS.
2021-04-16 18:57:58 +02:00
sin-ack
091d352526 Kernel: Add some missing socket ioctls
This patch adds a few missing ioctls which were required by Wine.
SIOCGIFNETMASK, SIOCGIFBRDADDR and SIOCGIFMTU are fully implemented,
while SIOCGIFFLAGS and SIOCGIFCONF are stubs.
2021-04-16 18:57:35 +02:00
Gunnar Beutner
92749d9a76 LibC: Don't call initializers in crt0
The dynamic linker is already taking care of this for us. Now
that crt0 is statically linked into each executable and shared
library this breaks things because initializers are invoked twice.

Before this PR this didn't crash because crt0 and its _start()
function was contained in LibC and thus only LibC's initializers were
invoked several times which wasn't as much of a problem because
these initializers didn't have any side effects (such as malloc/free).

However, user programs are more likely to have constructors with side
effects, e.g.:

    std::string g_test("hello!");

This would allocate memory when the constructor is invoked. When it is
invoked again the original allocation would be leaked and another copy
of the string would get allocated. Worse still, when the destructors are
invoked twice the memory would get free'd twice which would likely
crash the program.
2021-04-16 17:56:12 +02:00
Gunnar Beutner
50e4cad4a0 Toolchain+LibC: Don't link LibC against crt0
Instead GCC should be used to automatically link against crt0
and crt0_shared depending on the type of object file that is being
built.

Unfortunately this requires a rebuild of the toolchain as well
as everything that has been built with the old GCC.
2021-04-16 17:56:12 +02:00
Gunnar Beutner
67516fa555 LibC: Shared libraries shouldn't have an entry point
The _start() function attempts to call main() which is a
problem when trying to build a shared library with --no-undefined:

  $ echo > t.c
  $ gcc -shared -Wl,--no-undefined -o t.so t.c
  /usr/local/lib/gcc/i686-pc-serenity/10.2.0/../../../../i686-pc-serenity/bin/ld:
  /usr/lib/crt0_shared.o: in function `_start':
  ./Build/i686/../../Userland/Libraries/LibC/crt0_shared.cpp:56: undefined reference to `main'
  collect2: error: ld returned 1 exit status

Also, unless explicitly requested by the user shared libraries
should not have an entry point (e.g. _start) at all.
2021-04-16 17:56:12 +02:00
FalseHonesty
a5b4d4434e LibDebug: Fix typo in handle_special_opcode method name
handle_sepcial_opcode -> handle_special_opcode :)
2021-04-16 17:40:24 +02:00
sin-ack
5b95850e28 SystemServer+LibCore: Allow service to request multiple sockets
SystemServer only allowed a single socket to be created for a service
before this.  Now, SystemServer will allow any amount of sockets.  The
sockets can be defined like so:

[SomeService]
Socket=/tmp/portal/socket1,/tmp/portal/socket2,/tmp/portal/socket3
SocketPermissions=660,600

The last item in SocketPermissions is applied to the remainder of the
sockets in the Socket= line, so multiple sockets can have the same
permissions without having to repeat them.

Defining multiple sockets is not allowed for socket-activated services
at the moment, and wouldn't make much sense anyway.

This patch also makes socket takeovers more robust by removing the
assumption that the socket will always be passed in fd 3.  Now, the
SOCKET_TAKEOVER environment variable carries information about which
endpoint corresponds to which socket, like so:

SOCKET_TAKEOVER=/tmp/portal/socket1:3 /tmp/portal/socket2:4

and LocalServer/LocalService will parse this automatically and select
the correct one.  The old behavior of getting the default socket is
preserved so long as the service only requests a single socket in
SystemServer.ini.
2021-04-15 21:04:49 +02:00
Nicholas-Baron
c4ede38542 Everything: Add -Wnon-virtual-dtor flag
This flag warns on classes which have `virtual` functions but do not
have a `virtual` destructor.

This patch adds both the flag and missing destructors. The access level
of the destructors was determined by a two rules of thumb:
1. A destructor should have a similar or lower access level to that of a
   constructor.
2. Having a `private` destructor implicitly deletes the default
   constructor, which is probably undesirable for "interface" types
   (classes with only virtual functions and no data).

In short, most of the added destructors are `protected`, unless the
compiler complained about access.
2021-04-15 20:57:13 +02:00
Idan Horowitz
ad8e2f481d LibWeb: Expose the MouseEvent::{clientX, clientY} attributes
These provide the cursor coordinate within the viewport at which the
event occurred (as opposed to the page relative coordinates exposed via
offsetX, offsetY).
2021-04-15 20:22:08 +02:00
Idan Horowitz
815934a95d LibWeb: Expose the HTMLElement::{offsetLeft, offsetTop} attributes
These describe the border box of an element relative to their parent.
2021-04-15 20:22:08 +02:00
Idan Horowitz
c5769a7033 LibWeb: Check radius sign in CanvasRenderingContext2D::{arc, ellipse}
As required by the specification: 'If either radiusX or radiusY are
negative, then throw an "IndexSizeError" DOMException.'
2021-04-15 20:22:08 +02:00
Idan Horowitz
00114ab01d LibWeb: Add a naive implemention of CanvasRenderingContext2D::fill_text
This doesnt actually account for several unimplemented attributes
(like ltr/rtl, alignment, etc) yet, so this should be expanded in
the future.
2021-04-15 20:22:08 +02:00
Idan Horowitz
a257ef0f35 LibWeb: Add support for optional double arguments with no default value
This is implemented by emitting AK::Optional, similar to optional
boolean arguments.
2021-04-15 20:22:08 +02:00
Idan Horowitz
0072581693 LibWeb: Emit optional boolean variable definition in WrapperGenerator
The removed if in this commit was inside the else branch of an if with
the same condition, making it a no-op, as well as breaking optional
booleans.
2021-04-15 20:22:08 +02:00
AnotherTest
dbc5b05b7a LibM: Use fptan/fpatan instead of approximating atan2/tan
The previous versions were very inaccurate, and sometimes wrong.
2021-04-15 17:50:16 +02:00
AnotherTest
801daf47f0 LibGfx+LibWeb: Wire up CanvasRenderingContext2D.ellipse()
Note that this is *extremely* naive, and not very good at being correct.
2021-04-15 17:50:16 +02:00
AnotherTest
6c05d6d370 LibGfx: Add a Path::arc_to() helper
...That just uses elliptical_arc_to().
2021-04-15 17:50:16 +02:00
AnotherTest
1ea466661f LibGfx+LibWeb: Move out the EllipticArcTo() logic into Path
At its previous state, the interface allowed invalid "ellipses" to be
specified, instead of doing that, simply use the parameters that SVG
uses :^)
2021-04-15 17:50:16 +02:00
AnotherTest
cb04a441cf LibGfx: Un-recursive-ify the Bezier and Elliptic curve implementations 2021-04-15 17:50:16 +02:00
Timothy Flynn
0f47a23e8e LibWeb: Set Cookie header on remaining resource requests 2021-04-15 09:46:49 +02:00
Timothy Flynn
0cacc52990 LibWeb: Set Cookie header on <img> and <object> resource requests
This required passing a reference to the owning HTML*Element to
ImageLoader, the same way that CSSLoader has a reference to its owner.
2021-04-15 09:46:49 +02:00
Timothy Flynn
347838a240 LibWeb: Set Cookie header on <script> resource requests
This required changing the load_sync API to take a LoadRequest instead
of just a URL. Since HTMLScriptElement was the only (non-test) user of
this API, it didn't seem useful to instead add an overload of load_sync
for this.
2021-04-15 09:46:49 +02:00
Timothy Flynn
3cc5286565 LibWeb: Helper for creating load requests with a Cookie header
Instead of all interested parties needing to write out the code to get
the cookie value for a load request, add a static helper to do it in
one location.
2021-04-15 09:46:49 +02:00
Linus Groh
726d631527 LibJS: Use references in CallExpression::compute_this_and_callee()
This has the nice side effect of giving us a decent error message for
something like undefined.foo() - another useless "ToObject on null or
undefined" gone. :^)
Also turn the various ternary operators into two separate if branches,
they don't really share that much.
2021-04-15 09:45:20 +02:00
Gunnar Beutner
b3eb55ec9a LibPthread: Implement sem_getvalue() 2021-04-15 09:31:49 +02:00
Gunnar Beutner
a44ddc4793 LibPthread: Don't hold sem->mtx after sem_wait()/sem_trywait()
Semaphores with values greater than one didn't work because whoever
called sem_wait() first held the semaphore's mutex until a matching
sem_post() call.

Other callers then wouldn't be able to acquire the semaphore even
if the semaphore's value was still greater than zero at that point.
2021-04-15 09:31:49 +02:00
Gunnar Beutner
32794e00a1 LibPthread: Improve error handling for the semaphore functions
This patch makes sure we're propagating errors to the caller.
2021-04-15 09:31:49 +02:00
Gunnar Beutner
98403eccb0 LibPthread: Ensure we're not overflowing the semaphore's value 2021-04-15 09:31:49 +02:00
Timothy Flynn
b6093ae2e3 LibJS: Implement String.prototype.substr according to the spec
Fixes #6325

The JavaScript on the HTML Spec site that caused the crash is:
    window.location.hash.substr(1)

Of course, window.location.hash can be the empty string. The spec allows
for calling substr(1) on an empty string, but our partial implementation
wasn't handling it properly.
2021-04-15 08:38:19 +02:00
Idan Horowitz
bc9cd55da4 Browser+LibWeb: Add support for spoofing the browser user agent
This is helpful when testing certain sites like twitter.com which
display differently based on the user agent.
2021-04-14 23:06:32 +02:00
Idan Horowitz
aab99d5945 LibWeb: Implement the CanvasRenderingContext2D::rect path method
This method adds a rectangle to the current 2D path.
2021-04-14 23:01:23 +02:00
Idan Horowitz
4c0937225e LibWeb: Make CanvasRenderingContext2D::fill's fillRule argument optional
As defined by the specification (and used by the website i am testing):
interface mixin CanvasDrawPath {
  undefined fill(optional CanvasFillRule fillRule = "nonzero");
}
2021-04-14 23:01:23 +02:00
Idan Horowitz
0a580ef891 LibWeb: Request repaint on canvas path finalizaiton via fill/stroke
Since these were not requesting a repaint the drawn path was not being
rendered until a repaint was forced in some other way (window resize).
2021-04-14 23:01:23 +02:00
Idan Horowitz
b7c3f046f7 LibGfx: initialize winding number to 1 for NonZero winding rules
Since we first check the winding number and only then update it, fills
for "Rectangle-like" (made up of 2 parallel segments) paths would draw
nothing when filled by NonZero winding rules. (Fix by alimpfard)
2021-04-14 23:01:23 +02:00
Linus Groh
51a5427419 LibJS: Improve Reference::get() TypeError message for nullish base
"ToObject on null or undefined" is useless.
"Cannot get property 'foo' of undefined" isn't.
2021-04-14 22:37:12 +02:00
Linus Groh
73a92c79b8 LibJS: Use reference in MemberExpression::execute()
This was basically duplicated code.
2021-04-14 22:37:12 +02:00
Gunnar Beutner
1e1de4a542 LibC: Use __inline_isascii() in isascii() 2021-04-14 21:46:20 +02:00
Gunnar Beutner
3df7f868e8 LibC: Add support for isblank() 2021-04-14 21:46:20 +02:00
Gunnar Beutner
75d774ba29 LibC: Add missing macro for _SC_CLK_TCK 2021-04-14 21:46:20 +02:00
Gunnar Beutner
5a4206ef2e LibC: Turn regex_t and regmatch_t into typedefs
According to POSIX.1-2001 these should be anonymous structs with
a typedef.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
546fa8cfb5 LibC: Change return type for sleep() to unsigned int
According to POSIX.1-2001 the return type should be unsigned int.
2021-04-14 21:46:20 +02:00
Timothy Flynn
c00760c5f9 Browser+LibWeb+WebContent: Track the source of document.cookie requests
To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
2021-04-14 16:07:46 +02:00
Timothy Flynn
7193e518d1 Browser+LibWeb: Move the cookie structure into LibWeb 2021-04-14 16:07:46 +02:00
Timothy Flynn
c2d38abe6f Browser+LibWeb: Move cookie parser into LibWeb
This moves the cookie parsing steps out of CookieJar into their own file
inside LibWeb. It makes sense for the cookie structures to be in LibWeb
for a couple reasons:

1. There are some steps in the spec that will need to partially happen
   from LibWeb, such as the HttpOnly attribute.
2. Parsing the cookie string will be safer if it happens in the OOP tab
   rather than the main Browser process. Then if the parser blows up due
   to a malformed cookie, only that tab will be affected.
3. Cookies in general are a Web concept not specific to a browser.
2021-04-14 16:07:46 +02:00
Idan Horowitz
ba77b40808 LibJS: Implement the encode/decodeURI(Component) family of functions
These are generally useful and in particular needed for twitter.com
2021-04-14 13:30:10 +02:00
FalseHonesty
2d58549296 LibDebug: Add support for parsing array types
This includes multi-dimensional arrays :O
2021-04-14 13:28:48 +02:00
FalseHonesty
acbb119b27 LibDebug: Support unnamed variables and types
We were supposed to already support unnamed types, but due to a
little typo, we were actually causing more problems :^)
2021-04-14 13:28:48 +02:00
Gunnar Beutner
7d12c08bec LibC: Add definition for the NI_NAMEREQD macro 2021-04-14 13:13:06 +02:00
Gunnar Beutner
ea6d0aa1d4 LibPthread: Implement semaphore functions 2021-04-14 13:13:06 +02:00
Gunnar Beutner
f2ff8f2658 LibELF: Improve error messages for missing shared libraries 2021-04-14 13:13:06 +02:00
Gunnar Beutner
dce57cd085 LibC: Add definitions for INTMAX_C and UINTMAX_C 2021-04-14 13:13:06 +02:00
Gunnar Beutner
1946a4bee6 LibC: Add missing include in <syslog.h>
The include is necessary for __BEGIN_DECLS and __END_DECLS.
2021-04-14 13:13:06 +02:00
Gunnar Beutner
cd7512a2ad LibELF: Add support for loading objects with multiple data and text segments
This enables loading executables with multiple data and text segments. Also
it fixes loading executables where the text segment has a non-zero offset.

Example:

  $ echo "main () {}" > test.c
  $ gcc -Wl,-z,separate-code -o test test.c
  $ objdump -p test
  test:     file format elf32-i386

  Program Header:
      PHDR off    0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
           filesz 0x000000e0 memsz 0x000000e0 flags r--
    INTERP off    0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**0
           filesz 0x00000013 memsz 0x00000013 flags r--
      LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
           filesz 0x000003c4 memsz 0x000003c4 flags r--
      LOAD off    0x00001000 vaddr 0x00001000 paddr 0x00001000 align 2**12
           filesz 0x00000279 memsz 0x00000279 flags r-x
      LOAD off    0x00002000 vaddr 0x00002000 paddr 0x00002000 align 2**12
           filesz 0x00000004 memsz 0x00000004 flags r--
      LOAD off    0x00002004 vaddr 0x00003004 paddr 0x00003004 align 2**12
           filesz 0x00000100 memsz 0x00000124 flags rw-
   DYNAMIC off    0x00002014 vaddr 0x00003014 paddr 0x00003014 align 2**2
           filesz 0x000000c8 memsz 0x000000c8 flags rw-
2021-04-14 13:12:52 +02:00
Maciej Zygmanowski
e83caffccc LibCore: Use dbgln_if in EventLoop.cpp 2021-04-14 10:54:56 +02:00
Linus Groh
ea60b344eb LibJS: Add name and message properties to NativeError prototypes
Otherwise these will get their name/default message from the Error
prototype, and as a result would always just say "Error" in error
messages, not the specific type.
Something I missed in da177c6, now with tests. :^)
2021-04-14 10:11:04 +02:00
AnotherTest
339ae7873e LibHTTP: Trim the whitespace around the Transfer-Encoding header value
Fixes #6302.
2021-04-14 09:31:31 +02:00
Linus Groh
5da4c9bf1e LibWeb: Implement Node.cloneNode()
With this we can now successfully run a Vue.js 2 hello world! :^)
2021-04-14 09:30:29 +02:00
Linus Groh
d721c93beb LibWeb: Add Element::prefix()
Just a getter for m_qualified_name.prefix(), just like local_name() and
namespace_().
2021-04-14 09:30:29 +02:00
AnotherTest
d2b5c4d8dc LibWeb: Actually return an empty value when an exception is thrown via
throw_dom_exception_if_needed()

Fixes #6298.
2021-04-13 23:56:19 +02:00
AnotherTest
9c201767a0 LibWeb: Fix some FIXMEs related to ExceptionOr<T>
This fixes a few FIXMEs mentioned in 5beacf08a2,
which depended on #6075 being fixed.
2021-04-13 22:31:06 +02:00
AnotherTest
8ba2b5f36f LibWeb: Make ExceptionOr work with non-JS::Value types
Fixes #6075.
2021-04-13 22:31:06 +02:00
Egor Ananyin
d5def1cad0 LibWeb: Use min-height in calculating height 2021-04-13 22:04:25 +02:00
Egor Ananyin
fe544feb17 LibWeb: Start parsing font property 2021-04-13 22:04:25 +02:00
Linus Groh
e4b3591ac4 LibWeb: Fix a TODO in the adoption agency algorithm
There's still a much bigger one at the end of the function though. :^)
2021-04-13 21:59:55 +02:00
Jean-Baptiste Boric
c130161d9f LibCore: Don't leak file descriptor inside AnonymousBuffer on Linux 2021-04-13 21:52:34 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Linus Groh
45133d8ada LibJS: Unset m_unwind_until_label in stop_unwind()
I don't see a reason to keep this intact, that might only surprise us
down the line...
2021-04-13 15:40:52 +02:00
Linus Groh
4ee965f916 LibJS: Add set_exception() and change throw_exception() to take a reference
Sometimes we just want to set m_exception to some value we stored
previously, without really "throwing" it again - that's what
set_exception() does now. Since we have clear_exception(), it does take
a reference, i.e. you don't set_exception(nullptr). For consistency I
updated throw_exception() to do the same.
2021-04-13 15:40:52 +02:00
Linus Groh
f2abe42ecb LibJS: Update empty TryStatement result value to undefined
It's what the spec wants us to do, although I'm not sure if it has an
observable effect anywhere, as we don't expose empty values. Let's do it
anyway.
2021-04-13 15:40:52 +02:00
Linus Groh
7cbede4342 LibJS: Fix return value of TryStatement with finalizer
Previously we would always return the result of executing the finalizer,
however the spec dictates the finalizer result must only be returned for
a non-normal completion.
I added some more comments along the way, which should make it more
clear what's going on - the unwinding and exception flow isn't super
straightforward here.
2021-04-13 15:40:52 +02:00
Linus Groh
e8cbcc2fbf LibJS: Replace two more uses of unwind(ScopeType::None) with stop_unwind()
Same thing, but a lot more clear.
2021-04-13 15:40:52 +02:00
Itamar
f52c3cabcf HackStudio: Add ClassView tab for viewing classes in a tree structure
This enables the user to view and navigate classes with a TreeView that
is updated by the LanguageServer as it parses the code.

It offers a new neat way to view the project's structure :^)
2021-04-13 15:16:27 +02:00
Itamar
b87791cada LibCpp: Add 'Namespace' and 'Member' declaration types 2021-04-13 15:16:27 +02:00
Itamar
c6c83bd80e HackStudio+LibCpp: Include class members in Locator 2021-04-13 15:16:27 +02:00
tuqqu
c8ad1df143 LibJS: Array.from mapFn fixes + thisArg support
* Callback mapFn now properly supports second argument (index)
* Support of thisArg to be passed as "this" in vm.call
* Tests for all cases
2021-04-13 15:16:16 +02:00
FalseHonesty
2ed5d19407 LibGUI+HackStudio: Add way to tell FilePicker to open a folder
This now means that when trying to open a folder, one can click on
the folder and press open instead of having to actually step into
the desired folder. Of course, it also means it won't let you open
non-directories anymore.
2021-04-13 15:16:07 +02:00
Brendan Coles
ce010de74f LibC: getaddrinfo: Set addrinfo sin_port to 0 if service arg is NULL 2021-04-13 15:10:14 +02:00
Andreas Kling
1ca22b46f9 LibGUI: Allow GUI::ProgressBar to have min() == max() 2021-04-13 10:12:50 +02:00
Gunnar Beutner
30b038f8d9 LibC: Implement getaddrinfo(), freeaddrinfo(), gai_strerror() and getnameinfo() 2021-04-12 22:44:49 +02:00
Gunnar Beutner
8fcf91b030 LibC: The port numbers returned by getservby*() should be in network byte order 2021-04-12 22:44:49 +02:00
Gunnar Beutner
287a93a2a4 LibC: Validate the len argument for inet_ntop() 2021-04-12 22:44:49 +02:00
FalseHonesty
bffa1a0df8 LibDebug: Stop parsing unhandled variable types
Previously, when trying to debug variables with more complex
types (such as String), we would crash the debugger simply because
it didn't know how to handle types that were irrelevant anyways.
Now we just skip data we don't yet know how to handle.
2021-04-12 22:43:33 +02:00
FalseHonesty
d295095993 LibDebug+HackStudio: Fix crashes relating to debugger variable preview
For one, viewing a variable who's type contained a subprogram will
no longer crash HackStudio. Additionally, the variable view will
handle invalid enum values gracefully now, fixing another crash.
Finally, deeply nested (nest count > 1) structures will have their
memory addresses properly set, fixing the final crash I found.
2021-04-12 22:43:33 +02:00
Gunnar Beutner
0497986572 LibC: Use dbgln() in strerror() and strsignal()
Printing error messages to stdout can have unintended side effects
depending on what the program is doing.
2021-04-12 22:34:07 +02:00
Gunnar Beutner
44486e8818 LibC: Turn CRASH() into a function and add noreturn attribute
This way CRASH() can be used in functions that are themselves
marked as noreturn.
2021-04-12 22:30:06 +02:00