Commit Graph

15665 Commits

Author SHA1 Message Date
Itamar
a4b74cba0b Loader.so+LibELF: Do not read environment variables if AT_SECURE is set
AT_SECURE is set in the auxiliary vector when we execute setuid/setgid
programs.
In those cases, we do not want to read environment variables that
influence the logic of the dynamic loader, as they can be controlled
by the user.
2021-01-09 10:55:46 +01:00
Itamar
20974b0772 LibDebug: Keep going when parent's location info could not be computed
Previously, when trying to parse the location info of a member
variable, we asserted that the location info of its parent is of type
'Address'.

However, there are cases where we cannot compute the location info of
the parent (for example - because we do not yet support the type of
debug info generated for it).
In those cases, it is better to just leave the location info of the
member variable empty instead of crashing.
2021-01-09 10:55:46 +01:00
Itamar
e318a3d3d4 little: Remove "-Os" compile flag
This flag made gcc generate location info of type "location_list" for
'my_struct', which we do not yet support in LibDebug.
2021-01-09 10:55:46 +01:00
Itamar
94db04fc12 HackStudio: Make debugger support shared libraries 2021-01-09 10:55:46 +01:00
Itamar
dcdb68a013 Debugger: Support shared libraries
This makes our cli debugger, 'sdb', conform to the updated DebugSession
API and support shared libraries.
2021-01-09 10:55:46 +01:00
Itamar
4b91e7c821 LibDebug: Support shared libraries
DebugSession now makes the loader stop after loading the libraries,
and parses the loaded libraries of the program before continuing its
execution.

DebugSession now also supports inserting a breakpoint at a given symbol
or source position.
Additionally, DebugInfo now takes the base address of its object into
consideration.
2021-01-09 10:55:46 +01:00
Itamar
ca9d6d21b5 Loader.so+LibELF: Introduce "_LOADER_BREAKPOINT" environment variable
If set, the dynamic loader will perform a software breakpoint after
loading all libraries, and just before jumping to the main entry point.

This allows a debugger to inspect the loaded libraries before the
program starts executing.
2021-01-09 10:55:46 +01:00
Itamar
bb90d961b8 LibELF: Add Symbol::is_undefined() 2021-01-09 10:55:46 +01:00
Itamar
f95f15e0bd CMake: Install sources of LibELF 2021-01-09 10:55:46 +01:00
Brendan Coles
fc9f79fe01 Profiler: load_from_perfcore_file: handle invalid JSON gracefully 2021-01-09 10:36:40 +01:00
Emanuele Torre
5735fb47f3 FileManager: Remove extra semicolon added by mistake. 2021-01-08 22:10:25 +01:00
Andreas Kling
3b3233aaf0 FileManager: Allow drag&drop onto breadcrumb bar directories :^)
You can now drop dragged items onto directories in the breadcrumb bar
and we'll copy them to that directory for you. Pretty cool!
2021-01-08 19:51:44 +01:00
Andreas Kling
6159630fa0 LibGUI: Make BreadcrumbBar report drop events
Dropping something on a breadcrumb segment button will now fire the
BreadcrumbBar::on_drop hook.

Fixes #4792.
2021-01-08 19:51:44 +01:00
Tyler Lanphear
c762a0c4d6 LibC: Implement tgoto(). 2021-01-08 17:09:40 +01:00
Tyler Lanphear
0f988424cf LibVT: Implement ICH sequence. 2021-01-08 17:09:40 +01:00
Mart G
e575d3fd3d Utilities: Add a disk space usage analyzation program.
SpaceAnalyzer: Partially address code review changes.

- Use GUI::CommonActions::make_about_action().
- Pass large arguments by const reference instead of by value.
- Mark const functions as such.
- Add newline at end of SpaceAnalyzer.af
- Use full words instead of abbreviations in variable names.
- Use application's namespace instead of 'TreeMap'.
- move() certain assignments.
- Use member declaration initialization.
- Initialize TreeNode* member of QueueEntry.
- Rewrite find_mount_for_path to return MountInfo* instead.
- Rename ITreeMap and ITreeMapNode to TreeMap and TreeMapNode.
- Replace ext suffix with rect suffix for rectangles.

