Commit Graph

17378 Commits

Author SHA1 Message Date
Itamar
71c7597130 LanguageServers/Cpp: Add type to Declarations 2021-02-27 16:37:35 +01:00
Itamar
4b483071fb LanguageServers: Add ProjectLoaction, Declaration types and use in IPC
With this we can avoid passing (name, line, column) tuples in many
different places.
2021-02-27 16:37:35 +01:00
Andreas Kling
daf18e7777 AK: Use Array iterator instead of indexing outside Array bounds 2021-02-27 11:48:25 +01:00
Andreas Kling
6817d0701e TextEditor: Initialize menubar before opening initial file
Otherwise we can't toggle the syntax highlighting actions based on the
opened file (since the actions have not been created yet.)
2021-02-27 11:10:37 +01:00
Andreas Kling
28720e9035 TextEditor: Rename open_sesame() => open_file() 2021-02-27 11:05:39 +01:00
Andreas Kling
69d8ad52c4 AK: Always do bounds checking in Array::operator[] 2021-02-27 09:23:32 +01:00
Andreas Kling
b7c66233f6 LibVT: Make VT::Line use a Vector for storage
This is preparation for non-destructive terminal resizing which will
require more dynamic storage for lines.
2021-02-27 09:23:06 +01:00
speles
c58570ebaf LibGUI: Make empty TextRange invalid
Having TextRange which is empty doesn't make any sense. So it confuses
the functions that rely on having valid range, and causes them to do
no action.
Fixes #5341
2021-02-27 07:58:09 +01:00
Nick Vella
2b9098f540 WidgetGallery: add a simple Wizard demo :^)
The sample Wizard subclasses WizardDialog and demonstrates a front and
back cover, as well as extracting user input from a Wizard page to
display in the interface which spawned the Wizard.
2021-02-27 07:31:55 +01:00
Nick Vella
e241dba8d3 LibGUI: add a rudimentary framework for Wizards.
This patch provides the basic components needed for developers to create
consistent wizard interface experiences in their applications.
`WizardDialog` provides the dialog frame for the wizard, handling navigation
and presentation.
`AbstractWizardPage`s form the base class of Wizard pages, which are
pushed onto the `WizardDialog` page stack via `WizardDialog::push_page`.
`CoverWizardPage` and `WizardPage` are provided to ease the creation of
Wizard interfaces consistent with the Serenity visual language.
2021-02-27 07:31:55 +01:00
AnotherTest
610cec6e72 LibJS: Enable the BrowserExtended ECMA262 regexp flag by default
Fixes #5517.
2021-02-27 07:31:01 +01:00
AnotherTest
e0ac85288e LibRegex: Allow missing high bound in {x,y} quantifiers
Fixes #5518.
2021-02-27 07:31:01 +01:00
AnotherTest
91bf3dc7fe LibRegex: Match the escaped part of escaped syntax characters
Previously, `\^` would've matched `\`, not `^`.
2021-02-27 07:31:01 +01:00
AnotherTest
f05e518cbc LibRegex: Implement section B.1.4. of the ECMA262 spec
This allows the parser to deal with crazy patterns like the one
in #5517.
2021-02-27 07:31:01 +01:00
Luke
ce5fe2a6e8 LibGfx: Fix read buffer overflow in interlaced GIF decode
Unfortunately 10420dee7e didn't quite fix it,
as the buffer overflow was actually happening here:
af22204488/Userland/Libraries/LibGfx/GIFLoader.cpp (L402)

Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30507
2021-02-27 07:30:39 +01:00
Jakub Berkop
9aa91e6c6f Meta: Enable qemu virtualization acceleration on mac 2021-02-27 06:20:52 +01:00
Tom
af22204488 Kernel: Fix HPET timer structure layout
Only the first 3 timers have a reserved field, the 29 other timers
do not have a reserved field.

