Commit graph

13407 commits

Author SHA1 Message Date
zilrich
a2ffe95a8c
Meta: Update OpenSUSE build dependencies (#3655) 2020-10-02 13:08:06 +02:00
AnotherTest
254d66cd81 Shell: Assert that the same pid is not given to waitpid()
Theoretically, this assertion should never trip (at least, on serenity
where we don't really reuse PIDs).
This change should be considered temporary, until we figure out whether
waitpid() is being called twice (and succeeding) for one given PID.
2020-10-01 21:20:14 +02:00
AnotherTest
519d1811fd Shell: Wait for *any* child to change state when receiving a SIGCHLD
This really just works around the core issue, which is that we have no
reliable way to know exactly who raised the signal (yet).
Fixes #3645, in a very weird (yet apparently standard) way.
2020-10-01 21:20:14 +02:00
AnotherTest
a7828434c0 Shell: Sneak a way into being a session leader 2020-10-01 21:20:14 +02:00
Tibor Nagy
422cb50e4e Userland: Fix buffer overflow in unzip
It's not a great idea reading file names into a 4 byte sized buffer.
2020-10-01 21:15:35 +02:00
Andreas Kling
bd5abbc454 LibJS: Fix fatal mistake in HeapBlock::cell_from_possible_pointer()
When scanning for potential heap pointers during conservative GC,
we look for any value that is an address somewhere inside a heap cell.

However, we were failing to account for the slack at the end of a
block (which occurs whenever the block storage size isn't an exact
multiple of the cell size.) Pointers inside the trailing slack were
misidentified as pointers into "last_cell+1".

Instead of skipping over them, we would treat this garbage data as a
live cell and try to mark it. I believe this is the test-js crash that
has been terrorizing Travis for a while. :^)
2020-10-01 21:07:12 +02:00
Andreas Kling
0245e0f03a DevTools: Remove VisualBuilder and FormCompiler
This functionality is being moved to HackStudio so let's not confuse
people by keeping the old stuff around.
2020-10-01 21:07:12 +02:00
Andreas Kling
6c9a3ecf42 LibIPC: Silence a warning when compiling with gcc -O0 2020-10-01 19:16:35 +02:00
Itamar
a39c4cc340 HackStudio: Integrate with C++ Language Server
Editors now communicate with the c++ language server when openning and
editing c++ source files, and go through the language server to get
autocomplete suggestions.
2020-09-30 21:46:59 +02:00
Itamar
863f14788f HackStudio: Add C++ Language Server
The language server keeps track of the content of currently edited
files by receiving updates about edit actions.

Also, C++ autocompletion is no longer tied to HackStudio itself and
moved to be part of the language server.
2020-09-30 21:46:59 +02:00
Itamar
bf53d7ff64 LibCpp: Add library for working with c++ code
Moved the C++ Lexer we have from LibGUI to here, so that other
components could use it without linking with LibGUI.
2020-09-30 21:46:59 +02:00
Itamar
fec4152220 LibCore: Add ensure_parent_directories to LibCore::File
Moved the implementation in SystemServer/Service.cpp to LibCore.
2020-09-30 21:46:59 +02:00
AnotherTest
c1fc27cab2 HackStudio+TextEditor: Add the Shell syntax highlighter 2020-09-30 20:05:24 +02:00
AnotherTest
72b68221cc LibGUI: Add a Shell syntax highlighter 2020-09-30 20:05:24 +02:00
AnotherTest
a10cfee0d4 Shell: Track line numbers and the positions of some keywords 2020-09-30 20:05:24 +02:00
AnotherTest
b91be8b9fd Shell: Make 'editor' a member of Shell, and provide a LibShell 2020-09-30 20:05:24 +02:00
Andreas Kling
e4bda2e1e7 LibJS: Move Console from Interpreter to GlobalObject
Each JS global object has its own "console", so it makes more sense to
store it in GlobalObject.

We'll need some smartness later to bundle up console messages from all
the different frames that make up a page later, but this works for now.
2020-09-29 21:15:06 +02:00
Luke
a9335eea1c LibWeb: Add cm, in, mm and Q CSS units 2020-09-29 20:46:18 +02:00
Andreas Kling
279a49cdf4 Base: Show how long it took to load the welcome.html page :^) 2020-09-29 18:36:00 +02:00
Andreas Kling
18cff5e0be LibWeb: Implement performance.timeOrigin
This is the origin timestamp of the same monotonic clock used for the
performance.now() timestamp.

I got a little confused while implementing this, since the numbers are
very low. That's because it uses the CLOCK_MONOTONIC system clock,
which we start counting from 0 at boot. :^)
2020-09-29 18:31:07 +02:00
Andreas Kling
62785b7872 LibCore: Expose origin timestamp of Core::ElapsedTime 2020-09-29 18:22:53 +02:00
Andreas Kling
97d0acc5b6 LibWeb: Implement performance.now()
This patch introduces the HighResolutionTime namespace which is home to
the Performance object (exposed via window.performance)

performance.now() is currently the only function, and it returns the
number of milliseconds since the window object was constructed. :^)
2020-09-29 18:19:18 +02:00
Andreas Kling
8cb789d061 LibWeb: Remove a bunch of unnecessary <LibJS/Interpreter.h> includes 2020-09-29 17:04:16 +02:00
Andreas Kling
be055b3ddd LibJS: Reduce use of Interpreter in Reference 2020-09-29 16:45:39 +02:00
Andreas Kling
3df604ad12 LibJS: Reduce use of Interpreter in LexicalEnvironment 2020-09-29 16:41:28 +02:00
asynts
1175ecf1dd AK+Format: Add support for integer to character casts.
Now the following is possible:

    outf("{:c}", 75); // K