SpaceAnalyzer: Further address code review and coding style.

- Remove get prefix from accessor functions.
- Layout algorithm in its own function, with callback.
- Remove nullptr comparisons.
- Store lstat errors in error_accumulator.
- Use Rect::shatter.
- Use Rect's orientation based functions.

SpaceAnalyzer: Make sort_children_by_area const qualified.
2021-01-08 17:08:48 +01:00
Andreas Kling
56ff0f89af WindowServer: is_blocked_by_modal_window() => blocking_modal_window()
The name of this function was weird, since it returned the blocking
modal window itself, and not just a bool answering the question.
2021-01-08 12:33:34 +01:00
Andreas Kling
6a970611d6 UserspaceEmulator: Fix build after MOVSX shadowing changes 2021-01-08 12:29:46 +01:00
Gal Horowitz
2fd2396d63 UserspaceEmulator: Fix incorrect shadowing on mov sign extend
Unlike zero-extend moves, the upper bytes are not just zeroed,
but rather are based on the sign bit of the source, which means
if the source is tainted, so should the upper bytes be.
2021-01-08 12:17:06 +01:00
Tom
edc18ab4e6 WindowServer: Start blocked modal animation when clicking on frame
Fixes #4835
2021-01-08 11:21:30 +01:00
Brendan Coles
d0a9954f0e Userland: Add ddate utility
Today is Boomtime, day 7 of Chaos, in the YOLD 3187
2021-01-08 09:42:43 +01:00
Brendan Coles
fb9eb20544 date: Use ArgsParser and add ISO8601 / RFC3339 / RFC5322 output formats 2021-01-07 20:17:44 +01:00
Nico Weber
cf9135557b Userland: Rename cp's "-r" flag to "-R"
Linux accepts both -r and -R, but the BSDs only like -R, and
dR POSIX also only mentions -R. So make -R the canonical flag.

Keep -r available as an alias for -R.
2021-01-07 20:00:39 +01:00
Andreas Kling
56c2cc4162 LibWeb: Implement most of the CSS table fixup algorithm
This patch implements the "remove irrelevant boxes" and "generate
missing child wrappers" parts of table fixup.

"Generate missing parents" is left as a task for our future selves.
2021-01-07 18:00:51 +01:00
Andreas Kling
0fd577084f LibWeb: Specialize is<DOM::Element>() and is<Layout::Box>()
These two show up in profiles, so let's add specializations for them.
2021-01-07 17:33:29 +01:00
Andreas Kling
d3046a2649 LibWeb: Allow anonymous table, table-row and table-cell layout nodes 2021-01-07 17:33:29 +01:00
Andreas Kling
75829c1b81 LibWeb: Move remove_all_children() from Node to TreeNode<T>
This is useful in all tree types.
2021-01-07 17:33:29 +01:00
Andreas Kling
fe9de4b55c LibWeb: Add the computed "display" values to CSS::ComputedValues 2021-01-07 17:33:29 +01:00
Andreas Kling
f655a60773 LibWeb: Add some more CSS "display" values 2021-01-07 17:33:29 +01:00
Andreas Kling
5a97e8bb23 CMake: Only enable "MacOS workaround" on MacOS
This was preventing ports from building on Linux.
2021-01-07 11:41:05 +01:00
Nico Weber
6ab81c32be CMake: set CMAKE_SKIP_RPATH everywhere
Else, there's tons of "-- Set runtime path of" spam at build time,
with apparently no way of disabling the build noise other than turning
of rpaths. If the dynamic loader uses them at some point, we probably
want to set them through cflags/ldflags instead of through cmake's
built-in thing anyways, for that reason.
2021-01-07 11:26:05 +01:00
Andreas Kling
7ed89703fe LibCrypto+LibJS: Fix broken subtraction of two negative signed bigints
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29326
2021-01-07 08:57:37 +01:00
Nico Weber
cd2f85dc10 Userland: Give cp a "-l" flag to make hard links
Also present on Linux and FreeBSD.
2021-01-07 08:22:10 +01:00
Nico Weber
8079d566f1 Userland: Include hard link count in "ls -l" output 2021-01-07 08:22:10 +01:00
AnotherTest
ddc255a6c0 LibHTTP: Take the final EOF read notification into account
Fixes the HTTP part of #3691.
2021-01-06 19:50:34 +01:00
Andreas Kling
80cffdc0a1 LibWeb: Compute width of absolutely positioned, replaced elements
Fixes #4589.
2021-01-06 19:20:49 +01:00
Andreas Kling
0ecefbff57 LibWeb: Move absolute positioning up to FormattingContext
It seems like both BFC and IFC can have absolutely positioned children.
It's a bit strange, but consider the following HTML:

