Age | Commit message (Collapse) | Author |
|
This is racy in userspace and non-racy in kernelspace so let's keep
it in kernelspace.
The behavior change where CLOEXEC is preserved when dup2() is called
with (old_fd == new_fd) was good though, let's keep that.
|
|
We can just implement these in userspace, so yay two less syscalls!
|
|
This patch adds GUI::FocusEvent which has a GUI::FocusSource.
The focus source is one of three things:
- Programmatic
- Mouse
- Keyboard
This allows receivers of focus events to implement different behaviors
depending on how they receive/lose focus.
|
|
Make the window a bit larger, and give the left pane a Fixed
size policy, so that it takes up less than half the window.
|
|
This enables a nice warning in case a function becomes dead code. Also, in case
of signal_trampoline_dummy, marking it external (non-static) prevents it from
being 'optimized away', which would lead to surprising and weird linker errors.
|
|
This also resolves some typing issues that only 'accidentally' worked, like declaring
a function to return type A, and the definition actually returning type B (which works
if type B is a subtype of type A). I like to call these "ninja imports".
To prevent problems like this in the future, I put all globals in a HackStudio.h.
I'm not sure about the name, but main.h and common.h felt wrong.
|
|
|
|
|
|
|
|
|
|
This fixes #3046.
|
|
|
|
|
|
Don't just pass argv[0] to the new UE, pass the full program path.
|
|
With this, you can now kinda sorta run the shell in UserspaceEmulator!
|
|
|
|
|
|
When compiling with "-Os", GCC produces the following pattern for
atomic decrement (which is used by our RefCounted template):
or eax, -1
lock xadd [destination], eax
Since or-ing with -1 will always produce the same output (-1), we can
mark the result of these operations as initialized. This stops us from
complaining about false positives when running the shell in UE. :^)
|
|
Errors here are (rc < 0), not (rc < 1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The emulator will now register signal handlers for all possible signals
and act as a translation layer between the kernel and the emulated
process.
To get an accurate simulation of signal handling, we duplicate the same
trampoline mechanism used by the kernel's signal delivery system, and
also use the "sigreturn" syscall to return from a signal handler.
Signal masking is not fully implemented yet, but this is pretty cool!
|
|
|
|
When HackStudio is invoked with one or more arguments it will attempt to
treat the first argument as a project or source file and open it
accordingly.
|
|
|
|
File/line is way more interesting than offsets, so let's only do the
offsets if we don't have file/line information.
|
|
|
|
We don't have to be clever at all to figure out which MmapRegions are
malloc blocks, we can just mark the containing region as such when
the emulated process performs a malloc! :^)
|
|
|
|
Ultimately we'll want to make it a bit easier to add more reporting.
This at least makes it easier to redirect the logging.
|
|
Some of the remaining instructions have different behavior for
register and non-register ops. Since we already have the
two-level flags tables, model this by setting all handlers in
the two-level table to the register op handler, while the
first-level flags table stores the action for the non-reg handler.
|
|
|
|
Some of these don't just use the REG bits of the mod/rm byte
as slashes, but also the R/M bits to have up to 9 different
instructions per opcode/slash combination (1 opcode requires
that MOD is != 11, the other 8 have MODE == 11).
This is done by making the slashes table two levels deep for
these cases.
Some of this is cosmetic (e.g "FST st0" has no effect already,
but its bit pattern gets disassembled as "FNOP"), but for
most uses it isn't.
FSTENV and FSTCW have an extraordinary 0x9b prefix. This is
not yet handled in this patch.
|
|
Inspector now opens ProcessChooser when no PID is supplied.
|
|
Moves ProcessChooser and RunningProcessesModel to LibGUI and
generalizes their construction for use by other apps. Updates
Profiler to reflect the change and use its new icons.
|
|
This is enough to run /bin/ls :^)
|
|
Now that emulated processes have their real name (with a "(UE)" prefix)
we can actually let them know their name.
|
|
This is very commonly used by terminal programs, and easy to support.
|
|
This makes it much easier to see who's who when running multiple
emulators at the same time. :^)
|
|
This virtual syscall works by exec'ing the UserspaceEmulator itself,
with the emulated program's provided arguments as the arguments to the
new UserspaceEmulator instance.
This means that we "follow" exec'ed programs and emulate them as well.
In the future we might want to make this an opt-in (or opt-out, idk)
behavior, but for now it's what we do.
This is really quite cool, I think! :^)
|
|
|
|
Note that running a setuid program (e.g /bin/ping) in UE does not
actually run uid=0. You'll have to run UE itself as uid=0 if you want
to test programs that do setuid/setgid.
|
|
It's now possible to run LookupServer in UE (by setting up SystemServer
to run the service inside UE.) No bugs found, but very cool! :^)
|
|
|
|
This prevents some false positives since the initial stack is expected
to be zero-initialized.
|
|
"xor reg,reg" or "sub reg,reg" both zero out the register, which means
we know for sure the result is 0. So mark the value as initialized,
and make sure we don't taint the CPU flags.
This removes some false positives from the uninitialized memory use
detection mechanism.
Fixes #2850.
|