2020-09-29 16:14:58 +02:00
asynts
f221a95a71 AK: Add NumericLimits specialization for char.
This is yet another bug because of the 'char'/'signed char'/'unsigned char' shit.
2020-09-29 16:14:58 +02:00
asynts
71b7ef0992 AK+Format: Support all format specifiers for strings.
The following is now possible:

    outf("{:.4}", "abcdef"); // abcd
    outf("{:*<8}", "abcdef"); // abcdef**
2020-09-29 16:14:58 +02:00
Luke
c0d9daadb0 LibGfx: Fix cut off CSS color names 2020-09-29 09:20:33 +02:00
Andreas Kling
709581e141 UserspaceEmulator: Implement the getsid() syscall 2020-09-28 23:34:55 +02:00
Andreas Kling
b058852c62 Kernel: Fix overly eager fd closing in sys$execve()
When obeying FD_CLOEXEC, we don't need to explicitly call close() on
all the FileDescriptions. We can just clear them out from the process
fd table. ~FileDescription() will call close() anyway.

This fixes an issue where TelnetServer would shut down accepted sockets
when exec'ing a shell for them. Since the parent process still has the
socket open, we should not force-close it. Just let go.
2020-09-28 22:40:44 +02:00
Andreas Kling
0930e2323b Kernel: Remove unnecessary capture in sys$execve() 2020-09-28 22:24:27 +02:00
Andreas Kling
f88a7cd4e1 LibCore: Make TCPServer::listen() report failure instead of asserting 2020-09-28 22:14:23 +02:00
Luke
d79194d87f Kernel: Return early in create_inode if name is too long 2020-09-28 21:52:31 +02:00
AnotherTest
cfa5e6efe9 Spreadsheet: Add the 'lookup' and 'reflookup' functions 2020-09-28 17:41:48 +02:00
AnotherTest
9c1143fe13 Spreadsheet: Add a 'choose' function 2020-09-28 17:41:48 +02:00
AnotherTest
f159d161fa Spreadsheet: Let the cells know their own position in the sheet 2020-09-28 17:41:48 +02:00
asynts
13ce24de13 AK+Format: Support default index in replacement field.
The following does now work:

    outf("{:0{}}", 1, 3);      // 001
2020-09-28 17:41:27 +02:00
asynts
afa2523724 Shell: Don't execute scripts interactively.
The following example should illustrate one issue arising from this:

    $ echo 'exit 1' > example.sh
    $ Shell example.sh
    Good-bye!

This message is meant to be shown to an interactive user, but not in a
shell script.
2020-09-28 17:39:50 +02:00
Andreas Kling
d3d7ea7e75 LibWeb: LoadRequest::operator==() should compare header values
It was only comparing header names. Thanks to @Sponji for noticing!
2020-09-28 17:36:55 +02:00
asynts
574f49e4be AK+TestSuite: Don't assume that the test passed in output.
The problem with our test suite is that it can't detect if a test
failed. When a test fails we simply write 'FAIL ...' to stderr and move
on.

Previously, the test suite would list all tests as passing regardless
how many assertions failed. In the future it might be smart to implement
this properly but test suites for C++ are always hard to do nicely.
(Because C++ execution isn't meant to be embedded.)
2020-09-28 15:10:52 +02:00
Andreas Kling
9225bfa95e LibGUI: Correct inline editor placement in ColumnsView
Thanks to @bugaevc for noticing that I didn't account for the 1px space
between columns, and for the space occupied by the item icon.
2020-09-28 12:27:56 +02:00
Andreas Kling
ceda137bf2 LibWeb: Support <form method=POST>
Use the new support for HTTP method and request body to implement basic
support for POST'ed forms. This is pretty cool! :^)
2020-09-28 11:56:26 +02:00
Andreas Kling
2946a684ef ProtocolServer+LibWeb: Support more detailed HTTP requests
This patch adds the ability for ProtocolServer clients to specify which
HTTP method to use, and also to include an optional HTTP request body.
2020-09-28 11:55:26 +02:00
Andreas Kling
cfafd4d52d LibWeb: Expand LoadRequest class to include method, headers and body
This will allow us to create more detailed requests from inside the
web engine.
2020-09-28 11:53:32 +02:00
asynts
56bfefabb6 AK+Format: Keep type information for integers in TypeErasedParameter.
It's now save to pass a signed integer as parameter and then use it as
replacement field (previously, this would just cast it to size_t which
would be bad.)
2020-09-28 10:53:16 +02:00
asynts
6a2f5f4522 AK+Format: Clean up format specifier parsing using GenericLexer.
Also adds support for replacement fields.
2020-09-28 10:53:16 +02:00
Andreas Kling
ebe1288aea LibJS: Add missing <AK/Function.h> include in JSONObject.cpp 2020-09-28 09:17:33 +02:00
Benoît Lormeau
f0f6b09acb AK: Remove the ctype adapters and use the actual ctype functions instead
This finally takes care of the kind-of excessive boilerplate code that were the
ctype adapters. On the other hand, I had to link `LibC/ctype.cpp` to the Kernel
(for `AK/JsonParser.cpp` and `AK/Format.cpp`). The previous commit actually makes
sense now: the `string.h` includes in `ctype.{h,cpp}` would require to link more LibC
stuff to the Kernel when it only needs the `_ctype_` array of `ctype.cpp`, and there
wasn't any string stuff used in ctype.
Instead of all this I could have put static derivatives of `is_any_of()` in the
concerned AK files, however that would have meant more boilerplate and workarounds;
so I went for the Kernel approach.
2020-09-27 21:15:25 +02:00
Benoit Lormeau
f158cb27ea LibC: Remove an unneeded string.h include in ctype.h/cpp
And include string.h in the files that actually needed it
2020-09-27 21:15:25 +02:00