<html><body>foobar<img style="position: absolute"></body></html>

In such a document, the <img> element is an absolutely positioned child
of a block-level element (<body>) with no block-level children.
An IFC is established for <body>, and needs to handle layout for <img>.
2021-01-06 19:20:49 +01:00
AnotherTest
4c98d00bef LibLine: Don't ignore ^C inputs when there are no registered handlers
Some people really like their ^C's, let's not make them sad.
2021-01-06 19:20:36 +01:00
Sergey Semushin
277fc41f47 LibKeyboard: don't null codepoint for numpad return key 2021-01-06 19:20:18 +01:00
AnotherTest
335221d830 Shell: Run function declarations in the current process
Fixes #4817
2021-01-06 15:40:45 +01:00
Brendan Coles
81c5b35dce Base: Add tar man page documentation 2021-01-06 15:40:26 +01:00
Andreas Kling
612827eff3 LibWeb: Don't prune whitespace nodes from layout tree
Various whitespace-related issues have been fixed, and support for the
different CSS white-space values is improved enough that I think we can
stop doing the hack where we just prune whitespace nodes from the tree
and actually let them show up.

This is a nice step forward for correctness with the slight downside of
cluttering up layout tree dumps with tons of whitespace text nodes.
But hey, that's the web we know & love. :^)

Fixes #4427.
2021-01-06 14:58:48 +01:00
Andreas Kling
29a4da30b7 LibWeb: Make DOM::Node::create_layout_node() not need parent's style
The StyleResolver can find the specified CSS values for the parent
element via the DOM. Forcing everyone to locate specified values for
their parent was completely unnecessary.
2021-01-06 14:58:48 +01:00
Andreas Kling
d9b2650dcc LibWeb: Remove specified style from layout nodes
Layout nodes now only carry CSS computer values with them. The main
idea here is to give them only what they need to perform layout, and
leave the rest back in the DOM.
2021-01-06 14:58:48 +01:00
Andreas Kling
cc024bdcc0 LibWeb: Split CSS::ComputedValues members into structs by inheritance
Put all the inherited members in one struct and all the non-inherited
ones in another.

This makes it clear which is which, and also makes it easy to copy all
the inherited values while ignoring the non-inherited ones.
2021-01-06 14:58:48 +01:00
Andreas Kling
981758a8b1 LibWeb: Use the specified CSS values from element in more places
Instead of using the specified style stored on Layout::Node, use the
specified CSS values kept by the DOM::Element in more places.
2021-01-06 14:58:48 +01:00
Andreas Kling
63046d82f4 LibWeb: Use the cached background-image value in Layout::Box::paint() 2021-01-06 14:58:48 +01:00
Andreas Kling
ba8990fb6c LibWeb: Rename Element::resolved_style() => specified_css_values()
This object represents the specified CSS values, so let's call it that.
2021-01-06 14:58:48 +01:00
Andreas Kling
2cc39cfb0e LibWeb: Copy some properties from specified style into layout node
Another step towards not having to carry the full specified style with
us everywhere. This isn't the ideal final layout, since we're mixing
computed and used values a bit randomly here, but one step at a time.
2021-01-06 14:58:48 +01:00
Andreas Kling
e5490ae1d1 LibWeb: Rename Layout::Node::style() => computed_values() 2021-01-06 14:58:48 +01:00