Fixes #5530
2021-02-26 21:15:38 +01:00
Itamar
85ea60b7f1 LibCpp: Don't fail when encountering #elif statements
However, we currently always treat the expression in #elif as true.
2021-02-26 21:14:41 +01:00
Itamar
e20cd1d8db LanguageServers/Cpp: Don't VERIFY that a file could be found
... when creating a new DocumentData
2021-02-26 21:14:41 +01:00
Adam Sandberg Ericsson
477e13f6c5 Net: use KBuffer::capacity() when checking if we can reuse buffer 2021-02-26 19:55:50 +01:00
Andreas Kling
69a30f95cc Ext2FS: Make block list flushing a bit less aggressive
We don't need to flush the on-disk inode struct multiple times while
writing out its block list. Just mark the in-memory Inode as having
dirty metadata and the SyncTask will flush it eventually.
2021-02-26 18:24:40 +01:00
Andreas Kling
c3a0fd4b7a Ext2FS: Move block list computation from Ext2FS to Ext2FSInode
Since the inode is the logical owner of its block list, let's move the
code that computes the block list there, and also stop hogging the FS
lock while we compute the block list, as there is no need for it.
2021-02-26 18:14:02 +01:00
Andreas Kling
c09921b9be Ext2FS: Don't hog FS lock while reading/writing inodes
There are two locks in the Ext2FS implementation:

* The FS lock (Ext2FS::m_lock)
  This governs access to the superblock, block group descriptors,
  and the block & inode bitmap blocks. It's held while allocating
  or freeing blocks/inodes.

* The inode lock (Ext2FSInode::m_lock)
  This governs access to the inode metadata, including the block
  list, and to the content data as well. It's held while doing
  basically anything with the inode.

Once an on-disk block/inode is allocated, it logically belongs
to the in-memory Inode object, so there's no need for the FS lock
to be taken while manipulating them, the inode lock is all you need.

This dramatically reduces the impact of disk I/O on path resolution
and various other things that look at individual inodes.
2021-02-26 17:57:38 +01:00
Andreas Kling
c7c63727bf Ext2FS: Remove unnecessary locking in find_block_containing_inode()
This is just a bunch of index math based on immutable values in the
super block and block group descriptor. No need to lock here!
2021-02-26 17:24:39 +01:00
Andreas Kling
81e3ea29c3 Ext2FS: Remove unnecessary lock in Ext2FS::write_ext2_node()
Now that writing to the underlying storage is serialized, we don't
need to take the FS lock when writing out an inode struct.
2021-02-26 17:23:46 +01:00
Andreas Kling
dcc5b7397f Kernel: Take FS lock in BlockBasedFS during seek/read/write operations
Since these filesystems operate on an underlying file descriptor
and rely on its offset for correctness, let's use the FS lock to
serialize these operations.

This also means that FS subclasses can rely on block-level read/write
operations being atomic.
2021-02-26 17:15:32 +01:00
Linus Groh
e265054c12 Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
2021-02-26 16:59:56 +01:00
speles
be9df404fd LibJS: Re-enable "reassignment to const" test
It passes now :^)
2021-02-26 16:59:37 +01:00
speles
f7d64e9fa8 LibJS: Set declared for-in and for-of variables as first time.
These declarations might be const, and now when we're handling it
properly, we have to set values to them correctly.
2021-02-26 16:59:37 +01:00
speles
913fd8de13 LibJS: Respect declaration kind for variables inside functions 2021-02-26 16:59:37 +01:00
Andreas Kling
65e083ed36 Revert "Ext2FS: Don't reload already-cached block list when freeing inode"
This reverts commit 1e737a5c50.

The cached block list does not include meta-blocks, so we'd end up
leaking those. There's definitely a nice way to avoid work here, but it
turns out it wasn't quite this trivial. Reverting for now.
2021-02-26 14:57:00 +01:00
Andreas Kling
79889ef052 LibELF: Consolidate main executable loading a bit
Merge the load_elf() and commit_elf() functions into a single
load_main_executable() function that takes care of both things.

Also split "stage 3" into two separate stages, keeping the lazy
relocations in stage 3, and adding a stage 4 for calling library
initialization functions.

We also make sure to map the main executable before dealing with
any of its dependencies, to ensure that non-PIE executables get
loaded at their desired address.
2021-02-26 14:49:55 +01:00
cbsirb
8456dc87d8 Kernel: Detach the traced process on process exit
Currently, when a process which has a tracee exits, nothing will happen,
leaving the tracee unable to be attached again. This will call the
stop_tracing function on any process which is traced by the exiting
process and sending the SIGSTOP signal making the traced process wait
for a SIGCONT (just as Linux does)
2021-02-26 14:49:39 +01:00
Itamar
780e84f2e1 Documentation: Update CLion configuration documentation
Closes #5512
2021-02-26 14:43:26 +01:00
Andreas Kling
1e737a5c50 Ext2FS: Don't reload already-cached block list when freeing inode
If we already have a cached copy of the inode's block list, we can use
that to free the blocks. No need to reload the list.
2021-02-26 14:05:18 +01:00
Andreas Kling
1f9409a658 Ext2FS: Inode allocation improvements
This patch combines inode the scan for an available inode with the
updating of the bit in the inode bitmap into a single operation.

We also exit the scan immediately when we find an inode, instead of
continuing until we've scanned all the eligible groups(!)

Finally, we stop holding the filesystem lock throughout the entire
operation, and instead only take it while actually necessary
(during inode allocation, flush, and inode cache update.)
2021-02-26 14:05:18 +01:00
Andreas Kling
1318b9391d disk_benchmark: Modernize this code a little bit
Use the new formatting helpers and such.
2021-02-26 14:05:18 +01:00
Andreas Kling
19083fd760 Ext2FS: Propagate errors from more places
Improve a bunch of situations where we'd previously panic the kernel
on failure. We now propagate whatever error we had instead. Usually
that'll be EIO.
2021-02-26 14:05:18 +01:00
Andreas Kling
6352b4fd74 Ext2FS: Share some bitmap code between inode and block allocation
Both inode and block allocation operate on bitmap blocks and update
counters in the superblock and group descriptor.

Since we're here, also add some error propagation around this code.
2021-02-26 14:05:18 +01:00
thankyouverycool
042152b346 LibGUI: Set correct open action for LinkLabel context menu
Replaces the Open... common action for files with more appropriate
Show in File Manager, as the desktop context menu uses
2021-02-26 13:50:00 +01:00
thankyouverycool
885c17b583 HackStudio: Set correct icons, text and location in menus
Adds correct icon to New Project, moves Wrapping Mode to more
traditional View, and truncates overly verbose Project entries
2021-02-26 13:50:00 +01:00
thankyouverycool
1723eac40f TextEditor: Fix passing null parent to AboutDialog
Refactors menubar creation to avoid passing a null parent window
to AboutDialog during construction. Fixes #5177 in part
2021-02-26 13:50:00 +01:00
thankyouverycool
2481dbcc41 Terminal: Remove unnecessary ellipses and capitalize name in menu 2021-02-26 13:50:00 +01:00
thankyouverycool
132ca7e37b Spreadsheet: Merge File menu into 'Spreadsheet' app menu
This is the common convention among the other apps. Also remove
a superfluous separator
2021-02-26 13:50:00 +01:00
thankyouverycool
a2e935e7a2 HexEditor: Fix nullptr pass to AboutDialog and clean up menus
Refactors menubar creation to avoid a null parent window during
construction; moves search options to the more traditional edit
menu; creates and exclusive action group for bytes per row

Fixes #5177 in part
2021-02-26 13:50:00 +01:00
thankyouverycool
fb5cdc670f Browser: Add Go menu and move Bookmarks bar toggle to View 2021-02-26 13:50:00 +01:00
thankyouverycool
38e70d2874 Base: Adjust cursor and link colors in Redmond themes
Fixes red blinking carets and unreadable link text
2021-02-26 13:30:08 +01:00
Jelle Raaijmakers
9473c694dc Spreadsheet: Fix cell identifier label
Commit 6a6f19a72 broke the cell position display in the top left of the
Spreadsheet window and the title of the cell type dialog, causing the
application to crash when interacting with cells beyond column FE.
2021-02-25 23:32:22 +01:00
Andreas Kling
4aa58aaab5 Kernel: Don't disable interrupts while exiting a thread or process
This was another vestige from a long time ago, when exiting a thread
would mutate global data structures that were only protected by the
interrupt flag.
2021-02-25 19:36:36 +01:00
Andreas Kling
8eeb8db2ed Kernel: Don't disable interrupts while dealing with a process crash
This was necessary in the past when crash handling would modify
various global things, but all that stuff is long gone so we can
simplify crashes by leaving the interrupt flag alone.
2021-02-25 19:36:36 +01:00